summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/register_app_interface_response.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
index fe6f3a925..b31879585 100644
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
@@ -42,7 +42,7 @@ namespace application_manager {
namespace commands {
void RegisterAppInterfaceResponse::Run() {
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
bool success = (*message_)[strings::msg_params][strings::success].asBool();
@@ -60,25 +60,24 @@ void RegisterAppInterfaceResponse::Run() {
// Add registered application to the policy db right after response sent to
// mobile to be able to check all other API according to app permissions
- uint32_t connection_key =
- (*message_)[strings::params][strings::connection_key].asUInt();
application_manager::ApplicationConstSharedPtr app =
application_manager::ApplicationManagerImpl::instance()->
- application(connection_key);
+ application(connection_key());
if (app.valid()) {
policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
- std::string mobile_app_id = app->mobile_app_id()->asString();
+ std::string mobile_app_id = app->mobile_app_id();
policy_handler->AddApplication(mobile_app_id);
- SetHeartBeatTimeout(connection_key, mobile_app_id);
+ SetHeartBeatTimeout(connection_key(), mobile_app_id);
}
}
void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
uint32_t connection_key, const std::string& mobile_app_id) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
if (policy_handler->PolicyEnabled()) {
- const int32_t timeout = policy_handler->HeartBeatTimeout(mobile_app_id);
+ const int32_t timeout = policy_handler->HeartBeatTimeout(mobile_app_id) /
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
if (timeout > 0) {
application_manager::ApplicationManagerImpl::instance()->
connection_handler()->SetHeartBeatTimeout(connection_key, timeout);
@@ -86,7 +85,6 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
} else {
LOG4CXX_INFO(logger_, "Policy is turn off");
}
- LOG4CXX_TRACE_EXIT(logger_);
}
} // namespace commands