Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8367119 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Add a new system service for blob store management."

parents a232661f f5b36964
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ filegroup {
    name: "framework-non-updatable-sources",
    srcs: [
        // Java/AIDL sources under frameworks/base
        ":framework-blobstore-sources",
        ":framework-core-sources",
        ":framework-drm-sources",
        ":framework-graphics-sources",
+40 −0
Original line number Diff line number Diff line
// 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",
    ],
}
+41 −0
Original line number Diff line number Diff line
/*
 * 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;
    }
}
+34 −0
Original line number Diff line number Diff line
/*
 * 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)));
    }
}
+20 −0
Original line number Diff line number Diff line
/**
 * 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
Loading