summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/SystemServer.java
diff options
context:
space:
mode:
authorRobert Berry <robertberry@google.com>2019-03-18 16:33:42 -0400
committerRobert Berry <robertberry@google.com>2019-04-03 20:41:03 -0400
commite14120edf2cb2251b5ece810ef38eaadd27bc46d (patch)
treedc55ee0ef5412649d6a7fbeee1fe464b9b9d326f /services/java/com/android/server/SystemServer.java
parent259c73c00704a48fe25505546ce4f721eb40de9b (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. Bug: 128925852 Test: Manual. I created an implementation of the service. Change-Id: Iafde1bb68f4754d8167624f47c6833d43c0ec336
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r--services/java/com/android/server/SystemServer.java19
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"));