This patch supports "|" delimiter to split the value string.
+----------------------------------------------------------+
| e.g. org.tizen.hello & org.tizen.tizen |
| <metadata key="http://tizen.org/metadata/allowedappid" |
| value="org.tizen.hello|org.tizen.tizen"/> |
+----------------------------------------------------------+
Change-Id: I9cfd2f7fcbc55d59650891e87d7206dc5f1193ef
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
+std::vector<std::string> PluginManager::Split(const std::string& str,
+ const std::string& delim) {
+ std::string string(str);
+ std::vector<std::string> result;
+ std::size_t pos;
+ while ((pos = string.find(delim)) != std::string::npos) {
+ std::string token = string.substr(0, pos);
+ result.push_back(token);
+ string.erase(0, pos + delim.length());
+ }
+ result.push_back(string);
+ return result;
+}
+
bool PluginManager::StepInstall(const std::unique_ptr<AppEventArgs>& args) {
auto* db = dynamic_cast<AppSvcDB*>(GetDB());
if (db == nullptr) {
bool PluginManager::StepInstall(const std::unique_ptr<AppEventArgs>& args) {
auto* db = dynamic_cast<AppSvcDB*>(GetDB());
if (db == nullptr) {
}
for (auto& metadata : args->GetMetadataList()) {
}
for (auto& metadata : args->GetMetadataList()) {
- try {
- db->Insert(args->GetAppId(), metadata->GetValue());
- } catch (Exception& e) {
- return false;
+ for (auto& app_id : Split(metadata->GetValue(), "|")) {
+ try {
+ db->Insert(args->GetAppId(), app_id);
+ } catch (Exception& e) {
+ return false;
+ }
#ifndef ALIAS_APPID_PLUGIN_MANAGER_HH_
#define ALIAS_APPID_PLUGIN_MANAGER_HH_
#ifndef ALIAS_APPID_PLUGIN_MANAGER_HH_
#define ALIAS_APPID_PLUGIN_MANAGER_HH_
#include "common/metadata_plugin.hh"
namespace plugin {
#include "common/metadata_plugin.hh"
namespace plugin {
bool StepUninstall(const std::unique_ptr<AppEventArgs>& args) override;
bool StepUpgrade(const std::unique_ptr<AppEventArgs>& args) override;
bool StepUninstall(const std::unique_ptr<AppEventArgs>& args) override;
bool StepUpgrade(const std::unique_ptr<AppEventArgs>& args) override;
+ private:
+ std::vector<std::string> Split(const std::string& str,
+ const std::string& delim);