change voice touch click logic as by coordinate 73/281773/1
authordyamy-lee <dyamy.lee@samsung.com>
Wed, 21 Sep 2022 09:50:58 +0000 (18:50 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Thu, 22 Sep 2022 01:11:27 +0000 (10:11 +0900)
If a target's profile is not a TV, it clicks object by coordinate.
No longer it finds object by aurum because of time.

Change-Id: Id6ee19f8d1ec4f5c2c3bd2c1041346cb1edffa67

src/mmimgr/output_modality/TouchModule.cpp
src/mmimgr/output_modality/mmi_output_modality.cpp
src/mmimgr/output_modality/mmi_output_modality.h

index 451e541..d8c6002 100644 (file)
 #include <Aurum.h>
 #include <string>
 #include <memory>
-#include <system_info.h>
 
 #include "mmi-manager-dbg.h"
 #include "TouchModule.h"
 
-#define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
-#define TIZEN_PROFILE_COMMON (get_tizen_profile() == _PROFILE_COMMON)
-
-typedef enum {
-       _PROFILE_UNKNOWN = 0,
-       _PROFILE_MOBILE = 0x1,
-       _PROFILE_WEARABLE = 0x2,
-       _PROFILE_TV = 0x4,
-       _PROFILE_IVI = 0x8,
-       _PROFILE_COMMON = 0x10,
-} tizen_profile_e;
-
-static tizen_profile_e get_tizen_profile()
-{
-       tizen_profile_e profile;
-       char *profileName = NULL;
-
-       system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
-       switch (*profileName) {
-       case 't':
-       case 'T':
-               profile = _PROFILE_TV;
-               break;
-       case 'm':
-       case 'M':
-               profile = _PROFILE_MOBILE;
-               break;
-       default:
-               profile = _PROFILE_COMMON;
-       }
-
-       free(profileName);
-       return profile;
-}
-
 TouchModule::TouchModule()
 {
        Aurum::AccessibleWatcher::getInstance();
@@ -84,19 +48,15 @@ bool TouchModule::ClickByObjectId(std::string objectId)
 
        LOGD("click object = %s", objectId.c_str());
        found->getAccessibleNode()->print(1,1);
-       if (TIZEN_PROFILE_TV) {
-               found->setFocus();
-               std::string input_text("Return");
-               ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::PRESS);
-               LOGD("press ret = %d", ret);
+       found->setFocus();
+       std::string input_text("Return");
+       ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::PRESS);
+       LOGD("press ret = %d", ret);
+
+       ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::RELEASE);
+       LOGD("release ret = %d", ret);
+       LOGD("clicked keyname result = %d", ret);
 
-               ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::RELEASE);
-               LOGD("release ret = %d", ret);
-               LOGD("clicked keyname result = %d", ret);
-       } else {
-               found->click();
-               ret = true;
-       }
        return ret;
 }
 
index 4377732..985fcaf 100644 (file)
@@ -32,6 +32,29 @@ static void __refresh_screen_inform_event_free(void *data EINA_UNUSED, void *eve
        free(ev);
 }
 
+static tizen_profile_e __get_tizen_profile()
+{
+       tizen_profile_e profile;
+       char *profileName = NULL;
+
+       system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+       switch (*profileName) {
+       case 't':
+       case 'T':
+               profile = _PROFILE_TV;
+               break;
+       case 'm':
+       case 'M':
+               profile = _PROFILE_MOBILE;
+               break;
+       default:
+               profile = _PROFILE_COMMON;
+       }
+
+       free(profileName);
+       return profile;
+}
+
 EXPORT_API void output_modality_initialize()
 {
        LOGD("initialize output modality");
@@ -53,9 +76,15 @@ EXPORT_API int output_modality_voice_touch(mmi_output_modality_voice_touch modal
        int ret = 0;
 
        if (MMI_VOICE_TOUCH_MODE_TOOLTIP == mode) {
-               LOGD("voice touch by tooltip");
-               std::string objID = std::string(modality.object_id, strlen(modality.object_id));
-               ret = g_touch_module->ClickByObjectId(objID);
+               if (TIZEN_PROFILE_TV) {
+                       LOGD("voice touch by tooltip in TV");
+                       std::string objID = std::string(modality.object_id, strlen(modality.object_id));
+                       ret = g_touch_module->ClickByObjectId(objID);
+               }
+               else {
+                       LOGD("voice touch by tooltip in others");
+                       ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
+               }
        } else if (MMI_VOICE_TOUCH_MODE_GRID == mode) {
                LOGD("voice touch by grid");
                ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
index 135635a..45d3109 100644 (file)
 
 #include "mmi-common.h"
 #include <tizen.h>
+#include <system_info.h>
+
+typedef enum {
+       _PROFILE_UNKNOWN = 0,
+       _PROFILE_MOBILE = 0x1,
+       _PROFILE_WEARABLE = 0x2,
+       _PROFILE_TV = 0x4,
+       _PROFILE_IVI = 0x8,
+       _PROFILE_COMMON = 0x10,
+} tizen_profile_e;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+static tizen_profile_e __get_tizen_profile();
+
+#define TIZEN_PROFILE_TV (__get_tizen_profile() == _PROFILE_TV)
+#define TIZEN_PROFILE_COMMON (__get_tizen_profile() == _PROFILE_COMMON)
+
 /**
  * @brief Initialize MMI Output Modality Manager
  */