Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5179,6 +5179,7 @@ package android.service.notification { package android.service.oemlock { public class OemLockManager { method public java.lang.String getLockName(); method public boolean isOemUnlockAllowedByCarrier(); method public boolean isOemUnlockAllowedByUser(); method public void setOemUnlockAllowedByCarrier(boolean, byte[]); Loading core/java/android/service/oemlock/IOemLockService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ package android.service.oemlock; * @hide */ interface IOemLockService { String getLockName(); void setOemUnlockAllowedByCarrier(boolean allowed, in byte[] signature); boolean isOemUnlockAllowedByCarrier(); Loading core/java/android/service/oemlock/OemLockManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,23 @@ public class OemLockManager { mService = service; } /** * Returns a vendor specific name for the OEM lock. * * This value is used to identify the security protocol used by locks. * * @return The name of the OEM lock or {@code null} if failed to get the name. */ @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) @Nullable public String getLockName() { try { return mService.getLockName(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sets whether the carrier has allowed this device to be OEM unlocked. * Loading services/core/java/com/android/server/oemlock/OemLock.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,9 @@ package com.android.server.oemlock; import android.annotation.Nullable; abstract class OemLock { @Nullable abstract String getLockName(); abstract void setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature); abstract boolean isOemUnlockAllowedByCarrier(); Loading services/core/java/com/android/server/oemlock/OemLockService.java +13 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,19 @@ public class OemLockService extends SystemService { * implementation being used on this device. */ private final IBinder mService = new IOemLockService.Stub() { @Override @Nullable public String getLockName() { enforceManageCarrierOemUnlockPermission(); final long token = Binder.clearCallingIdentity(); try { return mOemLock.getLockName(); } finally { Binder.restoreCallingIdentity(token); } } @Override public void setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature) { enforceManageCarrierOemUnlockPermission(); Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5179,6 +5179,7 @@ package android.service.notification { package android.service.oemlock { public class OemLockManager { method public java.lang.String getLockName(); method public boolean isOemUnlockAllowedByCarrier(); method public boolean isOemUnlockAllowedByUser(); method public void setOemUnlockAllowedByCarrier(boolean, byte[]); Loading
core/java/android/service/oemlock/IOemLockService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ package android.service.oemlock; * @hide */ interface IOemLockService { String getLockName(); void setOemUnlockAllowedByCarrier(boolean allowed, in byte[] signature); boolean isOemUnlockAllowedByCarrier(); Loading
core/java/android/service/oemlock/OemLockManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,23 @@ public class OemLockManager { mService = service; } /** * Returns a vendor specific name for the OEM lock. * * This value is used to identify the security protocol used by locks. * * @return The name of the OEM lock or {@code null} if failed to get the name. */ @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) @Nullable public String getLockName() { try { return mService.getLockName(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sets whether the carrier has allowed this device to be OEM unlocked. * Loading
services/core/java/com/android/server/oemlock/OemLock.java +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,9 @@ package com.android.server.oemlock; import android.annotation.Nullable; abstract class OemLock { @Nullable abstract String getLockName(); abstract void setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature); abstract boolean isOemUnlockAllowedByCarrier(); Loading
services/core/java/com/android/server/oemlock/OemLockService.java +13 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,19 @@ public class OemLockService extends SystemService { * implementation being used on this device. */ private final IBinder mService = new IOemLockService.Stub() { @Override @Nullable public String getLockName() { enforceManageCarrierOemUnlockPermission(); final long token = Binder.clearCallingIdentity(); try { return mOemLock.getLockName(); } finally { Binder.restoreCallingIdentity(token); } } @Override public void setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature) { enforceManageCarrierOemUnlockPermission(); Loading