Loading services/core/java/com/android/server/oemlock/PersistentDataBlockLock.java +12 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,10 @@ class PersistentDataBlockLock extends OemLock { // unlocked but doesn't actually do any unlocking. final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return; } pdbm.setOemUnlockEnabled(allowedByDevice); } Loading @@ -80,6 +84,10 @@ class PersistentDataBlockLock extends OemLock { boolean isOemUnlockAllowedByDevice() { final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return false; } return pdbm.getOemUnlockEnabled(); } Loading @@ -91,6 +99,10 @@ class PersistentDataBlockLock extends OemLock { private void disallowUnlockIfNotUnlocked() { final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return; } if (pdbm.getFlashLockState() != PersistentDataBlockManager.FLASH_LOCK_UNLOCKED) { pdbm.setOemUnlockEnabled(false); } Loading Loading
services/core/java/com/android/server/oemlock/PersistentDataBlockLock.java +12 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,10 @@ class PersistentDataBlockLock extends OemLock { // unlocked but doesn't actually do any unlocking. final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return; } pdbm.setOemUnlockEnabled(allowedByDevice); } Loading @@ -80,6 +84,10 @@ class PersistentDataBlockLock extends OemLock { boolean isOemUnlockAllowedByDevice() { final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return false; } return pdbm.getOemUnlockEnabled(); } Loading @@ -91,6 +99,10 @@ class PersistentDataBlockLock extends OemLock { private void disallowUnlockIfNotUnlocked() { final PersistentDataBlockManager pdbm = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); if (pdbm == null) { Slog.w(TAG, "PersistentDataBlock is not supported on this device"); return; } if (pdbm.getFlashLockState() != PersistentDataBlockManager.FLASH_LOCK_UNLOCKED) { pdbm.setOemUnlockEnabled(false); } Loading