summaryrefslogtreecommitdiff
path: root/core/java/android/os
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-02-18 13:19:50 +0000
committerTreehugger Robot <treehugger-gerrit@google.com>2020-02-18 13:19:50 +0000
commit46d77cf71c4091daa2aba353afdfe9f4f718ba48 (patch)
treef8265163b54ca76fa81941f7834db1c416c75d5b /core/java/android/os
parenta9ec170cc3051082be5115f47702f24d1c2505e7 (diff)
parent0ed127a6b64c6237a4c7c1c3d49a0e77c6791c80 (diff)
Merge "Add getAvbPublicKey to IDynamicSystemService" am: ecd7c440df am: d584bb1ef0 am: 0ed127a6b6
Change-Id: I8d6ae5ccebe085e08f48abc6f7624419e4de043e
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/image/DynamicSystemManager.java18
-rw-r--r--core/java/android/os/image/IDynamicSystemService.aidl10
2 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/os/image/DynamicSystemManager.java b/core/java/android/os/image/DynamicSystemManager.java
index cbf531c5730a..17851adac51b 100644
--- a/core/java/android/os/image/DynamicSystemManager.java
+++ b/core/java/android/os/image/DynamicSystemManager.java
@@ -19,6 +19,7 @@ package android.os.image;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
import android.content.Context;
+import android.gsi.AvbPublicKey;
import android.gsi.GsiProgress;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
@@ -85,6 +86,23 @@ public class DynamicSystemManager {
throw new RuntimeException(e.toString());
}
}
+
+ /**
+ * Retrieve AVB public key from installing partition.
+ *
+ * @param dst Output the AVB public key.
+ * @return true on success, false if partition doesn't have a
+ * valid VBMeta block to retrieve the AVB key from.
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
+ public boolean getAvbPublicKey(AvbPublicKey dst) {
+ try {
+ return mService.getAvbPublicKey(dst);
+ } catch (RemoteException e) {
+ throw new RuntimeException(e.toString());
+ }
+ }
+
/**
* Finish write and make device to boot into the it after reboot.
*
diff --git a/core/java/android/os/image/IDynamicSystemService.aidl b/core/java/android/os/image/IDynamicSystemService.aidl
index cc32f998d0c2..a1f927266de3 100644
--- a/core/java/android/os/image/IDynamicSystemService.aidl
+++ b/core/java/android/os/image/IDynamicSystemService.aidl
@@ -15,6 +15,7 @@
*/
package android.os.image;
+import android.gsi.AvbPublicKey;
import android.gsi.GsiProgress;
/** {@hide} */
@@ -108,4 +109,13 @@ interface IDynamicSystemService
* @return true on success, false otherwise.
*/
boolean submitFromAshmem(long bytes);
+
+ /**
+ * Retrieve AVB public key from installing partition.
+ *
+ * @param dst Output the AVB public key.
+ * @return true on success, false if partition doesn't have a
+ * valid VBMeta block to retrieve the AVB key from.
+ */
+ boolean getAvbPublicKey(out AvbPublicKey dst);
}