Android ACCESS_LOCATION_EXTRA_COMMANDS permission uses-ThrowExceptions

Exception or error:

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 commands this permission allows the app to access ?


How to solve:

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)


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-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />

Leave a Reply

Your email address will not be published. Required fields are marked *