summaryrefslogtreecommitdiff
path: root/aidl/android
diff options
context:
space:
mode:
Diffstat (limited to 'aidl/android')
-rw-r--r--aidl/android/gsi/AvbPublicKey.aidl25
-rw-r--r--aidl/android/gsi/IGsiService.aidl17
-rw-r--r--aidl/android/gsi/IImageService.aidl18
3 files changed, 60 insertions, 0 deletions
diff --git a/aidl/android/gsi/AvbPublicKey.aidl b/aidl/android/gsi/AvbPublicKey.aidl
new file mode 100644
index 0000000..519ec80
--- /dev/null
+++ b/aidl/android/gsi/AvbPublicKey.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.gsi;
+
+/** {@hide} */
+parcelable AvbPublicKey {
+ /* Raw data bytes. */
+ byte[] bytes;
+ /* SHA-1 digest of the key. */
+ byte[] sha1;
+}
diff --git a/aidl/android/gsi/IGsiService.aidl b/aidl/android/gsi/IGsiService.aidl
index cd48c63..65050fe 100644
--- a/aidl/android/gsi/IGsiService.aidl
+++ b/aidl/android/gsi/IGsiService.aidl
@@ -16,6 +16,7 @@
package android.gsi;
+import android.gsi.AvbPublicKey;
import android.gsi.GsiProgress;
import android.gsi.IImageService;
import android.os.ParcelFileDescriptor;
@@ -188,4 +189,20 @@ interface IGsiService {
* for dumpstate.
*/
@utf8InCpp String dumpDeviceMapperDevices();
+
+ /**
+ * Retrieve AVB public key from the current mapped partition.
+ * This works only while partition device is mapped and the end-of-partition
+ * AVB footer has been written.
+ * A call to createPartition() does the following things:
+ * 1. Close the previous partition installer, thus unmap the partition.
+ * 2. Open a new partition installer.
+ * 3. Create and map the new partition.
+ *
+ * In other words, getAvbPublicKey() works between two createPartition() calls.
+ *
+ * @param dst Output the AVB public key.
+ * @return 0 on success, an error code on failure.
+ */
+ int getAvbPublicKey(out AvbPublicKey dst);
}
diff --git a/aidl/android/gsi/IImageService.aidl b/aidl/android/gsi/IImageService.aidl
index 5d9002f..c8c5a9d 100644
--- a/aidl/android/gsi/IImageService.aidl
+++ b/aidl/android/gsi/IImageService.aidl
@@ -16,6 +16,7 @@
package android.gsi;
+import android.gsi.AvbPublicKey;
import android.gsi.MappedImage;
import android.gsi.IProgressCallback;
@@ -26,6 +27,11 @@ interface IImageService {
const int CREATE_IMAGE_READONLY = 0x1;
const int CREATE_IMAGE_ZERO_FILL = 0x2;
+ /* Successfully returned */
+ const int IMAGE_OK = 0;
+ /* Generic error code */
+ const int IMAGE_ERROR = 1;
+
/**
* Create an image that can be mapped as a block device.
*
@@ -87,6 +93,18 @@ interface IImageService {
boolean isImageMapped(@utf8InCpp String name);
/**
+ * Retrieve AVB public key from an image.
+ * If the image is already mapped then it works the same as
+ * IGsiService::getAvbPublicKey(). Otherwise this will attempt to
+ * map / unmap the partition image upon enter / return.
+ *
+ * @param name Image name as passed to createBackingImage().
+ * @param dst Output of the AVB public key.
+ * @return 0 on success, an error code on failure.
+ */
+ int getAvbPublicKey(@utf8InCpp String name, out AvbPublicKey dst);
+
+ /**
* Get all installed backing image names
*
* @return list of installed backing image names