From 4b1c66b65ac49478197a7799eba6d3754654a846 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 26 Mar 2019 16:58:07 +0900 Subject: [PATCH] Fix bug detected when testing on TV profile Change-Id: Ic66fff13b80f7ccfd7086434590f7e60e5faa7bb --- plugins/wakeup-manager/inc/wakeup_settings.h | 2 +- .../wakeup-manager/src/wakeup_audio_manager.cpp | 5 +++++ plugins/wakeup-manager/src/wakeup_manager.cpp | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/wakeup-manager/inc/wakeup_settings.h b/plugins/wakeup-manager/inc/wakeup_settings.h index c24d170..d4743f2 100644 --- a/plugins/wakeup-manager/inc/wakeup_settings.h +++ b/plugins/wakeup-manager/inc/wakeup_settings.h @@ -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" diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index be7bd64..00ced81 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -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(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() diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index 6758c46..32521fe 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -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 */ -- 2.34.1