diff options
Diffstat (limited to 'services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java')
-rw-r--r-- | services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java b/services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java index 9015563f439e..24114988d6ba 100644 --- a/services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java +++ b/services/texttospeech/java/com/android/server/texttospeech/TextToSpeechManagerService.java @@ -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) { |