summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Reema Bajwa <reemabajwa@google.com> 2022-10-04 19:22:37 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-04 19:22:37 +0000
commit0eef6a958a7ce89a10ae28ba3acf41f84bf521e1 (patch)
tree13e156e300782e28ae15d1ae2c6c1f5869dae9fe
parentf5cc004e5e8f856077c9e4e6d51be77fa4c4e818 (diff)
parent89b8a12b942c99c770c50f4e69940385addf16ba (diff)
Merge "Register credential manager system service Test: Local testing. Successfully able to call publishBinderServie and register service with system server Bug:250713478"
-rw-r--r--core/java/android/app/SystemServiceRegistry.java15
-rw-r--r--services/java/com/android/server/SystemServer.java8
2 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index d5b85cde4926..4ddfdb603e73 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -81,6 +81,8 @@ import android.content.pm.verify.domain.DomainVerificationManager;
import android.content.pm.verify.domain.IDomainVerificationManager;
import android.content.res.Resources;
import android.content.rollback.RollbackManagerFrameworkInitializer;
+import android.credentials.CredentialManager;
+import android.credentials.ICredentialManager;
import android.debug.AdbManager;
import android.debug.IAdbManager;
import android.graphics.fonts.FontManager;
@@ -1138,6 +1140,19 @@ public final class SystemServiceRegistry {
return new AutofillManager(ctx.getOuterContext(), service);
}});
+ registerService(Context.CREDENTIAL_SERVICE, CredentialManager.class,
+ new CachedServiceFetcher<CredentialManager>() {
+ @Override
+ public CredentialManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ IBinder b = ServiceManager.getService(Context.CREDENTIAL_SERVICE);
+ ICredentialManager service = ICredentialManager.Stub.asInterface(b);
+ if (service != null) {
+ return new CredentialManager(ctx.getOuterContext(), service);
+ }
+ return null;
+ }});
+
registerService(Context.MUSIC_RECOGNITION_SERVICE, MusicRecognitionManager.class,
new CachedServiceFetcher<MusicRecognitionManager>() {
@Override
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index d8f282aee5a8..9e449aedf0d9 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -331,6 +331,8 @@ public final class SystemServer implements Dumpable {
"com.android.server.wallpaper.WallpaperManagerService$Lifecycle";
private static final String AUTO_FILL_MANAGER_SERVICE_CLASS =
"com.android.server.autofill.AutofillManagerService";
+ private static final String CREDENTIAL_MANAGER_SERVICE_CLASS =
+ "com.android.server.credentials.CredentialManagerService";
private static final String CONTENT_CAPTURE_MANAGER_SERVICE_CLASS =
"com.android.server.contentcapture.ContentCaptureManagerService";
private static final String TRANSLATION_MANAGER_SERVICE_CLASS =
@@ -2571,6 +2573,12 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
}
+ if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_CREDENTIALS)) {
+ t.traceBegin("StartCredentialManagerService");
+ mSystemServiceManager.startService(CREDENTIAL_MANAGER_SERVICE_CLASS);
+ t.traceEnd();
+ }
+
// Translation manager service
if (deviceHasConfigString(context, R.string.config_defaultTranslationService)) {
t.traceBegin("StartTranslationManagerService");