Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1c53539 authored by Eran Messeri's avatar Eran Messeri Committed by Android (Google) Code Review
Browse files

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

parents 56dac4cc 2fa704eb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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();
+1 −14
Original line number Diff line number Diff line
@@ -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();
        }