Skip to content Skip to sidebar Skip to footer

Android Access_location_extra_commands Permission Uses

Android contains a permission called 'ACCESS_LOCATION_EXTRA_COMMANDS'. Normal location commands would involve accessing coarse/fine location. Does anyone know what kind of extra c

Solution 1:

I only know of 1 command which can be uses when you have a slow GPS fix:

((LocationManager)YourActivity.this.getSystemService("location")).sendExtraCommand("gps", "delete_aiding_data", null);

and in the Manifest:

<uses-permissionandroid:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />

Solution 2:

According to a rough search in Android source code, it indicate that LocationManager.sendExtraCommand() need this permission exactly.

Documentation: sendExtraCommand(java.lang.String, java.lang.String, android.os.Bundle)

Solution 3:

Go to https://cs.android.com/android/platform/superproject/+/master:frameworks/base/services/core/java/com/android/server/location/provider/AbstractLocationProvider.java;drc=master;bpv=1;bpt=1;l=353, click on onExtraCommand if you don't see the "References" panel at the bottom, scroll down to "Overriden By", and click on each implementation to see what commands it supports.

Here's a list of commands supported by GnssLocationProvider (since all of the other implementations seem to do nothing or delegate to another one):

  • delete_aiding_data: calls deleteAidingData
  • force_time_injection: calls requestUtcTime
  • force_psds_injection: sends a DOWNLOAD_PSDS_DATA message if mSupportsPsds is true
  • request_power_stats: calls requestPowerStats

Post a Comment for "Android Access_location_extra_commands Permission Uses"