diff options
author | KVGrygoriev <KVGrygoriev@luxoft.com> | 2018-08-20 18:51:32 +0300 |
---|---|---|
committer | KVGrygoriev <KVGrygoriev@luxoft.com> | 2018-08-20 18:51:32 +0300 |
commit | 5b9537386a73b5f56c0818cee1726bde99e5d986 (patch) | |
tree | 0cac1268b63c543c9cc849c45c21f7e91d695f92 | |
parent | 2e20fe9a9cda25a54be7847b38e7b1998fe4ef72 (diff) | |
download | sdl_core-fix/wrong_order_of_requests_on_device_disconnect.tar.gz |
Fix SendUpdateAppList and SendOnAppUnreg orderfix/wrong_order_of_requests_on_device_disconnect
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 386bfe4825..1d157bca10 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1949,7 +1949,7 @@ bool ApplicationManagerImpl::Stop() { application_list_update_timer_.Stop(); try { SetUnregisterAllApplicationsReason( - mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF); + mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF); UnregisterAllApplications(); } catch (...) { LOG4CXX_ERROR(logger_, @@ -2633,12 +2633,17 @@ void ApplicationManagerImpl::UnregisterApplication( logger_, "There is no more SDL4 apps with device handle: " << handle); RemoveAppsWaitingForRegistration(handle); + } + + commands_holder_->Clear(app_to_remove); + MessageHelper::SendOnAppUnregNotificationToHMI( + app_to_remove, is_unexpected_disconnect, *this); + + if (!app) { SendUpdateAppList(); } } - commands_holder_->Clear(app_to_remove); - if (EndAudioPassThru(app_id)) { // May be better to put this code in MessageHelper? StopAudioPassThru(app_id); @@ -2649,11 +2654,10 @@ void ApplicationManagerImpl::UnregisterApplication( plugin.OnApplicationEvent(plugin_manager::kApplicationUnregistered, app_to_remove); }; - plugin_manager_->ForEachPlugin(on_app_unregistered); - MessageHelper::SendOnAppUnregNotificationToHMI( - app_to_remove, is_unexpected_disconnect, *this); + plugin_manager_->ForEachPlugin(on_app_unregistered); request_ctrl_.terminateAppRequests(app_id); + return; } |