diff options
author | Robert Berry <robertberry@google.com> | 2019-03-18 16:33:42 -0400 |
---|---|---|
committer | Robert Berry <robertberry@google.com> | 2019-04-07 15:09:06 +0000 |
commit | 835123dba260548fdcd8610f71fb60c8440d0a5a (patch) | |
tree | 18bde0464c54efe57466bcab9a904fb560f117e5 /services/java/com/android/server/SystemServer.java | |
parent | 02cca81c10665fcd5dcd8cbdad6b16ca0f2e1e4a (diff) |
Add system captions manager service
This service connects to a remote system captions manager service. This
service is responsible for enabling system captions when the user
requests them. As the system binds to it, this service will be
persistent.
Cherry pick from ag/6761232
Bug: 128925852
Test: Manual. I created an implementation of the service.
Merged-In: Iafde1bb68f4754d8167624f47c6833d43c0ec336
Change-Id: Iafde1bb68f4754d8167624f47c6833d43c0ec336
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 9d09c4c3637b..106e64222c00 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -254,6 +254,8 @@ public final class SystemServer { "com.android.server.autofill.AutofillManagerService"; private static final String CONTENT_CAPTURE_MANAGER_SERVICE_CLASS = "com.android.server.contentcapture.ContentCaptureManagerService"; + private static final String SYSTEM_CAPTIONS_MANAGER_SERVICE_CLASS = + "com.android.server.systemcaptions.SystemCaptionsManagerService"; private static final String TIME_ZONE_RULES_MANAGER_SERVICE_CLASS = "com.android.server.timezone.RulesManagerService$Lifecycle"; private static final String IOT_SERVICE_CLASS = @@ -1232,6 +1234,8 @@ public final class SystemServer { startContentCaptureService(context); startAttentionService(context); + startSystemCaptionsManagerService(context); + // App prediction manager service traceBeginAndSlog("StartAppPredictionService"); mSystemServiceManager.startService(APP_PREDICTION_MANAGER_SERVICE_CLASS); @@ -2225,6 +2229,19 @@ public final class SystemServer { }, BOOT_TIMINGS_TRACE_LOG); } + private void startSystemCaptionsManagerService(@NonNull Context context) { + String serviceName = context.getString( + com.android.internal.R.string.config_defaultSystemCaptionsManagerService); + if (TextUtils.isEmpty(serviceName)) { + Slog.d(TAG, "SystemCaptionsManagerService disabled because resource is not overlaid"); + return; + } + + traceBeginAndSlog("StartSystemCaptionsManagerService"); + mSystemServiceManager.startService(SYSTEM_CAPTIONS_MANAGER_SERVICE_CLASS); + traceEnd(); + } + private void startContentCaptureService(@NonNull Context context) { // First check if it was explicitly enabled by DeviceConfig boolean explicitlyEnabled = false; @@ -2273,7 +2290,7 @@ public final class SystemServer { traceEnd(); } - static final void startSystemUi(Context context, WindowManagerService windowManager) { + private static void startSystemUi(Context context, WindowManagerService windowManager) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); |