diff options
Diffstat (limited to 'src/components/application_manager/src/helpers/application_helper.cc')
-rw-r--r-- | src/components/application_manager/src/helpers/application_helper.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc index 488ee4aca0..c9a0d87aed 100644 --- a/src/components/application_manager/src/helpers/application_helper.cc +++ b/src/components/application_manager/src/helpers/application_helper.cc @@ -9,12 +9,16 @@ namespace { using namespace application_manager; void DeleteWayPoints(ApplicationSharedPtr app, ApplicationManager& app_manager) { - app_manager.UnsubscribeAppFromWayPoints(app); - if (!app_manager.IsAnyAppSubscribedForWayPoints()) { + std::set<uint32_t> subscribed_apps = + app_manager.GetAppsSubscribedForWayPoints(); + bool send_unsubscribe = + subscribed_apps.size() <= 1 && app_manager.IsSubscribedToHMIWayPoints(); + if (send_unsubscribe) { auto request = MessageHelper::CreateUnsubscribeWayPointsRequest( app_manager.GetNextHMICorrelationID()); app_manager.GetRPCService().ManageHMICommand(request); } + app_manager.UnsubscribeAppFromWayPoints(app, send_unsubscribe); } void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) { |