Fix Jira issue (privilege, icon)
authorDuyoung Jang <duyoung.jang@samsung.com>
Mon, 20 May 2013 10:29:37 +0000 (19:29 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Mon, 20 May 2013 10:29:37 +0000 (19:29 +0900)
Change-Id: Ia77b25d5d8c84b48f68729ab2735085249a5bf0c
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
src/app/inc/FAppPkg_PackageManagerImpl.h
src/app/package/FAppPkg_PackageAppInfoImpl.cpp
src/app/package/FAppPkg_PackageInfoImpl.cpp
src/app/package/FAppPkg_PackageManagerImpl.cpp

index 1682e51..4125c9b 100644 (file)
@@ -73,6 +73,12 @@ static const wchar_t PACKAGE_APP_FILTER_CATEGORY_HOMEAPP[] = L"http://tizen.org/
 static const wchar_t PACKAGE_APP_FILTER_CATEGORY_LOCKAPP[] = L"http://tizen.org/category/lockapp";
 static const wchar_t PACKAGE_APP_FILTER_CATEGORY_MENUAPP[] = L"http://tizen.org/category/menuapp";
 
+// PackageAppFilter(internal)
+//static const wchar_t PACKAGE_APP_FILTER_LAUNCH_ONBOOT[] = L"http://tizen.org/package/app/launchonboot";
+//static const wchar_t PACKAGE_APP_FILTER_AUTO_RESTART[] = L"http://tizen.org/package/app/autorestart";
+static const wchar_t PACKAGE_APP_FILTER_LAUNCHING_HISTORY_VISIBLE[] = L"http://tizen.org/package/app/launchinghistoryvisible";
+static const wchar_t PACKAGE_APP_FILTER_LAUNCH_CONDITION[] = L"http://tizen.org/package/app/launchcondition";
+
 enum PackageStorageType
 {
        PACKAGE_STORAGE_TYPE_INTERNAL,
index a3475af..1d69ad8 100755 (executable)
@@ -146,13 +146,19 @@ _PackageAppInfoImpl::GetAppMenuIconN(void) const
 
        if (__fromDatabase)
        {
-               SysTryReturn(NID_APP, __appIconPath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "appIconPath() is empty.");
+               if (__appIconPath.IsEmpty() == true)
+               {
+                       return null;
+               }
 
                iconPath = __appIconPath;
        }
        else
        {
-               SysTryReturn(NID_APP, __appTempIconPath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "__appTempIconPath() is empty.");
+               if (__appTempIconPath.IsEmpty() == true)
+               {
+                       return null;
+               }
 
                iconPath = __appTempIconPath;
        }
index 00fbd8f..5295cc7 100755 (executable)
@@ -514,23 +514,24 @@ _PackageInfoImpl::GetPrivilegeListN(void) const
        }
        else
        {
-               SysTryReturn(NID_APP, __pPrivilegeList, null, E_SYSTEM, "__pPrivilegeList must not be null.");
-
-               for (int i = 0; i < __pPrivilegeList->GetCount(); i++)
+               if (__pPrivilegeList)
                {
-                       String* pPrivilege = dynamic_cast < String* >(__pPrivilegeList->GetAt(i));
-                       if (pPrivilege)
+                       for (int i = 0; i < __pPrivilegeList->GetCount(); i++)
                        {
-                               std::unique_ptr< PrivilegeInfo > pPrivilegeInfo(new (std::nothrow) PrivilegeInfo);
-                               SysTryReturn(NID_APP, pPrivilegeInfo, null, E_OUT_OF_MEMORY, "pPrivilegeInfo must not be null.");
+                               String* pPrivilege = dynamic_cast < String* >(__pPrivilegeList->GetAt(i));
+                               if (pPrivilege)
+                               {
+                                       std::unique_ptr< PrivilegeInfo > pPrivilegeInfo(new (std::nothrow) PrivilegeInfo);
+                                       SysTryReturn(NID_APP, pPrivilegeInfo, null, E_OUT_OF_MEMORY, "pPrivilegeInfo must not be null.");
 
-                               r = pPrivilegeInfo->Construct(*pPrivilege);
-                               SysTryReturn(NID_APP, !IsFailed(r), null, E_SYSTEM, "pPrivilegeInfo->Construct() failed.");
+                                       r = pPrivilegeInfo->Construct(*pPrivilege);
+                                       SysTryReturn(NID_APP, !IsFailed(r), null, E_SYSTEM, "pPrivilegeInfo->Construct() failed.");
 
-                               r = pPrivilegeList->Add(*pPrivilegeInfo.release());
-                               SysTryReturn(NID_APP, !IsFailed(r), null, E_SYSTEM, "pPrivilegeList->Add() failed.");
-                       }
-                }
+                                       r = pPrivilegeList->Add(*pPrivilegeInfo.release());
+                                       SysTryReturn(NID_APP, !IsFailed(r), null, E_SYSTEM, "pPrivilegeList->Add() failed.");
+                               }
+                        }
+               }
        }
 
        if (pPrivilegeList->GetCount() <= 0)
