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

Commit 3c665dc9 authored by Mahaver Chopra's avatar Mahaver Chopra Committed by android-build-merger
Browse files

Merge \\"Global.OEM_UNLOCK_DISALLOWED should only restrict when enabling...

Merge \\"Global.OEM_UNLOCK_DISALLOWED should only restrict when enabling oem\\" into nyc-mr1-dev am: 18676815
am: d3a0f10b

Change-Id: I3cc8d0ff8cc97b57262edfb09c07fc91f06cf56c
parents a4b22ba1 d3a0f10b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -466,12 +466,13 @@ public class PersistentDataBlockService extends SystemService {
            enforceOemUnlockWritePermission();
            enforceIsAdmin();

            // Do not allow oem unlock modification if it has been disallowed.
            if (enabled) {
                // Do not allow oem unlock to be enabled 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.");
                    throw new SecurityException(
                            "OEM unlock has been disallowed by OEM_UNLOCK_DISALLOWED.");
                }
            if (enabled) {
                enforceFactoryResetAllowed();
            }
            synchronized (mLock) {
+1 −1
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ public class UserRestrictionsUtils {
                    if (newValue) {
                        PersistentDataBlockManager manager = (PersistentDataBlockManager) context
                                .getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
                        if (manager != null) {
                        if (manager != null && manager.getOemUnlockEnabled()) {
                            manager.setOemUnlockEnabled(false);
                        }
                    }