diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-09-03 13:55:38 -0400 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-09-03 13:55:38 -0400 |
commit | 4f9a8f62ca25c38591362a46f7ec87973da61ad0 (patch) | |
tree | 6dc40189efedb236d9aea8cfe5cea466719967c9 | |
parent | e6b4c1050c9d21a6004d6be2de7aa5e0191de194 (diff) | |
download | sdl_android-4f9a8f62ca25c38591362a46f7ec87973da61ad0.tar.gz |
Remove createSimpleTTSChunks()
3 files changed, 16 insertions, 37 deletions
diff --git a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java index 4818423ab..7f5873fb0 100755 --- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java +++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java @@ -238,7 +238,8 @@ public class SdlService extends Service { break; } if (isNeedUpdate) { - return new LifecycleConfigurationUpdate(appName, null, createSimpleTTSChunks(ttsName), null); + Vector<TTSChunk> chunks = new Vector<>(Collections.singletonList(new TTSChunk(ttsName, SpeechCapabilities.TEXT))); + return new LifecycleConfigurationUpdate(appName, null, chunks, null); } else { return null; } @@ -353,7 +354,8 @@ public class SdlService extends Service { * Will speak a sample welcome message */ private void performWelcomeSpeak(){ - sdlManager.sendRPC(new Speak(createSimpleTTSChunks(WELCOME_SPEAK))); + List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(WELCOME_SPEAK, SpeechCapabilities.TEXT)); + sdlManager.sendRPC(new Speak(chunks)); } /** @@ -415,7 +417,8 @@ public class SdlService extends Service { sdlManager.getScreenManager().setTextField2(""); sdlManager.getScreenManager().commit(null); - sdlManager.sendRPC(new Speak(createSimpleTTSChunks(TEST_COMMAND_NAME))); + List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(TEST_COMMAND_NAME, SpeechCapabilities.TEXT)); + sdlManager.sendRPC(new Speak(chunks)); } private void showAlert(String text){ @@ -451,13 +454,4 @@ public class SdlService extends Service { sdlManager.getScreenManager().presentChoiceSet(choiceSet, InteractionMode.MANUAL_ONLY); } } - - private Vector<TTSChunk> createSimpleTTSChunks(String simple) { - if (simple == null) { - return null; - } - Vector<TTSChunk> chunks = new Vector<>(); - chunks.add(new TTSChunk(simple, SpeechCapabilities.TEXT)); - return chunks; - } } diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java index 3ada6368d..c85333cbe 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java @@ -42,9 +42,9 @@ import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; import com.smartdevicelink.util.DebugTool; import java.util.ArrayList; +import java.util.Collections; import java.util.Hashtable; import java.util.List; -import java.util.Vector; public class ChoiceSet { private static final String TAG = "ChoiceSet"; @@ -109,15 +109,15 @@ public class ChoiceSet { // Help the dev by creating TTS chunks for them if (initialPrompt != null){ - setInitialPrompt(createSimpleTTSChunks(initialPrompt)); + setInitialPrompt(Collections.singletonList(new TTSChunk(initialPrompt, SpeechCapabilities.TEXT))); } if (timeoutPrompt != null){ - setTimeoutPrompt(createSimpleTTSChunks(timeoutPrompt)); + setTimeoutPrompt(Collections.singletonList(new TTSChunk(timeoutPrompt, SpeechCapabilities.TEXT))); } if (helpPrompt != null){ - setHelpPrompt(createSimpleTTSChunks(helpPrompt)); + setHelpPrompt(Collections.singletonList(new TTSChunk(helpPrompt, SpeechCapabilities.TEXT))); } // things to do @@ -398,13 +398,4 @@ public class ChoiceSet { } return clonedHelpItems; } - - private Vector<TTSChunk> createSimpleTTSChunks(String simple) { - if (simple == null) { - return null; - } - Vector<TTSChunk> chunks = new Vector<>(); - chunks.add(new TTSChunk(simple, SpeechCapabilities.TEXT)); - return chunks; - } } diff --git a/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java b/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java index 0abd4ad81..2ac46def8 100644 --- a/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java +++ b/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java @@ -169,7 +169,8 @@ public class SdlService { break; } if (isNeedUpdate) { - return new LifecycleConfigurationUpdate(appName, null, createSimpleTTSChunks(ttsName), null); + Vector<TTSChunk> chunks = new Vector<>(Collections.singletonList(new TTSChunk(ttsName, SpeechCapabilities.TEXT))); + return new LifecycleConfigurationUpdate(appName, null, chunks, null); } else { return null; } @@ -301,7 +302,8 @@ public class SdlService { * Will speak a sample welcome message */ private void performWelcomeSpeak(){ - sdlManager.sendRPC(new Speak(createSimpleTTSChunks(WELCOME_SPEAK))); + List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(WELCOME_SPEAK, SpeechCapabilities.TEXT)); + sdlManager.sendRPC(new Speak(chunks)); } /** @@ -364,7 +366,8 @@ public class SdlService { sdlManager.getScreenManager().setTextField2(""); sdlManager.getScreenManager().commit(null); - sdlManager.sendRPC(new Speak(createSimpleTTSChunks(TEST_COMMAND_NAME))); + List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(TEST_COMMAND_NAME, SpeechCapabilities.TEXT)); + sdlManager.sendRPC(new Speak(chunks)); } private void showAlert(String text){ @@ -404,13 +407,4 @@ public class SdlService { sdlManager.getScreenManager().presentChoiceSet(choiceSet, InteractionMode.MANUAL_ONLY); } } - - private Vector<TTSChunk> createSimpleTTSChunks(String simple) { - if (simple == null) { - return null; - } - Vector<TTSChunk> chunks = new Vector<>(); - chunks.add(new TTSChunk(simple, SpeechCapabilities.TEXT)); - return chunks; - } } |