Skip to content

Commit a6c32b4

Browse files
authored
Merge pull request #907 from smartdevicelink/release/4.2.0
Release 4.2.0
2 parents d456891 + fc832c7 commit a6c32b4

File tree

231 files changed

+21069
-2712
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+21069
-2712
lines changed

src/appMain/life_cycle.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ bool LifeCycle::StartComponents() {
128128
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
129129

130130
media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
131+
app_manager_->set_connection_handler(connection_handler_);
131132
if (!app_manager_->Init(*last_state_, media_manager_)) {
132133
LOG4CXX_ERROR(logger_, "Application manager init failed.");
133134
return false;
@@ -177,7 +178,6 @@ bool LifeCycle::StartComponents() {
177178
// It's important to initialise TM after setting up listener chain
178179
// [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
179180
app_manager_->set_protocol_handler(protocol_handler_);
180-
app_manager_->set_connection_handler(connection_handler_);
181181
app_manager_->set_hmi_message_handler(hmi_handler_);
182182

183183
transport_manager_->Init(*last_state_);

src/appMain/smartDeviceLink.ini

+17
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,20 @@ UseDBForResumption = false
238238
AttemptsToOpenResumptionDB = 5
239239
; Timeout between attempts during opening DB in milliseconds
240240
OpenAttemptTimeoutMsResumptionDB = 500
241+
242+
[AppLaunch]
243+
; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
244+
AppLaunchWaitTime = 5000
245+
; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device
246+
AppLaunchMaxRetryAttempt = 3
247+
; time in milliseconds started by SDL after app launch request. if expired and app did not register, SDL sends new launch request. applied separately to each app
248+
AppLaunchRetryWaitTime = 15000
249+
; the number of the given device connections that the requested application failed to register after SDL's launch attempts - SDL removes app's bundleID on "value + 1" device connection
250+
RemoveBundleIDattempts = 3
251+
; the maximum number of iOS devices for which entries can be remembered by SDL
252+
MaxNumberOfiOSDevice = 10
253+
; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
254+
WaitTimeBetweenApps = 4000
255+
; App Launch on iOS devices SDL feature enabler/disabler
256+
EnableAppLaunchIOS = true
257+

src/components/application_manager/CMakeLists.txt

+246-235
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (c) 2016, Ford Motor Company
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* Redistributions of source code must retain the above copyright notice, this
9+
* list of conditions and the following disclaimer.
10+
*
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following
13+
* disclaimer in the documentation and/or other materials provided with the
14+
* distribution.
15+
*
16+
* Neither the name of the Ford Motor Company nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
* POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
34+
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
35+
#include <string>
36+
#include "utils/shared_ptr.h"
37+
38+
namespace application_manager {
39+
class Application;
40+
typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
41+
} // namespace application_manager
42+
43+
namespace app_launch {
44+
45+
/**
46+
* @brief The AppLaunchCtrl class manage logic of AppLaunch feature
47+
* It launches all known applications on newly connected device
48+
*/
49+
class AppLaunchCtrl {
50+
public:
51+
/**
52+
* @brief OnAppRegistered should be called when application registered
53+
* Save application parameters to database
54+
* @param app application to save
55+
*/
56+
virtual void OnAppRegistered(const application_manager::Application& app) = 0;
57+
58+
/**
59+
* @brief OnDeviceConnected shoudl be called on device connected event
60+
* Start launching saaved applications on ios device
61+
* @param device_mac
62+
*/
63+
virtual void OnDeviceConnected(const std::string& device_mac) = 0;
64+
65+
/**
66+
* @brief OnMasterReset clear database of saved applications
67+
*/
68+
virtual void OnMasterReset() = 0;
69+
virtual ~AppLaunchCtrl() {}
70+
};
71+
72+
} // namespace app_launch
73+
74+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (c) 2016, Ford Motor Company
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* Redistributions of source code must retain the above copyright notice, this
9+
* list of conditions and the following disclaimer.
10+
*
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following
13+
* disclaimer in the documentation and/or other materials provided with the
14+
* distribution.
15+
*
16+
* Neither the name of the Ford Motor Company nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
* POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
34+
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
35+
36+
#include "application_manager/app_launch/app_launch_ctrl.h"
37+
#include "application_manager/app_launch/app_launch_data.h"
38+
#include "application_manager/app_launch/apps_launcher.h"
39+
#include "application_manager/app_launch/device_apps_launcher.h"
40+
#include "application_manager/app_launch_settings.h"
41+
42+
namespace connection_handler {
43+
class ConnectionHandler;
44+
} // connection_handler
45+
46+
namespace resumption {
47+
class ResumeCtrl;
48+
} // resumption
49+
50+
namespace app_launch {
51+
// TODO(AK) Use unique pointer
52+
typedef utils::SharedPtr<timer::Timer> TimerPtr;
53+
class MultipleAppsLauncherFactoryImpl;
54+
55+
class AppLaunchCtrlImpl : public AppLaunchCtrl {
56+
public:
57+
/**
58+
* @brief allows to create AppLaunchCtrlImpl object
59+
*/
60+
AppLaunchCtrlImpl(AppLaunchData& data,
61+
application_manager::ApplicationManager& app_mngr,
62+
const AppLaunchSettings& settings);
63+
64+
/**
65+
* @brief allows to destroy AppLaunchCtrlImpl object
66+
*/
67+
~AppLaunchCtrlImpl() {}
68+
69+
void OnAppRegistered(const application_manager::Application& app) OVERRIDE;
70+
void OnDeviceConnected(const std::string& device_mac) OVERRIDE;
71+
void OnMasterReset() OVERRIDE;
72+
73+
private:
74+
const AppLaunchSettings& settings_;
75+
AppLaunchData& app_launch_data_;
76+
resumption::ResumeCtrl& resume_ctrl_;
77+
78+
AppsLauncher apps_launcher_;
79+
DeviceAppsLauncher device_apps_launcher_;
80+
81+
DISALLOW_COPY_AND_ASSIGN(AppLaunchCtrlImpl);
82+
};
83+
84+
} // namespace app_launch
85+
86+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_IMPL_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright (c) 2016, Ford Motor Company
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* Redistributions of source code must retain the above copyright notice, this
9+
* list of conditions and the following disclaimer.
10+
*
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following
13+
* disclaimer in the documentation and/or other materials provided with the
14+
* distribution.
15+
*
16+
* Neither the name of the Ford Motor Company nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
* POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_
34+
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_
35+
36+
#include <stdint.h>
37+
#include <vector>
38+
#include <string>
39+
#include "utils/shared_ptr.h"
40+
41+
namespace app_launch {
42+
43+
/**
44+
* @brief struct holds AppLaunch data
45+
*/
46+
struct ApplicationData {
47+
ApplicationData(const std::string& mobile_app_id,
48+
const std::string& bundle_id,
49+
const std::string& device_id)
50+
: mobile_app_id_(mobile_app_id)
51+
, bundle_id_(bundle_id)
52+
, device_mac_(device_id) {}
53+
54+
std::string mobile_app_id_;
55+
std::string bundle_id_;
56+
std::string device_mac_;
57+
bool operator==(const ApplicationData& app_data) const {
58+
return mobile_app_id_ == app_data.mobile_app_id_ &&
59+
bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_;
60+
}
61+
};
62+
typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr;
63+
64+
/**
65+
* @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson
66+
*/
67+
class AppLaunchData {
68+
public:
69+
/**
70+
* @brief allows correct delete heir object
71+
*/
72+
virtual ~AppLaunchData() {}
73+
74+
/**
75+
* @brief insert new data to DB
76+
* @param app_data - data to inserting
77+
* @return true in success cases and false othrewise
78+
*/
79+
virtual bool AddApplicationData(const ApplicationData& app_data) = 0;
80+
81+
/**
82+
* @brief select from DB all records with this dev_mac
83+
* @param app_data - data to inserting
84+
* @param dev_apps -
85+
* @return vector of pointers on results of select
86+
*/
87+
virtual std::vector<ApplicationDataPtr> GetApplicationDataByDevice(
88+
const std::string& dev_mac) = 0;
89+
/**
90+
* @brief delete App_launch table in DB, after calling this
91+
* one, it should again call init
92+
* @return true in success cases and false othrewise
93+
*/
94+
virtual bool Clear() = 0;
95+
96+
/**
97+
* @brief Persist saves resumption data on file system
98+
*/
99+
virtual bool Persist() = 0;
100+
};
101+
} // namespace app_launch
102+
103+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_

0 commit comments

Comments
 (0)