summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-03-05 20:43:41 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2019-03-05 20:43:41 -0500
commit74af264f3dc62cd48f15b6d3269b17936b5aede6 (patch)
tree9c3f311137f7cc0d844dc06c05526c3e289c9d92 /src/components
parent7083c88030f15af77dc9a1c9a40a8a5bf73d8c73 (diff)
parent7c8c299260ca5411c62bc5e0c315a62a51c5526f (diff)
downloadsdl_core-74af264f3dc62cd48f15b6d3269b17936b5aede6.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/cloud_app_transport
Diffstat (limited to 'src/components')
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h2
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc36
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc14
-rw-r--r--src/components/application_manager/src/hmi_state.cc36
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc11
-rw-r--r--src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc1
-rw-r--r--src/components/application_manager/test/application_impl_test.cc8
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc9
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h2
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc6
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc137
-rw-r--r--src/components/smart_objects/src/smart_object.cc3
14 files changed, 203 insertions, 78 deletions
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index 07d9c8dc23..774376b249 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -207,7 +207,7 @@ class HmiState {
}
protected:
- std::shared_ptr<Application> app_;
+ uint32_t hmi_app_id_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 609b240301..93cf6f9ad3 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -786,6 +786,14 @@ class MessageHelper {
static hmi_apis::Common_Language::eType CommonLanguageFromString(
const std::string& language);
+ /**
+ * @brief CommonLightNameFromString convert string to LightName enum value
+ * @param lightName string to convert
+ * @return value LightName enum value
+ */
+ static hmi_apis::Common_LightName::eType CommonLightNameFromString(
+ const std::string& lightName);
+
static smart_objects::SmartObjectSPtr
GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
index 863e179040..628eaa2e58 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
@@ -68,8 +68,12 @@ void ButtonGetCapabilitiesResponse::Run() {
hmi_capabilities.set_button_capabilities(
(*message_)[strings::msg_params][hmi_response::capabilities]);
- hmi_capabilities.set_preset_bank_capabilities(
- (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::preset_bank_capabilities)) {
+ hmi_capabilities.set_preset_bank_capabilities(
+ (*message_)[strings::msg_params]
+ [hmi_response::preset_bank_capabilities]);
+ }
}
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index b78e541f17..10b0b41a58 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -36,6 +36,7 @@
#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "policy/policy_table/enums.h"
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
@@ -65,6 +66,7 @@ void OnSystemRequestNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace application_manager;
using namespace mobile_apis;
+ using namespace helpers;
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -106,17 +108,33 @@ void OnSystemRequestNotification::Run() {
}
}
- if (mobile_apis::RequestType::PROPRIETARY == request_type) {
- /* According to requirements:
- "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
- If the requestType = HTTP, add to mobile API fileType = BINARY"
- Also in Genivi SDL we don't save the PT to file - we put it directly in
- binary_data */
+ LOG4CXX_DEBUG(logger_,
+ "Processing Request type : " << stringified_request_type);
+
+ const bool binary_data_is_required =
+ Compare<mobile_apis::RequestType::eType, EQ, ONE>(
+ request_type,
+ mobile_apis::RequestType::PROPRIETARY,
+ mobile_apis::RequestType::OEM_SPECIFIC);
+ BinaryMessage binary_data;
+ if (binary_data_is_required) {
const std::string filename =
(*message_)[strings::msg_params][strings::file_name].asString();
- BinaryMessage binary_data;
file_system::ReadBinaryFile(filename, binary_data);
+ }
+
+ if (mobile_apis::RequestType::OEM_SPECIFIC == request_type) {
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+ }
+
+ if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+/* According to requirements:
+ "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
+ If the requestType = HTTP, add to mobile API fileType = BINARY"
+ Also in Genivi SDL we don't save the PT to file - we put it directly in
+ binary_data */
+
#if defined(PROPRIETARY_MODE)
AddHeader(binary_data);
#endif // PROPRIETARY_MODE
@@ -126,7 +144,9 @@ void OnSystemRequestNotification::Run() {
#endif // PROPRIETARY_MODE
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- } else if (mobile_apis::RequestType::HTTP == request_type) {
+ }
+
+ if (mobile_apis::RequestType::HTTP == request_type) {
(*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
if ((*message_)[strings::msg_params].keyExists(strings::url)) {
(*message_)[strings::msg_params][strings::timeout] =
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index f67590543d..6cd6747e99 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -1170,6 +1170,20 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
smart_objects::SmartObject rc_capability_so;
formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
rc_capability_so);
+ if (rc_capability_so.keyExists("lightControlCapabilities")) {
+ if (rc_capability_so["lightControlCapabilities"].keyExists(
+ "supportedLights")) {
+ auto& lights = rc_capability_so["lightControlCapabilities"]
+ ["supportedLights"];
+ auto it = lights.asArray()->begin();
+ for (; it != lights.asArray()->end(); ++it) {
+ smart_objects::SmartObject& light_name_so = (*it)["name"];
+ auto light_name = MessageHelper::CommonLightNameFromString(
+ light_name_so.asString());
+ light_name_so = light_name;
+ }
+ }
+ }
set_rc_capability(rc_capability_so);
if (!rc_capability_so.empty()) {
set_rc_supported(true);
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 7be9668543..e220988f0e 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -45,7 +45,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState")
HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
- : app_(app)
+ : hmi_app_id_(app->hmi_app_id())
, state_id_(state_id)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
@@ -57,7 +57,7 @@ HmiState::HmiState(std::shared_ptr<Application> app,
HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : app_(app)
+ : hmi_app_id_(app->hmi_app_id())
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
@@ -73,19 +73,27 @@ void HmiState::set_parent(HmiStatePtr parent) {
}
bool HmiState::is_navi_app() const {
- return app_->is_navi();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_navi() : false;
}
bool HmiState::is_media_app() const {
- return app_->is_media_application();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_media_application() : false;
}
bool HmiState::is_voice_communication_app() const {
- return app_->is_voice_communication_supported();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_voice_communication_supported() : false;
}
bool HmiState::is_mobile_projection_app() const {
- return app_->mobile_projection_enabled();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->mobile_projection_enabled() : false;
}
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
@@ -123,7 +131,9 @@ VideoStreamingHmiState::VideoStreamingHmiState(
mobile_apis::VideoStreamingState::eType
VideoStreamingHmiState::video_streaming_state() const {
- if (app_->IsVideoApplication()) {
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ if (app && app->IsVideoApplication()) {
return parent()->video_streaming_state();
}
@@ -201,7 +211,7 @@ AudioSource::AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE)
, keep_context_(app->keep_context()) {
- app_->set_keep_context(false);
+ app->set_keep_context(false);
}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
@@ -260,7 +270,15 @@ std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) {
}
std::ostream& operator<<(std::ostream& os, const HmiState& src) {
- os << "HMIState(app id:" << src.app_->app_id() << ", state:" << src.state_id()
+ const ApplicationSharedPtr app =
+ src.app_mngr_.application_by_hmi_app(src.hmi_app_id_);
+ os << "HMIState(app id:";
+ if (app) {
+ os << app->app_id();
+ } else {
+ os << "(none)";
+ }
+ os << ", hmi app id:" << src.hmi_app_id_ << ", state:" << src.state_id()
<< ", hmi_level:" << src.hmi_level()
<< ", audio:" << src.audio_streaming_state()
<< ", video:" << src.video_streaming_state()
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index cc162b03ea..cc291bbfe3 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -290,6 +290,17 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
return hmi_apis::Common_Language::INVALID_ENUM;
}
+hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString(
+ const std::string& lightName) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+ hmi_apis::Common_LightName::eType value;
+ if (EnumConversionHelper<hmi_apis::Common_LightName::eType>::StringToEnum(
+ lightName, &value)) {
+ return value;
+ }
+ return hmi_apis::Common_LightName::INVALID_ENUM;
+}
+
std::string MessageHelper::GetDeviceMacAddressForHandle(
const transport_manager::DeviceHandle device_handle,
const ApplicationManager& app_mngr) {
diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
index 712b91afe7..bbd0011298 100644
--- a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
+++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
@@ -54,7 +54,6 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
return RPCPluginPtr();
}
RPCPlugin* plugin = create_plugin();
- dlclose(plugin_dll);
return RPCPluginPtr(plugin);
}
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 301ed227b8..437f567538 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -118,6 +118,13 @@ class ApplicationImplTest : public ::testing::Test {
AddSet hmi_action);
void CheckCurrentHMIState();
+ // 'directory_name' has to be declared prior to 'app_impl' so that when
+ // deleting ApplicationImplTest class, 'directory_name' will be removed
+ // after 'app_impl' runs its destructor.
+ // (ApplicationImpl's destructor calls CleanupFiles(), which will call
+ // application_manager_.get_settings().app_storage_folder() and will
+ // access 'directory_name'.)
+ const std::string directory_name = "./test_storage";
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
std::shared_ptr<ApplicationImpl> app_impl;
@@ -126,7 +133,6 @@ class ApplicationImplTest : public ::testing::Test {
std::string mac_address;
connection_handler::DeviceHandle device_handle;
custom_str::CustomString app_name;
- const std::string directory_name = "./test_storage";
HmiState::StateID state_id;
HmiStatePtr testHmiState;
HMILevel::eType test_lvl;
diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc
index f921eb1dde..dc6635b049 100644
--- a/src/components/application_manager/test/help_prompt_manager_test.cc
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -136,10 +136,12 @@ class HelpPromptManagerTest : public ::testing::Test {
typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager
MockAppManager;
MockAppManager app_mngr_;
+ // put this before ApplicationImplTest instance, so that app_mngr_settings_
+ // will still exist during app_impl_'s destructor.
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
std::shared_ptr<ApplicationImplTest> app_impl_;
MockHmiInterfaces mock_hmi_interfaces_;
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
std::shared_ptr<application_manager_test::MockApplication> mock_app_;
sync_primitives::Lock app_lock_;
MockRPCService mock_rpc_service_;
@@ -175,11 +177,6 @@ void HelpPromptManagerTest::SetUp() {
mock_help_prompt_manager_ =
std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
- HmiStatePtr state = std::make_shared<HmiState>(
- static_cast<std::shared_ptr<Application> >(mock_app_),
- app_mngr_,
- HmiState::STATE_ID_REGULAR);
-
std::string path = file_system::CreateDirectory("storage");
file_system::CreateFile(path + "/" + "certificate");
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 84a3b6bc87..1a4c561ab4 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -164,6 +164,8 @@ class MockMessageHelper {
ApplicationManager& app_mngr));
MOCK_METHOD1(CommonLanguageFromString,
hmi_apis::Common_Language::eType(const std::string& language));
+ MOCK_METHOD1(CommonLightNameFromString,
+ hmi_apis::Common_LightName::eType(const std::string& lightName));
MOCK_METHOD1(CommonLanguageToString,
std::string(hmi_apis::Common_Language::eType));
MOCK_METHOD2(CreateModuleInfoSO,
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index f091e183dc..180818f401 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -277,6 +277,12 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
language);
}
+hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString(
+ const std::string& lightName) {
+ return MockMessageHelper::message_helper_mock()->CommonLightNameFromString(
+ lightName);
+}
+
smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
uint32_t function_id, ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->CreateModuleInfoSO(
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index 1d4cead52b..76d9a69e74 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -170,34 +170,42 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr simple_app_;
NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
uint32_t simple_app_id_ = 1721;
+ uint32_t simple_hmi_app_id_ = 22770; // random number
am::ApplicationSharedPtr navi_app_;
NiceMock<application_manager_test::MockApplication>* navi_app_ptr_;
uint32_t navi_app_id_ = 1762;
+ uint32_t navi_hmi_app_id_ = 17559;
am::ApplicationSharedPtr media_app_;
NiceMock<application_manager_test::MockApplication>* media_app_ptr_;
uint32_t media_app_id_ = 1801;
+ uint32_t media_hmi_app_id_ = 12751;
am::ApplicationSharedPtr vc_app_;
NiceMock<application_manager_test::MockApplication>* vc_app_ptr_;
uint32_t vc_app_id_ = 1825;
+ uint32_t vc_hmi_app_id_ = 14986;
am::ApplicationSharedPtr media_navi_app_;
NiceMock<application_manager_test::MockApplication>* media_navi_app_ptr_;
uint32_t media_navi_app_id_ = 1855;
+ uint32_t media_navi_hmi_app_id_ = 16194;
am::ApplicationSharedPtr media_vc_app_;
NiceMock<application_manager_test::MockApplication>* media_vc_app_ptr_;
uint32_t media_vc_app_id_ = 1881;
+ uint32_t media_vc_hmi_app_id_ = 12798;
am::ApplicationSharedPtr navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* navi_vc_app_ptr_;
uint32_t navi_vc_app_id_ = 1894;
+ uint32_t navi_vc_hmi_app_id_ = 10807;
am::ApplicationSharedPtr media_navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* media_navi_vc_app_ptr_;
uint32_t media_navi_vc_app_id_ = 1922;
+ uint32_t media_navi_vc_hmi_app_id_ = 21419;
std::vector<am::HmiStatePtr> valid_states_for_audio_app_;
std::vector<am::HmiStatePtr> valid_states_for_not_audio_app_;
@@ -661,6 +669,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr ConfigureApp(
NiceMock<application_manager_test::MockApplication>** app_mock,
uint32_t app_id,
+ uint32_t hmi_app_id,
bool media,
bool navi,
bool vc) {
@@ -670,6 +679,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr app(*app_mock);
ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
+ ON_CALL(**app_mock, hmi_app_id()).WillByDefault(Return(hmi_app_id));
ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
ON_CALL(**app_mock, is_voice_communication_supported())
@@ -871,21 +881,50 @@ class StateControllerImplTest : public ::testing::Test {
}
void ConfigureApps() {
- simple_app_ = ConfigureApp(
- &simple_app_ptr_, simple_app_id_, NOT_MEDIA, NOT_NAVI, NOT_VC);
- media_app_ =
- ConfigureApp(&media_app_ptr_, media_app_id_, MEDIA, NOT_NAVI, NOT_VC);
- navi_app_ =
- ConfigureApp(&navi_app_ptr_, navi_app_id_, NOT_MEDIA, NAVI, NOT_VC);
- vc_app_ = ConfigureApp(&vc_app_ptr_, vc_app_id_, NOT_MEDIA, NOT_NAVI, VC);
- media_navi_app_ = ConfigureApp(
- &media_navi_app_ptr_, media_navi_app_id_, MEDIA, NAVI, NOT_VC);
- media_vc_app_ =
- ConfigureApp(&media_vc_app_ptr_, media_vc_app_id_, MEDIA, NOT_NAVI, VC);
- navi_vc_app_ =
- ConfigureApp(&navi_vc_app_ptr_, navi_vc_app_id_, NOT_MEDIA, NAVI, VC);
- media_navi_vc_app_ = ConfigureApp(
- &media_navi_vc_app_ptr_, media_navi_vc_app_id_, MEDIA, NAVI, VC);
+ simple_app_ = ConfigureApp(&simple_app_ptr_,
+ simple_app_id_,
+ simple_hmi_app_id_,
+ NOT_MEDIA,
+ NOT_NAVI,
+ NOT_VC);
+ media_app_ = ConfigureApp(&media_app_ptr_,
+ media_app_id_,
+ media_hmi_app_id_,
+ MEDIA,
+ NOT_NAVI,
+ NOT_VC);
+ navi_app_ = ConfigureApp(&navi_app_ptr_,
+ navi_app_id_,
+ navi_hmi_app_id_,
+ NOT_MEDIA,
+ NAVI,
+ NOT_VC);
+ vc_app_ = ConfigureApp(
+ &vc_app_ptr_, vc_app_id_, vc_hmi_app_id_, NOT_MEDIA, NOT_NAVI, VC);
+ media_navi_app_ = ConfigureApp(&media_navi_app_ptr_,
+ media_navi_app_id_,
+ media_navi_hmi_app_id_,
+ MEDIA,
+ NAVI,
+ NOT_VC);
+ media_vc_app_ = ConfigureApp(&media_vc_app_ptr_,
+ media_vc_app_id_,
+ media_vc_hmi_app_id_,
+ MEDIA,
+ NOT_NAVI,
+ VC);
+ navi_vc_app_ = ConfigureApp(&navi_vc_app_ptr_,
+ navi_vc_app_id_,
+ navi_vc_hmi_app_id_,
+ NOT_MEDIA,
+ NAVI,
+ VC);
+ media_navi_vc_app_ = ConfigureApp(&media_navi_vc_app_ptr_,
+ media_navi_vc_app_id_,
+ media_navi_vc_hmi_app_id_,
+ MEDIA,
+ NAVI,
+ VC);
applications_list_.push_back(simple_app_);
applications_list_.push_back(media_app_);
applications_list_.push_back(navi_app_);
@@ -914,6 +953,15 @@ class StateControllerImplTest : public ::testing::Test {
ASSERT_EQ(navi_vc_app_->app_id(), navi_vc_app_id_);
ASSERT_EQ(media_navi_vc_app_->app_id(), media_navi_vc_app_id_);
+ ASSERT_EQ(simple_app_->hmi_app_id(), simple_hmi_app_id_);
+ ASSERT_EQ(media_app_->hmi_app_id(), media_hmi_app_id_);
+ ASSERT_EQ(navi_app_->hmi_app_id(), navi_hmi_app_id_);
+ ASSERT_EQ(vc_app_->hmi_app_id(), vc_hmi_app_id_);
+ ASSERT_EQ(media_navi_app_->hmi_app_id(), media_navi_hmi_app_id_);
+ ASSERT_EQ(media_vc_app_->hmi_app_id(), media_vc_hmi_app_id_);
+ ASSERT_EQ(navi_vc_app_->hmi_app_id(), navi_vc_hmi_app_id_);
+ ASSERT_EQ(media_navi_vc_app_->hmi_app_id(), media_navi_vc_hmi_app_id_);
+
ASSERT_FALSE(simple_app_->IsAudioApplication());
ASSERT_TRUE(media_app_->IsAudioApplication());
ASSERT_TRUE(navi_app_->IsAudioApplication());
@@ -1040,6 +1088,8 @@ class StateControllerImplTest : public ::testing::Test {
application_set_.insert(app);
ON_CALL(app_manager_mock_, application(app->app_id()))
.WillByDefault(Return(app));
+ ON_CALL(app_manager_mock_, application_by_hmi_app(app->hmi_app_id()))
+ .WillByDefault(Return(app));
}
am::HmiStatePtr NoneNotAudibleState() {
@@ -1475,9 +1525,9 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
app_in_full =
- ConfigureApp(&app_in_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
- app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&app_in_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
@@ -1549,11 +1599,11 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_in_full =
- ConfigureApp(&app_in_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&app_in_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1796, 30093, MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
@@ -1575,11 +1625,11 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
- ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NAVI, NOT_VC);
+ ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NAVI, VC);
+ ConfigureApp(&app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_full);
@@ -1600,12 +1650,12 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
- ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC);
+ ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, VC);
NiceMock<application_manager_test::MockApplication>*
app_moved_to_limited_mock;
- am::ApplicationSharedPtr app_moved_to_limited =
- ConfigureApp(&app_moved_to_limited_mock, 1796, NOT_MEDIA, NOT_NAVI, VC);
+ am::ApplicationSharedPtr app_moved_to_limited = ConfigureApp(
+ &app_moved_to_limited_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
@@ -1749,8 +1799,8 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC);
am::ApplicationSharedPtr limited_app = media_app_;
NiceMock<application_manager_test::MockApplication>* limited_app_mock =
@@ -1758,7 +1808,7 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -1786,16 +1836,16 @@ TEST_F(
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
- ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -1823,16 +1873,16 @@ TEST_F(
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
- ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -2845,14 +2895,7 @@ TEST_F(StateControllerImplTest,
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- const HmiStatePtr state =
- createHmiState(mobile_apis::HMILevel::HMI_FULL,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::VideoStreamingState::NOT_STREAMABLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
-
EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
@@ -2884,12 +2927,6 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- const HmiStatePtr state =
- createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::VideoStreamingState::NOT_STREAMABLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index 1322757ab1..3235dd619e 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -701,6 +701,9 @@ void SmartObject::duplicate(const SmartObject& OtherObject) {
case SmartType_Integer:
newData.int_value = OtherObject.m_data.int_value;
break;
+ case SmartType_UInteger:
+ newData.int_value = OtherObject.m_data.int_value;
+ break;
case SmartType_Double:
newData.double_value = OtherObject.m_data.double_value;
break;