Register credential manager system service

Test: Local testing. Successfully able to call publishBinderServie and register service with system server
Bug:250713478

Change-Id: I5aec8b67ad81a38992d59c01efedfd55832d570e
This commit is contained in:
Reema Bajwa
2022-09-06 05:37:30 +00:00
parent 94d00b167c
commit 89b8a12b94
2 changed files with 23 additions and 0 deletions

View File

@@ -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

View File

@@ -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");