Merge "Utilize context user ID for canAdminGrantSensorsPermissions" into sc-dev

This commit is contained in:
Eran Messeri
2021-02-16 14:41:10 +00:00
committed by Android (Google) Code Review
2 changed files with 1 additions and 15 deletions

View File

@@ -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();

View File

@@ -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();
}