init voice data when pressed backkey in voice input mode 94/176194/1
authorsungwook79.park <sungwook79.park@samsung.com>
Tue, 17 Apr 2018 07:13:25 +0000 (16:13 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Tue, 17 Apr 2018 09:05:45 +0000 (18:05 +0900)
Change-Id: I7f4e7bfd77f3e059d833025a40dc188e40389aee
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/include/ise-stt-mode.h
src/ise-stt-mode.cpp
src/ise.cpp

index 028e957..19d329a 100644 (file)
@@ -115,6 +115,7 @@ void set_animation_state(VoiceData *voicedata);
 void show_error_message(VoiceData *voicedata, stt_error_e reason);
 void voice_get_string(const char *keyValue, VoiceData *voicedata);
 void voice_result_string_flush();
+void ise_stt_stop();
 
 
 #ifdef __cplusplus
index a094ccd..89557ab 100644 (file)
@@ -62,6 +62,17 @@ void voice_result_string_flush()
     }
 }
 
+void ise_stt_stop()
+{
+    if (my_voicedata != NULL)
+        try {
+            my_voicedata->state = STT_STATE_VAL_INIT;
+            my_voicedata->sttmanager->Stop();
+        }
+        catch (is::stt::SttException &e) {
+        }
+}
+
 void send_result_text(void *data)
 {
     if (!data)
index fdbb38b..cf29772 100644 (file)
@@ -1100,6 +1100,9 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
                     ise_hide();
                     ime_request_hide();
                 } else if (event_desc.key_event) {
+                    if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE) {
+                        ise_stt_stop();
+                    }
                     ise_send_event(event_desc.key_event, KEY_MASK_NULL);
                     if (event_desc.key_event == MVK_Shift_L) {
                         g_need_send_shift_event = TRUE;