Fix issue that showing drawing item when explicitly call with reply input type
[platform/core/uifw/inputdelegator.git] / src / w-input-stt-ise.cpp
index 965d36d..0d14c94 100755 (executable)
@@ -21,6 +21,7 @@
 #include "w-input-stt-ise.h"
 #include "w-input-stt-voice.h"
 #include "w-input-stt-engine.h"
+#include "voice-recorder.h"
 
 
 VoiceData *my_voicedata = NULL;
@@ -43,12 +44,12 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(
        //stt_feedback_initialize();
 
        if (!my_voicedata) {
-               my_voicedata = (VoiceData*)malloc(sizeof(VoiceData));
+               my_voicedata = new VoiceData;
                if (my_voicedata == NULL) {
                        PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__);
                        return;
                }
-               memset(my_voicedata, 0, sizeof(VoiceData));
+               init_voicedata(my_voicedata);
        }
 
        if (my_voicedata) {
@@ -67,7 +68,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(
        vconf_notify_key_changed(VCONFKEY_ISE_STT_LANGUAGE, _stt_lang_changed_cb, my_voicedata);
 }
 
-void  pause_voice(){
+void pause_voice(){
        PRINTFUNC(DLOG_DEBUG, "pause_voice");
 
        powerUnlock();
@@ -76,8 +77,15 @@ void  pause_voice(){
        }
 }
 
- void destroy_voice()
- {
+void resume_voice(){
+       if (my_voicedata) {
+               PRINTFUNC(DLOG_DEBUG, "resume_voice");
+               on_stt_resume(my_voicedata);
+       }
+}
+
+void destroy_voice()
+{
         PRINTFUNC(DLOG_DEBUG, "destroy voice");
 
         //stt_feedback_deinitialize();  // It disable w-input-selector touch sound. So removed.
@@ -88,6 +96,8 @@ void  pause_voice(){
                 on_destroy(my_voicedata);
                 my_voicedata = NULL;
         }
+
+       destroy_voice_recorder();
  }
 
  int is_lang_supported_by_voice_input(const char *lang)