summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/application_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/include/application_manager/application_impl.h')
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h87
1 files changed, 75 insertions, 12 deletions
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 dc2d8ce528..2a7ea112d4 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -44,6 +44,7 @@
#include "utils/date_time.h"
#include "application_manager/application_data_impl.h"
#include "application_manager/usage_statistics.h"
+#include "application_manager/help_prompt_manager_impl.h"
#include "application_manager/hmi_state.h"
#include "protocol_handler/protocol_handler.h"
@@ -52,6 +53,7 @@
#include "utils/atomic_object.h"
#include "utils/custom_string.h"
#include "utils/timer.h"
+#include "utils/macro.h"
namespace usage_statistics {
@@ -65,6 +67,19 @@ using namespace timer;
namespace mobile_api = mobile_apis;
namespace custom_str = custom_string;
+/**
+ * @brief SwitchApplicationParameters updates application internal parameters
+ * on transport switch. Must be used only for switching flow.
+ * @param app Pointer to switched application
+ * @param app_id New application id (connection key)
+ * @param device_id New device id
+ * @param mac_address New device MAC address
+ */
+void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
class ApplicationImpl : public virtual Application,
public virtual InitialApplicationDataImpl,
public virtual DynamicApplicationDataImpl {
@@ -73,6 +88,15 @@ class ApplicationImpl : public virtual Application,
uint32_t application_id,
const std::string& policy_app_id,
const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
+ const custom_str::CustomString& app_name,
+ utils::SharedPtr<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,
utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
@@ -198,18 +222,34 @@ class ApplicationImpl : public virtual Application,
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const OVERRIDE;
virtual const std::string& curHash() const;
-#ifdef CUSTOMER_PASA
- virtual bool flag_sending_hash_change_after_awake() const;
- virtual void set_flag_sending_hash_change_after_awake(bool flag);
-#endif // CUSTOMER_PASA
- /**
- * @brief Change Hash for current application
- * and send notification to mobile
- * @return updated_hash
- */
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
virtual void UpdateHash();
+ /**
+ * @brief checks is hashID was changed during suspended state
+ * @return Returns TRUE if hashID was changed during suspended state
+ * otherwise returns FALSE.
+ */
+ bool IsHashChangedDuringSuspend() const OVERRIDE;
+
+ /**
+ * @brief changes state of the flag which tracks is hashID was changed during
+ * suspended state or not
+ * @param state new state of the flag
+ */
+ void SetHashChangedDuringSuspend(const bool state) OVERRIDE;
+
UsageStatistics& usage_report();
+ /**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ HelpPromptManager& help_prompt_manager() OVERRIDE;
bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
TLimitSource source);
@@ -232,6 +272,13 @@ class ApplicationImpl : public virtual Application,
virtual bool IsAudioApplication() const;
/**
+ * @brief SetInitialState sets initial HMI state for application on
+ * registration
+ * @param state Hmi state value
+ */
+ void SetInitialState(HmiStatePtr state) FINAL;
+
+ /**
* @brief SetRegularState set permanent state of application
*
* @param state state to setup
@@ -331,7 +378,7 @@ class ApplicationImpl : public virtual Application,
* @brief Get list of subscriptions to vehicle info notifications
* @return list of subscriptions to vehicle info notifications
*/
- const std::set<uint32_t>& SubscribesIVI() const OVERRIDE;
+ const VehicleInfoSubscriptions& SubscribesIVI() const OVERRIDE;
/**
* @brief Return pointer to extension by uid
@@ -341,6 +388,11 @@ class ApplicationImpl : public virtual Application,
AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE;
#endif
+ void PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) OVERRIDE;
+
+ void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) OVERRIDE;
+
protected:
/**
* @brief Clean up application folder. Persistent files will stay
@@ -422,16 +474,18 @@ class ApplicationImpl : public virtual Application,
uint32_t delete_file_in_none_count_;
uint32_t list_files_in_none_count_;
std::string app_icon_path_;
- connection_handler::DeviceHandle device_;
- const std::string mac_address_;
+ std::string mac_address_;
+ connection_handler::DeviceHandle device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
VehicleInfoSubscriptions subscribed_vehicle_info_;
UsageStatistics usage_report_;
+ HelpPromptManagerImpl help_prompt_manager_impl_;
protocol_handler::MajorProtocolVersion protocol_version_;
bool is_voice_communication_application_;
sync_primitives::atomic_bool is_resuming_;
+ bool is_hash_changed_during_suspend_;
uint32_t video_stream_retry_number_;
uint32_t audio_stream_retry_number_;
@@ -467,6 +521,15 @@ class ApplicationImpl : public virtual Application,
sync_primitives::Lock button_lock_;
std::string folder_name_;
ApplicationManager& application_manager_;
+
+ sync_primitives::Lock mobile_message_lock_;
+ MobileMessageQueue mobile_message_queue_;
+
+ friend void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};