return false;
std::string name = GetFunctionName(action_type);
for (application_x* app : GListRange<application_x*>(manifest->application)) {
- // pack all categories starting with key + '/' to list that will
+ // pack all categories starting with key to list that will
// be sent to the plugin.
// e.g. all http://tizen.org/category/antivirus/*
// will be packed for http://tizen.org/category/antivirus
GList* category_list = nullptr;
for (const char* category : GListRange<char*>(app->category)) {
- std::string sub_key_prefix = plugin_info_.name() + "/";
+ const std::string& sub_key_prefix = plugin_info_.name();
if (std::string(category).find(sub_key_prefix) == 0) {
__category_t* c = reinterpret_cast<__category_t*>(
calloc(1, sizeof(__category_t)));
category_list = g_list_append(category_list, c);
}
}
+
+ // skip application if it has no given category
+ if (!category_list)
+ continue;
+
int result = 0;
- Exec(name, &result, category_list, tag.c_str(),
- ActionTypeToPkgmgrActionType(action_type),
- manifest->package, app->appid);
+ Exec(name, &result, manifest->package, app->appid, category_list);
if (result) {
LOG(ERROR) << "Function: " << name << " of plugin "
<< plugin_info_.path() << " failed";
return false;
std::string name = GetFunctionName(action_type);
for (application_x* app : GListRange<application_x*>(manifest->application)) {
- // pack all metadata starting with key + '/' to list that will
+ // pack all metadata starting with key to list that will
// be sent to the plugin.
// e.g. all http://developer.samsung.com/tizen/metadata/profile/*
// will be packed for http://developer.samsung.com/tizen/metadata/profile
GList* md_list = nullptr;
for (metadata_x* meta : GListRange<metadata_x*>(app->metadata)) {
- std::string sub_key_prefix = plugin_info_.name() + "/";
+ const std::string& sub_key_prefix = plugin_info_.name();
if (meta->key && meta->value &&
std::string(meta->key).find(sub_key_prefix) == 0) {
__metadata_t* md = reinterpret_cast<__metadata_t*>(
md_list = g_list_append(md_list, md);
}
}
+
+ // skip application if it has no given metadata
+ if (!md_list)
+ continue;
+
int result = 0;
- Exec(name, &result, md_list, tag.c_str(),
- ActionTypeToPkgmgrActionType(action_type),
- manifest->package, app->appid);
+ Exec(name, &result, manifest->package, app->appid, md_list);
if (result) {
LOG(ERROR) << "Function: " << name << " of plugin "
<< plugin_info_.path() << " failed";