summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include
diff options
context:
space:
mode:
authorAndrey Oleynik (GitHub) <aoleynik@luxoft.com>2017-11-29 18:33:59 +0200
committerAndriy Byzhynar <AByzhynar@luxoft.com>2018-01-18 12:03:51 +0200
commitee1d2d7677a7d94da43cc8b1e047bdd816e5fd83 (patch)
treee1b956cd3c472f792117735a20935587e75cfb79 /src/components/application_manager/include
parent11bef60123b62bbe0f8f624bb24a5f0cf74980aa (diff)
downloadsdl_core-ee1d2d7677a7d94da43cc8b1e047bdd816e5fd83.tar.gz
Changes iAP2 Bluetooth to USB switching flow
These changes update switching flow so now instead of automatic switching start in case of same UUID is detected SDL will wait for external signal from the system to start this flow. Also due to UUID is reliable only while device remains connected (at least on certain systems) SDL now uses Bluetooth MAC and USB serial to manage devices and UUID is used only for detection of devices able to switch their transports. Currently only iAP2 Bluetooth to USB support is implemented.
Diffstat (limited to 'src/components/application_manager/include')
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h9
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h5
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h9
4 files changed, 25 insertions, 8 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 5d12cab6ba..ffdd83eb5d 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -71,10 +71,12 @@ namespace custom_str = custom_string;
* @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 uint32_t device_id);
+ const size_t device_id,
+ const std::string& mac_address);
class ApplicationImpl : public virtual Application,
public virtual InitialApplicationDataImpl,
@@ -460,7 +462,7 @@ class ApplicationImpl : public virtual Application,
uint32_t delete_file_in_none_count_;
uint32_t list_files_in_none_count_;
std::string app_icon_path_;
- const std::string mac_address_;
+ std::string mac_address_;
connection_handler::DeviceHandle device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
@@ -509,7 +511,8 @@ class ApplicationImpl : public virtual Application,
friend void SwitchApplicationParameters(ApplicationSharedPtr app,
const uint32_t app_id,
- const uint32_t device_id);
+ const size_t device_id,
+ const std::string& mac_address);
DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};
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 66facf7044..280617c25f 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
@@ -893,9 +893,11 @@ class ApplicationManagerImpl
* @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_uid UID of device being switched
+ * @param device_from device params being switched to the new transport
+ * @param device_to device params on the new transport
*/
- void OnDeviceSwitchingStart(const std::string& device_uid) FINAL;
+ void OnDeviceSwitchingStart(const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) FINAL;
/**
* @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
@@ -1582,10 +1584,12 @@ class ApplicationManagerImpl
* @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 uint32_t device_id);
+ const size_t device_id,
+ const std::string& mac_address);
/**
* @brief Converts BSON object containing video parameters to
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 a7c627b529..3e5f9252de 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
@@ -88,14 +88,15 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
* @brief The AppicationType enum defines whether application is newly
* registered or existing and being switched over another transport
*/
- enum class AppicationType { kNewApplication, kSwitchedApplication };
+ enum class ApplicationType {
+ kNewApplication, kSwitchedApplicationHashOk, kSwitchedApplicationWrongHashId };
/**
* @brief Prepares and sends RegisterAppInterface response to mobile
* considering application type
* @param app_type Type of application
**/
- void SendRegisterAppInterfaceResponseToMobile(AppicationType app_type);
+ void SendRegisterAppInterfaceResponseToMobile(ApplicationType app_type);
smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
const uint32_t connection_key, ApplicationSharedPtr app);
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index 9de2d6af68..dff27cf7f1 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -533,6 +533,15 @@ class PolicyHandler : public PolicyHandlerInterface,
virtual void OnPTUFinished(const bool ptu_result) OVERRIDE;
+ /**
+ * @brief OnDeviceSwitching Notifies policy manager on device switch event so
+ * policy permissions should be processed accordingly
+ * @param device_id_from Id of device being switched
+ * @param device_id_to Id of device on the new transport
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) FINAL;
+
protected:
/**
* Starts next retry exchange policy table