Add API to expose ignore settings whitelist for GTS
Bug: 124517571 Test: manually Change-Id: I846f9112c3cc3dde1466ff13e740ccf72c16b833
This commit is contained in:
@@ -802,6 +802,7 @@ package android.location {
|
||||
|
||||
public class LocationManager {
|
||||
method public String[] getBackgroundThrottlingWhitelist();
|
||||
method public String[] getIgnoreSettingsWhitelist();
|
||||
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper);
|
||||
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.app.PendingIntent);
|
||||
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, android.os.UserHandle);
|
||||
|
||||
@@ -114,6 +114,7 @@ interface ILocationManager
|
||||
// for reporting callback completion
|
||||
void locationCallbackFinished(ILocationListener listener);
|
||||
|
||||
// used by gts tests to verify throttling whitelist
|
||||
// used by gts tests to verify whitelists
|
||||
String[] getBackgroundThrottlingWhitelist();
|
||||
String[] getIgnoreSettingsWhitelist();
|
||||
}
|
||||
|
||||
@@ -413,6 +413,18 @@ public class LocationManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public String[] getIgnoreSettingsWhitelist() {
|
||||
try {
|
||||
return mService.getIgnoreSettingsWhitelist();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide - hide this constructor because it has a parameter
|
||||
* of type ILocationManager, which is a system private class. The
|
||||
|
||||
@@ -2136,6 +2136,13 @@ public class LocationManagerService extends ILocationManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getIgnoreSettingsWhitelist() {
|
||||
synchronized (mLock) {
|
||||
return mIgnoreSettingsPackageWhitelist.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@GuardedBy("mLock")
|
||||
private boolean isThrottlingExemptLocked(CallerIdentity callerIdentity) {
|
||||
if (callerIdentity.mUid == Process.SYSTEM_UID) {
|
||||
|
||||
Reference in New Issue
Block a user