AppInfo::Builder& AppInfo::Builder::SetArgs(
const tizen_base::Bundle& args) {
+ static const std::vector<std::string> 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;
}
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)
}
int BootSequenceManager::Reload(uid_t uid) const {
- std::unique_lock<std::mutex> lock(mutex_);
return AppRequest(BOOT_SEQUENCE_RELOAD, uid).SendSimply();
}
int BootSequenceManager::StartApp(const std::string& appid) const {
- std::unique_lock<std::mutex> lock(mutex_);
return AppRequest(BOOT_SEQUENCE_START_APP, getuid())
.SetAppId(appid)
.SendSimply();
}
std::vector<AppInfoPtr> BootSequenceManager::GetAppInfoList(uid_t uid) const {
- std::unique_lock<std::mutex> lock(mutex_);
int fd = AppRequest(BOOT_SEQUENCE_GET_APPINFO_LIST, uid)
.SendSimply(AUL_SOCK_ASYNC);
#include <bundle_cpp.h>
#include <memory>
-#include <mutex>
#include <string>
#include <vector>
static void InsertAppInfoCb(app_pkt_t* pkt, void* data);
AppInfoPtr CreateAppInfoFromBundle(tizen_base::Bundle b);
- mutable std::mutex mutex_;
};
} // namespace boot_sequence