summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src
diff options
context:
space:
mode:
authorAndrey Oleynik (GitHub) <aoleynik@luxoft.com>2017-12-06 10:20:51 +0200
committerAndriy Byzhynar <AByzhynar@luxoft.com>2018-01-18 12:03:51 +0200
commitc4e771fb7d402157c5cbb5159c41e0a4553b8492 (patch)
tree80590c89fd5edf14c425fc92976be92236cff6a0 /src/components/application_manager/src
parent2c207377259ad01c7f231533ba7189008d03a898 (diff)
downloadsdl_core-c4e771fb7d402157c5cbb5159c41e0a4553b8492.tar.gz
Fixes coding style
Diffstat (limited to 'src/components/application_manager/src')
-rw-r--r--src/components/application_manager/src/application_impl.cc2
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc34
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc47
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc45
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc2
5 files changed, 65 insertions, 65 deletions
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index fcdbc25a3e..eaf097d43f 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -79,7 +79,7 @@ namespace application_manager {
void SwitchApplicationParameters(ApplicationSharedPtr app,
const uint32_t app_id,
- const size_t device_id,
+ const size_t device_id,
const std::string& mac_address) {
utils::SharedPtr<ApplicationImpl> application =
ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app);
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index b6ffc80ed4..d42d6d91b2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -1079,19 +1079,19 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
{
auto apps_data_accessor = applications();
- std::copy_if(
- apps_data_accessor.GetData().begin(),
- apps_data_accessor.GetData().end(),
- std::back_inserter(reregister_wait_list_),
- std::bind1st(std::ptr_fun(&device_id_comparator),
- device_from.mac_address()));
+ std::copy_if(apps_data_accessor.GetData().begin(),
+ apps_data_accessor.GetData().end(),
+ std::back_inserter(reregister_wait_list_),
+ std::bind1st(std::ptr_fun(&device_id_comparator),
+ device_from.mac_address()));
}
{
// During sending of UpdateDeviceList this lock is acquired also so making
// it scoped
sync_primitives::AutoLock lock(reregister_wait_list_lock_);
- for (auto i = reregister_wait_list_.begin(); reregister_wait_list_.end() != i;
+ for (auto i = reregister_wait_list_.begin();
+ reregister_wait_list_.end() != i;
++i) {
auto app = *i;
request_ctrl_.terminateAppRequests(app->app_id());
@@ -1101,10 +1101,10 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
policy_handler_->OnDeviceSwitching(device_from.mac_address(),
device_to.mac_address());
-
+
connection_handler::DeviceMap device_list;
device_list.insert(std::make_pair(device_to.device_handle(), device_to));
-
+
smart_objects::SmartObjectSPtr msg_params =
MessageHelper::CreateDeviceListSO(device_list, GetPolicyHandler(), *this);
if (!msg_params) {
@@ -1136,7 +1136,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingFinish(
for (auto app_it = reregister_wait_list_.begin();
app_it != reregister_wait_list_.end();
++app_it) {
- auto app = *app_it;
+ auto app = *app_it;
UnregisterApplication(app->app_id(),
mobile_apis::Result::INVALID_ENUM,
is_resuming,
@@ -1147,9 +1147,9 @@ void ApplicationManagerImpl::OnDeviceSwitchingFinish(
void ApplicationManagerImpl::SwitchApplication(ApplicationSharedPtr app,
const uint32_t connection_key,
- const size_t device_id,
+ const size_t device_id,
const std::string& mac_address) {
- LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(applications_list_lock_);
DCHECK_OR_RETURN_VOID(1 == applications_.erase(app));
@@ -1862,9 +1862,8 @@ bool ApplicationManagerImpl::ManageMobileCommand(
auto app_ptr = application(connection_key);
if (app_ptr && IsAppInReconnectMode(app_ptr->policy_app_id())) {
- commands_holder_->Suspend(app_ptr,
- CommandHolder::CommandType::kMobileCommand,
- message);
+ commands_holder_->Suspend(
+ app_ptr, CommandHolder::CommandType::kMobileCommand, message);
return true;
}
@@ -2101,9 +2100,8 @@ bool ApplicationManagerImpl::ManageHMICommand(
auto app = application(static_cast<uint32_t>(connection_key));
if (app && IsAppInReconnectMode(app->policy_app_id())) {
- commands_holder_->Suspend(app,
- CommandHolder::CommandType::kHmiCommand,
- message);
+ commands_holder_->Suspend(
+ app, CommandHolder::CommandType::kHmiCommand, message);
return true;
}
}
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
index d5700f512e..82ba486913 100644
--- a/src/components/application_manager/src/command_holder_impl.cc
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -45,26 +45,28 @@ void CommandHolderImpl::Suspend(
CommandType type,
utils::SharedPtr<smart_objects::SmartObject> command) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Suspending command(s) for application: "
- << application->policy_app_id());
+ LOG4CXX_DEBUG(logger_,
+ "Suspending command(s) for application: "
+ << application->policy_app_id());
sync_primitives::AutoLock lock(commands_lock_);
if (CommandType::kHmiCommand == type) {
app_hmi_commands_[application].push_back(command);
- LOG4CXX_DEBUG(logger_, "Suspended HMI command(s): "
- << app_hmi_commands_.size());
+ LOG4CXX_DEBUG(logger_,
+ "Suspended HMI command(s): " << app_hmi_commands_.size());
} else {
app_mobile_commands_[application].push_back(command);
- LOG4CXX_DEBUG(logger_, "Suspended mobile command(s): "
- << app_hmi_commands_.size());
+ LOG4CXX_DEBUG(logger_,
+ "Suspended mobile command(s): " << app_hmi_commands_.size());
}
}
void CommandHolderImpl::Resume(ApplicationSharedPtr application,
CommandType type) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Resuming command(s) for application: "
- << application->policy_app_id());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Resuming command(s) for application: " << application->policy_app_id());
if (CommandType::kHmiCommand == type) {
ResumeHmiCommand(application);
} else {
@@ -74,20 +76,23 @@ void CommandHolderImpl::Resume(ApplicationSharedPtr application,
void CommandHolderImpl::Clear(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Clearing command(s) for application: "
- << application->policy_app_id());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing command(s) for application: " << application->policy_app_id());
sync_primitives::AutoLock lock(commands_lock_);
auto app_hmi_commands = app_hmi_commands_.find(application);
if (app_hmi_commands_.end() != app_hmi_commands) {
- LOG4CXX_DEBUG(logger_, "Clearing HMI command(s): "
- << app_hmi_commands->second.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing HMI command(s): " << app_hmi_commands->second.size());
app_hmi_commands_.erase(app_hmi_commands);
}
auto app_mobile_commands = app_mobile_commands_.find(application);
if (app_mobile_commands_.end() != app_mobile_commands) {
- LOG4CXX_DEBUG(logger_, "Clearing mobile command(s): "
- << app_mobile_commands->second.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing mobile command(s): " << app_mobile_commands->second.size());
app_mobile_commands_.erase(app_mobile_commands);
}
}
@@ -99,8 +104,8 @@ void CommandHolderImpl::ResumeHmiCommand(ApplicationSharedPtr application) {
return;
}
- LOG4CXX_DEBUG(logger_, "Resuming HMI command(s): "
- << app_hmi_commands_.size());
+ LOG4CXX_DEBUG(logger_,
+ "Resuming HMI command(s): " << app_hmi_commands_.size());
for (auto cmd : app_commands->second) {
(*cmd)[strings::msg_params][strings::app_id] = application->hmi_app_id();
@@ -117,15 +122,13 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
return;
}
- LOG4CXX_DEBUG(logger_, "Resuming mobile command(s): "
- << app_mobile_commands_.size());
+ LOG4CXX_DEBUG(logger_,
+ "Resuming mobile command(s): " << app_mobile_commands_.size());
for (auto cmd : app_commands->second) {
- (*cmd)[strings::params][strings::connection_key] =
- application->app_id();
+ (*cmd)[strings::params][strings::connection_key] = application->app_id();
app_manager_.ManageMobileCommand(
- cmd,
- commands::Command::CommandOrigin::ORIGIN_MOBILE);
+ cmd, commands::Command::CommandOrigin::ORIGIN_MOBILE);
}
app_mobile_commands_.erase(app_commands);
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
index fda4d09de2..cb6534dd2d 100644
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
@@ -641,26 +641,25 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
}
if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) {
- LOG4CXX_DEBUG(logger_,
- "Application has been switched from another transport, "
- "but doesn't have correct hashID.");
-
- application_manager::RecallApplicationData(application,
- application_manager_);
-
- SendResponse(true, mobile_apis::Result::RESUME_FAILED, NULL,
- &response_params);
- return;
- }
-
- if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
- LOG4CXX_DEBUG(logger_,
- "Application has been switched from another transport "
- "and has correct hashID.");
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL,
- &response_params);
- return;
- }
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport, "
+ "but doesn't have correct hashID.");
+
+ application_manager::RecallApplicationData(application,
+ application_manager_);
+
+ SendResponse(
+ true, mobile_apis::Result::RESUME_FAILED, NULL, &response_params);
+ return;
+ }
+
+ if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport "
+ "and has correct hashID.");
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ return;
+ }
bool resumption =
(*message_)[strings::msg_params].keyExists(strings::hash_id);
@@ -1469,10 +1468,10 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
auto app_type = ApplicationType::kSwitchedApplicationWrongHashId;
if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
- const auto hash_id =
+ const auto hash_id =
(*message_)[strings::msg_params][strings::hash_id].asString();
-
- auto& resume_ctrl = application_manager_.resume_controller();
+
+ auto& resume_ctrl = application_manager_.resume_controller();
if (resume_ctrl.CheckApplicationHash(app, hash_id)) {
app_type = ApplicationType::kSwitchedApplicationHashOk;
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index e5bf7a2a7c..41e7990e43 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -852,7 +852,7 @@ uint32_t PolicyHandler::ChooseRandomAppForPolicyUpdate(
return 0;
}
-void PolicyHandler::OnDeviceSwitching(const std::string& device_id_from,
+void PolicyHandler::OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();