Merge "New API for getting uids have specific permissions from SystemConfig"
This commit is contained in:
@@ -35,4 +35,9 @@ interface ISystemConfig {
|
||||
* @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries
|
||||
*/
|
||||
Map getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries();
|
||||
|
||||
/**
|
||||
* @see SystemConfigManager#getSystemPermissionUids
|
||||
*/
|
||||
int[] getSystemPermissionUids(String permissionName);
|
||||
}
|
||||
|
||||
@@ -111,4 +111,22 @@ public class SystemConfigManager {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uids which have been granted given permission in system configuration.
|
||||
*
|
||||
* The uids and assigning permissions are defined on data/etc/platform.xml
|
||||
*
|
||||
* @param permissionName The target permission.
|
||||
* @return The uids have been granted given permission in system configuration.
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.GET_RUNTIME_PERMISSIONS)
|
||||
@NonNull
|
||||
public int[] getSystemPermissionUids(@NonNull String permissionName) {
|
||||
try {
|
||||
return mInterface.getSystemPermissionUids(permissionName);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user