bool enable = b->GetString(AUL_K_AUTO_RESTART) == "true";
auto& inst = amd::restart::RestartManager::GetInst();
int ret;
- bundle* extra_data = nullptr;
+ tizen_base::Bundle extra_data;
if (enable) {
std::shared_ptr<tizen_base::Bundle> extra;
auto extra_raw = b->GetString(AUL_K_RESTART_EXTRA);
extra = std::make_shared<tizen_base::Bundle>(extra_raw);
extra->Delete(AUL_K_APPID);
extra->Delete(AUL_K_PKG_NAME);
- extra_data = extra->GetHandle();
+ extra_data = *extra;
}
ret = inst.RegisterRestartApp(appid, std::move(extra)) ? 0 : -1;
req->SendResult(ret);
- _noti_send(AMD_NOTI_MSG_RESTART_MANAGER_SET_AUTO_RESTART,
- static_cast<int>(enable), 0, app_status.get(), extra_data);
+ if (ret == 0) {
+ _noti_send(AMD_NOTI_MSG_RESTART_MANAGER_SET_AUTO_RESTART,
+ static_cast<int>(enable), 0, app_status.get(), extra_data.GetHandle());
+ }
+
return ret;
}