Skip to content
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

[SDL-0190] Handle response from HMI during resumption data #3475

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b43e92a
Add changes to RAI request
ychernysheva Aug 14, 2020
3ea77e8
Add new class ResumptionDataProcessor
ychernysheva Aug 14, 2020
3f86f12
Add new class SDLAppExtension
ychernysheva Aug 14, 2020
fa6605e
Add new class ExtensionPendingResumptionHandler
ychernysheva Aug 14, 2020
1739dca
Add new class SDLPendingResumptionHandler
ychernysheva Aug 14, 2020
eb91325
New class VehicleInfoPendingResumptionHandler
ychernysheva Aug 14, 2020
976aa03
Add changes related to ApplicationManager class
ychernysheva Aug 14, 2020
f259f86
Add changes related to MessageHelper class
ychernysheva Aug 14, 2020
da854cf
Add changes related to StateController class
ychernysheva Aug 14, 2020
7b92692
Add changes related to ResumeController class
ychernysheva Aug 14, 2020
7edcf47
Add changes related to PolicyHandler class
ychernysheva Aug 14, 2020
0637a6f
Add changes related to SDLRPCPlugin
ychernysheva Aug 14, 2020
022e50d
Add changes related to VehicleInfoPlugin
ychernysheva Aug 14, 2020
5e210b5
Add changes related to AppServiceAppExtension and SystemCapabilitiesA…
ychernysheva Aug 14, 2020
e9096e5
Add changes related to ResetGlobalProperties request
ychernysheva Aug 14, 2020
149b36e
Add changes related to VehicleInfoAppExtension
ychernysheva Aug 14, 2020
ae12891
Add changes related to AppExtension and RCAppExtension
ychernysheva Aug 14, 2020
d80637c
Change OnTimeOut() method in affected requests
ychernysheva Aug 14, 2020
4ccecdf
Add changes related to method IsAppSubscribedForWayPoints
ychernysheva Aug 14, 2020
bb7f379
Fix problem with multiple definitions during building of unit tests
ychernysheva Aug 14, 2020
ed2ad53
Add changes related to ApplicationHelper class
ychernysheva Aug 14, 2020
3d81e0d
Add changes related to EventDispatcher
ychernysheva Aug 14, 2020
7a433a3
Add changes related to OnSystemCapabilitiesUpdated notification
ychernysheva Aug 14, 2020
746f855
Fix/fix rai default timeout (#108)
AKalinich-Luxoft Aug 14, 2020
c9418c8
Do not unsubscribe from pending VD
AKalinich-Luxoft Aug 17, 2020
60e3e2c
Fill subscription data for all pending requests
AKalinich-Luxoft Aug 17, 2020
eb41075
fixup! Add new class ResumptionDataProcessor
ychernysheva Aug 19, 2020
25b2f22
fixup! Add new class SDLPendingResumptionHandler
ychernysheva Aug 19, 2020
c74eaf2
fixup! Add new class ExtensionPendingResumptionHandler
ychernysheva Aug 19, 2020
db0698f
fixup! New class VehicleInfoPendingResumptionHandler
ychernysheva Aug 19, 2020
de87e33
fixup! Add changes to RAI request
AKalinich-Luxoft Aug 28, 2020
8fa02f0
fixup! Add new class ResumptionDataProcessor
AKalinich-Luxoft Aug 28, 2020
018a2c2
fixup! Add new class SDLAppExtension
AKalinich-Luxoft Aug 28, 2020
4949821
fixup! Add new class SDLPendingResumptionHandler
AKalinich-Luxoft Aug 28, 2020
11b1c53
fixup! New class VehicleInfoPendingResumptionHandler
AKalinich-Luxoft Aug 28, 2020
f55b03c
fixup! Add changes related to ApplicationManager class
AKalinich-Luxoft Aug 28, 2020
0149f2f
fixup! Add changes related to MessageHelper class
AKalinich-Luxoft Aug 28, 2020
b35c374
fixup! Add changes related to ResumeController class
AKalinich-Luxoft Aug 28, 2020
ffe9539
fixup! Add changes related to SDLRPCPlugin
AKalinich-Luxoft Aug 28, 2020
dfa6b02
fixup! Add changes related to AppExtension and RCAppExtension
AKalinich-Luxoft Aug 28, 2020
d32be37
fixup! Add changes related to AppServiceAppExtension and SystemCapabi…
AKalinich-Luxoft Aug 28, 2020
6027ae4
fixup! Add changes related to OnSystemCapabilitiesUpdated notification
AKalinich-Luxoft Aug 28, 2020
f0c8233
fixup! Add changes related to ResumeController class
AKalinich-Luxoft Aug 29, 2020
c4fcad4
fixup! Change OnTimeOut() method in affected requests
AKalinich-Luxoft Aug 29, 2020
bdfe4d5
fixup! fixup! Add new class SDLAppExtension
AKalinich-Luxoft Aug 30, 2020
a4215f5
Merge remote-tracking branch 'origin/develop' into feature/sdl_0190_r…
AKalinich-Luxoft Sep 2, 2020
f35e573
Filter RC subscriptions in vehicle data plugin
LuxoftAKutsan Aug 20, 2020
47832c9
Timeout process for reset global properties
LuxoftAKutsan Aug 20, 2020
e601b42
Use ResumptionDataProcessor interface instead of subscriber function
LuxoftAKutsan Sep 3, 2020
28da143
Rename ExtensionPendingResumptionHandler
AKalinich-Luxoft Sep 3, 2020
7fa98ac
Rename SDLAppExtension
AKalinich-Luxoft Sep 3, 2020
4bb87a5
Revert "Filter RC subscriptions in vehicle data plugin"
AKalinich-Luxoft Sep 3, 2020
96d0396
Rename resumption_data_processor.cc
AKalinich-Luxoft Sep 3, 2020
8913095
Rename SDLPendingResumptionHandler
AKalinich-Luxoft Sep 3, 2020
dcf3dc5
fixup! fixup! Add changes related to OnSystemCapabilitiesUpdated noti…
AKalinich-Luxoft Sep 3, 2020
8db46ca
fixup! fixup! Add changes related to AppServiceAppExtension and Syste…
AKalinich-Luxoft Sep 3, 2020
1bda351
fixup! Use ResumptionDataProcessor interface instead of subscriber fu…
AKalinich-Luxoft Sep 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_

#include <functional>
#include <memory>

namespace ns_smart_device_link {
namespace ns_smart_objects {
class SmartObject;
}
} // namespace ns_smart_device_link
#include "smart_objects/smart_object.h"

namespace resumption {
struct ResumptionRequest;
class ResumptionDataProcessor;
} // namespace resumption

namespace application_manager {
namespace ns_smart = ns_smart_device_link::ns_smart_objects;

typedef int AppExtensionUID;

Expand All @@ -59,16 +62,22 @@ class AppExtension {
* @param resumption_data data reference to data, that will be appended by
* plugin
*/
virtual void SaveResumptionData(
ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) = 0;
virtual void SaveResumptionData(ns_smart::SmartObject& resumption_data) = 0;

/**
* @brief ProcessResumption Method called by SDL during resumption.
* @param resumption_data list of resumption data
* @param subscriber callbacks for subscribing
*/
virtual void ProcessResumption(
const ns_smart_device_link::ns_smart_objects::SmartObject&
resumption_data) = 0;
const ns_smart::SmartObject& resumption_data) = 0;

/**
* @brief RevertResumption Method called by SDL during revert resumption.
* @param subscriptions Subscriptions from which must discard. Expected that
* SO contains the map of "IVI data" keys and "subscription bool flag" values
*/
virtual void RevertResumption(const ns_smart::SmartObject& subscriptions) = 0;

private:
const AppExtensionUID kUid_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,14 @@ class DynamicApplicationDataImpl : public virtual Application {
SubMenuMap sub_menu_;
mutable std::shared_ptr<sync_primitives::RecursiveLock> sub_menu_lock_ptr_;
ChoiceSetMap choice_set_map_;
mutable std::shared_ptr<sync_primitives::Lock> choice_set_map_lock_ptr_;
mutable std::shared_ptr<sync_primitives::RecursiveLock>
choice_set_map_lock_ptr_;
PerformChoiceSetMap performinteraction_choice_set_map_;
mutable std::shared_ptr<sync_primitives::RecursiveLock>
performinteraction_choice_set_lock_ptr_;
WindowParamsMap window_params_map_;
mutable std::shared_ptr<sync_primitives::Lock> window_params_map_lock_ptr_;
mutable std::shared_ptr<sync_primitives::RecursiveLock>
window_params_map_lock_ptr_;
uint32_t is_perform_interaction_active_;
bool is_reset_global_properties_active_;
int32_t perform_interaction_mode_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ class ApplicationManagerImpl

/**
* @brief Checks if Application is subscribed for way points
* @param Application pointer
* @param Application reference
* @return true if Application is subscribed for way points
* otherwise false
*/
bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const OVERRIDE;
bool IsAppSubscribedForWayPoints(Application& app) const OVERRIDE;

void SaveWayPointsMessage(
smart_objects::SmartObjectSPtr way_points_message) OVERRIDE;
Expand Down Expand Up @@ -983,6 +983,13 @@ class ApplicationManagerImpl
*/
void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE;

ResetGlobalPropertiesResult ResetGlobalProperties(
AKalinich-Luxoft marked this conversation as resolved.
Show resolved Hide resolved
const smart_objects::SmartObject& global_properties_ids,
const uint32_t app_id) OVERRIDE;

ResetGlobalPropertiesResult ResetAllApplicationGlobalProperties(
AKalinich-Luxoft marked this conversation as resolved.
Show resolved Hide resolved
const uint32_t app_id) OVERRIDE;

// TODO(AOleynik): Temporary added, to fix build. Should be reworked.
connection_handler::ConnectionHandler& connection_handler() const OVERRIDE;
protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE;
Expand Down Expand Up @@ -1341,6 +1348,39 @@ class ApplicationManagerImpl
*/
void SendMobileMessage(smart_objects::SmartObjectSPtr message);

/**
* @brief Sets default value of the HELPPROMT global property
* to the first vrCommand of the Command Menu registered in application
*
* @param app Registered application
* @param is_timeout_promp Flag indicating that timeout prompt
* should be reset
*
* @return TRUE on success, otherwise FALSE
*/
bool ResetHelpPromt(ApplicationSharedPtr app) const;

/**
* @brief Sets default value of the TIMEOUTPROMT global property
* to the first vrCommand of the Command Menu registered in application
*
* @param app Registered application
*
* @return TRUE on success, otherwise FALSE
*/
bool ResetTimeoutPromt(ApplicationSharedPtr app) const;

/**
* @brief Sets default value of the VRHELPTITLE global property
* to the application name and value of the VRHELPITEMS global property
* to value equal to registered command -1(default command “Help / Cancel”.)
*
* @param app Registered application
*
* @return TRUE on success, otherwise FALSE
*/
bool ResetVrHelpTitleItems(ApplicationSharedPtr app) const;

private:
/*
* NaviServiceStatusMap shows which navi service (audio/video) is opened
Expand All @@ -1364,6 +1404,16 @@ class ApplicationManagerImpl
std::string GetHashedAppID(uint32_t connection_key,
const std::string& policy_app_id) const;

/**
* @brief CreateAllAppGlobalPropsIDList creates an array of all application
* global properties IDs. Used as utility to call
* ApplicationManger::ResetGlobalProperties
* with all global properties.
* @return array smart object with global properties identifiers.
*/
const smart_objects::SmartObjectSPtr CreateAllAppGlobalPropsIDList(
const uint32_t app_id) const;

/**
* @brief Removes suspended and stopped timers from timer pool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ class DisplayCapabilitiesBuilder {
void UpdateDisplayCapabilities(
const smart_objects::SmartObject& display_capabilities);

/**
* @brief IsWaitingForWindowCapabilities checks wheter builder is waiting for
* a capabilities notification for at least one window or not
* @param incoming_display_capabilities capabilities to analyze
* @return true if builder is waiting for capabilities for at least one
* window, otherwise returns false
*/
bool IsWaitingForWindowCapabilities(
const smart_objects::SmartObject& incoming_display_capabilities) const;

/**
* @brief ResetDisplayCapabilities resets stored notification
*/
Expand All @@ -84,13 +94,29 @@ class DisplayCapabilitiesBuilder {
*/
const smart_objects::SmartObjectSPtr display_capabilities() const;

/**
* @brief IsWindowResumptionNeeded checks that is there a need for
* resumption of windows (except main window)
* @return true if data about windows to be resumed was saved in window_info,
* otherwise returns false
*/

bool IsWindowResumptionNeeded() const;

private:
/**
* @brief InvokeResumeCallback invokes resume callback function if all
* required criteria is met
*/
void InvokeResumeCallback();

smart_objects::SmartObjectSPtr display_capabilities_;
typedef std::set<WindowID> WindowIDsToResume;
WindowIDsToResume window_ids_to_resume_;
Application& owner_;
ResumeCallback resume_callback_;
sync_primitives::Lock display_capabilities_lock_;
mutable sync_primitives::Lock display_capabilities_lock_;
bool is_widget_windows_resumption_;
};
} // namespace application_manager
#endif
Loading