summaryrefslogtreecommitdiff
path: root/apex/blobstore/framework
diff options
context:
space:
mode:
authorSudheer Shanka <sudheersai@google.com>2019-10-04 16:16:13 -0700
committerSudheer Shanka <sudheersai@google.com>2019-11-07 13:37:14 -0800
commitf5b36964e0657da7ce70dbb33397da54d5c30dfe (patch)
tree1c1b5c0a06fad4d321ce91fed0eaabe864fd3432 /apex/blobstore/framework
parent9bf17be527757dce04524f8d51a15fc47cb33c22 (diff)
Add a new system service for blob store management.
This change adds a bare-bones system service, implementation will follow later. Bug: 143559646 Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java Change-Id: Idf21dfcd11dd32a42b62c6ad965d6f5ad7eed1b4
Diffstat (limited to 'apex/blobstore/framework')
-rw-r--r--apex/blobstore/framework/Android.bp40
-rw-r--r--apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java41
-rw-r--r--apex/blobstore/framework/java/android/app/blob/BlobStoreManagerFrameworkInitializer.java34
-rw-r--r--apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl20
4 files changed, 135 insertions, 0 deletions
diff --git a/apex/blobstore/framework/Android.bp b/apex/blobstore/framework/Android.bp
new file mode 100644
index 000000000000..24693511117c
--- /dev/null
+++ b/apex/blobstore/framework/Android.bp
@@ -0,0 +1,40 @@
+// 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.
+
+filegroup {
+ name: "framework-blobstore-sources",
+ srcs: [
+ "java/**/*.java",
+ "java/**/*.aidl"
+ ],
+ path: "java",
+}
+
+java_library {
+ name: "blobstore-framework",
+ installable: false,
+ compile_dex: true,
+ sdk_version: "core_platform",
+ srcs: [
+ ":framework-blobstore-sources",
+ ],
+ aidl: {
+ export_include_dirs: [
+ "java",
+ ],
+ },
+ libs: [
+ "framework-minus-apex",
+ ],
+}
diff --git a/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java b/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java
new file mode 100644
index 000000000000..1ed188e69881
--- /dev/null
+++ b/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 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.app.blob;
+
+import android.annotation.SystemService;
+import android.content.Context;
+
+/**
+ * This class provides access to the blob store maintained by the system.
+ *
+ * Apps can publish data blobs which might be useful for other apps on the device to be
+ * maintained by the system and apps that would like to access these data blobs can do so
+ * by addressing them via their cryptographically secure hashes.
+ *
+ * TODO: make this public once the APIs are added.
+ * @hide
+ */
+@SystemService(Context.BLOB_STORE_SERVICE)
+public class BlobStoreManager {
+ private final Context mContext;
+ private final IBlobStoreManager mService;
+
+ /** @hide */
+ public BlobStoreManager(Context context, IBlobStoreManager service) {
+ mContext = context;
+ mService = service;
+ }
+}
diff --git a/apex/blobstore/framework/java/android/app/blob/BlobStoreManagerFrameworkInitializer.java b/apex/blobstore/framework/java/android/app/blob/BlobStoreManagerFrameworkInitializer.java
new file mode 100644
index 000000000000..6e6d6aee60fa
--- /dev/null
+++ b/apex/blobstore/framework/java/android/app/blob/BlobStoreManagerFrameworkInitializer.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 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.app.blob;
+
+import android.app.SystemServiceRegistry;
+import android.content.Context;
+
+/**
+ * This is where the BlobStoreManagerService wrapper is registered.
+ *
+ * @hide
+ */
+public class BlobStoreManagerFrameworkInitializer {
+ /** Register the BlobStoreManager wrapper class */
+ public static void initialize() {
+ SystemServiceRegistry.registerCachedService(
+ Context.BLOB_STORE_SERVICE, BlobStoreManager.class,
+ (context, service) ->
+ new BlobStoreManager(context, IBlobStoreManager.Stub.asInterface(service)));
+ }
+}
diff --git a/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl b/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl
new file mode 100644
index 000000000000..00c1ed4daa27
--- /dev/null
+++ b/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl
@@ -0,0 +1,20 @@
+/**
+ * Copyright 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.app.blob;
+
+/** {@hide} */
+interface IBlobStoreManager {
+} \ No newline at end of file