diff options
13 files changed, 349 insertions, 56 deletions
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 8b838bd32a..674091f508 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -187,6 +187,7 @@ extern const char* red; extern const char* green; extern const char* blue; extern const char* display_layout; +extern const char* icon_resumed; // PutFile extern const char* sync_file_name; @@ -200,6 +201,7 @@ extern const char* persistent_file; extern const char* file_data; extern const char* space_available; extern const char* image_type; +extern const char* is_template; extern const char* image; extern const char* type; extern const char* system_file; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 248b54fee5..3ead8fe65e 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -623,6 +623,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( const std::string& bundle_id = app_info[strings::bundle_id].asString(); application->set_bundle_id(bundle_id); } + + const std::string app_icon_dir(settings_.app_icons_folder()); + const std::string full_icon_path(app_icon_dir + "/" + policy_app_id); + if (file_system::FileExists(full_icon_path)) { + application->set_app_icon_path(full_icon_path); + } + PutDriverDistractionMessageToPostponed(application); // Stops timer of saving data to resumption in order to diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index a58534b52b..179f2979a3 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -50,6 +50,7 @@ #include "config_profile/profile.h" #include "interfaces/MOBILE_API.h" #include "interfaces/generated_msg_version.h" +#include "utils/file_system.h" namespace { namespace custom_str = utils::custom_string; @@ -719,6 +720,10 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( } policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication( application->policy_app_id(), hmi_types); + + response_params[strings::icon_resumed] = + file_system::FileExists(application->app_icon_path()); + SendResponse(true, result_code, add_info.c_str(), &response_params); SendOnAppRegisteredNotificationToHMI( *(application.get()), resumption, need_restore_vr); @@ -835,7 +840,9 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( application[strings::app_name] = application_impl.name(); application[strings::app_id] = application_impl.app_id(); application[hmi_response::policy_app_id] = policy_app_id; - application[strings::icon] = application_impl.app_icon_path(); + if (file_system::FileExists(application_impl.app_icon_path())) { + application[strings::icon] = application_impl.app_icon_path(); + } const smart_objects::SmartObject* ngn_media_screen_name = application_impl.ngn_media_screen_name(); diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index ee544e956a..a100bbb5fb 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -31,9 +31,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "application_manager/commands/mobile/set_app_icon_request.h" +#include <algorithm> + #include "application_manager/message_helper.h" #include "application_manager/application_impl.h" #include "interfaces/MOBILE_API.h" @@ -90,10 +91,6 @@ void SetAppIconRequest::Run() { return; } - if (is_icons_saving_enabled_) { - CopyToIconStorage(full_file_path); - } - smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); @@ -262,6 +259,11 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { const std::string& path = (*message_)[strings::msg_params][strings::sync_file_name] [strings::value].asString(); + + if (is_icons_saving_enabled_) { + CopyToIconStorage(path); + } + app->set_app_icon_path(path); LOG4CXX_INFO(logger_, diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc index 648a531e92..ed60ca4928 100644 --- a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc @@ -76,9 +76,9 @@ void SetDisplayLayoutRequest::Run() { // Template layout is the same as previous layout // Reject message if colors are set if (msg_params.keyExists(strings::day_color_scheme) && - app->day_color_scheme() != NULL && - !(msg_params[strings::day_color_scheme] == - *(app->day_color_scheme()))) { + app->day_color_scheme() != NULL && + !(msg_params[strings::day_color_scheme] == + *(app->day_color_scheme()))) { // Color scheme param exists and has been previously set, do not allow // color change LOG4CXX_DEBUG(logger_, "Reject Day Color Scheme Change"); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 7e21cb5d33..2710285597 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -151,6 +151,7 @@ const char* red = "red"; const char* green = "green"; const char* blue = "blue"; const char* display_layout = "displayLayout"; +const char* icon_resumed = "iconResumed"; // PutFile const char* sync_file_name = "syncFileName"; @@ -164,6 +165,7 @@ const char* persistent_file = "persistentFile"; const char* file_data = "fileData"; const char* space_available = "spaceAvailable"; const char* image_type = "imageType"; +const char* is_template = "isTemplate"; const char* image = "image"; const char* type = "type"; const char* system_file = "systemFile"; diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index c922c227bb..9cc552f188 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -89,6 +89,9 @@ namespace { const std::string kDirectoryName = "./test_storage"; const uint32_t kTimeout = 10000u; connection_handler::DeviceHandle kDeviceId = 12345u; +const std::string kAppId = "someID"; +const uint32_t kConnectionKey = 1232u; +const std::string kAppName = "appName"; } // namespace class ApplicationManagerImplTest : public ::testing::Test { @@ -136,6 +139,8 @@ class ApplicationManagerImplTest : public ::testing::Test { .WillByDefault(Return(stop_streaming_timeout)); ON_CALL(mock_application_manager_settings_, default_timeout()) .WillByDefault(ReturnRef(kTimeout)); + ON_CALL(mock_application_manager_settings_, + application_list_update_timeout()).WillByDefault(Return(kTimeout)); app_manager_impl_.reset(new am::ApplicationManagerImpl( mock_application_manager_settings_, mock_policy_settings_)); @@ -941,6 +946,49 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) { } } +TEST_F(ApplicationManagerImplTest, + RegisterApplication_PathToTheIconExists_IconWasSet) { + file_system::CreateDirectory(kDirectoryName); + const std::string full_icon_path = kDirectoryName + "/" + kAppId; + ASSERT_TRUE(file_system::CreateFile(full_icon_path)); + + smart_objects::SmartObject request_for_registration( + smart_objects::SmartType_Map); + + smart_objects::SmartObject& params = + request_for_registration[strings::msg_params]; + params[strings::app_id] = kAppId; + params[strings::language_desired] = mobile_api::Language::EN_US; + params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US; + + request_for_registration[strings::params][strings::connection_key] = + kConnectionKey; + request_for_registration[strings::msg_params][strings::app_name] = kAppName; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::minor_version] = APIVersion::kAPIV2; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::major_version] = APIVersion::kAPIV3; + + request_for_registration[strings::params][strings::protocol_version] = + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2; + + smart_objects::SmartObjectSPtr request_for_registration_ptr = + MakeShared<smart_objects::SmartObject>(request_for_registration); + + ApplicationSharedPtr application = + app_manager_impl_->RegisterApplication(request_for_registration_ptr); + EXPECT_STREQ(kAppName.c_str(), application->name().c_str()); + EXPECT_STREQ(full_icon_path.c_str(), application->app_icon_path().c_str()); + EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2, + application->protocol_version()); + EXPECT_EQ(APIVersion::kAPIV2, + application->version().min_supported_api_version); + EXPECT_EQ(APIVersion::kAPIV3, + application->version().max_supported_api_version); + + EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true)); +} + } // application_manager_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc index b278479df8..a5d50502f4 100644 --- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc @@ -40,6 +40,8 @@ #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" +#include "protocol_handler/mock_protocol_handler.h" +#include "protocol_handler/mock_protocol_handler_settings.h" #include "application_manager/mock_message_helper.h" #include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" @@ -55,6 +57,9 @@ using am::commands::SetAppIconRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; +using am::MockHmiInterfaces; +using test::components::protocol_handler_test::MockProtocolHandler; +using test::components::protocol_handler_test::MockProtocolHandlerSettings; using ::utils::SharedPtr; using ::testing::_; using ::testing::Return; @@ -88,6 +93,10 @@ class SetAppIconRequestTest return msg; } + NiceMock<MockHmiInterfaces> hmi_interfaces_; + protocol_handler_test::MockProtocolHandler mock_protocol_handler_; + protocol_handler_test::MockProtocolHandlerSettings + mock_protocol_handler_settings_; }; TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { @@ -107,6 +116,20 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MockAppPtr mock_app = CreateMockApp(); ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app)); + ON_CALL(app_mngr_, hmi_interfaces()) + .WillByDefault(ReturnRef(hmi_interfaces_)); + ON_CALL(hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); + + ON_CALL(app_mngr_, protocol_handler()) + .WillByDefault(ReturnRef(mock_protocol_handler_)); + ON_CALL(mock_protocol_handler_, get_settings()) + .WillByDefault(ReturnRef(mock_protocol_handler_settings_)); + + ON_CALL(mock_protocol_handler_settings_, max_supported_protocol_version()) + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)); ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey)); ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true)); diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc index 001e06ca58..3b2c0d7b13 100644 --- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc @@ -271,6 +271,10 @@ void ResumptionDataDBTest::CheckGlobalProportiesData() { select_image.GetInteger(0)); EXPECT_EQ((*menu_icon_)[am::strings::value].asString(), select_image.GetString(1)); + if ((*menu_icon_).keyExists(am::strings::is_template)) { + EXPECT_EQ((*menu_icon_)[am::strings::is_template].asBool(), + select_image.GetBoolean(2)); + } } if (!select_globalproperties.IsNull(8)) { utils::dbms::SQLQuery select_tts_chunk(test_db()); diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc index 65e01b6119..0f90fe978f 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -381,6 +381,7 @@ void ResumptionDataTest::SetMenuTitleAndIcon() { sm::SmartObject sm_icon; sm_icon[am::strings::value] = "test icon"; sm_icon[am::strings::image_type] = ImageType::STATIC; + sm_icon[am::strings::is_template] = false; sm::SmartObject sm_title; sm_title = "test title"; diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc index 28a3383086..0ec902085f 100644 --- a/src/components/application_manager/test/resumption_sql_queries_test.cc +++ b/src/components/application_manager/test/resumption_sql_queries_test.cc @@ -197,8 +197,9 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int64_t glob_prop_key); SQLQuery& FillImageTable(SQLQuery& query, - const int imageType, - const string& value); + const int image_type, + const string& value, + const bool is_template); SQLQuery& FillTableLimitedCharacterListTable( SQLQuery& query, const string& limitedCharacterList); @@ -456,11 +457,13 @@ void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check, } SQLQuery& ResumptionSqlQueriesTest::FillImageTable(SQLQuery& query, - const int imageType, - const string& value) { + const int image_type, + const string& value, + const bool is_template) { EXPECT_TRUE(query.Prepare(kInsertImage)); - query.Bind(0, imageType); + query.Bind(0, image_type); query.Bind(1, value); + query.Bind(2, is_template); EXPECT_TRUE(query.Exec()); return query; } @@ -802,7 +805,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksResumptionData_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -829,7 +835,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -854,7 +863,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -879,7 +891,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -904,7 +919,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -930,7 +948,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -956,7 +977,10 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -990,7 +1014,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectIgnOffTime_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1015,7 +1042,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1032,7 +1062,9 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { device_id, key); - key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId(); + key = FillImageTable( + temp_query, 1 /* image_type */, "tst_img2", true /* is_template */) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1056,7 +1088,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectDataForLoadResumeData_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1084,7 +1119,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1117,7 +1155,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1148,7 +1189,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1189,7 +1233,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectApplicationsIgnOffCount_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1229,7 +1276,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1258,7 +1308,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1288,7 +1341,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationFilesArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1324,7 +1380,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1355,7 +1414,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationSubMenuArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1389,7 +1451,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationSubscriptionsArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1426,7 +1491,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1456,7 +1524,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1490,7 +1561,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1522,7 +1596,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationCommandsArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1560,7 +1637,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable(temp_query, 2, "tst_menu_name", @@ -1595,7 +1675,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommandsFromChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1638,7 +1721,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1775,7 +1861,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromGlobalProperties_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1804,7 +1893,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1834,7 +1926,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -2051,7 +2146,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - FillImageTable(temp_query, 2, "tst_image"); + FillImageTable( + temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true); ValToPosPair p1(0, "tst_image"); ValToPosPair p2(1, ""); // Check @@ -2061,7 +2157,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); ValToPosPair p1(0, "tst_image"); ValToPosPair p2(1, ""); // Check @@ -2071,7 +2170,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kInsertImage_ExpectDataInserted) { // Arrange SQLQuery temp_query(db()); - FillImageTable(temp_query, 2, "tst_image"); + FillImageTable( + temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true); const std::string select_count_image = "SELECT COUNT(*) FROM image;"; // Check CheckSelectQuery(select_count_image, 1, 0); @@ -2616,7 +2716,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2656,7 +2759,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t choice_key = FillChoiceTable( @@ -2776,7 +2882,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t choice_key = FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2808,7 +2917,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); // Check ValToPosPair p1(0, IntToString(image_key)); ValToPosPair p2(1, ""); @@ -2846,7 +2958,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + test_image, + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -2883,7 +2998,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -2900,7 +3018,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 33f23409ea..80c704d7c0 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -781,6 +781,33 @@ </element> </enum> +<enum name="TPMS"> + <element name="UNKNOWN"> + <description>If set the status of the tire is not known.</description> + </element> + <element name="SYSTEM_FAULT"> + <description>TPMS does not function.</description> + </element> + <element name="SENSOR_FAULT"> + <description>The sensor of the tire does not function.</description> + </element> + <element name="LOW"> + <description>TPMS is reporting a low tire pressure for the tire.</description> + </element> + <element name="SYSTEM_ACTIVE"> + <description>TPMS is active and the tire pressure is monitored.</description> + </element> + <element name="TRAIN"> + <description>TPMS is reporting that the tire must be trained.</description> + </element> + <element name="TRAINING_COMPLETE"> + <description>TPMS reports the training for the tire is completed.</description> + </element> + <element name="NOT_TRAINED"> + <description>TPMS reports the tire is not trained.</description> + </element> +</enum> + <enum name="PRNDL"> <description>The selected gear.</description> <element name="PARK"> @@ -1857,6 +1884,9 @@ <param name="imageType" type="Common.ImageType" mandatory="true"> <description>Describes, whether it is a static or dynamic image.</description> </param> + <param name="isTemplate" type="Boolean" mandatory="false"> + <description>Optional value to specify whether it's a template image. A template image can be (re)colored by the HMI as needed by using an image pattern</description> + </param> </struct> <struct name="DeviceInfo"> @@ -2320,7 +2350,13 @@ <struct name="SingleTireStatus"> <param name="status" type="Common.ComponentVolumeStatus" mandatory="true"> <description>The status of component volume. See ComponentVolumeStatus.</description> -</param> + </param> + <param name="tpms" type="TPMS" mandatory="false"> + <description>The status of TPMS according to the particular tire.</description> + </param> + <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000"> + <description>The pressure value of the particular tire in kilo pascal.</description> + </param> </struct> <struct name="DIDResult"> diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 34e0744459..723ada56ae 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -908,6 +908,9 @@ <param name="imageType" type="ImageType" mandatory="true"> <description>Describes, whether it is a static or dynamic image.</description> </param> + <param name="isTemplate" type="Boolean" mandatory="false"> + <description>Optional value to specify whether it's a template image. A template image can be (re)colored by the HMI as needed by using an image pattern</description> + </param> </struct> <struct name="SoftButton"> @@ -1091,6 +1094,33 @@ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED"> </element> </enum> + + <enum name="TPMS"> + <element name="UNKNOWN"> + <description>If set the status of the tire is not known.</description> + </element> + <element name="SYSTEM_FAULT"> + <description>TPMS does not function.</description> + </element> + <element name="SENSOR_FAULT"> + <description>The sensor of the tire does not function.</description> + </element> + <element name="LOW"> + <description>TPMS is reporting a low tire pressure for the tire.</description> + </element> + <element name="SYSTEM_ACTIVE"> + <description>TPMS is active and the tire pressure is monitored.</description> + </element> + <element name="TRAIN"> + <description>TPMS is reporting that the tire must be trained.</description> + </element> + <element name="TRAINING_COMPLETE"> + <description>TPMS reports the training for the tire is completed.</description> + </element> + <element name="NOT_TRAINED"> + <description>TPMS reports the tire is not trained.</description> + </element> + </enum> <enum name="FuelType"> <element name="GASOLINE" /> @@ -1126,6 +1156,12 @@ <param name="status" type="ComponentVolumeStatus" mandatory="true"> <description>See ComponentVolumeStatus.</description> </param> + <param name="tpms" type="TPMS" mandatory="false"> + <description>The status of TPMS according to the particular tire.</description> + </param> + <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000"> + <description>The pressure value of the particular tire in kilo pascal.</description> + </param> </struct> <enum name="WarningLightStatus"> @@ -3154,6 +3190,10 @@ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation"> <description>The software version of the system that implements the SmartDeviceLink core.</description> </param> + <param name="iconResumed" type="Boolean" mandatory="true"> + <description>Existence of apps icon at system. If true, apps icon + was resumed at system. If false, apps icon is not resumed at system</description> + </param> </function> <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request"> |