summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/application_manager_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/include/application_manager/application_manager_impl.h')
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h146
1 files changed, 131 insertions, 15 deletions
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 a0b8d45de2..e91bdf5d59 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
@@ -53,6 +53,7 @@
#include "application_manager/application_manager_settings.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
#include "application_manager/hmi_interfaces_impl.h"
+#include "application_manager/command_holder.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
@@ -310,6 +311,7 @@ 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
@@ -318,18 +320,40 @@ class ApplicationManagerImpl
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
+ * otherwise false
+ */
+ bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const OVERRIDE;
+
+ /**
+ * @brief Subscribe Application for way points
+ * @param Application pointer
+ */
+ void SubscribeAppForWayPoints(ApplicationSharedPtr app) OVERRIDE;
+
+ /**
+ * @brief Unsubscribe Application for way points
+ * @param Application pointer
+ */
+ void UnsubscribeAppFromWayPoints(ApplicationSharedPtr app) OVERRIDE;
+
+ /**
* @brief Is Any Application is subscribed for way points
* @return true if some app is subscribed otherwise false
*/
@@ -353,6 +377,13 @@ class ApplicationManagerImpl
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
+ /**
+ * @brief OnApplicationSwitched starts processing of commands collected
+ * during device switching process
+ * @param app Application
+ */
+ void OnApplicationSwitched(ApplicationSharedPtr app) OVERRIDE;
+
HMICapabilities& hmi_capabilities() OVERRIDE;
const HMICapabilities& hmi_capabilities() const OVERRIDE;
@@ -422,8 +453,9 @@ class ApplicationManagerImpl
*/
void UnregisterAllApplications();
- bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
- bool LoadAppDataToHMI(ApplicationSharedPtr app);
+ DEPRECATED bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
+
+ DEPRECATED bool LoadAppDataToHMI(ApplicationSharedPtr app);
bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE;
/**
@@ -473,6 +505,7 @@ class ApplicationManagerImpl
void set_driver_distraction(const bool is_distracting) OVERRIDE;
/*
+ * DEPRECATED
* @brief Retrieves if VR session has started
*
* @return Current VR session state (started, stopped)
@@ -480,6 +513,7 @@ class ApplicationManagerImpl
inline bool vr_session_started() const;
/*
+ * DEPRECATED
* @brief Sets VR session state
*
* @param state Current HMI VR session state
@@ -502,13 +536,28 @@ class ApplicationManagerImpl
/**
* @brief CreateRegularState create regular HMI state for application
- * @param app_id
+ * @param app Application
* @param hmi_level of returned state
* @param audio_state of returned state
* @param system_context of returned state
* @return new regular HMI state
*/
HmiStatePtr CreateRegularState(
+ utils::SharedPtr<Application> app,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ 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,
@@ -837,6 +886,26 @@ class ApplicationManagerImpl
void OnFindNewApplicationsRequest() OVERRIDE;
void RemoveDevice(
const connection_handler::DeviceHandle& device_handle) OVERRIDE;
+
+ /**
+ * @brief OnDeviceSwitchingStart is invoked on device transport switching
+ * start (e.g. from Bluetooth to USB) and creates waiting list of applications
+ * expected to be re-registered after switching is complete
+ * @param device_from device params being switched to the new transport
+ * @param device_to device params on the new transport
+ */
+ void OnDeviceSwitchingStart(
+ const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) FINAL;
+
+ /**
+ * @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
+ * i.e. timeout for switching is expired, unregisters applications from
+ * waiting list which haven't been re-registered and clears the waiting list
+ * @param device_uid UID of device being switched
+ */
+ void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL;
+
DEPRECATED bool OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -989,15 +1058,15 @@ 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);
@@ -1054,6 +1123,7 @@ 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
@@ -1061,6 +1131,7 @@ class ApplicationManagerImpl
void CreatePhoneCallAppList();
/**
+ * DEPRECATED
* @brief method removes application from on_phone_call_app_list_.
*
* Also OnHMIStateNotification with previous HMI state sent for these apps
@@ -1167,15 +1238,6 @@ class ApplicationManagerImpl
}
};
- struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
- };
-
struct GrammarIdPredicate {
uint32_t grammar_id_;
GrammarIdPredicate(uint32_t grammar_id) : grammar_id_(grammar_id) {}
@@ -1212,11 +1274,32 @@ class ApplicationManagerImpl
bool IsAppsQueriedFrom(
const connection_handler::DeviceHandle handle) const OVERRIDE;
+ /**
+ * @brief IsAppInReconnectMode check if application belongs to session
+ * affected by transport switching at the moment by checking internal
+ * waiting list prepared on switching start
+ * @param policy_app_id Application id
+ * @return True if application is in the waiting list, otherwise - false
+ */
+ bool IsAppInReconnectMode(const std::string& policy_app_id) const FINAL;
+
bool IsStopping() const OVERRIDE {
return is_stopping_;
}
/**
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of
+ * switched
+ * application
+ */
+ void ProcessReconnection(ApplicationSharedPtr application,
+ const uint32_t connection_key) FINAL;
+
+ /**
* @brief Clears all applications' persistent data
*/
void ClearAppsPersistentData();
@@ -1485,6 +1568,28 @@ class ApplicationManagerImpl
void ClearTTSGlobalPropertiesList();
/**
+ * @brief EraseAppFromReconnectionList drops application from reconnection
+ * list on transport switch success
+ * @param app Pointer to application
+ */
+ void EraseAppFromReconnectionList(const ApplicationSharedPtr& app);
+
+ /**
+ * @brief SwitchApplication updates parameters of switched application and
+ * internal applications list
+ * @param app Pointer to switched application, must be validated before
+ * passing in
+ * @param connection_key Connection key of switched application from its
+ * registration request
+ * @param device_id Device id of switched application
+ * @param mac_address New device mac address
+ */
+ void SwitchApplication(ApplicationSharedPtr app,
+ const uint32_t connection_key,
+ const size_t device_id,
+ const std::string& mac_address);
+
+ /**
* @brief Converts BSON object containing video parameters to
* smart object's map object
* @param output the smart object to add video parameters
@@ -1617,6 +1722,15 @@ class ApplicationManagerImpl
std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ /**
+ * @brief ReregisterWaitList is list of applications expected to be
+ * re-registered after transport switching is complete
+ */
+ typedef std::vector<ApplicationSharedPtr> ReregisterWaitList;
+ ReregisterWaitList reregister_wait_list_;
+
+ mutable sync_primitives::Lock reregister_wait_list_lock_;
+
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -1631,6 +1745,8 @@ class ApplicationManagerImpl
volatile bool is_stopping_;
+ std::unique_ptr<CommandHolder> commands_holder_;
+
#ifdef BUILD_TESTS
public:
/**
@@ -1646,7 +1762,7 @@ class ApplicationManagerImpl
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
};
-bool ApplicationManagerImpl::vr_session_started() const {
+DEPRECATED bool ApplicationManagerImpl::vr_session_started() const {
return is_vr_session_strated_;
}