summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/commands
diff options
context:
space:
mode:
authorAndrey Oleynik (GitHub) <aoleynik@luxoft.com>2017-09-19 16:51:35 +0300
committerAndriy Byzhynar <AByzhynar@luxoft.com>2018-01-18 11:26:30 +0200
commita6791129fb1cfcd5dad96e4987b1c2664aafb61e (patch)
tree82d991edadfd29485946fd07c0f31174c97b0e17 /src/components/application_manager/include/application_manager/commands
parente8911d03dde016a29b01fe80533bc6ac56531678 (diff)
downloadsdl_core-a6791129fb1cfcd5dad96e4987b1c2664aafb61e.tar.gz
Adds main logic and related bugfixes for transport switching
Diffstat (limited to 'src/components/application_manager/include/application_manager/commands')
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h14
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h15
3 files changed, 27 insertions, 6 deletions
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 66456dfdb1..7cab97d423 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
@@ -146,14 +146,14 @@ class CommandImpl : public Command {
*
* @param message Smartobject to be parsed
*/
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
+ bool ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
/**
* @brief Parse smartObject and replace HMI app ID by mobile app Id
*
* @param message Smartobject to be parsed
*/
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
+ bool ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
MessageSharedPtr message_;
uint32_t default_timeout_;
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
index 980e558d6f..f49dac071f 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
@@ -55,12 +55,22 @@ class OnAppUnregisteredNotification : public NotificationToHMI {
/**
* @brief OnAppUnregisteredNotification class destructor
**/
- virtual ~OnAppUnregisteredNotification();
+ ~OnAppUnregisteredNotification() FINAL;
+
+ /**
+ * @brief Init overrides and skips replacement of app id with hmi id since
+ * 1) at the moment this notification is being sent there is no application
+ * registered in application manager
+ * 2) hmi id is already used whenever this message is being constructed, so
+ * its already there
+ * @return True in any case
+ */
+ bool Init() FINAL;
/**
* @brief Execute command
**/
- virtual void Run();
+ virtual void Run() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
index cc3d5b685c..369fd68868 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
@@ -77,15 +77,17 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
**/
virtual void Run();
+ private:
+ enum class AppicationType { kNewApplication, kSwitchedApplication };
+
/**
* @brief Sends RegisterAppInterface response to mobile
*
*@param application_impl application
*
**/
- void SendRegisterAppInterfaceResponseToMobile();
+ void SendRegisterAppInterfaceResponseToMobile(AppicationType app_type);
- private:
smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
const uint32_t connection_key, ApplicationSharedPtr app);
@@ -184,6 +186,15 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
*/
void SendSubscribeCustomButtonNotification();
+ /**
+ * @brief IsApplicationSwitched checks whether application is switched from
+ * another transport. If application id is found, but not in reconnection
+ * list, returns 'already registered' code. Otherwise - proceed with
+ * switching.
+ * @return True if application is detected as switched, otherwise false.
+ */
+ bool IsApplicationSwitched();
+
private:
std::string response_info_;
mobile_apis::Result::eType result_checking_app_hmi_type_;