add press home 99/283799/1
authordyamy-lee <dyamy.lee@samsung.com>
Tue, 18 Oct 2022 11:39:12 +0000 (20:39 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Thu, 3 Nov 2022 05:44:38 +0000 (14:44 +0900)
Change-Id: I0bffe01b65f94064811f0427af041118c0bc809f

src/mmimgr/iu/VoiceTouchEngine.cpp
src/mmimgr/mmi-common.h
src/mmimgr/output_modality/TouchModule.cpp
src/mmimgr/output_modality/TouchModule.h
src/mmimgr/output_modality/mmi_output_modality.cpp
src/mmimgr/res/voice_touch_commands.json

index fb8f3c0..f7df9b2 100644 (file)
@@ -37,6 +37,7 @@ static const string __PRE_DEFINED_SHOW_GRID = "SHOW_GRID";
 static const string __PRE_DEFINED_REFRESH_WINDOW_INFO = "REFRESH_WINDOW_INFO";
 static const string __PRE_DEFINED_REQUEST_TURNING_OFF = "REQUEST_TURNING_OFF";
 static const string __PRE_DEFINED_OPERATION_PRESS_BACK = "OPERATION_PRESS_BACK";
+static const string __PRE_DEFINED_OPERATION_PRESS_HOME = "OPERATION_PRESS_HOME";
 static const string __PRE_DEFINED_OPERATION_PRESS_UP = "OPERATION_PRESS_UP";
 static const string __PRE_DEFINED_OPERATION_PRESS_DOWN = "OPERATION_PRESS_DOWN";
 static const string __PRE_DEFINED_OPERATION_PRESS_LEFT = "OPERATION_PRESS_LEFT";
@@ -49,6 +50,7 @@ static const string __PRE_DEFINED_OPERATION_PANEL_OFF = "OPERATION_PANEL_OFF";
 
 static const map<string, int> __OPERATION_REQUEST = {
        {__PRE_DEFINED_OPERATION_PRESS_BACK, MMI_VOICE_TOUCH_OPERATION_PRESS_BACK},
+       {__PRE_DEFINED_OPERATION_PRESS_HOME, MMI_VOICE_TOUCH_OPERATION_PRESS_HOME},
        {__PRE_DEFINED_OPERATION_PRESS_UP, MMI_VOICE_TOUCH_OPERATION_PRESS_UP},
        {__PRE_DEFINED_OPERATION_PRESS_DOWN, MMI_VOICE_TOUCH_OPERATION_PRESS_DOWN},
        {__PRE_DEFINED_OPERATION_PRESS_LEFT, MMI_VOICE_TOUCH_OPERATION_PRESS_LEFT},
index 75505f5..a0c2b83 100644 (file)
@@ -161,6 +161,7 @@ typedef enum mmi_voice_touch_mode
 typedef enum mmi_voice_touch_operation
 {
        MMI_VOICE_TOUCH_OPERATION_PRESS_BACK,
+       MMI_VOICE_TOUCH_OPERATION_PRESS_HOME,
        MMI_VOICE_TOUCH_OPERATION_PRESS_UP,
        MMI_VOICE_TOUCH_OPERATION_PRESS_DOWN,
        MMI_VOICE_TOUCH_OPERATION_PRESS_LEFT,
index d041ff1..e78e8c7 100644 (file)
@@ -84,6 +84,16 @@ bool TouchModule::PressBack()
        return ret;
 }
 
+bool TouchModule::PressHome()
+{
+       LOGD("execute press home");
+       std::shared_ptr<Aurum::UiDevice> device = Aurum::UiDevice::getInstance();
+       bool ret = false;
+       ret = device->pressHome(Aurum::KeyRequestType::STROKE);
+       LOGD("press home, ret = %d", ret);
+       return ret;
+}
+
 bool TouchModule::PressKey(std::string keyCode)
 {
        LOGD("execute keycode");
index f7f5a2f..5be8638 100644 (file)
@@ -31,6 +31,7 @@ public:
        bool ClickByObjectId(std::string key);
        bool ClickByCoordinate(int x, int y);
        bool PressBack();
+       bool PressHome();
        bool PressKey(std::string keyCode);
        bool Drag(int startX, int startY, int endX, int endY, int steps, int duration_ms);
 };
index 3d847c4..141d6f2 100644 (file)
@@ -99,6 +99,10 @@ static int __voice_touch_operation(mmi_output_modality_voice_touch modality)
                ret = g_touch_module->PressBack();
                break;
 
+       case MMI_VOICE_TOUCH_OPERATION_PRESS_HOME:
+               ret = g_touch_module->PressHome();
+               break;
+
        case MMI_VOICE_TOUCH_OPERATION_PRESS_UP:
                ret = g_touch_module->PressKey(std::string("Up"));
                break;
index 9db13e3..bcb0665 100644 (file)
                        ]
                },
                {
+                       "Result" : "OPERATION_PRESS_HOME",
+                       "Candidates" : [
+                               "홈으로",
+                               "홈 화면"
+                       ]
+               },
+               {
                        "Result" : "OPERATION_PRESS_UP",
                        "Candidates" : [
                                "위",
                        ]
                },
                {
+                       "Result" : "OPERATION_PRESS_HOME",
+                       "Candidates" : [
+                               "home",
+                               "go to home"
+                       ]
+               },
+               {
                        "Result" : "OPERATION_PRESS_UP",
                        "Candidates" : [
                                "up",