Merge \"Global.OEM_UNLOCK_DISALLOWED should only restrict when enabling oem\" into nyc-mr1-dev
am: 186768150f
Change-Id: Id35463500a31ff6e6d834c706e228d05c5d15918
This commit is contained in:
@@ -466,12 +466,13 @@ public class PersistentDataBlockService extends SystemService {
|
|||||||
enforceOemUnlockWritePermission();
|
enforceOemUnlockWritePermission();
|
||||||
enforceIsAdmin();
|
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.");
|
|
||||||
}
|
|
||||||
if (enabled) {
|
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 by OEM_UNLOCK_DISALLOWED.");
|
||||||
|
}
|
||||||
enforceFactoryResetAllowed();
|
enforceFactoryResetAllowed();
|
||||||
}
|
}
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ public class UserRestrictionsUtils {
|
|||||||
if (newValue) {
|
if (newValue) {
|
||||||
PersistentDataBlockManager manager = (PersistentDataBlockManager) context
|
PersistentDataBlockManager manager = (PersistentDataBlockManager) context
|
||||||
.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
|
.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
|
||||||
if (manager != null) {
|
if (manager != null && manager.getOemUnlockEnabled()) {
|
||||||
manager.setOemUnlockEnabled(false);
|
manager.setOemUnlockEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user