android.permission.ACCESS_LOCATION_EXTRA_COMMANDS

Allows an application to access extra location provider commands.

Protection level: normal

Added in API level 1

Constant Value: "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"

Access extra location provider commands. Malicious applications could use this to interfere with the operation of the GPS or other location sources.

Usage in manifest:

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

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS is required to use the method LocationManager.sendExtraCommand():
LocationManager.html#sendExtraCommand(java.lang.String, java.lang.String, android.os.Bundle))

Sample code:

1
2
3
4
LocationManager locationmanager = (LocationManager)getApplicationContext().getSystemService("location");
Bundle bundle = new Bundle();
locationmanager.sendExtraCommand("gps", "force_xtra_injection", bundle);
locationmanager.sendExtraCommand("gps", "force_time_injection", bundle);

sendExtraCommand can do the following:

  • Inject Time Data - Injects Time assistance data for GPS into the platform, using the Network Time Protocol (NTP) server defined in system file system/etc/gps.conf. Command input for method is “force_time_injection”
  • Inject XTRA Data - Injects XTRA assistance data for GPS into the platform, using the gpsOneXTRA server defined in system file system/etc/gps.conf (e.g., http://xtra3.gpsonextra.net/xtra.bin). Command input for method is “force_xtra_injection”
  • Clear Assist Data - Clears all aiding data used for GPS. Command input for method is “delete_aiding_data”
    If the LocationManager.sendExtraCommand() method returns true for any of these commands, then it means that they have succeeded

See also: