OSDN Git Service

Make it possible to construct a RecoverySession
authorRobert Berry <robertberry@google.com>
Thu, 22 Feb 2018 15:24:05 +0000 (15:24 +0000)
committerRobert Berry <robertberry@google.com>
Fri, 23 Feb 2018 12:00:34 +0000 (12:00 +0000)
These methods are currently inaccessible.

Bug: 73763265
Test: it builds

Change-Id: I8358a8084e1c4fa96b1fe599ef6b17d6196d6a12

api/system-current.txt
core/java/android/security/keystore/recovery/RecoveryController.java

index 1c2dbec..506ded7 100644 (file)
@@ -4291,6 +4291,7 @@ package android.security.keystore.recovery {
   }
 
   public class RecoveryController {
+    method public android.security.keystore.recovery.RecoverySession createRecoverySession();
     method public byte[] generateAndStoreKey(java.lang.String, byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
     method public java.util.List<java.lang.String> getAliases(java.lang.String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
     method public static android.security.keystore.recovery.RecoveryController getInstance(android.content.Context);
index 7cd08f7..5436653 100644 (file)
@@ -545,6 +545,15 @@ public class RecoveryController {
         }
     }
 
+    /**
+     * Returns a new {@link RecoverySession}.
+     *
+     * <p>A recovery session is required to restore keys from a remote store.
+     */
+    public RecoverySession createRecoverySession() {
+        return RecoverySession.newInstance(this);
+    }
+
     InternalRecoveryServiceException wrapUnexpectedServiceSpecificException(
             ServiceSpecificException e) {
         if (e.errorCode == ERROR_SERVICE_INTERNAL_ERROR) {