diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2018-08-22 13:07:09 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2018-08-22 13:07:09 -0400 |
commit | 6ada4dc5bd0d9a2b6068745154e715fccd5dc943 (patch) | |
tree | 2890f67599792367ca6315867b66be682795dea7 /src/components/application_manager/include/application_manager | |
parent | a086a8e23ed7c86f27460ddc61046ca595ab46a9 (diff) | |
parent | 6a436addb2811c3fbc6ff155a8a142aa14c8ec45 (diff) | |
download | sdl_core-6ada4dc5bd0d9a2b6068745154e715fccd5dc943.tar.gz |
Merge remote-tracking branch 'origin/develop' into feature/boost_datetime_implementation
Diffstat (limited to 'src/components/application_manager/include/application_manager')
18 files changed, 183 insertions, 237 deletions
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 844b08071b..c3a4ecbb30 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -51,6 +51,7 @@ #include "protocol_handler/protocol_handler.h" #include "smart_objects/smart_object.h" #include "utils/macro.h" +#include "utils/semantic_version.h" namespace application_manager { @@ -115,6 +116,7 @@ class InitialApplicationData { virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0; virtual const mobile_api::Language::eType& language() const = 0; virtual const mobile_api::Language::eType& ui_language() const = 0; + virtual const utils::SemanticVersion& msg_version() const = 0; virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0; virtual void set_vr_synonyms( const smart_objects::SmartObject& vr_synonyms) = 0; @@ -125,6 +127,7 @@ class InitialApplicationData { virtual void set_language(const mobile_api::Language::eType& language) = 0; virtual void set_ui_language( const mobile_api::Language::eType& ui_language) = 0; + virtual void set_msg_version(const utils::SemanticVersion& version) = 0; }; /* @@ -594,8 +597,6 @@ class Application : public virtual InitialApplicationData, virtual void increment_list_files_in_none_count() = 0; virtual bool set_app_icon_path(const std::string& file_name) = 0; virtual void set_app_allowed(const bool allowed) = 0; - DEPRECATED virtual void set_device( - connection_handler::DeviceHandle device) = 0; /** * @brief Sets the handle of the device on which secondary transport of this * app is running @@ -735,6 +736,12 @@ class Application : public virtual InitialApplicationData, virtual const HmiStatePtr RegularHmiState() const = 0; /** + * @brief Checks if app is allowed to change audio source + * @return True - if allowed, otherwise - False + */ + virtual bool IsAllowedToChangeAudioSource() const = 0; + + /** * @brief PostponedHmiState returns postponed hmi state of application * if it's present * @@ -782,16 +789,6 @@ class Application : public virtual InitialApplicationData, virtual bool IsVideoApplication() const = 0; /** - * DEPRECATED - * @brief GetDeviceId allows to obtain device id which posseses - * by this application. - * @return device the device id. - */ - std::string GetDeviceId() const { - return device_id_; - } - - /** * @brief IsRegistered allows to distinguish if this * application has been registered. * diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h index 3f60040db9..05091dbfbd 100644 --- a/src/components/application_manager/include/application_manager/application_data_impl.h +++ b/src/components/application_manager/include/application_manager/application_data_impl.h @@ -35,6 +35,7 @@ #include <string> #include "utils/lock.h" +#include "utils/semantic_version.h" #include "smart_objects/smart_object.h" #include "application_manager/application.h" #include "interfaces/MOBILE_API.h" @@ -55,6 +56,7 @@ class InitialApplicationDataImpl : public virtual Application { const smart_objects::SmartObject* ngn_media_screen_name() const; const mobile_api::Language::eType& language() const; const mobile_api::Language::eType& ui_language() const; + const utils::SemanticVersion& msg_version() const; void set_app_types(const smart_objects::SmartObject& app_types); void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms); @@ -63,6 +65,7 @@ class InitialApplicationDataImpl : public virtual Application { void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name); void set_language(const mobile_api::Language::eType& language); void set_ui_language(const mobile_api::Language::eType& ui_language); + void set_msg_version(const utils::SemanticVersion& version); void set_perform_interaction_layout( mobile_api::LayoutMode::eType layout) OVERRIDE; @@ -77,6 +80,7 @@ class InitialApplicationDataImpl : public virtual Application { mobile_api::Language::eType language_; mobile_api::Language::eType ui_language_; mobile_apis::LayoutMode::eType perform_interaction_layout_; + utils::SemanticVersion msg_version_; private: DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl); diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 6035a6e80b..f937ebebe1 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -94,14 +94,6 @@ class ApplicationImpl : public virtual Application, std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager, ApplicationManager& application_manager); - DEPRECATED ApplicationImpl( - uint32_t application_id, - const std::string& policy_app_id, - const std::string& mac_address, - const custom_str::CustomString& app_name, - std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager, - ApplicationManager& application_manager); - ~ApplicationImpl(); /** @@ -353,6 +345,12 @@ class ApplicationImpl : public virtual Application, virtual const HmiStatePtr CurrentHmiState() const; /** + * @brief Checks if app is allowed to change audio source + * @return True - if allowed, otherwise - False + */ + virtual bool IsAllowedToChangeAudioSource() const; + + /** * @brief RegularHmiState of application without active events VR, TTS etc ... * @return HmiState of application */ diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 4eb0d7826d..9dd5bea3a1 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -181,6 +181,10 @@ class ApplicationManagerImpl void set_application_id(const int32_t correlation_id, const uint32_t app_id) OVERRIDE; + uint32_t get_current_audio_source() const OVERRIDE; + + void set_current_audio_source(const uint32_t source) OVERRIDE; + void OnHMILevelChanged(uint32_t app_id, mobile_apis::HMILevel::eType from, mobile_apis::HMILevel::eType to) OVERRIDE; @@ -224,29 +228,6 @@ class ApplicationManagerImpl bool IsAppTypeExistsInFullOrLimited(ApplicationConstSharedPtr app) const; /** - * DEPRECATED - * @brief Checks if Application is subscribed for way points - * @param Application AppID - * @return true if Application is subscribed for way points - * otherwise false - */ - bool IsAppSubscribedForWayPoints(const uint32_t app_id) const OVERRIDE; - - /** - * DEPRECATED - * @brief Subscribe Application for way points - * @param Application AppID - */ - void SubscribeAppForWayPoints(const uint32_t app_id) OVERRIDE; - - /** - * DEPRECATED - * @brief Unsubscribe Application for way points - * @param Application AppID - */ - void UnsubscribeAppFromWayPoints(const uint32_t app_id) OVERRIDE; - - /** * @brief Checks if Application is subscribed for way points * @param Application pointer * @return true if Application is subscribed for way points @@ -365,10 +346,6 @@ class ApplicationManagerImpl * @brief Closes all registered applications */ void UnregisterAllApplications(); - - DEPRECATED bool RemoveAppDataFromHMI(ApplicationSharedPtr app); - - DEPRECATED bool LoadAppDataToHMI(ApplicationSharedPtr app); bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE; /** @@ -390,13 +367,6 @@ class ApplicationManagerImpl */ uint32_t GetNextHMICorrelationID() OVERRIDE; - /* @brief Starts audio passthru process - * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead - * - * @return true on success, false if passthru is already in process - */ - bool BeginAudioPassThrough() OVERRIDE; - /** * @brief Starts AudioPassThru process by given application * @param app_id ID of the application which starts the process @@ -404,14 +374,6 @@ class ApplicationManagerImpl */ bool BeginAudioPassThru(uint32_t app_id) OVERRIDE; - /* - * @brief Finishes already started audio passthru process - * @deprecated Use EndAudioPassThru(uint32_t app_id) instead - * - * @return true on success, false if passthru is not active - */ - bool EndAudioPassThrough() OVERRIDE; - /** * @brief Finishes already started AudioPassThru process by given application * @param app_id ID of the application which started the process @@ -437,22 +399,6 @@ class ApplicationManagerImpl const hmi_apis::Common_DriverDistractionState::eType state) OVERRIDE; /* - * DEPRECATED - * @brief Retrieves if VR session has started - * - * @return Current VR session state (started, stopped) - */ - inline bool vr_session_started() const; - - /* - * DEPRECATED - * @brief Sets VR session state - * - * @param state Current HMI VR session state - */ - void set_vr_session_started(const bool state); - - /* * @brief Retrieves SDL access to all mobile apps * * @return Currently active state of the access @@ -482,21 +428,6 @@ class ApplicationManagerImpl mobile_apis::SystemContext::eType system_context) const OVERRIDE; /** - * DEPRECATED - * @brief CreateRegularState create regular HMI state for application - * @param app_id Application id - * @param hmi_level of returned state - * @param audio_state of returned state - * @param system_context of returned state - * @return new regular HMI state - */ - DEPRECATED HmiStatePtr CreateRegularState( - uint32_t app_id, - mobile_apis::HMILevel::eType hmi_level, - mobile_apis::AudioStreamingState::eType audio_state, - mobile_apis::SystemContext::eType system_context) const OVERRIDE; - - /** * @brief Checks, if given RPC is allowed at current HMI level for specific * application in policy table * @param app Application @@ -660,10 +591,6 @@ class ApplicationManagerImpl */ void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL; - DEPRECATED bool OnServiceStartedCallback( - const connection_handler::DeviceHandle& device_handle, - const int32_t& session_key, - const protocol_handler::ServiceType& type) OVERRIDE; void OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, @@ -861,20 +788,6 @@ class ApplicationManagerImpl */ uint32_t GenerateNewHMIAppID() OVERRIDE; - /** - * DERPECATED - * @brief Parse smartObject and replace mobile app Id by HMI app ID - * @param message Smartobject to be parsed - */ - void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message); - - /** - * DEPRECATED - * @brief Parse smartObject and replace HMI app ID by mobile app Id - * @param message Smartobject to be parsed - */ - void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message); - /* * @brief Save binary data to specified directory * @@ -926,22 +839,6 @@ class ApplicationManagerImpl */ void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE; - /** - * DEPRECATED - * @brief method adds application in FULL and LIMITED state - * to on_phone_call_app_list_. - * Also OnHMIStateNotification with BACKGROUND state sent for these apps - */ - void CreatePhoneCallAppList(); - - /** - * DEPRECATED - * @brief method removes application from on_phone_call_app_list_. - * - * Also OnHMIStateNotification with previous HMI state sent for these apps - */ - void ResetPhoneCallAppList(); - // TODO(AOleynik): Temporary added, to fix build. Should be reworked. connection_handler::ConnectionHandler& connection_handler() const OVERRIDE; protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE; @@ -1234,10 +1131,10 @@ class ApplicationManagerImpl */ void SendOnSDLClose(); - /* + /** * @brief returns true if low voltage state is active */ - bool IsLowVoltage(); + bool IsLowVoltage() const OVERRIDE; /** * @brief Allows to process postponed commands for application @@ -1311,15 +1208,6 @@ class ApplicationManagerImpl * @brief Starts specified navi service for application * @param app_id Application to proceed * @param service_type Type of service to start - * @return True on success, false on fail - */ - DEPRECATED bool StartNaviService(uint32_t app_id, - protocol_handler::ServiceType service_type); - - /** - * @brief Starts specified navi service for application - * @param app_id Application to proceed - * @param service_type Type of service to start * @param params configuration parameters specified by mobile * @return True if service is immediately started or configuration * parameters are sent to HMI, false on other cases @@ -1480,6 +1368,7 @@ class ApplicationManagerImpl bool is_vr_session_strated_; bool hmi_cooperating_; bool is_all_apps_allowed_; + uint32_t current_audio_source_; event_engine::EventDispatcherImpl event_dispatcher_; media_manager::MediaManager* media_manager_; @@ -1604,10 +1493,6 @@ class ApplicationManagerImpl DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl); }; -DEPRECATED bool ApplicationManagerImpl::vr_session_started() const { - return is_vr_session_strated_; -} - inline bool ApplicationManagerImpl::all_apps_allowed() const { return is_all_apps_allowed_; } diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h index b8267ed438..f494fd64f8 100644 --- a/src/components/application_manager/include/application_manager/command_factory.h +++ b/src/components/application_manager/include/application_manager/command_factory.h @@ -40,7 +40,6 @@ #include "utils/macro.h" namespace application_manager { -using rpc_service::RPCService; using policy::PolicyHandlerInterface; typedef std::shared_ptr<commands::Command> CommandSharedPtr; @@ -105,7 +104,7 @@ class DefaultCommandCreator : public CommandCreator { * @param policy_handler PolicyHandlerInterface. */ DefaultCommandCreator(ApplicationManager& application_manager, - RPCService& rpc_service, + rpc_service::RPCService& rpc_service, HMICapabilities& hmi_capabilities, PolicyHandlerInterface& policy_handler) : application_manager_(application_manager) @@ -137,7 +136,7 @@ class DefaultCommandCreator : public CommandCreator { } ApplicationManager& application_manager_; - RPCService& rpc_service_; + rpc_service::RPCService& rpc_service_; HMICapabilities& hmi_capabilities_; PolicyHandlerInterface& policy_handler_; }; @@ -158,7 +157,7 @@ class DefaultCommandCreator<InvalidCommand> : public CommandCreator { * @param policy_handler PolicyHandlerInterface. */ DefaultCommandCreator(ApplicationManager& application_manager, - RPCService& rpc_service, + rpc_service::RPCService& rpc_service, HMICapabilities& hmi_capabilities, PolicyHandlerInterface& policy_handler) { UNUSED(application_manager); @@ -203,7 +202,7 @@ struct CommandCreatorFactory { return res; } ApplicationManager& application_manager_; - RPCService& rpc_service_; + rpc_service::RPCService& rpc_service_; HMICapabilities& hmi_capabilities_; PolicyHandlerInterface& policy_handler_; }; diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h index be79d9e8d1..4859f73a55 100644 --- a/src/components/application_manager/include/application_manager/commands/command_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_impl.h @@ -152,26 +152,12 @@ class CommandImpl : public Command { bool ReplaceMobileWithHMIAppId(smart_objects::SmartObject& message); /** - * DEPRECATED - * @brief Parses mobile message and replaces mobile app id with HMI app id - * @param message Message to replace its ids - */ - void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message); - - /** * @brief Parses message from HMI and replaces HMI app id with mobile app id * @param message Message to replace its ids * @return True if replacement succeeded, otherwise - false */ bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message); - /** - * DEPRECATED - * @brief Parses message from HMI and replaces HMI app id with mobile app id - * @param message Message to replace its ids - */ - void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message); - MessageSharedPtr message_; uint32_t default_timeout_; bool allowed_to_terminate_; diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index e790fc9af6..6fdeaea332 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -43,8 +43,6 @@ namespace application_manager { namespace commands { struct ResponseInfo { - DEPRECATED ResponseInfo(hmi_apis::Common_Result::eType result, - HmiInterfaces::InterfaceID interface); ResponseInfo(); ResponseInfo(const hmi_apis::Common_Result::eType result, const HmiInterfaces::InterfaceID hmi_interface, diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h index e333cb9bbc..4b7779e08c 100644 --- a/src/components/application_manager/include/application_manager/hmi_state.h +++ b/src/components/application_manager/include/application_manager/hmi_state.h @@ -94,25 +94,6 @@ class HmiState { const ApplicationManager& app_mngr, StateID state_id); - /** - * DEPRECATED - * @brief HmiState constructor - * @param app_id Application id - * @param app_mngr Application manager - */ - HmiState(uint32_t app_id, const ApplicationManager& app_mngr); - - /** - * DEPRECATED - * @brief HmiState constructor - * @param app_id Application id - * @param app_mngr Application manager - * @param state_id HMI state to assign - */ - HmiState(uint32_t app_id, - const ApplicationManager& app_mngr, - StateID state_id); - virtual ~HmiState() {} /** @@ -274,8 +255,6 @@ class VRHmiState : public HmiState { const OVERRIDE; VRHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - - DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr); }; /** @@ -286,8 +265,6 @@ class TTSHmiState : public HmiState { TTSHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr); - virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE; }; @@ -327,9 +304,6 @@ class PhoneCallHmiState : public HmiState { PhoneCallHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED PhoneCallHmiState(uint32_t app_id, - const ApplicationManager& app_mngr); - mobile_apis::HMILevel::eType hmi_level() const OVERRIDE; mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE { @@ -346,9 +320,6 @@ class SafetyModeHmiState : public HmiState { SafetyModeHmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED SafetyModeHmiState(uint32_t app_id, - const ApplicationManager& app_mngr); - mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE { return mobile_apis::AudioStreamingState::NOT_AUDIBLE; @@ -368,8 +339,6 @@ class DeactivateHMI : public HmiState { DeactivateHMI(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr); - mobile_apis::HMILevel::eType hmi_level() const OVERRIDE; mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE { @@ -390,8 +359,6 @@ class AudioSource : public HmiState { AudioSource(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED AudioSource(uint32_t app_id, const ApplicationManager& app_mngr); - mobile_apis::HMILevel::eType hmi_level() const OVERRIDE; mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE { @@ -413,8 +380,6 @@ class EmbeddedNavi : public HmiState { EmbeddedNavi(std::shared_ptr<Application> app, const ApplicationManager& app_mngr); - DEPRECATED EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr); - mobile_apis::HMILevel::eType hmi_level() const OVERRIDE; mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE { diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 7c3f0a13c9..1c319cf204 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -88,7 +88,6 @@ class Message { void set_correlation_id(int32_t id); void set_connection_key(int32_t key); void set_message_type(MessageType type); - DEPRECATED void set_binary_data(BinaryData* data); void set_binary_data(const BinaryData* data); void set_json_message(const std::string& json_message); void set_protocol_version(protocol_handler::MajorProtocolVersion version); diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 127ff967b4..73f49e3477 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -50,6 +50,7 @@ #include "application_manager/policies/policy_handler_interface.h" #include "smart_objects/smart_object.h" #include "transport_manager/common.h" +#include <application_manager/smart_object_keys.h> namespace policy { class PolicyHandlerInterface; @@ -634,6 +635,21 @@ class MessageHelper { ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + /** + * @brief Stores whether each choice in a set has the vrCommands parameter + * MIXED means some choices have vrCommands and others don't + * ALL means all do, NONE means none do + */ + enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE }; + + /** + * @brief Check whether each choice in the set has the vrCommands parameter + * @param choice set to check + * @return a ChoiceSetVRCommandsStatus with the state of the choice set + */ + static ChoiceSetVRCommandsStatus CheckChoiceSetVRCommands( + const smart_objects::SmartObject& choice_set); + /* * @brief Finds "Image" structure in request and verify image file presence * in Core. diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h index 90c6c5c208..f9a60c862b 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_ #include <stdint.h> - +#include <time.h> #include "application_manager/resumption/resumption_data.h" namespace application_manager { @@ -125,6 +125,16 @@ class ResumeCtrl { virtual void OnAwake() = 0; /** + * @brief Saves Low Voltage signal timestamp + */ + virtual void SaveLowVoltageTime() = 0; + + /** + * @brief Saves Wake Up signal timestamp + */ + virtual void SaveWakeUpTime() = 0; + + /** * @brief Checks if SDL has already received OnExitAllApplication notification * with "SUSPEND" reason * @@ -134,13 +144,19 @@ class ResumeCtrl { virtual bool is_suspended() const = 0; /** - * @brief Method stops timer "RsmCtrlPercist" when SDL + * @brief Method stops timer "RsmCtrlPersist" when SDL * receives OnExitAllApplication notification * with reason "SUSPEND" */ virtual void StopSavePersistentDataTimer() = 0; /** + * @brief Method starts timer "RsmCtrlPersist" when + * SDL receives onAwakeSDL notification + */ + virtual void StartSavePersistentDataTimer() = 0; + + /** * @brief Start timer for resumption applications * Restore D1-D5 data * @param application that is need to be restored diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h index 17aabb6d60..e749118140 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h @@ -33,6 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_ +#include "application_manager/resumption/resume_ctrl.h" + #include <stdint.h> #include <vector> #include <map> @@ -46,7 +48,6 @@ #include "smart_objects/smart_object.h" #include "application_manager/application.h" #include "application_manager/resumption/resumption_data.h" -#include "application_manager/resumption/resume_ctrl.h" #include "utils/timer.h" namespace resumption { @@ -138,6 +139,10 @@ class ResumeCtrlImpl : public ResumeCtrl, */ void OnAwake() OVERRIDE; + void SaveLowVoltageTime() OVERRIDE; + + void SaveWakeUpTime() OVERRIDE; + /** * @brief Checks if SDL has already received OnExitAllApplication notification * with "SUSPEND" reason @@ -155,6 +160,13 @@ class ResumeCtrlImpl : public ResumeCtrl, void StopSavePersistentDataTimer() OVERRIDE; /** + * @brief Check if all IGNITION OFF and IGNITION ON records + * saved in resumption data base + * @return True if all records saved, otherwise False + */ + bool CheckIgnCyclesData() const; + + /** * @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend() */ void StopRestoreHmiLevelTimer(); @@ -300,7 +312,7 @@ class ResumeCtrlImpl : public ResumeCtrl, * @brief Method starts timer "RsmCtrlPercist" when * SDL receives onAwakeSDL notification */ - void StartSavePersistentDataTimer(); + void StartSavePersistentDataTimer() OVERRIDE; #ifdef BUILD_TESTS void set_resumption_storage( @@ -310,6 +322,20 @@ class ResumeCtrlImpl : public ResumeCtrl, #endif // BUILD_TESTS private: /** + * @brief Returns Low Voltage signal timestamp + * @return Low Voltage event timestamp if event LOW VOLTAGE event occures + * otherwise 0 + */ + time_t LowVoltageTime() const; + + /** + * @brief Returns Wake Up signal timestamp + * @return Wake Up timestamp if Wake Up signal occures + * otherwise 0 + */ + time_t WakeUpTime() const; + + /** * @brief restores saved data of application * @param application contains application for which restores data * @return true if success, otherwise return false @@ -390,11 +416,27 @@ class ResumeCtrlImpl : public ResumeCtrl, void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application, const smart_objects::SmartObject& saved_app); + /** + * @brief Checks if saved HMI level is allowed for resumption + * by Ignition Cycle restrictions + * @param saved_app application specific section from backup file + * @return True if allowed , otherwise - False + */ bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app); - bool DisconnectedJustBeforeIgnOff( - const smart_objects::SmartObject& saved_app); + /** + * @brief Checks if saved HMI level is allowed for resumption + * by Low Voltage restrictions + * @param saved_app application specific section from backup file + * @return True if allowed , otherwise - False + */ + bool CheckLowVoltageRestrictions(const smart_objects::SmartObject& saved_app); + /** + * @brief Checks if saved HMI level is applicable for resumption + * @param saved_app application specific section from backup file + * @return True fs allowed , otherwise - False + */ bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application, const smart_objects::SmartObject& saved_app); @@ -409,10 +451,38 @@ class ResumeCtrlImpl : public ResumeCtrl, /** * @brief CheckDelayAfterIgnOn should check if SDL was started less - * then N seconds ago. N will be readed from profile. + * than N seconds ago. N will be read from profile. * @return true if SDL started N seconds ago, otherwise return false */ - bool CheckDelayAfterIgnOn(); + bool CheckDelayAfterIgnOn() const; + + /** + * @brief CheckDelayBeforeIgnOff checks if app was unregistered less + * than N seconds before Ignition OFF. N will be read from profile. + * @return true if app was disconnected within timeframe of N seconds before + * Ignition Off, + * otherwise return false + */ + bool CheckDelayBeforeIgnOff( + const smart_objects::SmartObject& saved_app) const; + + /** + * @brief CheckDelayAfterWakeUp should check if app was registered + * during the first N seconds after WakeUp signal. N will be read from + * profile. + * @return true if app registered within N seconds after WakeUp, otherwise + * return false + */ + bool CheckDelayAfterWakeUp() const; + + /** + * @brief CheckDelayBeforeLowVoltage checks if app was unregistered within + * N seconds before Low Voltage signal. N will be read from profile. + * @return true if app was disconnected within timeframe of N seconds before + * Low Voltage , otherwise return false + */ + bool CheckDelayBeforeLowVoltage( + const smart_objects::SmartObject& saved_app) const; typedef std::pair<uint32_t, uint32_t> application_timestamp; @@ -447,7 +517,7 @@ class ResumeCtrlImpl : public ResumeCtrl, * @brief Get the last ignition off time from LastState * @return the last ignition off time from LastState */ - time_t GetIgnOffTime(); + time_t GetIgnOffTime() const; /** * @brief Setup IgnOff time to LastState @@ -535,6 +605,8 @@ class ResumeCtrlImpl : public ResumeCtrl, bool is_data_saved_; bool is_suspended_; time_t launch_time_; + time_t low_voltage_time_; + time_t wake_up_time_; std::shared_ptr<ResumptionData> resumption_storage_; application_manager::ApplicationManager& application_manager_; }; diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h index 5ecfaf3c11..c2634173a5 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h @@ -95,20 +95,26 @@ class ResumptionData { virtual void IncrementIgnOffCount() = 0; /** - * @brief Increments ignition counter for all registered applications - * and remember ign_off time stamp + * @brief Decrements ignition counter for all registered applications */ - DEPRECATED virtual void OnSuspend() = 0; + virtual void DecrementIgnOffCount() = 0; /** - * @brief Decrements ignition counter for all registered applications + * @brief Increments global ignition on counter + * by 1 */ - virtual void DecrementIgnOffCount() = 0; + virtual void IncrementGlobalIgnOnCounter() = 0; /** - * @brief Decrements ignition counter for all registered applications + * @brief Get the global ignition on counter + * @return the global ignition on counter + */ + virtual uint32_t GetGlobalIgnOnCounter() const = 0; + + /** + * @brief Resets global ignition on counter */ - DEPRECATED virtual void OnAwake() = 0; + virtual void ResetGlobalIgnOnCount() = 0; /** * @brief Retrieves hash ID for the given mobile app ID diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h index 780aac82c1..2b5a1fdcc9 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h @@ -110,16 +110,11 @@ class ResumptionDataDB : public ResumptionData { virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id, const std::string& device_id) const; - /** - * @brief Increments ignition counter for all registered applications - * and remember ign_off time stamp - */ - DEPRECATED void OnSuspend() FINAL; + void IncrementGlobalIgnOnCounter() OVERRIDE; - /** - * @brief Decrements ignition counter for all registered applications - */ - DEPRECATED void OnAwake() FINAL; + uint32_t GetGlobalIgnOnCounter() const OVERRIDE; + + void ResetGlobalIgnOnCount() OVERRIDE; /** * @brief Increments ignition counter for all registered applications diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h index 82ec1d9e5c..e2418fd033 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h @@ -80,18 +80,6 @@ class ResumptionDataJson : public ResumptionData { */ virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id, const std::string& device_id) const; - - /** - * @brief Increments ignition counter for all registered applications - * and remember ign_off time stamp - */ - DEPRECATED void OnSuspend() FINAL; - - /** - * @brief Decrements ignition counter for all registered applications - */ - DEPRECATED void OnAwake() FINAL; - /** * @brief Increments ignition counter for all registered applications * and remember ign_off time stamp @@ -145,6 +133,12 @@ class ResumptionDataJson : public ResumptionData { */ virtual uint32_t GetIgnOffTime() const; + void IncrementGlobalIgnOnCounter() OVERRIDE; + + uint32_t GetGlobalIgnOnCounter() const OVERRIDE; + + void ResetGlobalIgnOnCount() OVERRIDE; + /** * @brief Checks if saved data have application * @param policy_app_id - mobile application id diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h index 33d62740f7..eee7650697 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h @@ -57,7 +57,10 @@ extern const std::string kUpdateIgnOffCount; extern const std::string kCountApplicationsIgnOff; extern const std::string kSelectApplicationsIgnOffCount; extern const std::string kUpdateSuspendData; -extern const std::string KUpdateLastIgnOffTime; +extern const std::string kUpdateLastIgnOffTime; +extern const std::string kUpdateGlobalIgnOnCount; +extern const std::string kResetGlobalIgnOnCount; +extern const std::string kSelectGlobalIgnOnCounter; extern const std::string kDeleteFile; extern const std::string kDeleteApplicationFilesArray; extern const std::string kDeleteSubMenu; diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h index 44954d41f7..8f1d454c3b 100644 --- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h @@ -57,6 +57,7 @@ #include "interfaces/v4_protocol_v1_2_no_extra_schema.h" #include "utils/threads/message_loop_thread.h" +#include "utils/semantic_version.h" namespace application_manager { namespace rpc_handler { @@ -142,6 +143,16 @@ class RPCHandlerImpl : public RPCHandler, void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE; #endif // TELEMETRY_MONITOR + /** + * @brief Extracts and validates the syncMsgVersion included in + * a RegisterAppInterfaceRequest + * + * @param output - SmartObject Message received from mobile + * @param messageVersion - message version to be updated + */ + void GetMessageVersion(NsSmartDeviceLink::NsSmartObjects::SmartObject& output, + utils::SemanticVersion& message_version); + private: void ProcessMessageFromMobile(const std::shared_ptr<Message> message); void ProcessMessageFromHMI(const std::shared_ptr<Message> message); diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index d0a3c1ed96..4646ef5e8f 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -313,6 +313,8 @@ extern const char* resume_vr_grammars; extern const char* ign_off_count; +extern const char* global_ign_on_counter; + extern const char* connection_info; extern const char* is_download_complete; |