diff options
| author | 2023-09-15 16:08:42 +0000 | |
|---|---|---|
| committer | 2023-09-15 16:08:42 +0000 | |
| commit | a3f36b1e6f5087bb43b44b23cd1d53e7fc715950 (patch) | |
| tree | 455f28cb4c711cdb2770e50233933821fb90870c | |
| parent | 5b51a6b11bd88ce07ff087c151a6566360b5d61e (diff) | |
| parent | 21f971c35316e9aa70e04510b3a6404a9cc3e3c5 (diff) | |
Merge "Fix NPE in TTS service if no engine string" into udc-qpr-dev
| -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) { |