Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0de318e3 authored by Atneya Nair's avatar Atneya Nair
Browse files

[audio] Bind TTS with FOREGROUND_SERVICE

Add BIND_FOREROUND_SERVICE to the system binding to TTSService. This
ensures that it is treated as an FGS when audio evaluates capabilities.

Test: manual Select To Speak verification
Bug: 385654000
Bug: 376481063
Flag: EXEMPT bug fix
Change-Id: I8767640c2cb9e4a8861f4a01780357f8e087a649
parent 25c889de
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package com.android.server.texttospeech;

import static android.content.Context.BIND_AUTO_CREATE;
import static android.content.Context.BIND_FOREGROUND_SERVICE;
import static android.content.Context.BIND_SCHEDULE_LIKE_TOP_APP;

import static com.android.internal.infra.AbstractRemoteService.PERMANENT_BOUND_TIMEOUT_MS;

import android.annotation.NonNull;
@@ -95,7 +99,7 @@ final class TextToSpeechManagerPerUserService extends
                ITextToSpeechSessionCallback callback) {
            super(context,
                    new Intent(TextToSpeech.Engine.INTENT_ACTION_TTS_SERVICE).setPackage(engine),
                    Context.BIND_AUTO_CREATE | Context.BIND_SCHEDULE_LIKE_TOP_APP,
                    BIND_AUTO_CREATE | BIND_SCHEDULE_LIKE_TOP_APP | BIND_FOREGROUND_SERVICE,
                    userId,
                    ITextToSpeechService.Stub::asInterface);
            mEngine = engine;