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

Commit e5364f93 authored by Felix Oghina's avatar Felix Oghina Committed by Sergey Volnov
Browse files

Fix NPE in TTS service if no engine string

Test: added test in TextToSpeechServiceTest
Bug: 232438498
Change-Id: Ia587d34e2898930c0956024c56a1f19debb445e4
parent f0ebf508
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -63,6 +63,12 @@ public final class TextToSpeechManagerService extends
        public void createSession(String engine,
                ITextToSpeechSessionCallback sessionCallback) {
            synchronized (mLock) {
                if (engine == null) {
                    runSessionCallbackMethod(
                            () -> sessionCallback.onError("Engine cannot be null"));
                    return;
                }

                TextToSpeechManagerPerUserService perUserService = getServiceForUserLocked(
                        UserHandle.getCallingUserId());
                if (perUserService != null) {