Fix does not send UnsubscribeVehicleData request to HMI after last unregister app.#2
Fix does not send UnsubscribeVehicleData request to HMI after last unregister app.#2IGapchuk wants to merge 3 commits intobranch_4.2.1from
Conversation
last unregister app.
There was a problem hiding this comment.
@IGapchuk i think there should be a return statement here, otherwise command->Init() or command->Run() below may result in a crash
| #include <utility> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <utility> |
There was a problem hiding this comment.
@IGapchuk any reasons to pass shared pointer by reference? Also please take a look at typedef ApplicationConstSharedPtr
| static smart_objects::SmartObjectList CreateAddCommandRequestToHMI( | ||
| ApplicationConstSharedPtr app, ApplicationManager& app_mngr); | ||
|
|
||
| static smart_objects::SmartObjectSPtr CreateMessageForHMI( |
There was a problem hiding this comment.
@IGapchuk please provide description for this function
There was a problem hiding this comment.
@IGapchuk any reasons to pass shared pointer by reference?
There was a problem hiding this comment.
@IGapchuk why just don't use ManageHMICommand(message_to_hmi) call?
|
|
||
| void VIUnsubscribeVehicleDataRequest::Run() { | ||
| LOG4CXX_AUTO_TRACE(logger_); | ||
|
|
There was a problem hiding this comment.
@IGapchuk suggest to use more descriptive names like message_so and message_ref
| commands::Command::CommandOrigin origin, | ||
| ApplicationManager& application_manager) { | ||
| CommandSharedPtr command; | ||
|
|
| hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered; | ||
|
|
||
| message[strings::params][strings::message_type] = MessageType::kNotification; | ||
| // we put hmi_app_id because applicaton list does not contain application on |
| static smart_objects::SmartObjectList CreateAddCommandRequestToHMI( | ||
| ApplicationConstSharedPtr app, ApplicationManager& app_mngr); | ||
|
|
||
| static smart_objects::SmartObjectSPtr CreateMessageForHMI( |
There was a problem hiding this comment.
@IGapchuk i think some sort of a short description is lacking here
There was a problem hiding this comment.
@IGapchuk minor thing, but i suppose it's better to make this variable const, since we do not modify it anywhere below
11b0429 to
5e67cdc
Compare
|
@IGapchuk Check destination branch and repo |
|
@IGapchuk Your branches names are invalid |
|
@IGapchuk Update PR description with detailed info where is the problem and why do you think your fix solves it. |
|
@IGapchuk Any updates? |
Fixes 2282
This PR is ready for review.
Risk
This PR makes no API changes.
Summary
When last application unregistered, SDL was not sending to HMI UnsubscribeVehicleData request.
This PR provides fix for that defect: when application unregister , SDL checks for exists other registered applications. If they exist, SDL compares their subscriptions for VehicleDataInfo with subscription of unregister application.
If unregister application only itself subscribe to some VehicleDataInfo, that VehicleDataInfo type will be added for unsubscribing.
If unregister application subscribed for some VehicleDataInfo and some register application subscribed for same VehicleDataInfo, that VehicleDataInfo will not added to unsubscribe.
When checking will be finished and all VehicleDataInfo for unregistering have collected, SDL sends to HMI UnsubscribeVehicleData request.
CLA