Add APIs to set Location History package name.
The package name will be used by Permission Controller to properly handle permissions for location history package. Bug: 119226131 Test: manually tested on device Change-Id: I522517272c132a054c44489d16626509cf2b42ee
This commit is contained in:
@@ -2396,4 +2396,65 @@ public class LocationManager {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the extra location controller package for location services on the device.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
|
||||
public void setLocationControllerExtraPackage(String packageName) {
|
||||
try {
|
||||
mService.setLocationControllerExtraPackage(packageName);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extra location controller package on the device.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public @Nullable String getLocationControllerExtraPackage() {
|
||||
try {
|
||||
return mService.getLocationControllerExtraPackage();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the extra location controller package is currently enabled on the device.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
|
||||
public void setLocationControllerExtraPackageEnabled(boolean enabled) {
|
||||
try {
|
||||
mService.setLocationControllerExtraPackageEnabled(enabled);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether extra location controller package is currently enabled on the device.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public boolean isLocationControllerExtraPackageEnabled() {
|
||||
try {
|
||||
return mService.isLocationControllerExtraPackageEnabled();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user