-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/wrong order of requests on device disconnect #2517
Fix/wrong order of requests on device disconnect #2517
Conversation
@@ -1440,6 +1440,14 @@ class ApplicationManagerImpl | |||
static std::vector<std::string> ConvertRejectedParamList( | |||
const std::vector<std::string>& input); | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KVGrygoriev missed arg names in description
@param app_to_remove the application which should be removed
@param is_unexpected_disconnect specifies whether the disconnect was unexpected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EKuliiev thanks, fixed
3753dbf
to
0899fa0
Compare
@@ -2623,12 +2630,15 @@ void ApplicationManagerImpl::UnregisterApplication( | |||
logger_, "There is no more SDL4 apps with device handle: " << handle); | |||
|
|||
RemoveAppsWaitingForRegistration(handle); | |||
ClearCommandListAndSendOnAppUnregNotificationToHMI( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KVGrygoriev I really dont like functions with more than one responsibility.
I suggest you to update this code like:
if (!app) {
LOG4CXX_DEBUG(
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();
}
Or even like this if SendUpdateAppList
call order is not necessary for this case:
if (!app) {
LOG4CXX_DEBUG(
logger_, "There is no more SDL4 apps with device handle: " << handle);
RemoveAppsWaitingForRegistration(handle);
SendUpdateAppList();
}
commands_holder_->Clear(app_to_remove);
MessageHelper::SendOnAppUnregNotificationToHMI(app_to_remove, is_unexpected_disconnect, *this);
14f3b8c
to
34440c0
Compare
@AKalinich-Luxoft fixed |
34440c0
to
b5dccbb
Compare
b5dccbb
to
5b95373
Compare
@@ -1949,7 +1949,7 @@ bool ApplicationManagerImpl::Stop() { | |||
application_list_update_timer_.Stop(); | |||
try { | |||
SetUnregisterAllApplicationsReason( | |||
mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF); | |||
mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KVGrygoriev make this change as additional commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LuxoftAKutsan this changes will disappear when someone fix it in develop branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KVGrygoriev commit will still contain this changes and cherry pick may trigger conflicts
…_requests_on_device_disconnect
Fixes #2238
This PR is ready for review.
Risk
This PR makes no API changes.
Summary
Moves clearing command list and SendOnAppUnreg notification call into separate logic unit.
Fixes SDL behaviour when device is suddenly disconnected.
CLA