Add a Global setting for disabling OEM unlocking setting
+ Don't enable OEM unlocking setting if the global setting disallows it. Bug: 28163088 Change-Id: Ic306da3fa2cecb90865be055566a7e1603e6b5e2
This commit is contained in:
@@ -759,9 +759,13 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
* devices allow users to flash other OSes to them.
|
||||
*/
|
||||
static void setOemUnlockEnabled(Context context, boolean enabled) {
|
||||
PersistentDataBlockManager manager =(PersistentDataBlockManager)
|
||||
context.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
|
||||
manager.setOemUnlockEnabled(enabled);
|
||||
try {
|
||||
PersistentDataBlockManager manager = (PersistentDataBlockManager)
|
||||
context.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
|
||||
manager.setOemUnlockEnabled(enabled);
|
||||
} catch (SecurityException e) {
|
||||
Log.e(TAG, "Fail to set oem unlock.", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user