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

Commit e66a26e8 authored by Rafael Prado's avatar Rafael Prado
Browse files

Associate DISALLOW_GRANT_ADMIN with MANAGE_DEVICE_POLICY_MODIFY_USERS permission.

Bug: 407776766
Flag: android.app.admin.flags.associate_disallow_grant_admin_with_permission
Test: N/A
Change-Id: I2560e8460026b6916b4e02f5a216ec6f85f0bb38
parent d47e010c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -432,3 +432,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "associate_disallow_grant_admin_with_permission"
  namespace: "supervision"
  description: "DISALLOW_GRANT_ADMIN restriction is currently not associated with any permission, causing null pointer exceptions when client try to add it."
  bug: "407776766"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+4 −0
Original line number Diff line number Diff line
@@ -13799,6 +13799,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                UserManager.DISALLOW_FACTORY_RESET, new String[]{MANAGE_DEVICE_POLICY_FACTORY_RESET});
        USER_RESTRICTION_PERMISSIONS.put(
                UserManager.DISALLOW_FUN, new String[]{MANAGE_DEVICE_POLICY_FUN});
        if (Flags.associateDisallowGrantAdminWithPermission()) {
            USER_RESTRICTION_PERMISSIONS.put(
                UserManager.DISALLOW_GRANT_ADMIN, new String[]{MANAGE_DEVICE_POLICY_MODIFY_USERS});
        }
        USER_RESTRICTION_PERMISSIONS.put(
                UserManager.DISALLOW_INSTALL_APPS, new String[]{MANAGE_DEVICE_POLICY_APPS_CONTROL});
        USER_RESTRICTION_PERMISSIONS.put(