Send empty clicked object result 92/283792/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Wed, 19 Oct 2022 05:31:50 +0000 (14:31 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Thu, 3 Nov 2022 05:44:38 +0000 (14:44 +0900)
- Issue:
Voice touch app did not clear the tooltip when user says 'back' or
'referesh'.

- Solution:
Current mmi-manager did not send result to client app, but just sends
output event to output modality when the utterance is pre defined
command. Thus, client app can not handle pre-defined command action
situation. This patch sends result of pre-defined command to client app.
Through this patch, client app can handle this special situation.

Change-Id: I560276bfa230e2171b3d79ed6a69f260a6a239be
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/mmimgr/iu/VoiceTouchEngine.cpp
src/mmimgr/iu/VoiceTouchEngine.h

index f2d1cf91550a633cfca60788820e41ea99dcf41c..f7e2017828a321682f06acd98541e7929f183c02 100644 (file)
@@ -222,6 +222,7 @@ bool VoiceTouchEngine::handleVoiceInput(mmi_provider_event_voice *voiceEvent)
        bool isRefreshNeed = __is_exist_in_candidates(asrResult, __REFRESH_WINDOW_INFO);
        if (isRefreshNeed) {
                _I("[VoiceTouchEngine] Request to refresh clickable object information.");
+               setAndSendPreDefinedCommandResult(timestamp, MMI_VOICE_TOUCH_OPERATION_PRESS_BACK);
                __invoke_event_for_refreshing_window();
                return true;
        }
@@ -239,6 +240,7 @@ bool VoiceTouchEngine::handleVoiceInput(mmi_provider_event_voice *voiceEvent)
        auto operationIterator = __OPERATION_REQUEST.find(asrResult);
        if (operationIterator != __OPERATION_REQUEST.end()) {
                int operation = operationIterator->second;
+               setAndSendPreDefinedCommandResult(timestamp, operation);
                makeOperation(timestamp, operation);
                invokeOutputModalityCallback(&__touchModality);
                return true;
@@ -500,6 +502,32 @@ void VoiceTouchEngine::makeTouchModality(const ClickableItem &item, int timestam
        setTouchModality(item, timestamp);
 }
 
+void VoiceTouchEngine::setAndSendPreDefinedCommandResult(int timestamp, int operation)
+{
+       _I("[VoiceTouchEngine] Set pre-defined command result into output. timestamp(%d). operation(%d)", timestamp, operation);
+
+       if (operation != MMI_VOICE_TOUCH_OPERATION_PRESS_BACK) {
+               _D("[VoiceTouchEngine] Skip making result. timestamp(%d). operation(%d)", timestamp, operation);
+               return;
+       }
+
+       JsonProvider provider;
+       ClickableItem item;
+       item.coordX = -1;
+       item.coordY = -1;
+       item.width = -1;
+       item.height = -1;
+       item.index = -1;
+       item.objectId = "";
+       item.label = "";
+
+       setSelectedItemResult(item, timestamp, provider);
+
+       _I("[VoiceTouchEngine] Set pre-defined command result into output. timestamp(%d). operation(%d)", timestamp, operation);
+       invokeOutputResultCallback(provider.jsonToString());
+}
+
+
 void VoiceTouchEngine::makeOperation(int timestamp, int operation)
 {
        _I("[VoiceTouchEngine] Make operation. timestamp(%d). operation(%d)", timestamp, operation);
index 127cffdedfb41c9632a1a315840928f3d0f52cdc..cbbeefee543651586d9b0505d429f47162a795ac 100644 (file)
@@ -97,6 +97,7 @@ private:
        void makeTouchModality(const ClickableItem &item, int timestamp);
        void setTouchModality(const ClickableItem &item, int timestamp);
 
+       void setAndSendPreDefinedCommandResult(int timestamp, int operation);
        void makeOperation(int timestamp, int operation);
        void setOperationModality(int timestamp, int operation);