Normally, lets say "camera access" is disabled/blocked, and then I open the camera app, it will first ask me to unblock my camera, only then can I use it.
Now if I have location disabled and I go to "Wifi direct", it uses location without asking me to turn on location. (I know because the green dot on the top right corner shows, and indicates that location service is being used.) and if I pull down the notification/status bar, it shows that location is off.

I am guessing this is aosp behaviour? but shouldn't the user be asked first?
Why is location needed anyway?

    Hello I'm not too clear on what it is or how it works, so I'm not sure I'm saying this right, but there are some internal APIs that when accessed are treated like they're "location," so even though location is disabled, the indicator flashes. In my experience, this kind of thing pops up when certain Bluetooth or Wi-Fi things are accessed.

    This is why there was this change in the most recent release (which last I heard won't make it to stable, but I'm pretty sure the change will still be included in the next release):

    exclude Settings app from visible Location indicator too since it gets triggered from accessing Wi-Fi data when enabling Wi-Fi hotspot and potentially other info tied to Wi-Fi and Bluetooth

    The reason for this is that any radio function requires location, because every country have different regulations.
    But, I'm not satisfied with that answer. For example why is it necessary while only connecting to an established WiFi networks? Why country of BTS is not enough? Why it works anyway, if location can't be established?
    I'd fill more comfortable if I could control this.

      DeletedUser43 No, that's not correct. Location means location data, not only Location services via GNSS as you believe it to mean. Nearly Wi-Fi networks, cellular networks, etc. are location data covered by the Location permission. Location means location data, not GPS, etc.

      Hello Location permission controls access to Location data, not specifically location services for detecting location via satellite-based location and other methods. GrapheneOS enables the Location indicator feature to show when location data accesses happen. This shows location data access in general, not specifically location services. That's a common misconception. System uses of location data as part of implementing features which inherently require it are meant to be excluded from the indicator and we're gradually extending the exclusions to cover things like this. Our most recent release added an exclusion for the OS Settings app so that it accessing nearby Wi-Fi networks, etc. doesn't trigger the indicator.

      The indicator is meant to be for apps, not internal OS components. Those are meant to be excluded. It's being worked on. The location indicator isn't included in Android partly because they haven't even tried to add all the necessary exclusions to avoid users wrongly believing their location is being detected.

      In general, why would you expect the OS itself to request permission to access data like nearby Wi-Fi networks, cellular carrier info or similar data? The request would cpme from the OS itself. We don't really understand why this is so consistently misunderstood. If you're specifically enabling a feature like this, why would you be concerned that the OS does what's required to use it? It seems to be based on both a misunderstand of what the Location permission means and how location detection works.

      Obtaining location data from satellites is a one-way transfer of information from the satellites. There is no connection or data sent to them. It's only A-GNSS and network location which involved network requests, and GrapheneOS doesn't have network location. It provides documentation about A-GNSS and control over it, but it mostly involves downloading static databases that are the same around the world (PSDS) and obtaining data on nearby cell towers for your carrier which we change to avoid providing IMSI or phone number. SUPL has multiple modes and the normal mode isn't a major privacy issue. Your carrier knows your approximate location when you're connected to their network based on which towers you're connected to and their signal strength, which is part of how 911 location detection works even without help from the phone.

        GrapheneOS
        Thanks for the reply.

        Location permission controls access to Location data, not specifically location services for detecting location via satellite-based location and other methods.

        What do you mean by Location data? And what kind of data does it contain.

        We don't really understand why this is so consistently misunderstood. If you're specifically enabling a feature like this, why would you be concerned that the OS does what's required to use it?

        Because I don't understand why android requires location data for things like wifi scanning and this.
        If you are just scanning the radio frequency around you (wifi in this example), why do you need location?