diff --git a/core/java/android/credentials/ICredentialManager.aidl b/core/java/android/credentials/ICredentialManager.aidl new file mode 100644 index 0000000000000..a281cd51d59f6 --- /dev/null +++ b/core/java/android/credentials/ICredentialManager.aidl @@ -0,0 +1,10 @@ +package android.credentials; + +/** + * Mediator between apps and credential manager service implementations. + * + * {@hide} + */ +oneway interface ICredentialManager { + void getCredential(); +} \ No newline at end of file diff --git a/services/credentials/Android.bp b/services/credentials/Android.bp new file mode 100644 index 0000000000000..5fa444239639f --- /dev/null +++ b/services/credentials/Android.bp @@ -0,0 +1,22 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +filegroup { + name: "services.credentials-sources", + srcs: ["java/**/*.java"], + path: "java", + visibility: ["//frameworks/base/services"], +} + +java_library_static { + name: "services.credentials", + defaults: ["platform_service_defaults"], + srcs: [":services.credentials-sources"], + libs: ["services.core"], +} diff --git a/services/credentials/java/com/android/server/credentials/CredentialManagerService.java b/services/credentials/java/com/android/server/credentials/CredentialManagerService.java new file mode 100644 index 0000000000000..76ed2b345c338 --- /dev/null +++ b/services/credentials/java/com/android/server/credentials/CredentialManagerService.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 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 com.android.server.credentials; + +import android.annotation.NonNull; +import android.annotation.UserIdInt; +import android.content.Context; +import android.credentials.ICredentialManager; +import android.os.UserHandle; +import android.provider.Settings; +import android.util.Log; + +import com.android.server.infra.AbstractMasterSystemService; +import com.android.server.infra.SecureSettingsServiceNameResolver; + +/** + * Entry point service for credential management. + * + *
This service provides the {@link ICredentialManager} implementation and keeps a list of
+ * {@link CredentialManagerServiceImpl} per user; the real work is done by
+ * {@link CredentialManagerServiceImpl} itself.
+ */
+public final class CredentialManagerService extends
+ AbstractMasterSystemService