diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2017-06-19 13:54:59 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2017-06-21 14:20:53 -0400 |
commit | 0ad8a66ea67a5bd8c4a7c3d0ac606a07f4ff73ea (patch) | |
tree | 39f5e37279a3a8fdc2ff52e73ce7a815bd08c1d5 /src/components/config_profile | |
parent | 0fdd32f58dbedf7e175d5ab8b3e04b4edd3d9526 (diff) | |
parent | 22a014b3746b28d2b8a3a4049c60bb76db6a0861 (diff) | |
download | sdl_core-0ad8a66ea67a5bd8c4a7c3d0ac606a07f4ff73ea.tar.gz |
Merge branch 'develop'
Diffstat (limited to 'src/components/config_profile')
12 files changed, 373 insertions, 71 deletions
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt index 107fd58127..4ed382039a 100644 --- a/src/components/config_profile/CMakeLists.txt +++ b/src/components/config_profile/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Ford Motor Company +# Copyright (c) 2016, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,20 +28,27 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories ( - include + ${COMPONENTS_DIR}/config_profile/include ${COMPONENTS_DIR}/utils/include/ + ${POLICY_GLOBAL_INCLUDE_PATH}/ ${LOG4CXX_INCLUDE_DIRECTORY} ) -set (SOURCES - ${COMPONENTS_DIR}/config_profile/src/profile.cc - ${COMPONENTS_DIR}/config_profile/src/ini_file.cc +set(PATHS + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/src ) +set(LIBRARIES + Utils +) + +collect_sources(SOURCES "${PATHS}") add_library("ConfigProfile" ${SOURCES}) -target_link_libraries("ConfigProfile" Utils) +target_link_libraries("ConfigProfile" ${LIBRARIES}) if(BUILD_TESTS) add_subdirectory(test) diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 5abf8a9f78..42b0d10ceb 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Ford Motor Company + * Copyright (c) 2016, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -137,7 +137,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, /** * @brief Sets the path to the config file */ - void config_file_name(const std::string& fileName); + void set_config_file_name(const std::string& file_name); /** * @brief Returns server address @@ -271,13 +271,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, * @brief Returns timeout for SDL to wait for the next package of raw data * over audio service */ - const std::uint32_t audio_data_stopped_timeout() const; + const uint32_t audio_data_stopped_timeout() const; /** * @brief Returns timeout for SDL to wait for the next package of raw data * over video service */ - const std::uint32_t video_data_stopped_timeout() const; + const uint32_t video_data_stopped_timeout() const; /** * @brief Returns allowable max amount of requests per time scale for @@ -560,7 +560,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, uint32_t resumption_delay_before_ign() const; - uint32_t resumption_delay_after_ign() const; + const uint32_t resumption_delay_after_ign() const; uint32_t hash_string_size() const; @@ -582,11 +582,56 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ uint16_t open_attempt_timeout_ms_resumption_db() const; - /* + /** + * @brief Returns wait time after device connection + * before app launch request + */ + const uint16_t app_launch_wait_time() const OVERRIDE; + + /** + * @brief Returns max number of attempts to launch an application + * after device connection + */ + const uint16_t app_launch_max_retry_attempt() const OVERRIDE; + + /** + * @brief Returns wait time before next app launch request + */ + const uint16_t app_launch_retry_wait_time() const OVERRIDE; + + /** + * @brief Returns max number of failed iOS app + * registration requests + */ + const uint16_t remove_bundle_id_attempts() const OVERRIDE; + + /** + * @brief Returns max number of iOS devices to be stored + */ + const uint16_t max_number_of_ios_device() const OVERRIDE; + + /** + * @brief Returns wait time before attempt to launch next app + */ + const uint16_t wait_time_between_apps() const OVERRIDE; + + /** + * @brief Returns status of feature of app launch on iOS + */ + const bool enable_app_launch_ios() const OVERRIDE; + + /** * @brief Updates all related values from ini file */ void UpdateValues(); + /** + * @brief Gets reading result of all related values from ini file + * @returns TRUE if no error appeared during updating + * otherwise FALSE + */ + const bool ErrorOccured() const; + const uint32_t& list_files_response_size() const OVERRIDE; const std::string& recording_file_source() const OVERRIDE; @@ -599,8 +644,21 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, const std::pair<uint32_t, int32_t>& start_stream_retry_amount() const OVERRIDE; + /** + * @brief Returns error description + * @return Actual error description if error appears otherwise empty line + */ + const std::string ErrorDescription() const; + private: /** + * @brief Checks that filename consists of portable symbols + * @param file_name - file name to check + * @return FALSE if file name has unportable symbols otherwise TRUE + */ + bool IsFileNamePortable(const std::string& file_name) const; + + /** * @brief Reads a string value from the profile and interpret it * as \c true on "true" value or as \c false on any other value * @@ -752,8 +810,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, std::string system_files_path_; uint16_t transport_manager_tcp_adapter_port_; std::string tts_delimiter_; - std::uint32_t audio_data_stopped_timeout_; - std::uint32_t video_data_stopped_timeout_; + uint32_t audio_data_stopped_timeout_; + uint32_t video_data_stopped_timeout_; std::string mme_db_name_; std::string event_mq_name_; std::string ack_mq_name_; @@ -810,6 +868,15 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, bool use_db_for_resumption_; uint16_t attempts_to_open_resumption_db_; uint16_t open_attempt_timeout_ms_resumption_db_; + uint16_t app_launch_wait_time_; + uint16_t app_launch_max_retry_attempt_; + uint16_t app_launch_retry_wait_time_; + uint16_t remove_bundle_id_attempts_; + uint16_t max_number_of_ios_device_; + uint16_t wait_time_between_apps_; + bool enable_app_launch_ios_; + bool error_occured_; + std::string error_description_; DISALLOW_COPY_AND_ASSIGN(Profile); }; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index b5ea924b49..beabc6afa8 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -38,6 +38,8 @@ #include <sstream> #include <algorithm> +#include <string> + #include "config_profile/ini_file.h" #include "utils/logger.h" #include "utils/threads/thread.h" @@ -84,6 +86,7 @@ const char* kIAPSection = "IAP"; const char* kProtocolHandlerSection = "ProtocolHandler"; const char* kSDL4Section = "SDL4"; const char* kResumptionSection = "Resumption"; +const char* kAppLaunchSection = "AppLaunch"; const char* kSDLVersionKey = "SDLVersion"; const char* kHmiCapabilitiesKey = "HMICapabilities"; @@ -102,7 +105,6 @@ const char* kAppIconsFolderKey = "AppIconsFolder"; const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize"; const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove"; const char* kLaunchHMIKey = "LaunchHMI"; - const char* kDefaultSDLVersion = ""; #ifdef WEB_HMI const char* kLinkToWebHMI = "LinkToWebHMI"; @@ -197,6 +199,13 @@ const char* kAttemptsToOpenResumptionDBKey = "AttemptsToOpenResumptionDB"; const char* kOpenAttemptTimeoutMsResumptionDBKey = "OpenAttemptTimeoutMsResumptionDB"; +const char* kAppLaunchWaitTimeKey = "AppLaunchWaitTime"; +const char* kAppLaunchMaxRetryAttemptKey = "AppLaunchMaxRetryAttempt"; +const char* kAppLaunchRetryWaitTimeKey = "AppLaunchRetryWaitTime"; +const char* kRemoveBundleIDattemptsKey = "RemoveBundleIDattempts"; +const char* kMaxNumberOfiOSDeviceKey = "MaxNumberOfiOSDevice"; +const char* kWaitTimeBetweenAppsKey = "WaitTimeBetweenApps"; +const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS"; #ifdef WEB_HMI const char* kDefaultLinkToWebHMI = "HMI/index.html"; #endif // WEB_HMI @@ -278,6 +287,15 @@ const uint32_t kDefaultAppIconsFolderMaxSize = 104857600; const uint32_t kDefaultAppIconsAmountToRemove = 1; const uint16_t kDefaultAttemptsToOpenResumptionDB = 5; const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500; +const uint16_t kDefaultAppLaunchWaitTime = 5000; +const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3; +const uint16_t kDefaultAppLaunchRetryWaitTime = 15000; +const uint16_t kDefaultRemoveBundleIDattempts = 3; +const uint16_t kDefaultMaxNumberOfiOSDevice = 10; +const uint16_t kDefaultWaitTimeBetweenApps = 4000; +const bool kDefaultEnableAppLaunchIOS = true; +const std::string kAllowedSymbols = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"; } // namespace namespace profile { @@ -366,14 +384,26 @@ Profile::Profile() , use_db_for_resumption_(false) , attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB) , open_attempt_timeout_ms_resumption_db_( - kDefaultOpenAttemptTimeoutMsResumptionDB) { + kDefaultOpenAttemptTimeoutMsResumptionDB) + , app_launch_wait_time_(kDefaultAppLaunchWaitTime) + , app_launch_max_retry_attempt_(kDefaultAppLaunchMaxRetryAttempt) + , app_launch_retry_wait_time_(kDefaultAppLaunchRetryWaitTime) + , remove_bundle_id_attempts_(kDefaultRemoveBundleIDattempts) + , max_number_of_ios_device_(kDefaultMaxNumberOfiOSDevice) + , wait_time_between_apps_(kDefaultWaitTimeBetweenApps) + , enable_app_launch_ios_(kDefaultEnableAppLaunchIOS) + , error_occured_(false) + , error_description_() { + // SDL version + ReadStringValue( + &sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey); } Profile::~Profile() {} -void Profile::config_file_name(const std::string& fileName) { - if (false == fileName.empty()) { - config_file_name_ = fileName; +void Profile::set_config_file_name(const std::string& file_name) { + if (false == file_name.empty()) { + config_file_name_ = file_name; UpdateValues(); } } @@ -532,11 +562,11 @@ const std::string& Profile::audio_stream_file() const { return audio_stream_file_; } -const std::uint32_t Profile::audio_data_stopped_timeout() const { +const uint32_t Profile::audio_data_stopped_timeout() const { return audio_data_stopped_timeout_; } -const std::uint32_t Profile::video_data_stopped_timeout() const { +const uint32_t Profile::video_data_stopped_timeout() const { return video_data_stopped_timeout_; } @@ -758,7 +788,7 @@ uint32_t Profile::resumption_delay_before_ign() const { return resumption_delay_before_ign_; } -uint32_t Profile::resumption_delay_after_ign() const { +const uint32_t Profile::resumption_delay_after_ign() const { return resumption_delay_after_ign_; } @@ -829,6 +859,49 @@ uint16_t Profile::open_attempt_timeout_ms_resumption_db() const { return open_attempt_timeout_ms_resumption_db_; } +const uint16_t Profile::app_launch_max_retry_attempt() const { + return app_launch_max_retry_attempt_; +} + +const uint16_t Profile::app_launch_retry_wait_time() const { + return app_launch_retry_wait_time_; +} + +const uint16_t Profile::app_launch_wait_time() const { + return app_launch_wait_time_; +} + +const bool Profile::enable_app_launch_ios() const { + return enable_app_launch_ios_; +} + +const uint16_t Profile::max_number_of_ios_device() const { + return max_number_of_ios_device_; +} + +const uint16_t Profile::remove_bundle_id_attempts() const { + return remove_bundle_id_attempts_; +} + +const uint16_t Profile::wait_time_between_apps() const { + return wait_time_between_apps_; +} + +const bool Profile::ErrorOccured() const { + return error_occured_; +} + +const std::string Profile::ErrorDescription() const { + return error_description_; +} + +bool Profile::IsFileNamePortable(const std::string& file_name) const { + if (file_name.find_first_not_of(kAllowedSymbols) != std::string::npos) { + return false; + } + return true; +} + void Profile::UpdateValues() { LOG4CXX_AUTO_TRACE(logger_); @@ -1522,6 +1595,11 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE( policy_snapshot_file_name_, kPathToSnapshotKey, kPolicySection); + if (!IsFileNamePortable(policy_snapshot_file_name_)) { + error_occured_ = true; + error_description_ = "PathToSnapshot has forbidden(non-portable) symbols"; + } + // Attempts number for opening policy DB ReadUIntValue(&attempts_to_open_policy_db_, kDefaultAttemptsToOpenPolicyDB, @@ -1687,6 +1765,66 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(open_attempt_timeout_ms_resumption_db_, kOpenAttemptTimeoutMsResumptionDBKey, kResumptionSection); + + // Read parameters from App Launch section + ReadUIntValue(&app_launch_wait_time_, + kDefaultAppLaunchWaitTime, + kAppLaunchSection, + kAppLaunchWaitTimeKey); + + LOG_UPDATED_VALUE( + app_launch_wait_time_, kAppLaunchWaitTimeKey, kAppLaunchSection); + + ReadUIntValue(&app_launch_max_retry_attempt_, + kDefaultAppLaunchMaxRetryAttempt, + kAppLaunchSection, + kAppLaunchMaxRetryAttemptKey); + + LOG_UPDATED_VALUE(app_launch_max_retry_attempt_, + kAppLaunchMaxRetryAttemptKey, + kAppLaunchSection); + + ReadUIntValue(&app_launch_retry_wait_time_, + kDefaultAppLaunchRetryWaitTime, + kAppLaunchSection, + kAppLaunchRetryWaitTimeKey); + + LOG_UPDATED_VALUE(app_launch_retry_wait_time_, + kAppLaunchRetryWaitTimeKey, + kAppLaunchSection); + + ReadUIntValue(&remove_bundle_id_attempts_, + kDefaultRemoveBundleIDattempts, + kAppLaunchSection, + kRemoveBundleIDattemptsKey); + + LOG_UPDATED_VALUE(remove_bundle_id_attempts_, + kRemoveBundleIDattemptsKey, + kAppLaunchSection); + + ReadUIntValue(&max_number_of_ios_device_, + kDefaultMaxNumberOfiOSDevice, + kAppLaunchSection, + kMaxNumberOfiOSDeviceKey); + + LOG_UPDATED_VALUE( + max_number_of_ios_device_, kMaxNumberOfiOSDeviceKey, kAppLaunchSection); + + ReadUIntValue(&wait_time_between_apps_, + kDefaultWaitTimeBetweenApps, + kAppLaunchSection, + kWaitTimeBetweenAppsKey); + + LOG_UPDATED_VALUE( + wait_time_between_apps_, kWaitTimeBetweenAppsKey, kAppLaunchSection); + + ReadBoolValue(&enable_app_launch_ios_, + kDefaultEnableAppLaunchIOS, + kAppLaunchSection, + kEnableAppLaunchIOSKey); + + LOG_UPDATED_BOOL_VALUE( + enable_app_launch_ios_, kEnableAppLaunchIOSKey, kAppLaunchSection); } bool Profile::ReadValue(bool* value, diff --git a/src/components/config_profile/test/CMakeLists.txt b/src/components/config_profile/test/CMakeLists.txt index 1246bff066..597be8fe00 100644 --- a/src/components/config_profile/test/CMakeLists.txt +++ b/src/components/config_profile/test/CMakeLists.txt @@ -28,23 +28,20 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -if(BUILD_TESTS) +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories ( ${GMOCK_INCLUDE_DIRECTORY} ${COMPONENTS_DIR}/config_profile/include ) - -set(testSources - profile_test.cc - ini_file_test.cc -) - -set(testLibraries +set(LIBRARIES gmock ConfigProfile ) + +collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}") +create_test(config_profile_test "${SOURCES}" "${LIBRARIES}") file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) @@ -52,6 +49,3 @@ file(COPY smartDeviceLink_invalid_pairs.ini DESTINATION ${CMAKE_CURRENT_BINARY_D file(COPY smartDeviceLink_invalid_string.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_invalid_int.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY smartDeviceLink_invalid_boolean.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -create_test("config_profile_test" "${testSources}" "${testLibraries}") - -endif() diff --git a/src/components/config_profile/test/ini_file_test.cc b/src/components/config_profile/test/ini_file_test.cc index 2f256c8b51..0443f061a2 100644 --- a/src/components/config_profile/test/ini_file_test.cc +++ b/src/components/config_profile/test/ini_file_test.cc @@ -36,7 +36,7 @@ namespace test { namespace components { -namespace profile { +namespace profile_test { using namespace ::profile; @@ -325,6 +325,6 @@ TEST(IniFileTest, ParseLineWithComment) { EXPECT_STREQ(line, res); } -} // namespace profile +} // namespace profile_test } // namespace components } // namespace test diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc index 59ebb2820b..e7d62f4740 100644 --- a/src/components/config_profile/test/profile_test.cc +++ b/src/components/config_profile/test/profile_test.cc @@ -40,7 +40,7 @@ namespace test { namespace components { -namespace profile { +namespace profile_test { using namespace ::profile; @@ -76,7 +76,7 @@ TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) { EXPECT_EQ(vr_help_title_, profile_.vr_help_title()); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Value was updated @@ -91,7 +91,7 @@ TEST_F(ProfileTest, SetConfigFileWithUpdate) { // Default value uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Value was updated @@ -108,7 +108,7 @@ TEST_F(ProfileTest, SetConfigFileWithUpdate) { TEST_F(ProfileTest, UpdateManyTimesDefaultFile) { // using for check logger's work - core dump when this test was started and // log4cxx exists in test derictory - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Update config many times for (int i = 0; i < 10; i++) { @@ -123,7 +123,7 @@ TEST_F(ProfileTest, UpdateIntValues) { EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set config file with default name - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Value changes @@ -136,7 +136,7 @@ TEST_F(ProfileTest, UpdateIntValues) { EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Value changes @@ -151,7 +151,7 @@ TEST_F(ProfileTest, UpdateIntValues) { EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set config file with default name again - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Value should be changed @@ -166,7 +166,7 @@ TEST_F(ProfileTest, UpdateBoolValues) { EXPECT_FALSE(profile_.enable_policy()); // Set config file - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); // Check values EXPECT_TRUE(profile_.launch_hmi()); EXPECT_TRUE(profile_.enable_policy()); @@ -180,7 +180,7 @@ TEST_F(ProfileTest, UpdateBoolValues) { EXPECT_FALSE(profile_.is_redecoding_enabled()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Parameters after updating @@ -208,7 +208,7 @@ TEST_F(ProfileTest, UpdateStringValue) { EXPECT_EQ(recording_file_name, profile_.recording_file_name()); EXPECT_EQ(server_address, profile_.server_address()); - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Check values @@ -234,7 +234,7 @@ TEST_F(ProfileTest, UpdateInt_ValueAppearsInFileTwice) { uint32_t server_port = 8087; EXPECT_EQ(server_port, profile_.server_port()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file // First server_port = 8088 @@ -246,7 +246,7 @@ TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) { // Default values EXPECT_FALSE(profile_.is_mixing_audio_supported()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file // First value is false @@ -258,7 +258,7 @@ TEST_F(ProfileTest, UpdateVectorOfString_ValueAppearsInFileTwice) { std::vector<std::string> time_out_promt; EXPECT_EQ(time_out_promt, profile_.time_out_promt()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file time_out_promt.push_back("Please say a command,"); @@ -270,7 +270,7 @@ TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) { std::string recording_file_name = "record.wav"; EXPECT_EQ(recording_file_name, profile_.recording_file_name()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file recording_file_name = "video.wav"; @@ -284,7 +284,7 @@ TEST_F(ProfileTest, UpdatePairsValue) { value.second = 0; EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); value.first = 5; @@ -305,7 +305,7 @@ TEST_F(ProfileTest, PairsValueEmpty) { value.second = 0; EXPECT_EQ(value, profile_.read_did_frequency()); - profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini"); EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); // Default values @@ -325,7 +325,7 @@ TEST_F(ProfileTest, CharValueInPairInsteadOfInt) { value.second = 0; EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); - profile_.config_file_name("smartDeviceLink_invalid_string.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_string.ini"); EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); @@ -337,7 +337,7 @@ TEST_F(ProfileTest, CharValueInPairInsteadOfInt) { } TEST_F(ProfileTest, EmptyValuesInPair) { - profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini"); EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); std::pair<uint32_t, int32_t> value; @@ -358,7 +358,7 @@ TEST_F(ProfileTest, IntInsteadOfPair) { value.second = 0; EXPECT_EQ(value, profile_.start_stream_retry_amount()); - profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini"); EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); // Ini file includes only one element value.first = 9; @@ -377,7 +377,7 @@ TEST_F(ProfileTest, WrongIntValue) { EXPECT_EQ(heart_beat_timeout, profile_.heart_beat_timeout()); // Change config file - profile_.config_file_name("smartDeviceLink_invalid_int.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_int.ini"); EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Value in file includes letters. Check that value is default @@ -395,7 +395,7 @@ TEST_F(ProfileTest, WrongMaxIntValue) { EXPECT_EQ(maxvalue, profile_.max_cmd_id()); // Change config file - profile_.config_file_name("smartDeviceLink_invalid_int.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_int.ini"); EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Value in file is more than could be saved. @@ -416,7 +416,7 @@ TEST_F(ProfileTest, WrongMinIntValue) { EXPECT_EQ(server_port, profile_.server_port()); // Change config file - profile_.config_file_name("smartDeviceLink_invalid_int.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_int.ini"); EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // File include 0, value should be lefted as default @@ -441,7 +441,7 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) { EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Change config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Check that value is default @@ -462,7 +462,7 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) { TEST_F(ProfileTest, PairsValueInsteadOfInt) { // Set new config file - profile_.config_file_name("smartDeviceLink_invalid_int.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_int.ini"); EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Get first number uint32_t list_files_in_none = 5; @@ -482,7 +482,7 @@ TEST_F(ProfileTest, StringValueIncludeSlashesAndRussianLetters) { std::string app_storage_folder = ""; std::string current_dir = file_system::CurrentWorkingDirectory(); - profile_.config_file_name("smartDeviceLink_invalid_string.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_string.ini"); EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); // Check values @@ -508,7 +508,7 @@ TEST_F(ProfileTest, StringUpperBoundValue) { EXPECT_EQ(vr_help_title, profile_.vr_help_title()); EXPECT_EQ(recording_file_name, profile_.recording_file_name()); - profile_.config_file_name("smartDeviceLink_invalid_string.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_string.ini"); EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); // Total count of elements in ini file's string will be less 512 @@ -548,14 +548,14 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) { EXPECT_FALSE(profile_.enable_policy()); // Set config file - profile_.config_file_name("smartDeviceLink.ini"); + profile_.set_config_file_name("smartDeviceLink.ini"); // Check values EXPECT_TRUE(profile_.launch_hmi()); EXPECT_TRUE(profile_.enable_policy()); EXPECT_FALSE(profile_.is_redecoding_enabled()); // Change config file - profile_.config_file_name("smartDeviceLink_invalid_boolean.ini"); + profile_.set_config_file_name("smartDeviceLink_invalid_boolean.ini"); EXPECT_EQ("smartDeviceLink_invalid_boolean.ini", profile_.config_file_name()); // Parameters after updating @@ -569,7 +569,7 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) { TEST_F(ProfileTest, CheckReadStringValue) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); std::string app_storage_folder_; @@ -586,7 +586,7 @@ TEST_F(ProfileTest, CheckReadStringValue) { TEST_F(ProfileTest, CheckReadBoolValue) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool enable_policy; @@ -600,7 +600,7 @@ TEST_F(ProfileTest, CheckReadBoolValue) { TEST_F(ProfileTest, CheckReadIntValue) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); int server_port = 0; @@ -611,7 +611,7 @@ TEST_F(ProfileTest, CheckReadIntValue) { TEST_F(ProfileTest, CheckIntContainer) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool isread = false; @@ -639,7 +639,7 @@ TEST_F(ProfileTest, CheckIntContainer) { } TEST_F(ProfileTest, CheckVectorContainer) { - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Get diag_modes after updating @@ -668,7 +668,7 @@ TEST_F(ProfileTest, CheckVectorContainer) { TEST_F(ProfileTest, CheckStringContainer) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool isread = false; @@ -697,7 +697,7 @@ TEST_F(ProfileTest, CheckStringContainer) { #ifdef ENABLE_SECURITY TEST_F(ProfileTest, CheckIntContainerInSecurityData) { // Set new config file - profile_.config_file_name("smartDeviceLink_test.ini"); + profile_.set_config_file_name("smartDeviceLink_test.ini"); EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); std::vector<int> force_unprotected_list = profile_.ReadIntContainer( @@ -724,6 +724,6 @@ TEST_F(ProfileTest, CheckIntContainerInSecurityData) { } #endif -} // namespace profile +} // namespace profile_test } // namespace components } // namespace test diff --git a/src/components/config_profile/test/smartDeviceLink.ini b/src/components/config_profile/test/smartDeviceLink.ini index 41dabaa530..6ea131b095 100644 --- a/src/components/config_profile/test/smartDeviceLink.ini +++ b/src/components/config_profile/test/smartDeviceLink.ini @@ -183,3 +183,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini index 560fb5117a..f93fa39597 100644 --- a/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini +++ b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini @@ -183,3 +183,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true
\ No newline at end of file diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_int.ini b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini index 76bcc5a0f0..9c88a8950c 100644 --- a/src/components/config_profile/test/smartDeviceLink_invalid_int.ini +++ b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini @@ -185,3 +185,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true
\ No newline at end of file diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini index 1507b2a84c..b389b0b492 100644 --- a/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini +++ b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini @@ -185,3 +185,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true
\ No newline at end of file diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_string.ini b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini index 6669b580c5..f18b43cb41 100644 --- a/src/components/config_profile/test/smartDeviceLink_invalid_string.ini +++ b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini @@ -188,3 +188,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true
\ No newline at end of file diff --git a/src/components/config_profile/test/smartDeviceLink_test.ini b/src/components/config_profile/test/smartDeviceLink_test.ini index 6e2943b569..9791544e16 100644 --- a/src/components/config_profile/test/smartDeviceLink_test.ini +++ b/src/components/config_profile/test/smartDeviceLink_test.ini @@ -190,3 +190,19 @@ ResumptionDelayBeforeIgn = 30; # Timeout in seconds to restore hmi_level for media app after sdl run ResumptionDelayAfterIgn = 30; + +[AppLaunch] +; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device +AppLaunchWaitTime = 5000 +; the number of times SDL attempts to launch an application after device connection - applied separately to each application from the given device +AppLaunchMaxRetryAttempt = 3 +; 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 +AppLaunchRetryWaitTime = 15000 +; 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 +RemoveBundleIDattempts = 3 +; the maximum number of iOS devices for which entries can be remembered by SDL +MaxNumberOfiOSDevice = 10 +; 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. +WaitTimeBetweenApps = 4000 +; App Launch on iOS devices SDL feature enabler/disabler +EnableAppLaunchIOS = true |