Add a system TextToSpeech implementation that initiates the connection through the system server.

This change includes the new System Service that allows the supervised binding to the TextToSpeech service provider.
    It proxies the binding process from the client instead of the direct client -> texttospeech connection.

Bug: 178112052
Test: atest CtsSpeechTestCases
Test: forest apct/device_boot_health_check
Change-Id: I0709e71460fa01ab025c92753a20bce38f562845
This commit is contained in:
Alex Agranovich
2021-02-18 09:19:33 +00:00
parent 0f3b641f82
commit 50c987fbb8
11 changed files with 544 additions and 28 deletions

View File

@@ -326,6 +326,8 @@ public final class SystemServer implements Dumpable {
"com.android.server.musicrecognition.MusicRecognitionManagerService";
private static final String SYSTEM_CAPTIONS_MANAGER_SERVICE_CLASS =
"com.android.server.systemcaptions.SystemCaptionsManagerService";
private static final String TEXT_TO_SPEECH_MANAGER_SERVICE_CLASS =
"com.android.server.texttospeech.TextToSpeechManagerService";
private static final String TIME_ZONE_RULES_MANAGER_SERVICE_CLASS =
"com.android.server.timezone.RulesManagerService$Lifecycle";
private static final String IOT_SERVICE_CLASS =
@@ -1713,6 +1715,7 @@ public final class SystemServer implements Dumpable {
startAttentionService(context, t);
startRotationResolverService(context, t);
startSystemCaptionsManagerService(context, t);
startTextToSpeechManagerService(context, t);
// System Speech Recognition Service
if (deviceHasConfigString(context,
@@ -2918,6 +2921,13 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
}
private void startTextToSpeechManagerService(@NonNull Context context,
@NonNull TimingsTraceAndSlog t) {
t.traceBegin("StartTextToSpeechManagerService");
mSystemServiceManager.startService(TEXT_TO_SPEECH_MANAGER_SERVICE_CLASS);
t.traceEnd();
}
private void startContentCaptureService(@NonNull Context context,
@NonNull TimingsTraceAndSlog t) {
// First check if it was explicitly enabled by DeviceConfig