- for (application_x* app : GListRange<application_x*>(manifest->application)) {
- // 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)) {
- 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*>(
- calloc(1, sizeof(__metadata_t)));
- if (!md) {
- LOG(ERROR) << "Out of memory";
- g_list_free_full(md_list, &ClearMetadataDetail);
- return false;
- }
- md->key = strdup(meta->key);
- if (!md->key) {
- LOG(ERROR) << "Out of memory";
- free(md);
- g_list_free_full(md_list, &ClearMetadataDetail);
- return false;
- }
- md->value = strdup(meta->value);
- if (!md->value) {
- LOG(ERROR) << "Out of memory";
- ClearMetadataDetail(md);
- g_list_free_full(md_list, &ClearMetadataDetail);
- return false;
- }
- md_list = g_list_append(md_list, md);
- }
+ bool result;
+ GList* md_list = GetMetadataListForKey(manifest->metadata,
+ plugin_info_.name());
+ if (md_list) {
+ name = GetFunctionName(action_type);
+ if (!AddPluginInfo(manifest, nullptr)) {
+ g_list_free_full(md_list, &ClearMetadataDetail);
+ return false;