index e729e03..0ccf832 100755 (executable)
@@ -968,6 +968,60 @@ _PackageManagerImpl::GetPackageAppInfoListN(const IMap& packageAppFilterMap) con
                        res = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_NODISPLAY, nodisplay);
                        SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_pkginfo_filter_add_bool(NODISPLAY, %d) is failed. [%d]", nodisplay, res);
                }
+#if 0
+               else if ((*pKey) == PACKAGE_APP_FILTER_LAUNCH_ONBOOT)
+               {
+                       definedKey = true;
+
+                       Boolean* pVal = static_cast< Boolean* >(pEnum->GetValue());
+                       SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed.");
+
+                       bool value = pVal->ToBool();
+                       SysLog(NID_APP, "Key[%ls], Value[%d]", pKey->GetPointer(), value);
+
+                       res = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_ONBOOT, value);
+                       SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_pkginfo_filter_add_bool(ONBOOT, %d) is failed. [%d]", value, res);
+               }
+               else if ((*pKey) == PACKAGE_APP_FILTER_AUTO_RESTART)
+               {
+                       definedKey = true;
+
+                       Boolean* pVal = static_cast< Boolean* >(pEnum->GetValue());
+                       SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed.");
+
+                       bool value = pVal->ToBool();
+                       SysLog(NID_APP, "Key[%ls], Value[%d]", pKey->GetPointer(), value);
+
+                       res = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_AUTORESTART, value);
+                       SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_pkginfo_filter_add_bool(AUTORESTART, %d) is failed. [%d]", value, res);
+               }
+#endif
+               else if ((*pKey) == PACKAGE_APP_FILTER_LAUNCHING_HISTORY_VISIBLE)
+               {
+                       definedKey = true;
+
+                       Boolean* pVal = static_cast< Boolean* >(pEnum->GetValue());
+                       SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed.");
+
+                       bool value = pVal->ToBool();
+                       SysLog(NID_APP, "Key[%ls], Value[%d]", pKey->GetPointer(), value);
+
+                       res = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, value);
+                       SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_pkginfo_filter_add_bool(TASKMANAGE, %d) is failed. [%d]", value, res);
+               }
+               else if ((*pKey) == PACKAGE_APP_FILTER_LAUNCH_CONDITION)
+               {
+                       definedKey = true;
+
+                       Boolean* pVal = static_cast< Boolean* >(pEnum->GetValue());
+                       SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed.");
+
+                       bool value = pVal->ToBool();
+                       SysLog(NID_APP, "Key[%ls], Value[%d]", pKey->GetPointer(), value);
+
+                       res = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION, value);
+                       SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_pkginfo_filter_add_bool(LAUNCHCONDITION, %d) is failed. [%d]", value, res);
+               }
                else if ((*pKey) == PACKAGE_APP_FILTER_CATEGORY_HOMEAPP || (*pKey) == PACKAGE_APP_FILTER_CATEGORY_LOCKAPP
                                                || (*pKey) == PACKAGE_APP_FILTER_CATEGORY_MENUAPP)
                {