Fix bug detected when testing on TV profile 43/202243/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 26 Mar 2019 07:58:07 +0000 (16:58 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 26 Mar 2019 07:58:07 +0000 (16:58 +0900)
Change-Id: Ic66fff13b80f7ccfd7086434590f7e60e5faa7bb

plugins/wakeup-manager/inc/wakeup_settings.h
plugins/wakeup-manager/src/wakeup_audio_manager.cpp
plugins/wakeup-manager/src/wakeup_manager.cpp

index c24d170f2f5af6ebbf5bd06d998e935a6180314a..d4743f29c63186e9965fa8ec75b2ebc5389344da 100644 (file)
@@ -25,7 +25,7 @@ namespace multiassistant
 namespace wakeup
 {
 
-#define DEFAULT_ASSISTANT_APPID "com.samsung.bixby-voice"
+#define DEFAULT_ASSISTANT_APPID "org.tizen.voice-app"
 
 #define WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID "db/multi-assistant/default_assistant_appid"
 #define WAKEUP_SETTINGS_KEY_UI_PANEL_ENABLED "db/multi-assistant/ui_panel_enabled"
index be7bd64184de0b47f3eaad0ba44da2065fbccd10..00ced81dd76072acb6c3ba33dbeb2ec406bc4995 100644 (file)
@@ -39,6 +39,8 @@ static void _bt_cb_hid_state_changed(int result, bool connected, const char *rem
 
 static void _bt_hid_audio_data_receive_cb(bt_hid_voice_data_s *voice_data, void *user_data)
 {
+       MWR_LOGD("_bt_hid_audio_data_receive_cb");
+
        CAudioManager *manager = static_cast<CAudioManager*>(user_data);
        if (nullptr == manager) return;
 
@@ -201,6 +203,8 @@ void CAudioManager::unsubscribe(IAudioDataObserver *observer)
 
 void CAudioManager::recorder_thread_func()
 {
+#ifndef TV_PRODUCT
+
        static int buffer_count = 0;
 
        while (!(mStopRecorderThread.load())) {
@@ -265,6 +269,7 @@ void CAudioManager::recorder_thread_func()
                        fwrite(buffer, 1, BUFFER_LENGTH, g_pFile);
 #endif
        }
+#endif
 }
 
 void CAudioManager::stop_recording()
index 6758c4660a18cccf5cb670fe0e7910e0968241af..32521fe1275a48fb5a664e8887ec1d1ccf07f742 100644 (file)
@@ -130,7 +130,7 @@ Eina_Bool _key_down_cb(void* data, int type, void* event)
                MWR_LOGD("KEY[%s], typep[%d]", ev->keyname, type);
 
                if (ev->keyname && strncmp(ev->keyname, KEY_BT_VOICE, strlen(KEY_BT_VOICE)) == 0 ) {
-                       wakeup_manager_send_assistant_specific_command(0, "voice_key_pressed");
+                       wakeup_manager_send_assistant_specific_command(DEFAULT_ASSISTANT_APPID, "voice_key_pressed");
                }
        }
 
@@ -144,7 +144,7 @@ Eina_Bool _key_up_cb(void* data, int type, void* event)
                MWR_LOGD("KEY[%s], typep[%d]", ev->keyname, type);
 
                if (ev->keyname && strncmp(ev->keyname, KEY_BT_VOICE, strlen(KEY_BT_VOICE)) == 0) {
-                       wakeup_manager_send_assistant_specific_command(0, "voice_key_released");
+                       wakeup_manager_send_assistant_specific_command(DEFAULT_ASSISTANT_APPID, "voice_key_released");
                }
        }
        return ECORE_CALLBACK_DONE;
@@ -538,6 +538,14 @@ int wakeup_manager_initialize(void)
        wakeup_engine_info_initialize();
 
 #ifdef TV_PRODUCT
+       Ecore_Wl2_Display *_ecore_wl2_display = NULL;
+
+       Eina_Bool bRet = ecore_wl2_init();
+       MWR_LOGD("ecore_wl2_init: %d", bRet);
+
+       _ecore_wl2_display = ecore_wl2_display_connect(NULL);
+       MWR_LOGD("_ecore_wl2_display: %p", _ecore_wl2_display);
+
        _grab_voice_key();
        _add_key_cb();
 #endif
@@ -846,6 +854,7 @@ int wakeup_manager_process_event(int event, void* data, int len)
                        g_audio_manager.clear_speech_data();
 
                        g_voice_key_pressed = true;
+                       g_audio_manager.voice_key_pressed_set(g_voice_key_pressed);
                        /* (Re)Start recorder thread using bt hid */
                        g_audio_manager.start_recording();
 
@@ -873,6 +882,7 @@ int wakeup_manager_process_event(int event, void* data, int len)
        } else if (event == MA_PLUGIN_EVENT_VOICE_KEY_RELEASED) {
                if (g_voice_key_pressed != false) {
                        g_voice_key_pressed = false;
+                       g_audio_manager.voice_key_pressed_set(g_voice_key_pressed);
                        g_audio_manager.finalize_speech_data();
                        if (g_audio_data_required == true) {
                                /* Restart recorder thread using standard mic */