diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index 937d9d8a52..14eed6b137 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -1373,8 +1373,8 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() { application_manager_.GetCorrectMobileIDFromMessage(message_); LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id); - - auto app = application_manager_.application(device_id_, policy_app_id); + auto app = + application_manager_.reregister_application_by_policy_id(policy_app_id); if (!app) { LOG4CXX_DEBUG( @@ -1385,11 +1385,12 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() { LOG4CXX_DEBUG(logger_, "Application with policy id " << policy_app_id << " is found."); - if (!application_manager_.IsAppInReconnectMode(device_handle_, - policy_app_id)) { - LOG4CXX_DEBUG( - logger_, - "Policy id " << policy_app_id << " is not found in reconnection list."); + + const auto app_device_handle = app->device(); + if (app_device_handle == device_handle_) { + LOG4CXX_DEBUG(logger_, + "Application " << policy_app_id + << " is already registered from this device."); SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY); return true; } |