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

Commit 9d5aa9b0 authored by Eran Messeri's avatar Eran Messeri Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13562208

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I347cf6c6149684330253a6188257825a50e85657
parents 087f6ebd b1c53539
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -873,7 +873,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
@@ -13448,24 +13448,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();
        }