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

Commit bfe1b04f authored by Steven Ng's avatar Steven Ng
Browse files

Enforce permission before checking OEM unlocking setting

Bug: 28783495
Change-Id: Idb7b191dd8c50a687c8e910656c0325414ecd544
parent 8cb18342
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -443,13 +443,15 @@ public class PersistentDataBlockService extends SystemService {
            if (ActivityManager.isUserAMonkey()) {
                return;
            }

            enforceOemUnlockPermission();
            enforceIsAdmin();

            // Do not allow oem unlock modification if it has been disallowed.
            if (Settings.Global.getInt(getContext().getContentResolver(),
                    Settings.Global.OEM_UNLOCK_DISALLOWED, 0) == 1) {
                throw new SecurityException("OEM unlock has been disallowed.");
            }
            enforceOemUnlockPermission();
            enforceIsAdmin();

            synchronized (mLock) {
                doSetOemUnlockEnabledLocked(enabled);