Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4396,6 +4396,7 @@ package android.security.keystore.recovery { method public java.security.Key importKey(java.lang.String, byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException; method public deprecated void initRecoveryService(java.lang.String, byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; method public void initRecoveryService(java.lang.String, byte[], byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; method public static boolean isRecoverableKeyStoreEnabled(android.content.Context); method public void removeKey(java.lang.String) throws android.security.keystore.recovery.InternalRecoveryServiceException; method public void setRecoverySecretTypes(int[]) throws android.security.keystore.recovery.InternalRecoveryServiceException; method public deprecated void setRecoveryStatus(java.lang.String, java.lang.String, int) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.content.pm.PackageManager.NameNotFoundException; Loading core/java/android/security/keystore/recovery/RecoveryController.java +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.app.KeyguardManager; import android.app.PendingIntent; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; Loading Loading @@ -287,6 +288,18 @@ public class RecoveryController { return new RecoveryController(lockSettings, KeyStore.getInstance()); } /** * Checks whether the recoverable key store is currently available. * * <p>If it returns true, the device must currently be using a screen lock that is supported for * use with the recoverable key store, i.e. AOSP PIN, pattern or password. */ @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static boolean isRecoverableKeyStoreEnabled(@NonNull Context context) { KeyguardManager keyguardManager = context.getSystemService(KeyguardManager.class); return keyguardManager != null && keyguardManager.isDeviceSecure(); } /** * @deprecated Use {@link #initRecoveryService(String, byte[], byte[])} instead. */ Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4396,6 +4396,7 @@ package android.security.keystore.recovery { method public java.security.Key importKey(java.lang.String, byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException; method public deprecated void initRecoveryService(java.lang.String, byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; method public void initRecoveryService(java.lang.String, byte[], byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException; method public static boolean isRecoverableKeyStoreEnabled(android.content.Context); method public void removeKey(java.lang.String) throws android.security.keystore.recovery.InternalRecoveryServiceException; method public void setRecoverySecretTypes(int[]) throws android.security.keystore.recovery.InternalRecoveryServiceException; method public deprecated void setRecoveryStatus(java.lang.String, java.lang.String, int) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.content.pm.PackageManager.NameNotFoundException; Loading
core/java/android/security/keystore/recovery/RecoveryController.java +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.app.KeyguardManager; import android.app.PendingIntent; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; Loading Loading @@ -287,6 +288,18 @@ public class RecoveryController { return new RecoveryController(lockSettings, KeyStore.getInstance()); } /** * Checks whether the recoverable key store is currently available. * * <p>If it returns true, the device must currently be using a screen lock that is supported for * use with the recoverable key store, i.e. AOSP PIN, pattern or password. */ @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static boolean isRecoverableKeyStoreEnabled(@NonNull Context context) { KeyguardManager keyguardManager = context.getSystemService(KeyguardManager.class); return keyguardManager != null && keyguardManager.isDeviceSecure(); } /** * @deprecated Use {@link #initRecoveryService(String, byte[], byte[])} instead. */ Loading