diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/register_app_interface_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/register_app_interface_request.cc | 25 |
1 files changed, 17 insertions, 8 deletions
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 526ce6e672..412827f7c8 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 @@ -542,16 +542,25 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { *(application.get()), resumption, need_restore_vr); SendResponse(true, result_code, add_info.c_str(), &response_params); - if (result_code != mobile_apis::Result::RESUME_FAILED) { - resumer.StartResumption(application, hash_id); + // Check if application exists, because application might be unregestered + // during sending reponse to mobile. + application = application_manager_.application(key); + if (application) { + LOG4CXX_DEBUG(logger_, "Application with app_id = " << key << " exists."); + if (result_code != mobile_apis::Result::RESUME_FAILED) { + resumer.StartResumption(application, hash_id); + } else { + resumer.StartResumptionOnlyHMILevel(application); + } + + // By default app subscribed to CUSTOM_BUTTON + SendSubscribeCustomButtonNotification(); + MessageHelper::SendChangeRegistrationRequestToHMI(application, + application_manager_); } else { - resumer.StartResumptionOnlyHMILevel(application); + LOG4CXX_DEBUG(logger_, + "Application with app_id = " << key << " doesn't exist."); } - - // By default app subscribed to CUSTOM_BUTTON - SendSubscribeCustomButtonNotification(); - MessageHelper::SendChangeRegistrationRequestToHMI(application, - application_manager_); } void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( |