From: Hwankyu Jhun Date: Thu, 1 Feb 2024 04:53:30 +0000 (+0900) Subject: Remove alias appid feature X-Git-Tag: accepted/tizen/unified/20240202.170006~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a1bcab67b4bebe21de28a8398b8f0aa3f123082;p=platform%2Fcore%2Fappfw%2Faul-1.git Remove alias appid feature The alias.ini file and the related codes are removed. Currently, platform and products do not support it properly. Change-Id: Ie76c8aebedbc64ddd3f30355ba2cda4188670579 Signed-off-by: Hwankyu Jhun --- diff --git a/alias/alias.ini b/alias/alias.ini deleted file mode 100644 index 0a3a12c..0000000 --- a/alias/alias.ini +++ /dev/null @@ -1,11 +0,0 @@ -# Alias -[Alias] -tizen.imageviewer=org.tizen.image-viewer -tizen.internet=org.tizen.browser -tizen.phone=org.tizen.phone -tizen.filemanager=org.tizen.myfile -tizen.call=org.tizen.call-ui -tizen.smsmessages=org.tizen.message -tizen.mmsmessages=org.tizen.message -tizen.messages=org.tizen.message -tizen.camera=org.tizen.camera-app diff --git a/packaging/aul.spec b/packaging/aul.spec index 6606a72..6c82e5d 100644 --- a/packaging/aul.spec +++ b/packaging/aul.spec @@ -196,9 +196,6 @@ install -m 0644 .appsvc.db-journal %{buildroot}%{TZ_SYS_DB} install -m 0644 .component.db %{buildroot}%{TZ_SYS_DB} install -m 0644 .component.db-journal %{buildroot}%{TZ_SYS_DB} -mkdir -p %{buildroot}%{_datadir}/appsvc -cp -R %{_builddir}/%{name}-%{version}/alias/* %{buildroot}%{_datadir}/appsvc - mkdir -p %{buildroot}%{_sysconfdir}/gumd/useradd.d cp -f scripts/12_appsvc-add.post %{buildroot}%{_sysconfdir}/gumd/useradd.d/12_appsvc-add.post @@ -291,7 +288,6 @@ chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal %{_bindir}/aul_window %{_datadir}/aul/miregex/* %{_datadir}/aul/preexec_list.txt -%{_datadir}/appsvc/* %{_datadir}/parser-plugins/component.info %{_datadir}/parser-plugins/alias-appid.info %{_datadir}/parser-plugins/allowed-appid.info diff --git a/src/aul/aul_svc.cc b/src/aul/aul_svc.cc index 73ff1b8..76eb24d 100644 --- a/src/aul/aul_svc.cc +++ b/src/aul/aul_svc.cc @@ -94,54 +94,6 @@ class AliasInfo { std::string appid_; }; -class AppSvcAlias { - public: - AppSvcAlias() = default; - - void Load() { - std::lock_guard lock(mutex_); - if (loaded_) - return; - - dictionary* dict = iniparser_load("/usr/share/appsvc/alias.ini"); - if (dict == nullptr) { - loaded_ = true; - return; - } - - std::string delimiter = "Alias:"; - for (int i = 0; i < dict->n; ++i) { - if (dict->key[i] == nullptr || dict->val[i] == nullptr) - continue; - - std::string key = dict->key[i]; - key.erase(0, key.find(delimiter) + delimiter.length() + 1); - std::string value = dict->val[i]; - map_[key] = value; - } - - iniparser_freedict(dict); - loaded_ = true; - } - - std::string GetAliasAppId(const std::string& alias_appid) { - auto found = map_.find(alias_appid); - if (found == map_.end()) - return {}; - - SECURE_LOGD("alias_appid: %s, appid: %s", - alias_appid.c_str(), found->second.c_str()); - return found->second; - } - - private: - bool loaded_ = false; - std::unordered_map map_; - std::mutex mutex_; -}; - -AppSvcAlias appsvc_alias; - int SetBundle(bundle* b, const char* key, const char* value) { if (bundle_get_type(b, key) != BUNDLE_TYPE_NONE) { if (bundle_del(b, key) != BUNDLE_ERROR_NONE) @@ -176,11 +128,6 @@ int SetBundleArray(bundle* b, const char* key, const char** value, return AUL_SVC_RET_OK; } -std::string GetAliasAppId(const char* appid) { - appsvc_alias.Load(); - return appsvc_alias.GetAliasAppId(appid); -} - bool IsSpecialApp(const char* appid) { if (!strcmp(appid, APP_SELECTOR) || !strcmp(appid, SHARE_PANEL)) return true; @@ -498,12 +445,6 @@ extern "C" API int aul_svc_set_appid(bundle* b, const char* appid) { return AUL_SVC_RET_EINVAL; } - if (TIZEN_FEATURE_APPSVC_ALIAS) { - std::string alias_id = ::GetAliasAppId(appid); - if (!alias_id.empty()) - return ::SetBundle(b, AUL_SVC_K_PKG_NAME, alias_id.c_str()); - } - return ::SetBundle(b, AUL_SVC_K_PKG_NAME, appid); }