Skip to content

Commit

Permalink
Check waypoint subscription size in resumption (#3684)
Browse files Browse the repository at this point in the history
* Check waypoint subscription size in resumption

* Update modifiers
  • Loading branch information
Jack-Byrne authored Apr 9, 2021
1 parent c163c2d commit 5f9cbdf
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,20 @@ void SDLRPCPlugin::RevertResumption(application_manager::Application& app) {
pending_resumption_handler_->OnResumptionRevert();

if (application_manager_->IsAppSubscribedForWayPoints(app)) {
application_manager_->UnsubscribeAppFromWayPoints(app.app_id());
if (!application_manager_->IsAnyAppSubscribedForWayPoints()) {
const auto subscribed_apps =
application_manager_->GetAppsSubscribedForWayPoints();
const bool send_unsubscribe =
subscribed_apps.size() <= 1 &&
application_manager_->IsSubscribedToHMIWayPoints();
if (send_unsubscribe) {
SDL_LOG_DEBUG("Send UnsubscribeWayPoints");
auto request =
application_manager::MessageHelper::CreateUnsubscribeWayPointsRequest(
application_manager_->GetNextHMICorrelationID());
application_manager_->GetRPCService().ManageHMICommand(request);
}
application_manager_->UnsubscribeAppFromWayPoints(app.app_id(),
send_unsubscribe);
}
}

Expand Down

0 comments on commit 5f9cbdf

Please sign in to comment.