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

Commit 5e0ad3d2 authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix DISALLOW_SAFE_BOOT on HSUM

Check the restriction on the correct user.

Bug: 346329112
Test: 1. Install TestDPC on a HSUM device
      2. Set as DO: adb shell dpm set-device-owner --user 10 com.afwsamples.testdpc/.DeviceAdminReceiver
      3. Enable "Disallow safe boot" in TestDPC
      4  Trigger Power menu
      5. Long press "Power off" or "Restart" button
      6. Verify it doesn't show the dialog to reboot to safe mode
Flag: EXEMPT bugfix
Change-Id: I97f08cdf88b8f14673c1dd48b920102a02b18afd
parent fcafa1c9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -833,7 +833,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                return false;
            }
            mUiEventLogger.log(GlobalActionsEvent.GA_SHUTDOWN_LONG_PRESS);
            if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) {
            if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT,
                    getCurrentUser().getUserHandle())) {
                mWindowManagerFuncs.reboot(true);
                return true;
            }
@@ -974,7 +975,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                return false;
            }
            mUiEventLogger.log(GlobalActionsEvent.GA_REBOOT_LONG_PRESS);
            if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) {
            if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT,
                    getCurrentUser().getUserHandle())) {
                mWindowManagerFuncs.reboot(true);
                return true;
            }