Merge "Utilize context user ID for canAdminGrantSensorsPermissions" into sc-dev
This commit is contained in:
@@ -872,7 +872,6 @@ package android.app.admin {
|
||||
}
|
||||
|
||||
public class DevicePolicyManager {
|
||||
method public boolean canAdminGrantSensorsPermissionsForUser(int);
|
||||
method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean getBluetoothContactSharingDisabled(@NonNull android.os.UserHandle);
|
||||
method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getDeviceOwner();
|
||||
method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.content.ComponentName getDeviceOwnerComponentOnAnyUser();
|
||||
|
||||
@@ -13358,24 +13358,11 @@ public class DevicePolicyManager {
|
||||
*/
|
||||
public boolean canAdminGrantSensorsPermissions() {
|
||||
throwIfParentInstance("canAdminGrantSensorsPermissions");
|
||||
return canAdminGrantSensorsPermissionsForUser(myUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the admin can control grants of sensors-related permissions, for
|
||||
* a given user.
|
||||
*
|
||||
* @hide
|
||||
* @param userId The ID of the user to check.
|
||||
* @return if the admin may grant these permissions, false otherwise.
|
||||
*/
|
||||
@SystemApi
|
||||
public boolean canAdminGrantSensorsPermissionsForUser(int userId) {
|
||||
if (mService == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return mService.canAdminGrantSensorsPermissionsForUser(userId);
|
||||
return mService.canAdminGrantSensorsPermissionsForUser(myUserId());
|
||||
} catch (RemoteException re) {
|
||||
throw re.rethrowFromSystemServer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user