From 693f5aee2650ad453271bdcb68f067d39cedfb59 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Fri, 11 Feb 2022 11:22:52 +0900 Subject: [PATCH] Fix api for aulctl Changes: - Removes internal keys from args. - Removes mutex from boot_sequence api Change-Id: I1d8630a7125cd85797b5b0de0e9368e3459fa28d Signed-off-by: Changgyu Choi --- aul/boot_sequence/app_info.cc | 12 ++++++++++-- aul/boot_sequence/boot_sequence_manager.cc | 4 ---- aul/boot_sequence/boot_sequence_manager.hh | 2 -- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/aul/boot_sequence/app_info.cc b/aul/boot_sequence/app_info.cc index 93483f3..dc22cc8 100644 --- a/aul/boot_sequence/app_info.cc +++ b/aul/boot_sequence/app_info.cc @@ -78,12 +78,20 @@ AppInfo::Builder& AppInfo::Builder::SetConflicts( AppInfo::Builder& AppInfo::Builder::SetArgs( const tizen_base::Bundle& args) { + static const std::vector internal_keys{ + "__AUL_APPID__", + "__AUL_STARTTIME__", + "__K_BG_LAUNCH" + }; auto arg_json = args.GetString(AUL_K_ARGS); bundle* b = nullptr; - if (bundle_from_json(arg_json.c_str(), &b) != BUNDLE_ERROR_NONE) + if (bundle_from_json(arg_json.c_str(), &b) != BUNDLE_ERROR_NONE) { _E("bundle_from_json() is failed"); - else + } else { args_ = tizen_base::Bundle(b, false, true); + for (auto& key : internal_keys) + args_.Delete(key); + } return *this; } diff --git a/aul/boot_sequence/boot_sequence_manager.cc b/aul/boot_sequence/boot_sequence_manager.cc index c0ef3ba..dc8677f 100644 --- a/aul/boot_sequence/boot_sequence_manager.cc +++ b/aul/boot_sequence/boot_sequence_manager.cc @@ -29,7 +29,6 @@ namespace aul::internal { namespace boot_sequence { AppInfoPtr BootSequenceManager::CreateAppInfoFromBundle(tizen_base::Bundle b) { - /* TODO(changyu.choi): Implement decoding appinfo from bundle. */ auto builder = AppInfo::Builder() .SetAppId(b) .SetUid(b) @@ -81,19 +80,16 @@ BootSequenceManager& BootSequenceManager::GetInst() { } int BootSequenceManager::Reload(uid_t uid) const { - std::unique_lock lock(mutex_); return AppRequest(BOOT_SEQUENCE_RELOAD, uid).SendSimply(); } int BootSequenceManager::StartApp(const std::string& appid) const { - std::unique_lock lock(mutex_); return AppRequest(BOOT_SEQUENCE_START_APP, getuid()) .SetAppId(appid) .SendSimply(); } std::vector BootSequenceManager::GetAppInfoList(uid_t uid) const { - std::unique_lock lock(mutex_); int fd = AppRequest(BOOT_SEQUENCE_GET_APPINFO_LIST, uid) .SendSimply(AUL_SOCK_ASYNC); diff --git a/aul/boot_sequence/boot_sequence_manager.hh b/aul/boot_sequence/boot_sequence_manager.hh index 1085de9..b718371 100644 --- a/aul/boot_sequence/boot_sequence_manager.hh +++ b/aul/boot_sequence/boot_sequence_manager.hh @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -55,7 +54,6 @@ class BootSequenceManager { static void InsertAppInfoCb(app_pkt_t* pkt, void* data); AppInfoPtr CreateAppInfoFromBundle(tizen_base::Bundle b); - mutable std::mutex mutex_; }; } // namespace boot_sequence -- 2.7.4