Loading services/core/java/com/android/server/PersistentDataBlockService.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -443,13 +443,15 @@ public class PersistentDataBlockService extends SystemService { if (ActivityManager.isUserAMonkey()) { if (ActivityManager.isUserAMonkey()) { return; return; } } enforceOemUnlockPermission(); enforceIsAdmin(); // Do not allow oem unlock modification if it has been disallowed. // Do not allow oem unlock modification if it has been disallowed. if (Settings.Global.getInt(getContext().getContentResolver(), if (Settings.Global.getInt(getContext().getContentResolver(), Settings.Global.OEM_UNLOCK_DISALLOWED, 0) == 1) { Settings.Global.OEM_UNLOCK_DISALLOWED, 0) == 1) { throw new SecurityException("OEM unlock has been disallowed."); throw new SecurityException("OEM unlock has been disallowed."); } } enforceOemUnlockPermission(); enforceIsAdmin(); synchronized (mLock) { synchronized (mLock) { doSetOemUnlockEnabledLocked(enabled); doSetOemUnlockEnabledLocked(enabled); Loading Loading
services/core/java/com/android/server/PersistentDataBlockService.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -443,13 +443,15 @@ public class PersistentDataBlockService extends SystemService { if (ActivityManager.isUserAMonkey()) { if (ActivityManager.isUserAMonkey()) { return; return; } } enforceOemUnlockPermission(); enforceIsAdmin(); // Do not allow oem unlock modification if it has been disallowed. // Do not allow oem unlock modification if it has been disallowed. if (Settings.Global.getInt(getContext().getContentResolver(), if (Settings.Global.getInt(getContext().getContentResolver(), Settings.Global.OEM_UNLOCK_DISALLOWED, 0) == 1) { Settings.Global.OEM_UNLOCK_DISALLOWED, 0) == 1) { throw new SecurityException("OEM unlock has been disallowed."); throw new SecurityException("OEM unlock has been disallowed."); } } enforceOemUnlockPermission(); enforceIsAdmin(); synchronized (mLock) { synchronized (mLock) { doSetOemUnlockEnabledLocked(enabled); doSetOemUnlockEnabledLocked(enabled); Loading