Revert vc_mgr_set_selected_result() execution condition 42/286142/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 22 Nov 2022 11:43:00 +0000 (20:43 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 29 Dec 2022 02:27:11 +0000 (11:27 +0900)
- Issue:
vc_mgr_set_selected_result() should be able to invoked if
vc_mgr_all_result_cb() returns false.

- Solution:
Previous commit changes the execution condition of
vc_mgr_set_selected_result() to be invoked only in
vc_mgr_all_result_cb(). However, according to the description of
vc_mgr_all_result_cb(), vc_mgr_set_selected_result() should be able to
be invoked if vc_mgr_all_result_cb() returns false. Thus, this patch
reverts the condition of vc_mgr_set_selected_result() and fixes the
description of vc_mgr_set_selected_result().

Change-Id: I330a150187698f8179a62956b32a8092986397b4
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/vc_mgr_core.c
include/voice_control_manager.h

index fc04ea6..2e69258 100644 (file)
@@ -52,8 +52,6 @@ static int g_volume_timer_cnt = 0;
 
 static bool g_err_callback_status = false;
 
-static bool g_all_result_callback_status = false;
-
 /* for TTS feedback */
 static int g_feedback_rate = 16000;
 static vc_audio_channel_e g_feedback_audio_channel = 0;
@@ -109,9 +107,7 @@ static void __vc_mgr_core_notify_all_result(vc_result_type_e result_type)
        vc_mgr_client_set_all_result(event, temp_text);
 
        vc_mgr_client_use_callback();
-       g_all_result_callback_status = true;
        cb_ret = all_callback(event, vc_cmd_list, temp_text, temp_message, all_user_data);
-       g_all_result_callback_status = false;
        vc_mgr_client_not_use_callback();
 
        if (true == vc_mgr_client_get_exclusive_command()) {
@@ -295,11 +291,6 @@ void vc_mgr_core_notify_error()
 
 int vc_mgr_core_set_selected_results(vc_cmd_list_h vc_cmd_list, int pid)
 {
-       if (false == g_all_result_callback_status) {
-               SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Not in all result callback");
-               return VC_ERROR_OPERATION_FAILED;
-       }
-
        if (NULL != vc_cmd_list) {
                int event = 0;
                char* result_text = NULL;
index f14e5f6..8978908 100644 (file)
@@ -993,6 +993,7 @@ int vc_mgr_get_recording_volume(float *volume);
  * @privilege %http://tizen.org/privilege/voicecontrol.manager
  *
  * @remarks This function should be called in vc_mgr_all_result_cb().
+ *      Or this function should be called after that vc_mgr_all_result_cb() returns @c false.
  *      The @a vc_cmd_list can be NULL, in that case the function does nothing.
  * @param[in] vc_cmd_list   The valid result list
  *