1

The following commands do not disable location services on API 30. Although they do work on other API levels.

adb shell settings put secure location_providers_allowed -gps
adb shell settings put secure location_providers_allowed -network

They do not throw any error message, but they do not turn off the location services either.

1
  • I assume the main problem is that location_providers_allowed is deprecated since API 19. According to the API doc it should be still present in 30 however the doc also states Do not rely on this value being present or correct.
    – Robert
    Commented Oct 6, 2020 at 7:20

1 Answer 1

0

On Android 11 -

to enable, I use:

adb shell settings put secure location_mode 3

and to disable, use:

adb shell settings put secure location_mode 0
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 21, 2021 at 20:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .