Skip the preload ISEs when it queries native IME apps.
authorBum-Sung Cho <bs0111.cho@samsung.com>
Wed, 10 Apr 2013 07:53:50 +0000 (16:53 +0900)
committerBum-Sung Cho <bs0111.cho@samsung.com>
Wed, 10 Apr 2013 07:53:50 +0000 (16:53 +0900)
Change-Id: I941c787750ffd37694db64bc69cd6b78cf1cd087
Signed-off-by: Bum-Sung Cho <bs0111.cho@samsung.com>
src/FUiIme_InputMethodManagerImpl.cpp

index 4262609..6b046af 100644 (file)
@@ -48,8 +48,8 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;\r
 using namespace Tizen::Locales;\r
 \r
-static const AppId PRELOADED_IME_APPID = "PRIVTIME01.ise-default";\r
-static const char* PRELOADED_IME_UUID = "12aa3425-f88d-45f4-a509-cee8dfe904e3";\r
+static const AppId _PRELOADED_IME_APPID = "PRIVTIME01.ise-default";\r
+static const char* _PRELOADED_IME_UUID = "12aa3425-f88d-45f4-a509-cee8dfe904e3";\r
 \r
 namespace Tizen { namespace Ui { namespace Ime {\r
 \r
@@ -351,7 +351,7 @@ _InputMethodManagerImpl::GetInputMethodInfoListN(void) const
 \r
        for (int i = 0; i < preloadedImeCount; i++)\r
        {\r
-               if (!strcmp(dpList[i], PRELOADED_IME_UUID))\r
+               if (!strcmp(dpList[i], _PRELOADED_IME_UUID))\r
                {\r
                        ret = isf_control_get_ise_info(dpList[i], &pName, &pLanguage, &type, &option);\r
                        SysTryCatch(NID_UI_IME, ret == 0, , E_SYSTEM, "[E_SYSTEM] A failure occurs from the underlying system.");\r
@@ -374,7 +374,7 @@ _InputMethodManagerImpl::GetInputMethodInfoListN(void) const
        r = GetLastResult();\r
        SysTryCatch(NID_UI_IME, pInputMethodInfoImpl, , r, "[%s] Propagating.", GetErrorMessage(r));\r
 \r
-       pInputMethodInfoImpl->SetAppId(PRELOADED_IME_APPID);\r
+       pInputMethodInfoImpl->SetAppId(_PRELOADED_IME_APPID);\r
        pInputMethodInfoImpl->SetUuid(dpList[preloadedImeIndex]);\r
        pInputMethodInfoImpl->SetName(String(pName));\r
        pInputMethodInfoImpl->SetType(_ScimDataConverter::ConvertType(type));\r
@@ -403,6 +403,13 @@ _InputMethodManagerImpl::GetInputMethodInfoListN(void) const
                r = GetLastResult();\r
                SysTryCatch(NID_UI_IME, pAppId, , r, "[%s] Propagating.", GetErrorMessage(r));\r
 \r
+               const wchar_t _RESERVED_APP_ID[] = L"PRIVT";\r
+               const int _RESERVED_APP_ID_LENGTH = 5;\r
+               if (!wcsncmp(pAppId->GetPointer(), _RESERVED_APP_ID, _RESERVED_APP_ID_LENGTH))\r
+               {\r
+                       continue;\r
+               }\r
+\r
                String appRootPath;\r
                r = _AppManagerImpl::GetAppRootPath(*pAppId, appRootPath);\r
                SysTryCatch(NID_UI_IME, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));\r
@@ -442,7 +449,7 @@ _InputMethodManagerImpl::SetInputMethod(const AppId& id)
        std::unique_ptr<char[]> pLog(_StringConverter::CopyToCharArrayN(id.GetPointer()));\r
        SysLog(NID_UI_IME, "The application ID is %s.", pLog.get());\r
 \r
-       if (id == PRELOADED_IME_APPID)\r
+       if (id == _PRELOADED_IME_APPID)\r
        {\r
                char** dpList = null;\r
                int preloadedImeCount = isf_control_get_ise_list(&dpList);\r
@@ -450,7 +457,7 @@ _InputMethodManagerImpl::SetInputMethod(const AppId& id)
 \r
                for (int i = 0; i < preloadedImeCount; i++)\r
                {\r
-                       if (!strcmp(dpList[i], PRELOADED_IME_UUID))\r
+                       if (!strcmp(dpList[i], _PRELOADED_IME_UUID))\r
                        {\r
                                isf_control_set_active_ise_by_uuid(dpList[i]);\r
                                break;\r