Skip to content

Commit

Permalink
Fix SendUpdateAppList and SendOnAppUnreg order
Browse files Browse the repository at this point in the history
  • Loading branch information
KVGrygoriev committed Aug 20, 2018
1 parent 0899fa0 commit 14f3b8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1440,14 +1440,6 @@ class ApplicationManagerImpl
static std::vector<std::string> ConvertRejectedParamList(
const std::vector<std::string>& input);

/**
* @brief Clears command list and send notification to HMI
* @param app_to_remove the application which should be removed
* @param is_unexpected_disconnect flag is that disconnect was unexpected
*/
void ClearCommandListAndSendOnAppUnregNotificationToHMI(
ApplicationSharedPtr& app_to_remove, bool is_unexpected_disconnect);

private:
const ApplicationManagerSettings& settings_;
/**
Expand Down
19 changes: 7 additions & 12 deletions src/components/application_manager/src/application_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2521,13 +2521,6 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
apps_to_register_list_lock_ptr_->Release();
}

void ApplicationManagerImpl::ClearCommandListAndSendOnAppUnregNotificationToHMI(
ApplicationSharedPtr& app_to_remove, bool is_unexpected_disconnect) {
commands_holder_->Clear(app_to_remove);
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);
}

void ApplicationManagerImpl::UnregisterApplication(
const uint32_t& app_id,
mobile_apis::Result::eType reason,
Expand Down Expand Up @@ -2630,12 +2623,14 @@ void ApplicationManagerImpl::UnregisterApplication(
logger_, "There is no more SDL4 apps with device handle: " << handle);

RemoveAppsWaitingForRegistration(handle);
ClearCommandListAndSendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect);
}

commands_holder_->Clear(app_to_remove);
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);

if (!app) {
SendUpdateAppList();
} else {
ClearCommandListAndSendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect);
}
}

Expand Down

0 comments on commit 14f3b8c

Please sign in to comment.