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<char[]> 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<char[]> 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
{
std::unique_ptr<char[]> 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);
+ }
}
}