Add new error for system errors that are retryable

Some issues require a system error to be raised that
indicates we should retry the process. This adds a new
error and bumps the version of the api for future use.

Test: atest keystore2_test
Bug: 238619180
Change-Id: I04fd03757c56901c64c4ceae6e6257785ca042e4
diff --git a/keystore2/aidl/Android.bp b/keystore2/aidl/Android.bp
index cc2f90f..9544c70 100644
--- a/keystore2/aidl/Android.bp
+++ b/keystore2/aidl/Android.bp
@@ -52,6 +52,16 @@
         },
 
     ],
-    frozen: true,
+    frozen: false,
 
 }
+
+// Note: This should always be one version ahead of the last frozen version
+latest_android_system_keystore = "android.system.keystore-V4"
+
+aidl_interface_defaults {
+    name: "latest_android_system_keystore_import_interface",
+    imports: [
+        latest_android_system_keystore,
+    ],
+}
diff --git a/keystore2/aidl/aidl_api/android.system.keystore2/current/android/system/keystore2/ResponseCode.aidl b/keystore2/aidl/aidl_api/android.system.keystore2/current/android/system/keystore2/ResponseCode.aidl
index 9a486e0..e1ff0bb 100644
--- a/keystore2/aidl/aidl_api/android.system.keystore2/current/android/system/keystore2/ResponseCode.aidl
+++ b/keystore2/aidl/aidl_api/android.system.keystore2/current/android/system/keystore2/ResponseCode.aidl
@@ -54,4 +54,5 @@
   OUT_OF_KEYS_PENDING_INTERNET_CONNECTIVITY = 24,
   OUT_OF_KEYS_TRANSIENT_ERROR = 25,
   OUT_OF_KEYS_PERMANENT_ERROR = 26,
+  GET_ATTESTATION_APPLICATION_ID_FAILED = 27,
 }
diff --git a/keystore2/aidl/android/system/keystore2/ResponseCode.aidl b/keystore2/aidl/android/system/keystore2/ResponseCode.aidl
index 6f2f585..4fe7db3 100644
--- a/keystore2/aidl/android/system/keystore2/ResponseCode.aidl
+++ b/keystore2/aidl/android/system/keystore2/ResponseCode.aidl
@@ -122,11 +122,19 @@
 
     /**
      * Indicates that this device will never be able to provision attestation keys using
-     * the remote provsisioning server. This may be due to multiple causes, such as the
+     * the remote provisioning server. This may be due to multiple causes, such as the
      * device is not registered with the remote provisioning backend or the device has
      * been permanently revoked. Clients who receive this error should not attempt to
      * retry key creation.
      */
     OUT_OF_KEYS_PERMANENT_ERROR = 26,
 
+    /**
+     * Indicates that the device had an error when getting the attestation application
+     * id. This is a temporary error that can be retried. This can happen if there is a
+     * failure to make a binder call to the package manager from Keystore service.
+     * The attestation can be retried as this can be seen as a warning.
+     */
+    GET_ATTESTATION_APPLICATION_ID_FAILED = 27,
+
 }