From: Duyoung Jang Date: Thu, 11 Apr 2013 01:55:16 +0000 (+0900) Subject: Merge "Update PackageAppFilter API" into tizen_2.1 X-Git-Tag: accepted/tizen_2.1/20130425.034849~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48ac942873b3e63fd03835872aa2b20dfc38d9cb;hp=eb9210ac7866f18be41d9f8613b330451a10768f;p=platform%2Fframework%2Fnative%2Fappfw.git Merge "Update PackageAppFilter API" into tizen_2.1 --- diff --git a/src/app/inc/FAppPkg_PackageManagerImpl.h b/src/app/inc/FAppPkg_PackageManagerImpl.h index 317a7be..8764e03 100644 --- a/src/app/inc/FAppPkg_PackageManagerImpl.h +++ b/src/app/inc/FAppPkg_PackageManagerImpl.h @@ -67,7 +67,9 @@ static const wchar_t PACKAGE_FILTER_APP_SETTING[] = L"http://tizen.org/package/a // PackageAppFilter static const wchar_t PACKAGE_APP_FILTER_MENUICON_VISIBLE[] = L"http://tizen.org/package/app/menuiconvisible"; -static const wchar_t PACKAGE_APP_FILTER_CATEGORY[] = L"http://tizen.org/package/app/category"; +static const wchar_t PACKAGE_APP_FILTER_CATEGORY_HOMEAPP[] = L"http://tizen.org/category/homeapp"; +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"; enum PackageStorageType { diff --git a/src/app/package/FAppPkg_PackageManagerImpl.cpp b/src/app/package/FAppPkg_PackageManagerImpl.cpp index 156f074..0fd3e8d 100755 --- a/src/app/package/FAppPkg_PackageManagerImpl.cpp +++ b/src/app/package/FAppPkg_PackageManagerImpl.cpp @@ -953,20 +953,22 @@ _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); } - else if ((*pKey) == PACKAGE_APP_FILTER_CATEGORY) + else if ((*pKey) == PACKAGE_APP_FILTER_CATEGORY_HOMEAPP || (*pKey) == PACKAGE_APP_FILTER_CATEGORY_LOCKAPP + || (*pKey) == PACKAGE_APP_FILTER_CATEGORY_MENUAPP) { definedKey = true; - String* pVal = static_cast< String* >(pEnum->GetValue()); - SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed."); + std::unique_ptr pDefinedKey(_StringConverter::CopyToCharArrayN(*pKey)); + SysTryCatch(NID_APP, pDefinedKey, , E_OUT_OF_MEMORY, "pDefinedKey is null."); - SysLog(NID_APP, "Key[%ls], Value[%ls]", pKey->GetPointer(), pVal->GetPointer()); + Boolean* pVal = static_cast< Boolean* >(pEnum->GetValue()); + SysTryCatch(NID_APP, pVal, , E_INVALID_ARG, "GetValue() is failed."); - std::unique_ptr pValue(_StringConverter::CopyToCharArrayN(*pVal)); - SysTryCatch(NID_APP, pValue, , E_OUT_OF_MEMORY, "pValue is null."); + SysLog(NID_APP, "Key[%ls], Value[%d]", pKey->GetPointer(), pVal->ToBool()); + SysTryCatch(NID_APP, pVal->ToBool() == true, , E_INVALID_ARG, "Value(false) is not allowed."); - res = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_CATEGORY, pValue.get()); - SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_appinfo_filter_add_string(CATEGORY, %s) is failed. [%d]", pValue.get(), res); + res = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_CATEGORY, pDefinedKey.get()); + SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_appinfo_filter_add_string(CATEGORY, %s) is failed. [%d]", pDefinedKey.get(), res); } else { @@ -983,8 +985,16 @@ _PackageManagerImpl::GetPackageAppInfoListN(const IMap& packageAppFilterMap) con std::unique_ptr pValue(_StringConverter::CopyToCharArrayN(*pVal)); SysTryCatch(NID_APP, pValue, , E_OUT_OF_MEMORY, "pValue is null."); - res = pkgmgrinfo_appinfo_metadata_filter_add(metaHandle, pMetaKey.get(), pValue.get()); - SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_appinfo_metadata_filter_add(%s, %s) is failed. [%d]", pMetaKey.get(), pValue.get(), res); + if ((*pVal) == L"*") + { + res = pkgmgrinfo_appinfo_metadata_filter_add(metaHandle, pMetaKey.get(), null); + SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_appinfo_metadata_filter_add(%s, null) is failed. [%d]", pMetaKey.get(), res); + } + else + { + res = pkgmgrinfo_appinfo_metadata_filter_add(metaHandle, pMetaKey.get(), pValue.get()); + SysTryCatch(NID_APP, res == PMINFO_R_OK, , E_SYSTEM, "pkgmgrinfo_appinfo_metadata_filter_add(%s, %s) is failed. [%d]", pMetaKey.get(), pValue.get(), res); + } } }