modify some log message, and rearrange function position
authorjungmin76.park <jungmin76.park@samsung.com>
Tue, 28 May 2013 12:50:52 +0000 (21:50 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 29 May 2013 14:01:34 +0000 (23:01 +0900)
Change-Id: Ie10f1aaeda15a3ab63776e9638c7a232aae2b866
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
src/FShell_AppWidgetManagerImpl.cpp
src/FShell_AppWidgetProviderManagerImpl.cpp
src/core/FShell_LockManagerImpl.cpp
src/core/FShell_ShortcutManagerImpl.cpp

index 0f98b85..10963e3 100644 (file)
@@ -83,7 +83,7 @@ _AppWidgetManagerImpl::GetInstance()
        if( __pAppWidgetManagerImpl == null)
        {
                __pAppWidgetManagerImpl = new (std::nothrow)_AppWidgetManagerImpl;
-               SysTryReturn(NID_SHELL, __pAppWidgetManagerImpl, null, E_OUT_OF_MEMORY, "Allocating new _AppWidgetManagerProxy failed.");
+               SysTryReturn(NID_SHELL, __pAppWidgetManagerImpl, null, E_OUT_OF_MEMORY, "Allocating new _AppWidgetManagerImpl failed.");
 
                result r = __pAppWidgetManagerImpl->Construct();
                SysTryReturn(NID_SHELL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
index e6de3d1..01aed75 100644 (file)
@@ -154,60 +154,6 @@ _AppWidgetProviderManagerImpl::SetAppWidgetProviderFactory(IAppWidgetProviderFac
        return E_SUCCESS;
 }
 
-const wchar_t USE_UI_KEY[] = L"UseUi";
-const wchar_t USE_UI_VAL_TRUE[] = L"True";
-const wchar_t LIFE_DURATION_KEY[] = L"LifeDuration";
-const wchar_t AUTO_RESTART_KEY[] = L"AutoRestart";
-const int LIFE_DURATION_MIN = 30000;
-
-result
-_AppWidgetProviderManagerImpl::ValidateApplicationAttribute(void)
-{
-       static result res = E_UNKNOWN;
-       if(res != E_UNKNOWN )
-       {
-               return res;
-       }
-
-       res = E_SYSTEM;
-       unique_ptr<HashMapT<String, _AppFeatureInfoImpl*> > pInfo(_PackageManagerImpl::GetInstance()->GetPackageAppFeatureMapN(_AppInfo::GetPackageId(), _AppInfo::GetAppExecutableName()) );
-       SysTryReturnResult(NID_SHELL, pInfo.get(), E_SYSTEM, "Failed to invoke _PackageManagerImpl::GetPackageAppFeatureMapN()");
-
-       _AppFeatureInfoImpl* pFeature = null;
-
-       res = E_INVALID_OPERATION;
-       // UseUi
-       result r = pInfo->GetValue(USE_UI_KEY, pFeature);
-       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Can't find %ls attribute for the ServiceApp in package information.", USE_UI_KEY );
-
-       const String& useUi = pFeature->GetValue();
-       SysTryReturnResult(NID_SHELL, useUi == USE_UI_VAL_TRUE, E_INVALID_OPERATION, "%ls attribute value should be '%ls' to be an application that providing AppWidget, but value is %ls", USE_UI_KEY, USE_UI_VAL_TRUE, useUi.GetPointer() );
-
-       // LifeDuration
-       r = pInfo->GetValue(LIFE_DURATION_KEY, pFeature);
-       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Can't find %ls attribute for the ServiceApp in package information.", LIFE_DURATION_KEY );
-
-       const String& lifeDurationValue = pFeature->GetValue();
-       int lifeDuration = 0;
-       r = Integer::Parse(lifeDurationValue, lifeDuration);
-       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Failed to parse %ls attribute for the ServiceApp in package information.", LIFE_DURATION_KEY );
-//     SysTryReturnResult(NID_SHELL, lifeDuration <= LIFE_DURATION_MIN, E_INVALID_OPERATION, "%ls attribute value should be less than '%d' to be an application that providing AppWidget, but value is %d", LIFE_DURATION_KEY, LIFE_DURATION_MIN, lifeDuration );
-
-       // AutoRestart
-       r = pInfo->GetValue(AUTO_RESTART_KEY, pFeature);
-       if (!IsFailed(r))
-       {
-               String autoRestart = pFeature->GetValue();
-               autoRestart.ToLowerCase();
-               SysTryReturnResult(NID_SHELL, autoRestart != "true", E_INVALID_OPERATION, "It's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget.");
-       }
-
-       _DeleteCollectionMapValue<String, _AppFeatureInfoImpl>(*pInfo);
-
-       res = E_SUCCESS;
-       return res;
-}
-
 result
 _AppWidgetProviderManagerImpl::SetAppWidgetPopupProviderFactory(IAppWidgetPopupProviderFactory& factory)
 {
@@ -533,28 +479,6 @@ _AppWidgetProviderManagerImpl::HandleAppWidgetRequest(const String& operationId,
        else if (operationId == APPWIDGET_ON_TOUCH)
        {
                SysLog(NID_SHELL, "[APPWIDGET_ON_TOUCH] touch events will be delivered after provider is initialized");
-//             int eventType = 0;
-//             double  timeStamp = 0.0f;
-//             double  x = 0.0f;
-//             double  y = 0.0f;
-
-//             const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
-//             Integer::Parse(*pValue, eventType);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
-//             Double::Parse(*pValue, timeStamp);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
-//             Double::Parse(*pValue, x);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
-//             Double::Parse(*pValue, y);
-//
-//             this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
        }
        SysLog(NID_SHELL, "Exit");
        return E_SUCCESS;
@@ -613,30 +537,6 @@ _AppWidgetProviderManagerImpl::HandleAppWidgetPopupRequest(const String& operati
        else if (operationId == APPWIDGET_POPUP_ON_TOUCH)
        {
                SysAssertf(false, "[Invalid state]");
-//             SysAssertf(pArgs->GetCount() == 6, "invalid argc(%d)", pArgs->GetCount() );
-//
-//             int eventType = 0;
-//             double  timeStamp = 0.0f;
-//             double  x = 0.0f;
-//             double  y = 0.0f;
-//
-//             const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
-//             Integer::Parse(*pValue, eventType);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
-//             Double::Parse(*pValue, timeStamp);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
-//             Double::Parse(*pValue, x);
-//
-//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
-//             SysTryReturnResult(NID_SHELL, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
-//             Double::Parse(*pValue, y);
-//
-//             ForwardTouchEventForPD(*pInstanceId, eventType, timeStamp, x, y);
        }
        else
        {
@@ -907,4 +807,58 @@ _AppWidgetProviderManagerImpl::OnApplicationTerminated(const AppId& appId, int p
        __appwidgetProviders.RemoveAll();
 }
 
+result
+_AppWidgetProviderManagerImpl::ValidateApplicationAttribute(void)
+{
+       const wchar_t USE_UI_KEY[] = L"UseUi";
+       const wchar_t USE_UI_VAL_TRUE[] = L"True";
+       const wchar_t LIFE_DURATION_KEY[] = L"LifeDuration";
+       const wchar_t AUTO_RESTART_KEY[] = L"AutoRestart";
+       const int LIFE_DURATION_MIN = 30000;
+
+       static result res = E_UNKNOWN;
+       if(res != E_UNKNOWN )
+       {
+               return res;
+       }
+
+       res = E_SYSTEM;
+       unique_ptr<HashMapT<String, _AppFeatureInfoImpl*> > pInfo(_PackageManagerImpl::GetInstance()->GetPackageAppFeatureMapN(_AppInfo::GetPackageId(), _AppInfo::GetAppExecutableName()) );
+       SysTryReturnResult(NID_SHELL, pInfo.get(), E_SYSTEM, "Failed to invoke _PackageManagerImpl::GetPackageAppFeatureMapN()");
+
+       _AppFeatureInfoImpl* pFeature = null;
+
+       res = E_INVALID_OPERATION;
+       // UseUi
+       result r = pInfo->GetValue(USE_UI_KEY, pFeature);
+       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Can't find %ls attribute for the ServiceApp in package information.", USE_UI_KEY );
+
+       const String& useUi = pFeature->GetValue();
+       SysTryReturnResult(NID_SHELL, useUi == USE_UI_VAL_TRUE, E_INVALID_OPERATION, "%ls attribute value should be '%ls' to be an application that providing AppWidget, but value is %ls", USE_UI_KEY, USE_UI_VAL_TRUE, useUi.GetPointer() );
+
+       // LifeDuration
+       r = pInfo->GetValue(LIFE_DURATION_KEY, pFeature);
+       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Can't find %ls attribute for the ServiceApp in package information.", LIFE_DURATION_KEY );
+
+       const String& lifeDurationValue = pFeature->GetValue();
+       int lifeDuration = 0;
+       r = Integer::Parse(lifeDurationValue, lifeDuration);
+       SysTryReturnResult(NID_SHELL, !IsFailed(r), E_INVALID_OPERATION, "Failed to parse %ls attribute for the ServiceApp in package information.", LIFE_DURATION_KEY );
+//     SysTryReturnResult(NID_SHELL, lifeDuration <= LIFE_DURATION_MIN, E_INVALID_OPERATION, "%ls attribute value should be less than '%d' to be an application that providing AppWidget, but value is %d", LIFE_DURATION_KEY, LIFE_DURATION_MIN, lifeDuration );
+
+       // AutoRestart
+       /*r = pInfo->GetValue(AUTO_RESTART_KEY, pFeature);
+       if (!IsFailed(r))
+       {
+               String autoRestart = pFeature->GetValue();
+               autoRestart.ToLowerCase();
+               SysTryReturnResult(NID_SHELL, autoRestart != "true", E_INVALID_OPERATION, "It's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget.");
+       }*/
+
+       _DeleteCollectionMapValue<String, _AppFeatureInfoImpl>(*pInfo);
+
+       res = E_SUCCESS;
+       return res;
+}
+
 }} // Tizen::Shell
index 486af51..c0cee44 100644 (file)
@@ -110,6 +110,7 @@ _LockManagerImpl::IsSecureMode(void) const
 
                default:
                        SysAssert(false);
+                       break;
        }
 
        return false;
index b17615a..d2ee852 100644 (file)
@@ -55,7 +55,7 @@ _ShortcutManagerImpl::GetInstance()
        if( __pShortcutManagerImpl == null)
        {
                __pShortcutManagerImpl = new (std::nothrow)_ShortcutManagerImpl;
-               SysTryReturn(NID_SHELL, __pShortcutManagerImpl, null, E_OUT_OF_MEMORY, "Allocating new _AppWidgetManagerProxy failed.");
+               SysTryReturn(NID_SHELL, __pShortcutManagerImpl, null, E_OUT_OF_MEMORY, "Allocating new _ShortcutManagerImpl failed.");
 
                result r = __pShortcutManagerImpl->Construct();
                SysTryReturn(NID_SHELL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));