From 3fcfbf34c55badf082555612bc6eecd0d5a9a217 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 28 Oct 2016 15:57:30 -0400 Subject: Change deprecated readdir_r to readdir `readdir_r` is deprecated as of glibc 2.24 in favor of `readdir`. In the use cases of `readdir_r`, it can safely be replaced with `readdir`. POSIX specifies that "The pointer returned by readdir() points to data which may be overwritten by another call to readdir() on the same directory stream. This data is not overwritten by another call to readdir() on a different directory stream". Since the code does not reuse the directory stream in a way that could cause threading issues, we can safely use `readdir`. This prevents possible issues with buffer overflows in `readdir_r` and simplifies the code. --- src/components/utils/src/file_system.cc | 54 ++++----------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) (limited to 'src/components') diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc index 91ff0c3b07..2e3a815be9 100644 --- a/src/components/utils/src/file_system.cc +++ b/src/components/utils/src/file_system.cc @@ -68,24 +68,14 @@ int64_t file_system::FileSize(const std::string& path) { size_t file_system::DirectorySize(const std::string& path) { size_t size = 0; - int32_t return_code = 0; DIR* directory = NULL; -#ifndef __QNXNTO__ - struct dirent dir_element_; - struct dirent* dir_element = &dir_element_; -#else - char* direntbuffer = new char[offsetof(struct dirent, d_name) + - pathconf(path.c_str(), _PC_NAME_MAX) + 1]; - struct dirent* dir_element = new (direntbuffer) dirent; -#endif struct dirent* result = NULL; struct stat file_info = {0}; directory = opendir(path.c_str()); if (NULL != directory) { - return_code = readdir_r(directory, dir_element, &result); - for (; NULL != result && 0 == return_code; - return_code = readdir_r(directory, dir_element, &result)) { + result = readdir(directory); + for (; NULL != result; result = readdir(directory)) { if (0 == strcmp(result->d_name, "..") || 0 == strcmp(result->d_name, ".")) { continue; @@ -100,9 +90,6 @@ size_t file_system::DirectorySize(const std::string& path) { } } closedir(directory); -#ifdef __QNXNTO__ - delete[] direntbuffer; -#endif return size; } @@ -230,26 +217,15 @@ bool file_system::DeleteFile(const std::string& name) { } void file_system::remove_directory_content(const std::string& directory_name) { - int32_t return_code = 0; DIR* directory = NULL; -#ifndef __QNXNTO__ - struct dirent dir_element_; - struct dirent* dir_element = &dir_element_; -#else - char* direntbuffer = - new char[offsetof(struct dirent, d_name) + - pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1]; - struct dirent* dir_element = new (direntbuffer) dirent; -#endif struct dirent* result = NULL; directory = opendir(directory_name.c_str()); if (NULL != directory) { - return_code = readdir_r(directory, dir_element, &result); + result = readdir(directory); - for (; NULL != result && 0 == return_code; - return_code = readdir_r(directory, dir_element, &result)) { + for (; NULL != result; result = readdir(directory)) { if (0 == strcmp(result->d_name, "..") || 0 == strcmp(result->d_name, ".")) { continue; @@ -267,9 +243,6 @@ void file_system::remove_directory_content(const std::string& directory_name) { } closedir(directory); -#ifdef __QNXNTO__ - delete[] direntbuffer; -#endif } bool file_system::RemoveDirectory(const std::string& directory_name, @@ -303,25 +276,14 @@ std::vector file_system::ListFiles( return listFiles; } - int32_t return_code = 0; DIR* directory = NULL; -#ifndef __QNXNTO__ - struct dirent dir_element_; - struct dirent* dir_element = &dir_element_; -#else - char* direntbuffer = - new char[offsetof(struct dirent, d_name) + - pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1]; - struct dirent* dir_element = new (direntbuffer) dirent; -#endif struct dirent* result = NULL; directory = opendir(directory_name.c_str()); if (NULL != directory) { - return_code = readdir_r(directory, dir_element, &result); + result = readdir(directory); - for (; NULL != result && 0 == return_code; - return_code = readdir_r(directory, dir_element, &result)) { + for (; NULL != result; result = readdir(directory)) { if (0 == strcmp(result->d_name, "..") || 0 == strcmp(result->d_name, ".")) { continue; @@ -333,10 +295,6 @@ std::vector file_system::ListFiles( closedir(directory); } -#ifdef __QNXNTO__ - delete[] direntbuffer; -#endif - return listFiles; } -- cgit v1.2.1 From 35d2403e4819a6d352a86cd3484e38eb69663cb2 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 28 Oct 2016 16:25:18 -0400 Subject: Support OpenSSL built without SSL3 Many linux distros such as Debian and Arch Linux are now shipping OpenSSL libraries without SSL3 support. This commit allows the project to be still be built with security in these instances. --- .../security_manager/src/crypto_manager_impl.cc | 5 ++ .../security_manager/test/ssl_context_test.cc | 59 ++++++++++++++-------- 2 files changed, 42 insertions(+), 22 deletions(-) (limited to 'src/components') diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc index f44198953b..6d88cb9233 100644 --- a/src/components/security_manager/src/crypto_manager_impl.cc +++ b/src/components/security_manager/src/crypto_manager_impl.cc @@ -136,8 +136,13 @@ bool CryptoManagerImpl::Init() { #endif switch (get_settings().security_manager_protocol_name()) { case SSLv3: +#ifdef OPENSSL_NO_SSL3 + LOG4CXX_WARN(logger_, "OpenSSL does not support SSL3 protocol"); + return false; +#else method = is_server ? SSLv3_server_method() : SSLv3_client_method(); break; +#endif case TLSv1: method = is_server ? TLSv1_server_method() : TLSv1_client_method(); break; diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc index b35da3fc61..1c50c5833b 100644 --- a/src/components/security_manager/test/ssl_context_test.cc +++ b/src/components/security_manager/test/ssl_context_test.cc @@ -218,7 +218,7 @@ class SSLTestParam : public testing::TestWithParam { GetParam().server_ciphers_list); const bool crypto_manager_initialization = crypto_manager->Init(); - EXPECT_TRUE(crypto_manager_initialization); + ASSERT_TRUE(crypto_manager_initialization); mock_client_manager_settings_ = utils::MakeShared< NiceMock>(); @@ -231,7 +231,7 @@ class SSLTestParam : public testing::TestWithParam { GetParam().client_ciphers_list); const bool client_manager_initialization = client_manager->Init(); - EXPECT_TRUE(client_manager_initialization); + ASSERT_TRUE(client_manager_initialization); server_ctx = crypto_manager->CreateSSLContext(); client_ctx = client_manager->CreateSSLContext(); @@ -251,9 +251,12 @@ class SSLTestParam : public testing::TestWithParam { } void TearDown() OVERRIDE { - crypto_manager->ReleaseSSLContext(server_ctx); - client_manager->ReleaseSSLContext(client_ctx); - + if (crypto_manager) { + crypto_manager->ReleaseSSLContext(server_ctx); + } + if (client_manager) { + client_manager->ReleaseSSLContext(client_ctx); + } delete crypto_manager; delete client_manager; } @@ -293,10 +296,10 @@ class SSLTestParam : public testing::TestWithParam { mock_crypto_manager_settings_; utils::SharedPtr> mock_client_manager_settings_; - security_manager::CryptoManager* crypto_manager; - security_manager::CryptoManager* client_manager; - security_manager::SSLContext* server_ctx; - security_manager::SSLContext* client_ctx; + security_manager::CryptoManager* crypto_manager = NULL; + security_manager::CryptoManager* client_manager = NULL; + security_manager::SSLContext* server_ctx = NULL; + security_manager::SSLContext* client_ctx = NULL; std::string certificate_data_base64_; }; @@ -313,11 +316,15 @@ INSTANTIATE_TEST_CASE_P( ProtocolAndCipher(security_manager::TLSv1_1, security_manager::TLSv1_1, kFordCipher, - kFordCipher), + kFordCipher) +#ifndef OPENSSL_NO_SSL3 + , ProtocolAndCipher(security_manager::SSLv3, security_manager::SSLv3, kFordCipher, - kFordCipher))); + kFordCipher) +#endif + )); INSTANTIATE_TEST_CASE_P( IncorrectProtocolAndCiphers, @@ -326,18 +333,10 @@ INSTANTIATE_TEST_CASE_P( security_manager::TLSv1_1, kFordCipher, kFordCipher), - ProtocolAndCipher(security_manager::TLSv1, - security_manager::SSLv3, - kFordCipher, - kFordCipher), ProtocolAndCipher(security_manager::TLSv1_1, security_manager::TLSv1, kFordCipher, kFordCipher), - ProtocolAndCipher(security_manager::TLSv1_1, - security_manager::SSLv3, - kFordCipher, - kFordCipher), ProtocolAndCipher(security_manager::TLSv1_2, security_manager::TLSv1, kFordCipher, @@ -345,6 +344,16 @@ INSTANTIATE_TEST_CASE_P( ProtocolAndCipher(security_manager::TLSv1_2, security_manager::TLSv1_1, kFordCipher, + kFordCipher) +#ifndef OPENSSL_NO_SSL3 + , + ProtocolAndCipher(security_manager::TLSv1, + security_manager::SSLv3, + kFordCipher, + kFordCipher), + ProtocolAndCipher(security_manager::TLSv1_1, + security_manager::SSLv3, + kFordCipher, kFordCipher), ProtocolAndCipher(security_manager::TLSv1_2, security_manager::SSLv3, @@ -357,7 +366,9 @@ INSTANTIATE_TEST_CASE_P( ProtocolAndCipher(security_manager::SSLv3, security_manager::TLSv1_1, kFordCipher, - kFordCipher))); + kFordCipher) +#endif + )); TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) { ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success, @@ -510,11 +521,15 @@ INSTANTIATE_TEST_CASE_P( ProtocolAndCipher(security_manager::TLSv1_1, security_manager::TLSv1_2, kFordCipher, - kFordCipher), + kFordCipher) +#ifndef OPENSSL_NO_SSL3 + , ProtocolAndCipher(security_manager::SSLv3, security_manager::TLSv1_2, kFordCipher, - kFordCipher))); + kFordCipher) +#endif + )); TEST_P(SSLTestForTLS1_2, HandshakeFailed) { ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success, -- cgit v1.2.1 From 244f2fa05e4490883823eddd0821dd885ce38041 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 27 Mar 2018 11:06:42 -0400 Subject: Fix build failures when using GCC7 Fixes `narrowing` errors in log4cxx, as well as an incorrect return type in the security manager --- src/components/security_manager/src/ssl_context_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc index 5be5ff8363..0b30198f4c 100644 --- a/src/components/security_manager/src/ssl_context_impl.cc +++ b/src/components/security_manager/src/ssl_context_impl.cc @@ -280,7 +280,7 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData( if (ret <= 0) { is_handshake_pending_ = false; ResetConnection(); - return Handshake_Result_AbnormalFail; + return false; } } return true; -- cgit v1.2.1 From 8262c208580858e67bea58131afb8893ed549288 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Wed, 28 Mar 2018 10:50:23 -0400 Subject: Fix broken links and paths in SDD Documents Also removes some Ford-specific terms, fixes typos in these documents, and changes their naming schemes --- .../docs/FORD.OpenSDL.SDD.Security.dox | 241 --------------------- .../security_manager/docs/SDL.SDD.Security.dox | 241 +++++++++++++++++++++ .../docs/assets/sm_class_diagram.png | Bin 0 -> 368935 bytes .../docs/assets/sm_class_digram.png | Bin 368935 -> 0 bytes .../docs/assets/sm_sequence_diagram_decryption.png | Bin 0 -> 28014 bytes .../docs/assets/sm_sequence_diagram_encryption.png | Bin 0 -> 22326 bytes .../docs/assets/sm_sequence_diagram_init.png | Bin 0 -> 119018 bytes .../docs/assets/sm_sequence_diagram_verify.png | Bin 0 -> 39820 bytes .../docs/assets/sm_sequence_digram_decryption.png | Bin 28014 -> 0 bytes .../docs/assets/sm_sequence_digram_encryption.png | Bin 22326 -> 0 bytes .../docs/assets/sm_sequence_digram_init.png | Bin 119018 -> 0 bytes .../docs/assets/sm_sequence_digram_verify.png | Bin 39820 -> 0 bytes 12 files changed, 241 insertions(+), 241 deletions(-) delete mode 100644 src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox create mode 100644 src/components/security_manager/docs/SDL.SDD.Security.dox create mode 100644 src/components/security_manager/docs/assets/sm_class_diagram.png delete mode 100644 src/components/security_manager/docs/assets/sm_class_digram.png create mode 100644 src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png create mode 100644 src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png create mode 100644 src/components/security_manager/docs/assets/sm_sequence_diagram_init.png create mode 100644 src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png delete mode 100644 src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png delete mode 100644 src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png delete mode 100644 src/components/security_manager/docs/assets/sm_sequence_digram_init.png delete mode 100644 src/components/security_manager/docs/assets/sm_sequence_digram_verify.png (limited to 'src/components') diff --git a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox b/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox deleted file mode 100644 index 42da2364d3..0000000000 --- a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox +++ /dev/null @@ -1,241 +0,0 @@ -/** -\page security_manager Security Manager Detailed Design -## Table of contents -- \subpage security_manager_intoduction - + \ref security_manager_rationale "1.1 Rationale" - + \ref security_manager_scope "1.2 Scope" - + \ref security_manager_abbreviations "1.3 Abbreviations" -- \subpage security_manager_detail_design - + \ref security_manager_design_solutions "2.1 Design solutions" - + \ref security_manager_class_structure "2.2 Class Structure" - + \ref security_manager_sequence_diagram "2.3 Sequence diagram" - + \ref security_manager_state_chart "2.4 State chart diagram" -- \subpage security_manager_interfaces - + \ref security_manager_public_interfaces "3.1 Public interfaces description" - + \ref security_manager_internal_interfaces "3.2 Internal interfaces description" - + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies" -- \subpage security_manager_data_structure_resources - + \ref security_manager_data_structure "4.1 Element Data Structure" - + \ref security_manager_resources "4.2 Resource usage" -- \subpage security_manager_references_and_history - + \ref security_manager_references "5.1 References" - + \ref security_manager_history "5.2 Document history change and approve" -*/ -//----------------------------------------------------------- -/** -\page security_manager_intoduction 1 Introduction -The document is intended to support software developers, -maintenance and integration engineers with sufficient, -detailed information concerning the design, development and -deployment concepts, to accomplish their respective tasks without reliance on the authors. - -\anchor security_manager_rationale -## 1.1 Rationale -Security Manager implements SDL Architectural Solution according to: -- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#security-manager - -\anchor security_manager_scope -## 1.2 Scope -Security Manager component extracted as a separate module for -Ford channel data protection. -This components is used to: -- Provide security communications -- Protect income and outcome business layer data from interception -- Verify the relation between a mobile application certificate and its owner - -\anchor security_manager_abbreviations -## 1.3 Abbreviations -Abbreviations used in this document please find in the table below. -| Abbreviation | Expansion | -|------------------|----------------------------------| -| SSL | Secure Sockets Layer cryptographic protocol | -| TLS | Transport Layer Security cryptographic protocol | -| DTLS | Datagram TLS cryptographic protocol | - -Definitions used in this document are in the table below. - -| Definition | Description | -|---------------------------|-----------------------------------| -| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network | -*/ -//----------------------------------------------------------- -/** -\page security_manager_detail_design 2 Component detail design -\anchor security_manager_design_solutions -### 2.1 Design solutions -The following design approaches and pattern was used for Security Manager: -- Protection, creation and business logic is spitted to separates interfaces - + SecurityManager for handling Security queries from mobile side - + SSLContext provides for SSL connection establishing, encryption and decryption - + CryptoManager provides a factory for SSLContext -- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory) - used for SSLContext objects creation - + It also guaranty correctness of SSLContext destruction by the - same Compiled SecurityManager object - -#### Design description -security_manager::SSLContext is an interface for TLS connection establishing, data encryption and -decryption within this connection. -security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure, -encryption and decryption, contains handshake procedure error handling. -_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl, -which implements protocol_handler::SessionObserver interface. - -security_manager::CryptoManager is an interface for SSLContext creation and destruction, -CA certificate update and last SSL error providing. -security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides -all OpenSSL initialization logics and SSL internal structures creation. - -security_manager::SecurityManager is a Facade of security_manager component and provides -external interface for security_manager::SSLContext creation and sending security error -via control service. -security_manager::SecurityManagerImpl implements security_manager::SecurityManager and -encapsulates control service data (security internal errors, handshake data) handling. - -security_manager::SecurityManagerListener is an interface for protection result notification -to other components. -security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending -protocol layer response on handshake procedure finish. - - -\anchor security_manager_class_structure -### 2.2 Class Structure -The following UML class digram shows the component structure. -![Security Manager class diagram](sm_class_digram.png) -For more information about class digram follow: -- http://www.uml-diagrams.org/class-diagrams-overview.htqml -- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram - -\anchor security_manager_sequence_diagram -### 2.3 Sequence diagram -The following UML sequence digram shows the component dynamic behavior. -For more information about sequence digram follow: -- http://www.uml-diagrams.org/sequence-diagrams.html -- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram - -Security first initialization on session: -![Start encryption](sm_sequence_digram_init.png) - -Security initialization for service on session with already initialized security: -![Initialization](sm_sequence_digram_verify.png) - -Decryption procedure: -![Decryption](sm_sequence_digram_decryption.png) - -Encryption procedure: -![Encryption](sm_sequence_digram_encryption.png) - -\anchor security_manager_state_chart -### 2.4 State chart diagram -Not applicable for Security Manager. -*/ -//----------------------------------------------------------- -/** -\page security_manager_interfaces 3 Component Interfaces -\anchor security_manager_public_interfaces -### 3.1 Public interfaces description -Security Manager provides functionality with following interfaces: -- security_manager::SecurityManager -- security_manager::SecurityManagerListener -- security_manager::SSLContext - -\anchor security_manager_internal_interfaces -### 3.2 Internal interfaces description -The following interfaces are provided by component for internal usage only: - - security_manager::CryptoManager - - security_manager::CryptoManagerSettings - -\anchor security_manager_derived_interfaces -### 3.3 Derived interfaces and dependencies -Security Manager required following 3d-party libraries: - - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts - -The following interfaces are required by component: -- \ref src/components/include/utils Utils -- protocol_handler::ProtocolObserver for getting Protocol notifications -- implements protocol_handler::SessionObserver for providing SSLContext object managing -- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) - + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html) - - registers the available SSL/TLS ciphers and digests. - + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html) - - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX. - + [(D)TLSv1(_1/2)_(server/client)_method, ] - (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html) - - TLS/SSL connections established with these methods will understand the TLSv1 protocol. - - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages. - + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html) - - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections. - + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html) - - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0. - + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key] - (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html) - - load certificate and key data - + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html) - - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite) - + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html) - - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings. - + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html) - - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used. - + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html) - - specifies the locations for ctx, at which CA certificates for verification purposes are located. - + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html) - - get or set certificate verification status information - + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html) - - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started. - - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state. - + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html) - - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer. - + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html) - - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl - - frees up the allocated memory if the reference count has reached 0. - +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html) - - BIO allocation and freeing functions - + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html) - - BIO I/O functions -*/ -//----------------------------------------------------------- -/** -\page security_manager_data_structure_resources 4 Component data and resources -\anchor security_manager_data_structure -### 4.1 Element Data Structure -The following data types are used by the Component: - - security_manager::SecurityQuery - - protocol_handler::ProtocolPacket - -The format of certificate data exchange is: - - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512) - -\anchor security_manager_resources -### 4.2 Resource usage -Security Manager get an assess to certificate and private key -data using OpenSSl API. -*/ -//----------------------------------------------------------- -/** -\page security_manager_references_and_history 5 References and history -\anchor security_manager_references -### 5.1 References -- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/) -- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) -- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346) -- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246) -- [DTLS RFC](https://tools.ietf.org/html/rfc4347) - -\anchor security_manager_history -### 5.2 Document history -Document change history - -| Version | Data | Author/Editor | Change description | -|-------------|------------|----------------------------------------|---------------------| -| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) | - -Document approve history - -| Version | Data | Author/Editor | Change description | -|-------------|------------|-----------------------------|---------------------| -| | | | | - -For more precise document change history follow github history - -- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/security_manager_software_detailed_design.dox -- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/security_manager_software_detailed_design.dox -*/ \ No newline at end of file diff --git a/src/components/security_manager/docs/SDL.SDD.Security.dox b/src/components/security_manager/docs/SDL.SDD.Security.dox new file mode 100644 index 0000000000..ba35bc116e --- /dev/null +++ b/src/components/security_manager/docs/SDL.SDD.Security.dox @@ -0,0 +1,241 @@ +/** +\page security_manager Security Manager Detailed Design +## Table of contents +- \subpage security_manager_intoduction + + \ref security_manager_rationale "1.1 Rationale" + + \ref security_manager_scope "1.2 Scope" + + \ref security_manager_abbreviations "1.3 Abbreviations" +- \subpage security_manager_detail_design + + \ref security_manager_design_solutions "2.1 Design solutions" + + \ref security_manager_class_structure "2.2 Class Structure" + + \ref security_manager_sequence_diagram "2.3 Sequence diagram" + + \ref security_manager_state_chart "2.4 State chart diagram" +- \subpage security_manager_interfaces + + \ref security_manager_public_interfaces "3.1 Public interfaces description" + + \ref security_manager_internal_interfaces "3.2 Internal interfaces description" + + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies" +- \subpage security_manager_data_structure_resources + + \ref security_manager_data_structure "4.1 Element Data Structure" + + \ref security_manager_resources "4.2 Resource usage" +- \subpage security_manager_references_and_history + + \ref security_manager_references "5.1 References" + + \ref security_manager_history "5.2 Document history change and approve" +*/ +//----------------------------------------------------------- +/** +\page security_manager_intoduction 1 Introduction +The document is intended to support software developers, +maintenance and integration engineers with sufficient, +detailed information concerning the design, development and +deployment concepts, to accomplish their respective tasks without reliance on the authors. + +\anchor security_manager_rationale +## 1.1 Rationale +Security Manager implements SDL Architectural Solution according to: +- https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/#security-manager + +\anchor security_manager_scope +## 1.2 Scope +Security Manager component extracted as a separate module for +SDL channel data protection. +This components is used to: +- Provide security communications +- Protect income and outcome business layer data from interception +- Verify the relation between a mobile application certificate and its owner + +\anchor security_manager_abbreviations +## 1.3 Abbreviations +Abbreviations used in this document please find in the table below. +| Abbreviation | Expansion | +|------------------|----------------------------------| +| SSL | Secure Sockets Layer cryptographic protocol | +| TLS | Transport Layer Security cryptographic protocol | +| DTLS | Datagram TLS cryptographic protocol | + +Definitions used in this document are in the table below. + +| Definition | Description | +|---------------------------|-----------------------------------| +| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network | +*/ +//----------------------------------------------------------- +/** +\page security_manager_detail_design 2 Component detail design +\anchor security_manager_design_solutions +### 2.1 Design solutions +The following design approaches and pattern was used for Security Manager: +- Protection, creation and business logic is spitted to separates interfaces + + SecurityManager for handling Security queries from mobile side + + SSLContext provides for SSL connection establishing, encryption and decryption + + CryptoManager provides a factory for SSLContext +- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory) + used for SSLContext objects creation + + It also guaranty correctness of SSLContext destruction by the + same Compiled SecurityManager object + +#### Design description +security_manager::SSLContext is an interface for TLS connection establishing, data encryption and +decryption within this connection. +security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure, +encryption and decryption, contains handshake procedure error handling. +_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl, +which implements protocol_handler::SessionObserver interface. + +security_manager::CryptoManager is an interface for SSLContext creation and destruction, +CA certificate update and last SSL error providing. +security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides +all OpenSSL initialization logics and SSL internal structures creation. + +security_manager::SecurityManager is a Facade of security_manager component and provides +external interface for security_manager::SSLContext creation and sending security error +via control service. +security_manager::SecurityManagerImpl implements security_manager::SecurityManager and +encapsulates control service data (security internal errors, handshake data) handling. + +security_manager::SecurityManagerListener is an interface for protection result notification +to other components. +security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending +protocol layer response on handshake procedure finish. + + +\anchor security_manager_class_structure +### 2.2 Class Structure +The following UML class diagram shows the component structure. +![Security Manager class diagram](sm_class_diagram.png) +For more information about class diagram follow: +- http://www.uml-diagrams.org/class-diagrams-overview.htqml +- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram + +\anchor security_manager_sequence_diagram +### 2.3 Sequence diagram +The following UML sequence diagram shows the component dynamic behavior. +For more information about sequence diagram follow: +- http://www.uml-diagrams.org/sequence-diagrams.html +- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram + +Security first initialization on session: +![Start encryption](sm_sequence_diagram_init.png) + +Security initialization for service on session with already initialized security: +![Initialization](sm_sequence_diagram_verify.png) + +Decryption procedure: +![Decryption](sm_sequence_diagram_decryption.png) + +Encryption procedure: +![Encryption](sm_sequence_diagram_encryption.png) + +\anchor security_manager_state_chart +### 2.4 State chart diagram +Not applicable for Security Manager. +*/ +//----------------------------------------------------------- +/** +\page security_manager_interfaces 3 Component Interfaces +\anchor security_manager_public_interfaces +### 3.1 Public interfaces description +Security Manager provides functionality with following interfaces: +- security_manager::SecurityManager +- security_manager::SecurityManagerListener +- security_manager::SSLContext + +\anchor security_manager_internal_interfaces +### 3.2 Internal interfaces description +The following interfaces are provided by component for internal usage only: + - security_manager::CryptoManager + - security_manager::CryptoManagerSettings + +\anchor security_manager_derived_interfaces +### 3.3 Derived interfaces and dependencies +Security Manager required following 3d-party libraries: + - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts + +The following interfaces are required by component: +- \ref src/components/include/utils Utils +- protocol_handler::ProtocolObserver for getting Protocol notifications +- implements protocol_handler::SessionObserver for providing SSLContext object managing +- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) + + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html) + - registers the available SSL/TLS ciphers and digests. + + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html) + - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX. + + [(D)TLSv1(_1/2)_(server/client)_method, ] + (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html) + - TLS/SSL connections established with these methods will understand the TLSv1 protocol. + - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages. + + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html) + - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections. + + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html) + - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0. + + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key] + (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html) + - load certificate and key data + + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html) + - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite) + + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html) + - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings. + + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html) + - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used. + + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html) + - specifies the locations for ctx, at which CA certificates for verification purposes are located. + + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html) + - get or set certificate verification status information + + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html) + - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started. + - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state. + + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html) + - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer. + + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html) + - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl + - frees up the allocated memory if the reference count has reached 0. + +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html) + - BIO allocation and freeing functions + + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html) + - BIO I/O functions +*/ +//----------------------------------------------------------- +/** +\page security_manager_data_structure_resources 4 Component data and resources +\anchor security_manager_data_structure +### 4.1 Element Data Structure +The following data types are used by the Component: + - security_manager::SecurityQuery + - protocol_handler::ProtocolPacket + +The format of certificate data exchange is: + - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512) + +\anchor security_manager_resources +### 4.2 Resource usage +Security Manager get an assess to certificate and private key +data using OpenSSl API. +*/ +//----------------------------------------------------------- +/** +\page security_manager_references_and_history 5 References and history +\anchor security_manager_references +### 5.1 References +- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/) +- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) +- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346) +- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246) +- [DTLS RFC](https://tools.ietf.org/html/rfc4347) + +\anchor security_manager_history +### 5.2 Document history +Document change history + +| Version | Data | Author/Editor | Change description | +|-------------|------------|----------------------------------------|---------------------| +| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) | + +Document approve history + +| Version | Data | Author/Editor | Change description | +|-------------|------------|-----------------------------|---------------------| +| | | | | + +For more precise document change history follow github history - +- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/SDL.SDD.Security.dox +- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/SDL.SDD.Security.dox +*/ \ No newline at end of file diff --git a/src/components/security_manager/docs/assets/sm_class_diagram.png b/src/components/security_manager/docs/assets/sm_class_diagram.png new file mode 100644 index 0000000000..61e300f4e7 Binary files /dev/null and b/src/components/security_manager/docs/assets/sm_class_diagram.png differ diff --git a/src/components/security_manager/docs/assets/sm_class_digram.png b/src/components/security_manager/docs/assets/sm_class_digram.png deleted file mode 100644 index 61e300f4e7..0000000000 Binary files a/src/components/security_manager/docs/assets/sm_class_digram.png and /dev/null differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png new file mode 100644 index 0000000000..849fe45b88 Binary files /dev/null and b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png new file mode 100644 index 0000000000..66dffd265e Binary files /dev/null and b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png new file mode 100644 index 0000000000..334b42b258 Binary files /dev/null and b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png new file mode 100644 index 0000000000..cb040c918b Binary files /dev/null and b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png deleted file mode 100644 index 849fe45b88..0000000000 Binary files a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png and /dev/null differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png deleted file mode 100644 index 66dffd265e..0000000000 Binary files a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png and /dev/null differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png b/src/components/security_manager/docs/assets/sm_sequence_digram_init.png deleted file mode 100644 index 334b42b258..0000000000 Binary files a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png and /dev/null differ diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png deleted file mode 100644 index cb040c918b..0000000000 Binary files a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png and /dev/null differ -- cgit v1.2.1 From d42cfe8434ade15c75c07427f53a1cc70cd79c49 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 29 Mar 2018 10:56:18 -0400 Subject: Fix EventDispatcher crash by rejecting duplicate correlation_ids --- src/components/application_manager/src/request_controller.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index 1b9bd7ffb9..a6d78f24de 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -474,7 +474,15 @@ void RequestController::Worker::threadMain() { RequestInfoPtr request_info_ptr = utils::MakeShared(request_ptr, timeout_in_mseconds); - request_controller_->waiting_for_response_.Add(request_info_ptr); + if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) { + commands::CommandRequestImpl* cmd_request = + dynamic_cast(request_ptr.get()); + if (cmd_request != NULL) { + cmd_request->SendResponse( + false, mobile_apis::Result::INVALID_ID, "Duplicate correlation_id"); + } + continue; + } LOG4CXX_DEBUG(logger_, "timeout_in_mseconds " << timeout_in_mseconds); if (0 != timeout_in_mseconds) { -- cgit v1.2.1 From b33bffd77d428d59612c9fc3267767d21542579d Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 29 Mar 2018 16:37:26 -0400 Subject: Add test case for duplicate correlation_ids --- .../request_controller/request_controller_test.cc | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc index e053d51c34..c2912fdc0b 100644 --- a/src/components/application_manager/test/request_controller/request_controller_test.cc +++ b/src/components/application_manager/test/request_controller/request_controller_test.cc @@ -62,6 +62,7 @@ using ::application_manager::request_controller::RequestInfo; using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; +using ::testing::_; typedef NiceMock MRequest; typedef utils::SharedPtr RequestPtr; @@ -114,6 +115,7 @@ class RequestControllerTestClass : public ::testing::Test { RequestPtr output = utils::MakeShared(connection_key, correlation_id); ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout)); + ON_CALL(*output, CheckPermissions()).WillByDefault(Return(true)); return output; } @@ -158,6 +160,40 @@ class RequestControllerTestClass : public ::testing::Test { const TestSettings default_settings_; }; +TEST_F(RequestControllerTestClass, + AddMobileRequest_DuplicateCorrelationId_INVALID_ID) { + RequestPtr request_valid = GetMockRequest(); + TestAsyncWaiter waiter_valid; + ON_CALL(*request_valid, default_timeout()).WillByDefault(Return(0)); + EXPECT_CALL(*request_valid, Init()).WillOnce(Return(true)); + EXPECT_CALL(*request_valid, Run()) + .Times(1) + .WillRepeatedly(NotifyTestAsyncWaiter(&waiter_valid)); + + EXPECT_EQ(RequestController::SUCCESS, + AddRequest(default_settings_, + request_valid, + RequestInfo::RequestType::MobileRequest, + mobile_apis::HMILevel::HMI_NONE)); + EXPECT_TRUE(waiter_valid.WaitFor(1, 1000)); + + // The command should not be run if another command with the same + // correlation_id is waiting for a response + RequestPtr request_dup_corr_id = GetMockRequest(); + TestAsyncWaiter waiter_dup; + ON_CALL(*request_dup_corr_id, default_timeout()).WillByDefault(Return(0)); + EXPECT_CALL(*request_dup_corr_id, Init()).WillOnce(Return(true)); + ON_CALL(*request_dup_corr_id, Run()) + .WillByDefault(NotifyTestAsyncWaiter(&waiter_dup)); + + EXPECT_EQ(RequestController::SUCCESS, + AddRequest(default_settings_, + request_dup_corr_id, + RequestInfo::RequestType::MobileRequest, + mobile_apis::HMILevel::HMI_NONE)); + EXPECT_FALSE(waiter_dup.WaitFor(1, 1000)); +} + TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_ZeroValueLimiters_SUCCESS) { // Test case than pending_requests_amount, -- cgit v1.2.1 From 230ad92b9a83797c80bbc29a03b3fe66f7a9a13b Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 4 Apr 2018 14:43:00 -0400 Subject: Additional fixes for 2072 When loading the policy table from backup sql file, service types must be read in a strings. --- .../policy/policy_external/src/sql_pt_representation.cc | 8 ++++---- src/components/utils/test/policy.sql | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/components') diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 6cc68cb102..4315d99b3a 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -559,10 +559,10 @@ void SQLPTRepresentation::GatherModuleConfig( LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints"); } else { while (endpoints.Next()) { - std::stringstream stream; - stream << "0x0" << endpoints.GetInteger(1); - config->endpoints[stream.str()][endpoints.GetString(2)].push_back( - endpoints.GetString(0)); + const std::string& url = endpoints.GetString(0); + const std::string& service = endpoints.GetString(1); + const std::string& app_id = endpoints.GetString(2); + config->endpoints[service][app_id].push_back(url); } } diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql index 292855734e..d588d695a6 100644 --- a/src/components/utils/test/policy.sql +++ b/src/components/utils/test/policy.sql @@ -263,7 +263,7 @@ BEGIN TRANSACTION; CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx` ON `consent_group`(`functional_group_id`); CREATE TABLE IF NOT EXISTS `endpoint`( - `service` INTEGER NOT NULL, + `service` VARCHAR(100) NOT NULL, `url` VARCHAR(100) NOT NULL, `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, CONSTRAINT `fk_endpoint_application1` -- cgit v1.2.1 From 07c274fb775f5400f1fe5bd1ae1ed742aaf84604 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 4 Apr 2018 16:42:49 -0400 Subject: Add license to new message broker files --- .../include/hmi_message_handler/mb_controller.h | 30 +++++++++++++++++++++ .../hmi_message_handler/websocket_session.h | 30 +++++++++++++++++++++ .../hmi_message_handler/src/mb_controller.cc | 31 +++++++++++++++++++++- .../hmi_message_handler/src/websocket_session.cc | 30 +++++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h index 98d5260259..1bd74e09ea 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h @@ -1,3 +1,33 @@ +/* +Copyright (c) 2018 Livio, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #ifndef MB_CONTROLLER_H #define MB_CONTROLLER_H diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h index c084bd7769..5d82a35679 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h @@ -1,3 +1,33 @@ +/* +Copyright (c) 2018 Livio, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #ifndef WEBSOCKET_SESSION_H #define WEBSOCKET_SESSION_H diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc index ec0d1f8bd8..df3c3f16b2 100644 --- a/src/components/hmi_message_handler/src/mb_controller.cc +++ b/src/components/hmi_message_handler/src/mb_controller.cc @@ -1,4 +1,33 @@ - +/* +Copyright (c) 2018 Livio, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #include "hmi_message_handler/mb_controller.h" using namespace boost::beast::websocket; diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc index 19227a1555..0327500a11 100644 --- a/src/components/hmi_message_handler/src/websocket_session.cc +++ b/src/components/hmi_message_handler/src/websocket_session.cc @@ -1,3 +1,33 @@ +/* +Copyright (c) 2018 Livio, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #include "hmi_message_handler/websocket_session.h" #include "hmi_message_handler/mb_controller.h" #include -- cgit v1.2.1 From 70953440b8bca01bd63eaeba3db47e4f9fe64454 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Tue, 27 Mar 2018 03:35:24 +0900 Subject: Fix/unregister while audio pass thru (#1757) * fix build error in MockMediaManager * Add SetMockMediaManager * add AudioPassThru start/stop tests * Add new BeginAudioPassThru() and EndAudioPassThru() methods * fix: don't terminate AudioPassThru when another app is unregistered * Append DEPRECATED macro only in interface header file and mock file. * Use @deprecated comments --- .../application_manager/application_manager_impl.h | 25 +++++ .../src/application_manager_impl.cc | 31 +++++- .../commands/mobile/end_audio_pass_thru_request.cc | 5 +- .../mobile/perform_audio_pass_thru_request.cc | 8 +- .../test/application_manager_impl_test.cc | 117 +++++++++++++++++++++ .../mobile/end_audio_pass_thru_request_test.cc | 3 +- .../mobile/perform_audio_pass_thru_test.cc | 41 +++++--- .../application_manager/application_manager.h | 21 +++- .../application_manager/mock_application_manager.h | 6 +- .../test/media_manager/mock_media_manager.h | 2 +- 10 files changed, 234 insertions(+), 25 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 3e7fab60fb..286ad87018 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -478,18 +478,35 @@ class ApplicationManagerImpl uint32_t GetNextHMICorrelationID() OVERRIDE; /* @brief Starts audio passthru process + * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead * * @return true on success, false if passthru is already in process */ bool BeginAudioPassThrough() OVERRIDE; + /** + * @brief Starts AudioPassThru process by given application + * @param app_id ID of the application which starts the process + * @return true if AudioPassThru can be started, false otherwise + */ + bool BeginAudioPassThru(uint32_t app_id) OVERRIDE; + /* * @brief Finishes already started audio passthru process + * @deprecated Use EndAudioPassThru(uint32_t app_id) instead * * @return true on success, false if passthru is not active */ bool EndAudioPassThrough() OVERRIDE; + /** + * @brief Finishes already started AudioPassThru process by given application + * @param app_id ID of the application which started the process + * @return true if AudioPassThru process has been started with given + * application and thus it can be stopped, false otherwise + */ + bool EndAudioPassThru(uint32_t app_id) OVERRIDE; + /* * @brief Retrieves driver distraction state * @@ -1702,6 +1719,7 @@ class ApplicationManagerImpl std::map tts_global_properties_app_list_; bool audio_pass_thru_active_; + uint32_t audio_pass_thru_app_id_; sync_primitives::Lock audio_pass_thru_lock_; sync_primitives::Lock tts_global_properties_app_list_lock_; hmi_apis::Common_DriverDistractionState::eType driver_distraction_state_; @@ -1820,6 +1838,13 @@ class ApplicationManagerImpl */ void AddMockApplication(ApplicationSharedPtr mock_app); + /** + * @brief set a mock media manager without running Init(). Only for unit + * testing. + * @param mock_app the mock app to be registered + */ + void SetMockMediaManager(media_manager::MediaManager* mock_media_manager); + private: #endif diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index f16c21ea84..248b54fee5 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -143,6 +143,7 @@ ApplicationManagerImpl::ApplicationManagerImpl( : settings_(am_settings) , applications_list_lock_(true) , audio_pass_thru_active_(false) + , audio_pass_thru_app_id_(0) , driver_distraction_state_( hmi_apis::Common_DriverDistractionState::INVALID_ENUM) , is_vr_session_strated_(false) @@ -784,6 +785,17 @@ bool ApplicationManagerImpl::BeginAudioPassThrough() { } } +bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) { + sync_primitives::AutoLock lock(audio_pass_thru_lock_); + if (audio_pass_thru_active_) { + return false; + } else { + audio_pass_thru_active_ = true; + audio_pass_thru_app_id_ = app_id; + return true; + } +} + bool ApplicationManagerImpl::EndAudioPassThrough() { sync_primitives::AutoLock lock(audio_pass_thru_lock_); if (audio_pass_thru_active_) { @@ -794,6 +806,17 @@ bool ApplicationManagerImpl::EndAudioPassThrough() { } } +bool ApplicationManagerImpl::EndAudioPassThru(uint32_t app_id) { + sync_primitives::AutoLock lock(audio_pass_thru_lock_); + if (audio_pass_thru_active_ && audio_pass_thru_app_id_ == app_id) { + audio_pass_thru_active_ = false; + audio_pass_thru_app_id_ = 0; + return true; + } else { + return false; + } +} + hmi_apis::Common_DriverDistractionState::eType ApplicationManagerImpl::driver_distraction_state() const { return driver_distraction_state_; @@ -3222,9 +3245,8 @@ void ApplicationManagerImpl::UnregisterApplication( commands_holder_->Clear(app_to_remove); - if (audio_pass_thru_active_) { + if (EndAudioPassThru(app_id)) { // May be better to put this code in MessageHelper? - EndAudioPassThrough(); StopAudioPassThru(app_id); MessageHelper::SendStopAudioPathThru(*this); } @@ -4441,6 +4463,11 @@ void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) { apps_size_ = applications_.size(); applications_list_lock_.Release(); } + +void ApplicationManagerImpl::SetMockMediaManager( + media_manager::MediaManager* mock_media_manager) { + media_manager_ = mock_media_manager; +} #endif // BUILD_TESTS #ifdef SDL_REMOTE_CONTROL struct MobileAppIdPredicate { diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc index 0bd83078e5..fb168e4256 100644 --- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc @@ -66,9 +66,10 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) { const bool result = PrepareResultForMobileResponse( result_code, HmiInterfaces::HMI_INTERFACE_UI); if (result) { - bool ended_successfully = application_manager_.EndAudioPassThrough(); + uint32_t app_id = connection_key(); + bool ended_successfully = application_manager_.EndAudioPassThru(app_id); if (ended_successfully) { - application_manager_.StopAudioPassThru(connection_key()); + application_manager_.StopAudioPassThru(app_id); } } diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc index a05d41c098..20076ac50c 100644 --- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc @@ -311,7 +311,8 @@ void PerformAudioPassThruRequest::SendRecordStartNotification() { void PerformAudioPassThruRequest::StartMicrophoneRecording() { LOG4CXX_AUTO_TRACE(logger_); - application_manager_.BeginAudioPassThrough(); + uint32_t app_id = connection_key(); + application_manager_.BeginAudioPassThru(app_id); application_manager_.StartAudioPassThruThread( connection_key(), @@ -370,9 +371,10 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { void PerformAudioPassThruRequest::FinishTTSSpeak() { LOG4CXX_AUTO_TRACE(logger_); - if (application_manager_.EndAudioPassThrough()) { + uint32_t app_id = connection_key(); + if (application_manager_.EndAudioPassThru(app_id)) { LOG4CXX_DEBUG(logger_, "Stop AudioPassThru."); - application_manager_.StopAudioPassThru(connection_key()); + application_manager_.StopAudioPassThru(app_id); } if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) { LOG4CXX_WARN(logger_, "TTS Speak is inactive."); 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 e54bc612ca..c922c227bb 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -47,6 +47,7 @@ #include "application_manager/test/include/application_manager/mock_message_helper.h" #include "connection_handler/mock_connection_handler.h" #include "hmi_message_handler/mock_hmi_message_handler.h" +#include "media_manager/mock_media_manager.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol/bson_object_keys.h" @@ -824,6 +825,122 @@ TEST_F(ApplicationManagerImplTest, EXPECT_EQ(new_application_id, app_impl->app_id()); } +TEST_F(ApplicationManagerImplTest, StartStopAudioPassThru) { + std::string dummy_file_name; + ON_CALL(mock_application_manager_settings_, recording_file_name()) + .WillByDefault(ReturnRef(dummy_file_name)); + + NiceMock + mock_media_manager; + app_manager_impl_->SetMockMediaManager(&mock_media_manager); + + const uint32_t app_id = 65537; + const int32_t max_duration = 1000; + // below are not used + const int32_t correlation_id = 0; + const int32_t sampling_rate = 0; + const int32_t bits_per_sample = 0; + const int32_t audio_type = 0; + + EXPECT_CALL(mock_media_manager, + StartMicrophoneRecording(app_id, _, max_duration)) + .WillOnce(Return()); + EXPECT_CALL(mock_media_manager, StopMicrophoneRecording(app_id)) + .WillOnce(Return()); + + bool result = app_manager_impl_->BeginAudioPassThru(app_id); + EXPECT_TRUE(result); + if (result) { + app_manager_impl_->StartAudioPassThruThread(app_id, + correlation_id, + max_duration, + sampling_rate, + bits_per_sample, + audio_type); + } + + result = app_manager_impl_->EndAudioPassThru(app_id); + EXPECT_TRUE(result); + if (result) { + app_manager_impl_->StopAudioPassThru(app_id); + } +} + +TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) { + std::string dummy_file_name; + ON_CALL(mock_application_manager_settings_, recording_file_name()) + .WillByDefault(ReturnRef(dummy_file_name)); + + const uint32_t app_id_1 = 65537; + const uint32_t app_id_2 = 65538; + + std::string dummy_mac_address; + utils::SharedPtr mock_app_1 = + utils::SharedPtr(new MockApplication()); + EXPECT_CALL(*mock_app_1, app_id()).WillRepeatedly(Return(app_id_1)); + EXPECT_CALL(*mock_app_1, device()).WillRepeatedly(Return(0)); + EXPECT_CALL(*mock_app_1, mac_address()) + .WillRepeatedly(ReturnRef(dummy_mac_address)); + EXPECT_CALL(*mock_app_1, policy_app_id()).WillRepeatedly(Return("")); + EXPECT_CALL(*mock_app_1, protocol_version()) + .WillRepeatedly( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)); + + utils::SharedPtr mock_app_2 = + utils::SharedPtr(new MockApplication()); + EXPECT_CALL(*mock_app_2, app_id()).WillRepeatedly(Return(app_id_2)); + EXPECT_CALL(*mock_app_2, device()).WillRepeatedly(Return(0)); + EXPECT_CALL(*mock_app_2, mac_address()) + .WillRepeatedly(ReturnRef(dummy_mac_address)); + EXPECT_CALL(*mock_app_2, policy_app_id()).WillRepeatedly(Return("")); + EXPECT_CALL(*mock_app_2, protocol_version()) + .WillRepeatedly( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)); + + NiceMock + mock_media_manager; + app_manager_impl_->SetMockMediaManager(&mock_media_manager); + + app_manager_impl_->AddMockApplication(mock_app_1); + app_manager_impl_->AddMockApplication(mock_app_2); + + const int32_t max_duration = 1000; + // below are not used + const int32_t correlation_id = 0; + const int32_t sampling_rate = 0; + const int32_t bits_per_sample = 0; + const int32_t audio_type = 0; + + EXPECT_CALL(mock_media_manager, + StartMicrophoneRecording(app_id_2, _, max_duration)) + .WillOnce(Return()); + EXPECT_CALL(mock_media_manager, StopMicrophoneRecording(app_id_2)) + .WillOnce(Return()); + + // app 2 starts Audio Pass Thru + bool result = app_manager_impl_->BeginAudioPassThru(app_id_2); + EXPECT_TRUE(result); + if (result) { + app_manager_impl_->StartAudioPassThruThread(app_id_2, + correlation_id, + max_duration, + sampling_rate, + bits_per_sample, + audio_type); + } + + // while running APT, app 1 is unregistered + app_manager_impl_->UnregisterApplication( + app_id_1, mobile_apis::Result::SUCCESS, false, true); + + // confirm that APT is still running + result = app_manager_impl_->EndAudioPassThru(app_id_2); + EXPECT_TRUE(result); + if (result) { + app_manager_impl_->StopAudioPassThru(app_id_2); + } +} + } // application_manager_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc index 33733f63ed..6b1d909121 100644 --- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -67,6 +67,7 @@ class EndAudioPassThruRequestTest TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { const uint32_t kConnectionKey = 2u; + const uint32_t app_id = kConnectionKey; MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::params][am::strings::connection_key] = @@ -83,7 +84,7 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { Event event(hmi_apis::FunctionID::UI_EndAudioPassThru); event.set_smart_object(*event_msg); - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false)); MessageSharedPtr ui_command_result; EXPECT_CALL( diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc index 6c35a5372a..a27bac970c 100644 --- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -128,6 +128,8 @@ class PerformAudioPassThruRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); + (*message_)[am::strings::params][am::strings::connection_key] = + kConnectionKey; command_sptr_ = CreateCommand(message_); @@ -160,10 +162,15 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) { am::mobile_api::Result::GENERIC_ERROR; (*msg_ui)[am::strings::msg_params][am::strings::success] = false; + MessageSharedPtr message = + utils::MakeShared(::smart_objects::SmartType_Map); + (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey; + utils::SharedPtr command = - CreateCommand(); + CreateCommand(message); - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL(app_mngr_, StopAudioPassThru(_)); EXPECT_CALL( @@ -232,7 +239,8 @@ TEST_F(PerformAudioPassThruRequestTest, event_ui.set_smart_object(*response_ui); MessageSharedPtr response_to_mobile; - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true)); EXPECT_CALL( app_mngr_, @@ -362,7 +370,8 @@ TEST_F(PerformAudioPassThruRequestTest, hmi_apis::Common_Result::GENERIC_ERROR; event.set_smart_object(*message_); - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); @@ -536,7 +545,8 @@ TEST_F( } // Start microphone recording cals - EXPECT_CALL(app_mngr_, BeginAudioPassThrough()); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)); EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _)); CallRun caller(*command_sptr_); @@ -581,7 +591,8 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); // Start microphone recording cals - EXPECT_CALL(app_mngr_, BeginAudioPassThrough()); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)); EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _)); EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); @@ -617,7 +628,8 @@ TEST_F(PerformAudioPassThruRequestTest, caller_speak(); // Second call for test correct behavior of UI_PerformAudioPassThru event - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false)); EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0); ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); @@ -641,7 +653,8 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); - EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL( app_mngr_, @@ -664,8 +677,9 @@ TEST_F(PerformAudioPassThruRequestTest, msg_params_[am::strings::connection_key] = kConnectionKey; msg_params_[am::strings::function_id] = kFunctionId; + uint32_t app_id = kConnectionKey; EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); - EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true)); + EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL( app_mngr_, @@ -683,8 +697,9 @@ TEST_F(PerformAudioPassThruRequestTest, TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) { am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM); + uint32_t app_id = kConnectionKey; EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).Times(0); + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0); CallOnEvent caller(*command_sptr_, event); caller(); @@ -703,7 +718,8 @@ TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) { TEST_F(PerformAudioPassThruRequestTest, onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) { - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL(app_mngr_, StopAudioPassThru(_)); // For setting current_state_ -> kCompleted @@ -717,7 +733,8 @@ TEST_F(PerformAudioPassThruRequestTest, TEST_F(PerformAudioPassThruRequestTest, DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) { - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true)); + uint32_t app_id = kConnectionKey; + EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL(app_mngr_, StopAudioPassThru(_)); EXPECT_CALL(*application_sptr_, hmi_level()) diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index eb9159f0b3..c7a50199b1 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -390,17 +390,34 @@ class ApplicationManager { virtual void EndNaviServices(uint32_t app_id) = 0; /* @brief Starts audio passthru process + * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead * * @return true on success, false if passthru is already in process */ - virtual bool BeginAudioPassThrough() = 0; + DEPRECATED virtual bool BeginAudioPassThrough() = 0; + + /** + * @brief Starts AudioPassThru process by given application + * @param app_id ID of the application which starts the process + * @return true if AudioPassThru can be started, false otherwise + */ + virtual bool BeginAudioPassThru(uint32_t app_id) = 0; /* * @brief Finishes already started audio passthru process + * @deprecated Use EndAudioPassThru(uint32_t app_id) instead * * @return true on success, false if passthru is not active */ - virtual bool EndAudioPassThrough() = 0; + DEPRECATED virtual bool EndAudioPassThrough() = 0; + + /** + * @brief Finishes already started AudioPassThru process by given application + * @param app_id ID of the application which started the process + * @return true if AudioPassThru process has been started with given + * application and thus it can be stopped, false otherwise + */ + virtual bool EndAudioPassThru(uint32_t app_id) = 0; virtual void ConnectToDevice(const std::string& device_mac) = 0; diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 58edcb637a..452a1e6c39 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -161,8 +161,10 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(GetNextHMICorrelationID, uint32_t()); MOCK_METHOD0(GenerateNewHMIAppID, uint32_t()); MOCK_METHOD1(EndNaviServices, void(uint32_t app_id)); - MOCK_METHOD0(BeginAudioPassThrough, bool()); - MOCK_METHOD0(EndAudioPassThrough, bool()); + DEPRECATED MOCK_METHOD0(BeginAudioPassThrough, bool()); + MOCK_METHOD1(BeginAudioPassThru, bool(uint32_t app_id)); + DEPRECATED MOCK_METHOD0(EndAudioPassThrough, bool()); + MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id)); MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac)); MOCK_METHOD0(OnHMIStartedCooperation, void()); MOCK_CONST_METHOD0(IsHMICooperating, bool()); diff --git a/src/components/include/test/media_manager/mock_media_manager.h b/src/components/include/test/media_manager/mock_media_manager.h index 9cd2a05fc0..b58cfab5d7 100644 --- a/src/components/include/test/media_manager/mock_media_manager.h +++ b/src/components/include/test/media_manager/mock_media_manager.h @@ -56,7 +56,7 @@ class MockMediaManager : public media_manager::MediaManager { protocol_handler::ServiceType service_type)); MOCK_METHOD2(FramesProcessed, void(int32_t application_key, int32_t frame_number)); - MOCK_CONST_METHOD0(settings, const MediaManagerSettings&()); + MOCK_CONST_METHOD0(settings, const media_manager::MediaManagerSettings&()); }; } // namespace media_manager_test -- cgit v1.2.1 From bdc1036bf8f28cae61e4ff676dc0a82a09d2f28b Mon Sep 17 00:00:00 2001 From: vkushnirenko-luxoft Date: Fri, 6 Apr 2018 10:07:25 +0300 Subject: Fix style after 4.5 merge --- .../policy/policy_external/src/policy_manager_impl.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/components') diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 2cd0d2b23b..122efa2435 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -588,8 +588,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, policy_table::FunctionalGroupings functional_groupings; cache_->GetFunctionalGroupings(functional_groupings); - policy_table::Strings app_groups = - GetGroupsNames(app_group_permissions); + policy_table::Strings app_groups = GetGroupsNames(app_group_permissions); // Undefined groups (without user consent) disallowed by default, since // OnPermissionsChange notification has no "undefined" section @@ -621,8 +620,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, } const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc); - LOG4CXX_DEBUG(logger_, "Is known rpc " << - (known_rpc ? "true" : "false") ); + LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false")); if (!known_rpc) { // RPC not found in list == disallowed by backend result.hmi_level_permitted = kRpcDisallowed; @@ -644,7 +642,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find( hmi_level)) { // RPC found in allowed == allowed by backend, but disallowed by user - LOG4CXX_DEBUG(logger_, "RPC found in allowed == allowed by backend, but disallowed by user"); + LOG4CXX_DEBUG( + logger_, + "RPC found in allowed == allowed by backend, but disallowed by user"); result.hmi_level_permitted = kRpcUserDisallowed; } else { LOG4CXX_DEBUG(logger_, @@ -984,7 +984,6 @@ void PolicyManagerImpl::SetUserConsentForApp( const PermissionConsent& permissions, const NotificationMode mode) { LOG4CXX_AUTO_TRACE(logger_); - cache_->ResetCalculatedPermissions(); PermissionConsent verified_permissions = EnsureCorrectPermissionConsent(permissions); -- cgit v1.2.1 From e15e3537c9fa898b6e6142ff01e75d23391f959a Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 5 Apr 2018 14:18:49 -0400 Subject: Don't force a PTU when an invalid PT is received --- .../application_manager/src/policies/policy_handler.cc | 3 +-- src/components/application_manager/test/policy_handler_test.cc | 1 - .../policy/policy_external/src/policy_manager_impl.cc | 10 ++++++++-- .../policy/policy_regular/src/policy_manager_impl.cc | 10 ++++++++-- 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index bbf391a9f1..559b9c0035 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1091,8 +1091,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file, MessageHelper::CreateGetVehicleDataRequest( correlation_id, vehicle_data_args, application_manager_); } else { - LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one."); - policy_manager_->ForcePTExchange(); + LOG4CXX_WARN(logger_, "Exchange wasn't successful"); } OnPTUFinished(ret); return ret; diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 77500fd238..d9e1cefa01 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -408,7 +408,6 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) { // Checks EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false)); - EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return("")); EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0); EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _)) .Times(0); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 2cd0d2b23b..aefd630b25 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -313,7 +313,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -327,7 +330,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 39b303cbb5..3e08147a4c 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -196,7 +196,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, utils::SharedPtr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { - LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); + LOG4CXX_ERROR( + logger_, + "Failed to create snapshot of policy table, trying another exchange"); + ForcePTExchange(); return false; } @@ -209,7 +212,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Replace current data with updated if (!cache_->ApplyUpdate(*pt_update)) { - LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table."); + LOG4CXX_WARN( + logger_, + "Unsuccessful save of updated policy table, trying another exchange"); + ForcePTExchange(); return false; } -- cgit v1.2.1 From 5eedc2ab20f585313010ac3c3378d1912caddfcf Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 12 Apr 2018 15:09:11 -0400 Subject: Remove Ford references from policy tests --- src/components/application_manager/test/sdl_preloaded_pt.json | 2 +- src/components/application_manager/test/sdl_pt_update.json | 4 ++-- src/components/policy/policy_external/test/json/PTU.json | 2 +- src/components/policy/policy_external/test/json/PTU2.json | 2 +- src/components/policy/policy_external/test/json/PTU3.json | 2 +- .../policy/policy_external/test/json/PTU_default_app.json | 4 ++-- .../json/PTU_default_app_app_invalid_values_RequestType_array.json | 4 ++-- .../test/json/PTU_default_app_empty_RequestType_array.json | 4 ++-- .../test/json/PTU_default_app_omitted_RequestType_array.json | 4 ++-- .../json/PTU_default_app_one_invalid_value_RequestType_array.json | 4 ++-- .../policy/policy_external/test/json/PTU_pre_data_consent_app.json | 4 ++-- .../test/json/PTU_pre_data_consent_app_empty_RequestType_array.json | 4 ++-- .../PTU_pre_data_consent_app_invalid_values_RequestType_array.json | 4 ++-- .../json/PTU_pre_data_consent_app_omitted_RequestType_array.json | 4 ++-- ...TU_pre_data_consent_app_one_invalid_value_RequestType_array.json | 4 ++-- .../policy_external/test/json/PTU_with_empty_requestType_array.json | 4 ++-- .../test/json/PTU_with_invalid_requestType_between_correct.json | 4 ++-- .../policy_external/test/json/PTU_with_one_invalid_requestType.json | 4 ++-- .../policy_external/test/json/PTU_without_requestType_field.json | 4 ++-- .../preloadedPT_with_invalid_default_reqestType_between_valid.json | 2 +- .../test/json/preloadedPT_with_invalid_default_requestType.json | 2 +- .../json/preloadedPT_with_several_invalid_default_requestTypes.json | 2 +- .../policy/policy_external/test/json/ptu2_requestType.json | 6 +++--- .../policy/policy_external/test/json/ptu_requestType.json | 6 +++--- .../policy/policy_external/test/json/sdl_preloaded_pt.json | 2 +- .../policy/policy_external/test/json/sdl_preloaded_pt1.json | 4 ++-- .../policy_external/test/json/sdl_preloaded_pt_send_location.json | 4 ++-- .../policy/policy_external/test/json/sdl_pt_first_update.json | 4 ++-- .../policy/policy_external/test/json/sdl_pt_second_update.json | 4 ++-- src/components/policy/policy_external/test/json/sdl_pt_update.json | 4 ++-- .../test/json/sdl_update_pt_2_groups_have_params.json | 4 ++-- .../test/json/sdl_update_pt_2_groups_no_params_in1.json | 4 ++-- .../test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json | 4 ++-- .../policy_external/test/json/sdl_update_pt_send_location.json | 4 ++-- .../test/json/sdl_update_pt_send_location_all_params.json | 4 ++-- .../test/json/sdl_update_pt_send_location_no_params.json | 4 ++-- .../test/json/sdl_update_pt_send_location_some_params.json | 4 ++-- .../policy/policy_external/test/json/valid_sdl_pt_update.json | 4 ++-- .../policy/policy_external/test/policy_manager_impl_ptu_test.cc | 2 +- .../policy/policy_external/test/policy_manager_impl_test_base.cc | 6 +++--- src/components/policy/policy_regular/test/PTU.json | 2 +- src/components/policy/policy_regular/test/PTU2.json | 2 +- src/components/policy/policy_regular/test/PTU3.json | 2 +- src/components/policy/policy_regular/test/PTU4.json | 2 +- .../policy/policy_regular/test/policy_manager_impl_test.cc | 2 +- src/components/policy/policy_regular/test/ptu2_requestType.json | 6 +++--- src/components/policy/policy_regular/test/ptu_requestType.json | 6 +++--- src/components/policy/policy_regular/test/sdl_preloaded_pt.json | 2 +- src/components/policy/policy_regular/test/sdl_pt_first_update.json | 4 ++-- src/components/policy/policy_regular/test/sdl_pt_second_update.json | 4 ++-- src/components/policy/policy_regular/test/sdl_pt_update.json | 4 ++-- src/components/policy/policy_regular/test/valid_sdl_pt_update.json | 4 ++-- 52 files changed, 94 insertions(+), 94 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json index d6f34c12fc..10894516cf 100644 --- a/src/components/application_manager/test/sdl_preloaded_pt.json +++ b/src/components/application_manager/test/sdl_preloaded_pt.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json index a332f92382..f890e8e5ae 100644 --- a/src/components/application_manager/test/sdl_pt_update.json +++ b/src/components/application_manager/test/sdl_pt_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1698,7 +1698,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json index 7316c7539d..c0f18bb6a9 100644 --- a/src/components/policy/policy_external/test/json/PTU.json +++ b/src/components/policy/policy_external/test/json/PTU.json @@ -15,7 +15,7 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json index c1a6bccb68..8ad6aefb83 100644 --- a/src/components/policy/policy_external/test/json/PTU2.json +++ b/src/components/policy/policy_external/test/json/PTU2.json @@ -15,7 +15,7 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json index 56939a789a..33f699d068 100644 --- a/src/components/policy/policy_external/test/json/PTU3.json +++ b/src/components/policy/policy_external/test/json/PTU3.json @@ -15,7 +15,7 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/PTU_default_app.json b/src/components/policy/policy_external/test/json/PTU_default_app.json index 833d46316a..b036d96b50 100644 --- a/src/components/policy/policy_external/test/json/PTU_default_app.json +++ b/src/components/policy/policy_external/test/json/PTU_default_app.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -295,7 +295,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json index 1e5b1c46a4..49ed46f16c 100644 --- a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -293,7 +293,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json index 76365ee4bb..66af76309a 100644 --- a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -290,7 +290,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json index b380fa2de5..0a7c059097 100644 --- a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -289,7 +289,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json index b8793b6cdc..08f12a21c8 100644 --- a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -296,7 +296,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json index 833d46316a..b036d96b50 100644 --- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json +++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -295,7 +295,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json index 8a183b45d5..6aeb637503 100644 --- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -290,7 +290,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json index 6ffc42c3e4..8c68aaeb89 100644 --- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -291,7 +291,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json index 24d0871d18..0ae0761f27 100644 --- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -283,7 +283,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json index b674913268..6b170089fe 100644 --- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -296,7 +296,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json index 7e0836a805..45e616c874 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1703,7 +1703,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json index a056c3ce9c..917d53177f 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json +++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1706,7 +1706,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json index c7e0a727fe..f514f279de 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json +++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1703,7 +1703,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json index a96ef74bd1..57c1bce8f1 100644 --- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json +++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1702,7 +1702,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json index 4c1bf19005..20023ba8e5 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json index 02801cc976..5e4dffbc56 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json index a9abeea5a2..6b92db7c17 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json index 899e58a68d..c12ec773e0 100644 --- a/src/components/policy/policy_external/test/json/ptu2_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json @@ -16,12 +16,12 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] }, "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] } }, @@ -2594,7 +2594,7 @@ "PROPRIETARY" ] }, - "584421907": { + "123454321": { "keep_context" : false, "steal_focus" : false, "priority" diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json index a1f085ac74..0b1f0ed469 100644 --- a/src/components/policy/policy_external/test/json/ptu_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu_requestType.json @@ -15,12 +15,12 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] }, "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] } }, @@ -2553,7 +2553,7 @@ } }, "app_policies": { - "584421907": { + "123454321": { "keep_context": false, "steal_focus": false, "priority": "NONE", diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json index d6f34c12fc..10894516cf 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json index 78c5f873d9..79d1b572e6 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json @@ -2385,11 +2385,11 @@ { "0x04" : { - "default" : [ "http://ivsu.software.ford.com/api/getsoftwareupdates" ] + "default" : [ "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 20, diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json index 49f9a1da3a..1401c3b7a1 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json @@ -16,12 +16,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json index e6817da0d3..ac2b18ab6f 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1720,7 +1720,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json index d5f5f480f3..230ad1fa4f 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1720,7 +1720,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json index 5047d832dd..4e2dd3a85c 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1704,7 +1704,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json index 18b0a09040..8a3ef897c5 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json index 3530c01388..dcb96f147b 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json index e169aea24a..dd7a529ec8 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json index df45a0be61..14eb11d195 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json index c471d6ec97..f1e460e603 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json index 29781d211c..0ba24ce484 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json index 91be06a561..6e8ce0c6a7 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json @@ -15,12 +15,12 @@ "endpoints": { "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] }, "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] } }, diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json index 56c728f104..c384ea73e2 100644 --- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1696,7 +1696,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index da0cd913b6..67c71cbf08 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -575,7 +575,7 @@ TEST_F(PolicyManagerImplTest2, GetUpdateUrl) { GetPTU(kValidSdlPtUpdateJson); // Check expectations const std::string update_url( - "http://policies.telematics.ford.com/api/policies"); + "http://x.x.x.x:3000/api/1/policies"); EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7)); EXPECT_EQ("", policy_manager_->GetUpdateUrl(4)); } diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc index 0608799535..48e86d24b7 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc @@ -238,8 +238,8 @@ void PolicyManagerImplTest::TearDown() { // PolicyManagerImplTest2 class methods PolicyManagerImplTest2::PolicyManagerImplTest2() : app_id_1_("123456789") - , app_id_2_("1766825573") - , app_id_3_("584421907") + , app_id_2_("1010101010") + , app_id_3_("123454321") , device_id_1_("XXX123456789ZZZ") , device_id_2_("08-00-27-CE-76-FE") , application_id_("1234") @@ -629,7 +629,7 @@ PolicyManagerImplTest_RequestTypes::PolicyManagerImplTest_RequestTypes() "PTU_pre_data_consent_app_one_invalid_value_RequestType_" "array." "json"} - , kAppId("1766825573") + , kAppId("1010101010") , kDefaultAppId(policy::kDefaultId) , app_storage_folder_("storage3") , preloaded_pt_filename_(kSdlPreloadedPtJson) {} diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json index 6d663e9a0c..d9f70426d1 100644 --- a/src/components/policy/policy_regular/test/PTU.json +++ b/src/components/policy/policy_regular/test/PTU.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json index 4062e94516..b4c3c0624c 100644 --- a/src/components/policy/policy_regular/test/PTU2.json +++ b/src/components/policy/policy_regular/test/PTU2.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json index 78596189da..6309bd9cfd 100644 --- a/src/components/policy/policy_regular/test/PTU3.json +++ b/src/components/policy/policy_regular/test/PTU3.json @@ -83,7 +83,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json index ab4c2f8927..651a4cb2ef 100644 --- a/src/components/policy/policy_regular/test/PTU4.json +++ b/src/components/policy/policy_regular/test/PTU4.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index f76e856cd0..5fd0a48f7c 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -181,7 +181,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { public: PolicyManagerImplTest2() : app_id1("123456789") - , app_id2("1766825573") + , app_id2("1010101010") , dev_id1("XXX123456789ZZZ") , dev_id2("08-00-27-CE-76-FE") , PTU_request_types(Json::arrayValue) {} diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json index 50364397fd..e25095bb9f 100644 --- a/src/components/policy/policy_regular/test/ptu2_requestType.json +++ b/src/components/policy/policy_regular/test/ptu2_requestType.json @@ -17,12 +17,12 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] }, "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] } }, @@ -2595,7 +2595,7 @@ "PROPRIETARY" ] }, - "584421907": { + "123454321": { "keep_context": false, "steal_focus": false, "priority": "NONE", diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json index 44bd8356fe..c5aa6f0a6c 100644 --- a/src/components/policy/policy_regular/test/ptu_requestType.json +++ b/src/components/policy/policy_regular/test/ptu_requestType.json @@ -17,12 +17,12 @@ "endpoints": { "0x07": { "default": [ - "http://policies.telematics.ford.com/api/policies" + "http://x.x.x.x:3000/api/1/policies" ] }, "0x04": { "default": [ - "http://ivsu.software.ford.com/api/getsoftwareupdates" + "http://x.x.x.x:3000/api/1/softwareUpdate" ] } }, @@ -2590,7 +2590,7 @@ "PROPRIETARY" ] }, - "584421907": { + "123454321": { "keep_context": false, "steal_focus": false, "priority": "NONE", diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json index d6f34c12fc..10894516cf 100644 --- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json +++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json @@ -14,7 +14,7 @@ 625], "endpoints": { "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] + "default": ["http://x.x.x.x:3000/api/1/policies"] } }, "notifications_per_minute_by_priority": { diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json index e6817da0d3..ac2b18ab6f 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1720,7 +1720,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json index d5f5f480f3..230ad1fa4f 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1720,7 +1720,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json index a332f92382..f890e8e5ae 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1698,7 +1698,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json index 56c728f104..c384ea73e2 100644 --- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json @@ -1,7 +1,7 @@ { "policy_table" : { "app_policies" : { - "1766825573" : { + "1010101010" : { "AppHMIType" : [ "MEDIA" ], "certificate" : "akdjfhaliuygrglurng", "default_hmi" : "BACKGROUND", @@ -1696,7 +1696,7 @@ }, "endpoints" : { "0x07" : { - "default" : [ "http://policies.telematics.ford.com/api/policies" ] + "default" : [ "http://x.x.x.x:3000/api/1/policies" ] } }, "exchange_after_x_days" : 30, -- cgit v1.2.1 From 255c18b4352dfde12632ab812f81b68fb256de32 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 12 Apr 2018 16:22:28 -0400 Subject: Fix style issues --- .../include/hmi_message_handler/mb_controller.h | 2 +- .../include/hmi_message_handler/websocket_session.h | 2 +- src/components/hmi_message_handler/src/mb_controller.cc | 4 ++-- src/components/hmi_message_handler/src/websocket_session.cc | 2 +- .../policy/policy_external/src/policy_manager_impl.cc | 11 +++++------ 5 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/components') diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h index 1bd74e09ea..60dc50ad7a 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 Livio, Inc. +Copyright (c) 2018 Livio, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h index 5d82a35679..9692c4aef4 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 Livio, Inc. +Copyright (c) 2018 Livio, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc index df3c3f16b2..8d3b11add5 100644 --- a/src/components/hmi_message_handler/src/mb_controller.cc +++ b/src/components/hmi_message_handler/src/mb_controller.cc @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 Livio, Inc. +Copyright (c) 2018 Livio, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #include "hmi_message_handler/mb_controller.h" using namespace boost::beast::websocket; diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc index 0327500a11..26f15695c9 100644 --- a/src/components/hmi_message_handler/src/websocket_session.cc +++ b/src/components/hmi_message_handler/src/websocket_session.cc @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 Livio, Inc. +Copyright (c) 2018 Livio, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index aefd630b25..a3736b9d23 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -594,8 +594,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, policy_table::FunctionalGroupings functional_groupings; cache_->GetFunctionalGroupings(functional_groupings); - policy_table::Strings app_groups = - GetGroupsNames(app_group_permissions); + policy_table::Strings app_groups = GetGroupsNames(app_group_permissions); // Undefined groups (without user consent) disallowed by default, since // OnPermissionsChange notification has no "undefined" section @@ -627,8 +626,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, } const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc); - LOG4CXX_DEBUG(logger_, "Is known rpc " << - (known_rpc ? "true" : "false") ); + LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false")); if (!known_rpc) { // RPC not found in list == disallowed by backend result.hmi_level_permitted = kRpcDisallowed; @@ -650,7 +648,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find( hmi_level)) { // RPC found in allowed == allowed by backend, but disallowed by user - LOG4CXX_DEBUG(logger_, "RPC found in allowed == allowed by backend, but disallowed by user"); + LOG4CXX_DEBUG( + logger_, + "RPC found in allowed == allowed by backend, but disallowed by user"); result.hmi_level_permitted = kRpcUserDisallowed; } else { LOG4CXX_DEBUG(logger_, @@ -990,7 +990,6 @@ void PolicyManagerImpl::SetUserConsentForApp( const PermissionConsent& permissions, const NotificationMode mode) { LOG4CXX_AUTO_TRACE(logger_); - cache_->ResetCalculatedPermissions(); PermissionConsent verified_permissions = EnsureCorrectPermissionConsent(permissions); -- cgit v1.2.1 From e4aea9676350a8c0e084b9b1d88a2317b76b0dda Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 16 Apr 2018 10:36:23 -0400 Subject: Fix infinite PTU when invalid PT, then a valid PT is received --- src/components/policy/policy_external/src/policy_manager_impl.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index a3736b9d23..433a7a6bca 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -1574,8 +1574,7 @@ void PolicyManagerImpl::OnUpdateStarted() { uint32_t update_timeout = TimeoutExchangeMSec(); LOG4CXX_DEBUG(logger_, "Update timeout will be set to (milisec): " << update_timeout); - send_on_update_sent_out_ = - !wrong_ptu_update_received_ && !update_status_manager_.IsUpdatePending(); + send_on_update_sent_out_ = !update_status_manager_.IsUpdatePending(); if (send_on_update_sent_out_) { update_status_manager_.OnUpdateSentOut(update_timeout); -- cgit v1.2.1 From 25f83014ca9c0be2c1ca24bcada14d80329a14f8 Mon Sep 17 00:00:00 2001 From: vkushnirenko-luxoft Date: Tue, 17 Apr 2018 11:22:12 +0300 Subject: Fix style after PR #2132 --- .../policy/policy_external/test/policy_manager_impl_ptu_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index 67c71cbf08..947bb5d3ad 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -574,8 +574,7 @@ TEST_F(PolicyManagerImplTest2, GetUpdateUrl) { CreateLocalPT(preloaded_pt_filename_); GetPTU(kValidSdlPtUpdateJson); // Check expectations - const std::string update_url( - "http://x.x.x.x:3000/api/1/policies"); + const std::string update_url("http://x.x.x.x:3000/api/1/policies"); EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7)); EXPECT_EQ("", policy_manager_->GetUpdateUrl(4)); } -- cgit v1.2.1 From 28d80dadabf8d4697b3d438d25adf22e8a0b6430 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 25 Apr 2018 15:33:55 -0400 Subject: Implementation of color schemes --- .../include/application_manager/application.h | 6 ++++ .../application_manager/application_data_impl.h | 6 ++++ .../application_manager/smart_object_keys.h | 8 +++++ .../src/application_data_impl.cc | 42 +++++++++++++++++++++- .../mobile/register_app_interface_request.cc | 20 +++++++++++ .../src/message_helper/message_helper.cc | 12 +++++++ .../application_manager/src/smart_object_keys.cc | 8 +++++ src/components/interfaces/HMI_API.xml | 25 +++++++++++++ src/components/interfaces/MOBILE_API.xml | 26 +++++++++++++- 9 files changed, 151 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 0c93f7447b..3ef608448e 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -113,6 +113,8 @@ class InitialApplicationData { virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0; virtual const mobile_api::Language::eType& language() const = 0; virtual const mobile_api::Language::eType& ui_language() const = 0; + virtual const smart_objects::SmartObject* day_color_scheme() const = 0; + virtual const smart_objects::SmartObject* night_color_scheme() const = 0; virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0; virtual void set_vr_synonyms( const smart_objects::SmartObject& vr_synonyms) = 0; @@ -123,6 +125,10 @@ class InitialApplicationData { virtual void set_language(const mobile_api::Language::eType& language) = 0; virtual void set_ui_language( const mobile_api::Language::eType& ui_language) = 0; + virtual void set_day_color_scheme( + const smart_objects::SmartObject& color_scheme) = 0; + virtual void set_night_color_scheme( + const smart_objects::SmartObject& color_scheme) = 0; }; /* diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h index 64b5f8780b..fb1e15f6ba 100644 --- a/src/components/application_manager/include/application_manager/application_data_impl.h +++ b/src/components/application_manager/include/application_manager/application_data_impl.h @@ -55,6 +55,8 @@ class InitialApplicationDataImpl : public virtual Application { const smart_objects::SmartObject* ngn_media_screen_name() const; const mobile_api::Language::eType& language() const; const mobile_api::Language::eType& ui_language() const; + const smart_objects::SmartObject* day_color_scheme() const; + const smart_objects::SmartObject* night_color_scheme() const; void set_app_types(const smart_objects::SmartObject& app_types); void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms); void set_mobile_app_id(const std::string& policy_app_id); @@ -62,6 +64,8 @@ class InitialApplicationDataImpl : public virtual Application { void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name); void set_language(const mobile_api::Language::eType& language); void set_ui_language(const mobile_api::Language::eType& ui_language); + void set_day_color_scheme(const smart_objects::SmartObject& color_scheme); + void set_night_color_scheme(const smart_objects::SmartObject& color_scheme); void set_perform_interaction_layout( mobile_api::LayoutMode::eType layout) OVERRIDE; @@ -76,6 +80,8 @@ class InitialApplicationDataImpl : public virtual Application { mobile_api::Language::eType language_; mobile_api::Language::eType ui_language_; mobile_apis::LayoutMode::eType perform_interaction_layout_; + smart_objects::SmartObject* day_color_scheme_; + smart_objects::SmartObject* night_color_scheme_; private: DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl); 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 32a2315f23..8bcd69f896 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 @@ -178,6 +178,14 @@ extern const char* navigation_capability; extern const char* phone_capability; extern const char* video_streaming_capability; extern const char* rc_capability; +extern const char* day_color_scheme; +extern const char* night_color_scheme; +extern const char* primary_color; +extern const char* secondary_color; +extern const char* background_color; +extern const char* red; +extern const char* green; +extern const char* blue; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc index a81540708c..cecd8d2d6c 100644 --- a/src/components/application_manager/src/application_data_impl.cc +++ b/src/components/application_manager/src/application_data_impl.cc @@ -45,7 +45,9 @@ InitialApplicationDataImpl::InitialApplicationDataImpl() , tts_name_(NULL) , ngn_media_screen_name_(NULL) , language_(mobile_api::Language::INVALID_ENUM) - , ui_language_(mobile_api::Language::INVALID_ENUM) {} + , ui_language_(mobile_api::Language::INVALID_ENUM) + , day_color_scheme_(NULL) + , night_color_scheme_(NULL) {} InitialApplicationDataImpl::~InitialApplicationDataImpl() { if (app_types_) { @@ -67,6 +69,16 @@ InitialApplicationDataImpl::~InitialApplicationDataImpl() { delete ngn_media_screen_name_; ngn_media_screen_name_ = NULL; } + + if (day_color_scheme_) { + delete day_color_scheme_; + day_color_scheme_ = NULL; + } + + if (night_color_scheme_) { + delete night_color_scheme_; + night_color_scheme_ = NULL; + } } const smart_objects::SmartObject* InitialApplicationDataImpl::app_types() @@ -102,6 +114,16 @@ const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language() return ui_language_; } +const smart_objects::SmartObject* +InitialApplicationDataImpl::day_color_scheme() const { + return day_color_scheme_; +} + +const smart_objects::SmartObject* +InitialApplicationDataImpl::night_color_scheme() const { + return night_color_scheme_; +} + void InitialApplicationDataImpl::set_app_types( const smart_objects::SmartObject& app_types) { if (app_types_) { @@ -162,6 +184,24 @@ InitialApplicationDataImpl::perform_interaction_layout() const { return perform_interaction_layout_; } +void InitialApplicationDataImpl::set_day_color_scheme( + const smart_objects::SmartObject& color_scheme) { + if (day_color_scheme_) { + delete day_color_scheme_; + } + + day_color_scheme_ = new smart_objects::SmartObject(color_scheme); +} + +void InitialApplicationDataImpl::set_night_color_scheme( + const smart_objects::SmartObject& color_scheme) { + if (night_color_scheme_) { + delete night_color_scheme_; + } + + night_color_scheme_ = new smart_objects::SmartObject(color_scheme); +} + DynamicApplicationDataImpl::DynamicApplicationDataImpl() : help_prompt_(NULL) , timeout_prompt_(NULL) 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 a3a30ddb20..c0cbe80ae4 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 @@ -348,6 +348,14 @@ void RegisterAppInterfaceRequest::Run() { } } + if (msg_params.keyExists(strings::day_color_scheme)) { + application->set_day_color_scheme(msg_params[strings::day_color_scheme]); + } + + if (msg_params.keyExists(strings::night_color_scheme)) { + application->set_night_color_scheme(msg_params[strings::night_color_scheme]); + } + // Add device to policy table and set device info, if any policy::DeviceParams dev_params; if (-1 == @@ -884,6 +892,18 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( device_info[strings::transport_type] = application_manager_.GetDeviceTransportType(transport_type); + const smart_objects::SmartObject* day_color_scheme = + application_impl.day_color_scheme(); + if (day_color_scheme) { + application[strings::day_color_scheme] = *day_color_scheme; + } + + const smart_objects::SmartObject* night_color_scheme = + application_impl.night_color_scheme(); + if (night_color_scheme) { + application[strings::night_color_scheme] = *night_color_scheme; + } + DCHECK(application_manager_.ManageHMICommand(notification)); } 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 6a908c4ebc..41138784c2 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -1677,6 +1677,10 @@ bool MessageHelper::CreateHMIApplicationStruct( const smart_objects::SmartObject* app_types = app->app_types(); const smart_objects::SmartObject* ngn_media_screen_name = app->ngn_media_screen_name(); + const smart_objects::SmartObject* day_color_scheme = + app->day_color_scheme(); + const smart_objects::SmartObject* night_color_scheme = + app->night_color_scheme(); std::string device_name; std::string mac_address; std::string transport_type; @@ -1714,6 +1718,14 @@ bool MessageHelper::CreateHMIApplicationStruct( message[strings::app_type] = *app_types; } + if (day_color_scheme) { + message[strings::day_color_scheme] = *day_color_scheme; + } + + if (night_color_scheme) { + message[strings::night_color_scheme] = *night_color_scheme; + } + message[strings::device_info] = smart_objects::SmartObject(smart_objects::SmartType_Map); message[strings::device_info][strings::name] = device_name; diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index c3aba90dd5..88ec5986f4 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -142,6 +142,14 @@ const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; const char* rc_capability = "remoteControlCapability"; +const char* day_color_scheme = "dayColorScheme"; +const char* night_color_scheme = "nightColorScheme"; +const char* primary_color = "primaryColor"; +const char* secondary_color = "secondaryColor"; +const char* background_color = "backgroundColor"; +const char* red = "red"; +const char* green = "green"; +const char* blue = "blue"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index ab3933fc0f..c2178922d6 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1870,6 +1870,27 @@ + + + + + + + + + A color scheme for all display layout templates. + + + The primary "accent" color + + + The secondary "accent" color + + + The color of the background + + + Data type containing information about application needed by HMI. @@ -1927,6 +1948,8 @@ If SDL omits this parameter - none RequestType is allowed for this app (either this is a pre-registered app or such is dictated by policies). + + @@ -3670,6 +3693,8 @@ ID of application related to this RPC. + + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..9f13eb1c57 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2887,7 +2887,27 @@ The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs. - + + + + + + + + + + A color scheme for all display layout templates. + + + The primary "accent" color + + + The secondary "accent" color + + + The color of the background + + @@ -2988,6 +3008,8 @@ See AppInfo. + + @@ -5245,6 +5267,8 @@ + + -- cgit v1.2.1 From ffab62e1f509d5aeb44436a705146c1ee4f5f77a Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Wed, 25 Apr 2018 15:17:36 -0400 Subject: Add `engineOilLife` vehicle data --- .../application_manager/smart_object_keys.h | 1 + .../src/message_helper/message_helper.cc | 3 ++- .../application_manager/src/smart_object_keys.cc | 1 + .../application_manager/test/sdl_preloaded_pt.json | 4 ++++ .../application_manager/test/sdl_pt_update.json | 4 ++++ src/components/interfaces/HMI_API.xml | 19 +++++++++++++++++++ src/components/interfaces/MOBILE_API.xml | 22 ++++++++++++++++++++++ .../include/policy/policy_table/enums.h | 1 + .../include/policy/policy_table_interface_ext.xml | 1 + .../policy_external/src/policy_table/enums.cc | 7 +++++++ .../policy/policy_external/test/json/PTU.json | 4 ++++ .../policy/policy_external/test/json/PTU2.json | 4 ++++ .../policy/policy_external/test/json/PTU3.json | 4 ++++ .../json/PTU_with_empty_requestType_array.json | 4 ++++ ...U_with_invalid_requestType_between_correct.json | 4 ++++ .../json/PTU_with_one_invalid_requestType.json | 4 ++++ .../test/json/PTU_without_requestType_field.json | 4 ++++ ...h_invalid_default_reqestType_between_valid.json | 4 ++++ ...eloadedPT_with_invalid_default_requestType.json | 4 ++++ ..._with_several_invalid_default_requestTypes.json | 4 ++++ .../test/json/ptu2_requestType.json | 4 ++++ .../policy_external/test/json/ptu_requestType.json | 4 ++++ .../test/json/sdl_preloaded_pt.json | 4 ++++ .../test/json/sdl_preloaded_pt1.json | 4 ++++ .../test/json/sdl_preloaded_pt_send_location.json | 4 ++++ .../test/json/sdl_pt_first_update.json | 4 ++++ .../test/json/sdl_pt_second_update.json | 4 ++++ .../policy_external/test/json/sdl_pt_update.json | 4 ++++ .../json/sdl_update_pt_2_groups_have_params.json | 4 ++++ .../json/sdl_update_pt_2_groups_no_params_in1.json | 4 ++++ ...date_pt_2_groups_no_params_in1_omitted_in2.json | 4 ++++ .../test/json/sdl_update_pt_send_location.json | 4 ++++ .../sdl_update_pt_send_location_all_params.json | 4 ++++ .../sdl_update_pt_send_location_no_params.json | 4 ++++ .../sdl_update_pt_send_location_some_params.json | 4 ++++ .../test/json/valid_sdl_pt_update.json | 4 ++++ .../include/policy/policy_table/enums.h | 1 + .../policy_regular/policy_table_interface_ext.xml | 1 + .../policy_regular/src/policy_table/enums.cc | 7 +++++++ src/components/policy/policy_regular/test/PTU.json | 4 ++++ .../policy/policy_regular/test/PTU2.json | 4 ++++ .../policy/policy_regular/test/PTU3.json | 4 ++++ .../policy/policy_regular/test/PTU4.json | 4 ++++ .../policy_regular/test/ptu2_requestType.json | 4 ++++ .../policy_regular/test/ptu_requestType.json | 4 ++++ .../policy_regular/test/sdl_preloaded_pt.json | 4 ++++ .../policy_regular/test/sdl_pt_first_update.json | 4 ++++ .../policy_regular/test/sdl_pt_second_update.json | 4 ++++ .../policy/policy_regular/test/sdl_pt_update.json | 4 ++++ .../policy_regular/test/valid_sdl_pt_update.json | 4 ++++ 50 files changed, 219 insertions(+), 1 deletion(-) (limited to 'src/components') 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 32a2315f23..0694447004 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 @@ -274,6 +274,7 @@ extern const char* remote_control; extern const char* sdl_version; extern const char* system_software_version; extern const char* priority; +extern const char* engine_oil_life; // resuming extern const char* application_commands; 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 6a908c4ebc..6938677ed0 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -217,7 +217,8 @@ std::pair + @@ -4233,6 +4234,9 @@ Current angle of the steering wheel (in deg) + + + The estimated percentage of remaining oil life of the engine. @@ -4309,6 +4313,9 @@ Current angle of the steering wheel (in deg) + + + The estimated percentage of remaining oil life of the engine. @@ -4391,6 +4398,9 @@ Current angle of the steering wheel (in deg) + + + The estimated percentage of remaining oil life of the engine. @@ -4467,6 +4477,9 @@ Current angle of the steering wheel (in deg) + + + The estimated percentage of remaining oil life of the engine. @@ -4548,6 +4561,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + Emergency Call notification and confirmation data @@ -4625,6 +4641,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + Emergency Call notification and confirmation data diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..c2fbff70e4 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -513,6 +513,7 @@ + @@ -4095,6 +4096,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -4198,6 +4202,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -4279,6 +4286,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -4380,6 +4390,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -4464,6 +4477,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -4569,6 +4585,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + @@ -5787,6 +5806,9 @@ Current angle of the steering wheel (in deg) + + The estimated percentage of remaining oil life of the engine. + diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h index 4f8ae5c98d..2e929fb158 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h @@ -80,6 +80,7 @@ enum Parameter { P_PRNDL, P_RPM, P_STEERINGWHEELANGLE, + P_ENGINEOILLIFE, P_MYKEY, P_AIRBAGSTATUS, P_BODYINFORMATION, diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml index 91518f8f6e..7cf8e1286a 100644 --- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml +++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml @@ -40,6 +40,7 @@ + diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index 168ff86b27..bc16b4547c 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -146,6 +146,8 @@ bool IsValidEnum(Parameter val) { return true; case P_STEERINGWHEELANGLE: return true; + case P_ENGINEOILLIFE: + return true; case P_MYKEY: return true; case P_AIRBAGSTATUS: @@ -235,6 +237,8 @@ const char* EnumToJsonString(Parameter val) { return "rpm"; case P_STEERINGWHEELANGLE: return "steeringWheelAngle"; + case P_ENGINEOILLIFE: + return "engineOilLife"; case P_MYKEY: return "myKey"; case P_AIRBAGSTATUS: @@ -341,6 +345,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("steeringWheelAngle" == literal) { *result = P_STEERINGWHEELANGLE; return true; + } else if ("engineOilLife" == literal) { + *result = P_ENGINEOILLIFE; + return true; } else if ("myKey" == literal) { *result = P_MYKEY; return true; diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json index c0f18bb6a9..54a69c1a9e 100644 --- a/src/components/policy/policy_external/test/json/PTU.json +++ b/src/components/policy/policy_external/test/json/PTU.json @@ -472,6 +472,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -493,6 +494,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -514,6 +516,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -534,6 +537,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json index 8ad6aefb83..72e668d007 100644 --- a/src/components/policy/policy_external/test/json/PTU2.json +++ b/src/components/policy/policy_external/test/json/PTU2.json @@ -472,6 +472,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -493,6 +494,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -514,6 +516,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -534,6 +537,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json index 33f699d068..5fddeda8ae 100644 --- a/src/components/policy/policy_external/test/json/PTU3.json +++ b/src/components/policy/policy_external/test/json/PTU3.json @@ -472,6 +472,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -493,6 +494,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -514,6 +516,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -534,6 +537,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json index 45e616c874..b08f6c07d3 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json @@ -1592,6 +1592,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1607,6 +1608,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1622,6 +1624,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1636,6 +1639,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json index 917d53177f..44398e0274 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json +++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json @@ -1595,6 +1595,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1610,6 +1611,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1625,6 +1627,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1639,6 +1642,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json index f514f279de..f8d8532a3d 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json +++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json @@ -1592,6 +1592,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1607,6 +1608,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1622,6 +1624,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1636,6 +1639,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json index 57c1bce8f1..b34f999f7a 100644 --- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json +++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json @@ -1591,6 +1591,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1606,6 +1607,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1621,6 +1623,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1635,6 +1638,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json index 20023ba8e5..ce2a9dd350 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json index 5e4dffbc56..9d91805305 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json index 6b92db7c17..9436fbd843 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json index c12ec773e0..e961f99a13 100644 --- a/src/components/policy/policy_external/test/json/ptu2_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json @@ -484,6 +484,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -505,6 +506,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -526,6 +528,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -546,6 +549,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json index 0b1f0ed469..4d6969c9ba 100644 --- a/src/components/policy/policy_external/test/json/ptu_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu_requestType.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json index 10894516cf..856e2edeb3 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json index 79d1b572e6..7834291283 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json @@ -2308,6 +2308,7 @@ [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -2327,6 +2328,7 @@ [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -2346,6 +2348,7 @@ [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -2364,6 +2367,7 @@ [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json index 1401c3b7a1..ffd986b440 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json @@ -484,6 +484,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -505,6 +506,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -526,6 +528,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -546,6 +549,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json index ac2b18ab6f..74fa119c53 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json @@ -1609,6 +1609,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1624,6 +1625,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1639,6 +1641,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1653,6 +1656,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json index 230ad1fa4f..c0f3069a6e 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json @@ -1609,6 +1609,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1624,6 +1625,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1639,6 +1641,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1653,6 +1656,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json index 4e2dd3a85c..4d69716643 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json @@ -1593,6 +1593,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1608,6 +1609,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1623,6 +1625,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1637,6 +1640,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json index 8a3ef897c5..2feaae7a5b 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json index dcb96f147b..ff40495fda 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json index dd7a529ec8..2e9b945929 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json index 14eb11d195..43e7465108 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json index f1e460e603..e258dc6569 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json index 0ba24ce484..5e4ba048b5 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json index 6e8ce0c6a7..55e5779258 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json @@ -483,6 +483,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -504,6 +505,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -525,6 +527,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -545,6 +548,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json index c384ea73e2..f06fd99a59 100644 --- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json @@ -1585,6 +1585,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1600,6 +1601,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1615,6 +1617,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1629,6 +1632,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h index 4eb35d2aa4..d01e2407d8 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h @@ -80,6 +80,7 @@ enum Parameter { P_PRNDL, P_RPM, P_STEERINGWHEELANGLE, + P_ENGINEOILLIFE, P_MYKEY, P_AIRBAGSTATUS, P_BODYINFORMATION, diff --git a/src/components/policy/policy_regular/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml index 468eec2b0b..e619b79efc 100644 --- a/src/components/policy/policy_regular/policy_table_interface_ext.xml +++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml @@ -40,6 +40,7 @@ + diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 34d12420d8..b3205c0cb5 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -147,6 +147,8 @@ bool IsValidEnum(Parameter val) { return true; case P_STEERINGWHEELANGLE: return true; + case P_ENGINEOILLIFE: + return true; case P_MYKEY: return true; case P_AIRBAGSTATUS: @@ -205,6 +207,8 @@ const char* EnumToJsonString(Parameter val) { return "rpm"; case P_STEERINGWHEELANGLE: return "steeringWheelAngle"; + case P_ENGINEOILLIFE: + return "engineOilLife"; case P_MYKEY: return "myKey"; case P_AIRBAGSTATUS: @@ -281,6 +285,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("steeringWheelAngle" == literal) { *result = P_STEERINGWHEELANGLE; return true; + } else if ("engineOilLife" == literal) { + *result = P_ENGINEOILLIFE; + return true; } else if ("myKey" == literal) { *result = P_MYKEY; return true; diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json index d9f70426d1..7881876d45 100644 --- a/src/components/policy/policy_regular/test/PTU.json +++ b/src/components/policy/policy_regular/test/PTU.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json index b4c3c0624c..73a90092a1 100644 --- a/src/components/policy/policy_regular/test/PTU2.json +++ b/src/components/policy/policy_regular/test/PTU2.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json index 6309bd9cfd..57b829ea55 100644 --- a/src/components/policy/policy_regular/test/PTU3.json +++ b/src/components/policy/policy_regular/test/PTU3.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json index 651a4cb2ef..271f9b5a79 100644 --- a/src/components/policy/policy_regular/test/PTU4.json +++ b/src/components/policy/policy_regular/test/PTU4.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json index e25095bb9f..431f680bbc 100644 --- a/src/components/policy/policy_regular/test/ptu2_requestType.json +++ b/src/components/policy/policy_regular/test/ptu2_requestType.json @@ -485,6 +485,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -506,6 +507,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -527,6 +529,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -547,6 +550,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json index c5aa6f0a6c..9de649f2b5 100644 --- a/src/components/policy/policy_regular/test/ptu_requestType.json +++ b/src/components/policy/policy_regular/test/ptu_requestType.json @@ -485,6 +485,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -506,6 +507,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -527,6 +529,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -547,6 +550,7 @@ "parameters": [ "bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json index 10894516cf..856e2edeb3 100644 --- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json +++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json @@ -349,6 +349,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -366,6 +367,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -383,6 +385,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -399,6 +402,7 @@ "LIMITED"], "parameters": ["bodyInformation", "deviceStatus", + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json index ac2b18ab6f..74fa119c53 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json @@ -1609,6 +1609,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1624,6 +1625,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1639,6 +1641,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1653,6 +1656,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json index 230ad1fa4f..c0f3069a6e 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json @@ -1609,6 +1609,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1624,6 +1625,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1639,6 +1641,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1653,6 +1656,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json index f890e8e5ae..f5f071e9df 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_update.json @@ -1587,6 +1587,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1602,6 +1603,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1617,6 +1619,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1631,6 +1634,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json index c384ea73e2..f06fd99a59 100644 --- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json @@ -1585,6 +1585,7 @@ "GetVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1600,6 +1601,7 @@ "OnVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1615,6 +1617,7 @@ "SubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", @@ -1629,6 +1632,7 @@ "UnsubscribeVehicleData" : { "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ], "parameters" : [ + "engineOilLife", "engineTorque", "externalTemperature", "fuelLevel", -- cgit v1.2.1 From 90962a664990f3d6bbd96c5b3cf387328ef3315d Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 1 May 2018 11:04:33 -0400 Subject: Move color scheme to Dynamic Application Data & Add Set Display layout support --- .../include/application_manager/application.h | 12 ++-- .../application_manager/application_data_impl.h | 13 ++-- .../src/application_data_impl.cc | 82 +++++++++++----------- .../commands/mobile/set_display_layout_request.cc | 13 +++- 4 files changed, 66 insertions(+), 54 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 3ef608448e..aa607449a2 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -113,8 +113,6 @@ class InitialApplicationData { virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0; virtual const mobile_api::Language::eType& language() const = 0; virtual const mobile_api::Language::eType& ui_language() const = 0; - virtual const smart_objects::SmartObject* day_color_scheme() const = 0; - virtual const smart_objects::SmartObject* night_color_scheme() const = 0; virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0; virtual void set_vr_synonyms( const smart_objects::SmartObject& vr_synonyms) = 0; @@ -125,10 +123,6 @@ class InitialApplicationData { virtual void set_language(const mobile_api::Language::eType& language) = 0; virtual void set_ui_language( const mobile_api::Language::eType& ui_language) = 0; - virtual void set_day_color_scheme( - const smart_objects::SmartObject& color_scheme) = 0; - virtual void set_night_color_scheme( - const smart_objects::SmartObject& color_scheme) = 0; }; /* @@ -195,6 +189,8 @@ class DynamicApplicationData { virtual const smart_objects::SmartObject* keyboard_props() const = 0; virtual const smart_objects::SmartObject* menu_title() const = 0; virtual const smart_objects::SmartObject* menu_icon() const = 0; + virtual const smart_objects::SmartObject* day_color_scheme() const = 0; + virtual const smart_objects::SmartObject* night_color_scheme() const = 0; virtual void load_global_properties(const smart_objects::SmartObject& so) = 0; virtual void set_help_prompt( @@ -226,6 +222,10 @@ class DynamicApplicationData { virtual void set_video_stream_retry_number( const uint32_t& video_stream_retry_number) = 0; + virtual void set_day_color_scheme( + const smart_objects::SmartObject& color_scheme) = 0; + virtual void set_night_color_scheme( + const smart_objects::SmartObject& color_scheme) = 0; /** * @brief Checks if application is media, voice communication or navigation * @return true if application is media, voice communication or navigation, diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h index fb1e15f6ba..6d47ba4736 100644 --- a/src/components/application_manager/include/application_manager/application_data_impl.h +++ b/src/components/application_manager/include/application_manager/application_data_impl.h @@ -55,8 +55,7 @@ class InitialApplicationDataImpl : public virtual Application { const smart_objects::SmartObject* ngn_media_screen_name() const; const mobile_api::Language::eType& language() const; const mobile_api::Language::eType& ui_language() const; - const smart_objects::SmartObject* day_color_scheme() const; - const smart_objects::SmartObject* night_color_scheme() const; + void set_app_types(const smart_objects::SmartObject& app_types); void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms); void set_mobile_app_id(const std::string& policy_app_id); @@ -64,8 +63,6 @@ class InitialApplicationDataImpl : public virtual Application { void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name); void set_language(const mobile_api::Language::eType& language); void set_ui_language(const mobile_api::Language::eType& ui_language); - void set_day_color_scheme(const smart_objects::SmartObject& color_scheme); - void set_night_color_scheme(const smart_objects::SmartObject& color_scheme); void set_perform_interaction_layout( mobile_api::LayoutMode::eType layout) OVERRIDE; @@ -80,8 +77,6 @@ class InitialApplicationDataImpl : public virtual Application { mobile_api::Language::eType language_; mobile_api::Language::eType ui_language_; mobile_apis::LayoutMode::eType perform_interaction_layout_; - smart_objects::SmartObject* day_color_scheme_; - smart_objects::SmartObject* night_color_scheme_; private: DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl); @@ -101,6 +96,8 @@ class DynamicApplicationDataImpl : public virtual Application { const smart_objects::SmartObject* keyboard_props() const; const smart_objects::SmartObject* menu_title() const; const smart_objects::SmartObject* menu_icon() const; + const smart_objects::SmartObject* day_color_scheme() const; + const smart_objects::SmartObject* night_color_scheme() const; void load_global_properties(const smart_objects::SmartObject& properties_so); void set_help_prompt(const smart_objects::SmartObject& help_prompt); @@ -115,6 +112,8 @@ class DynamicApplicationDataImpl : public virtual Application { void set_keyboard_props(const smart_objects::SmartObject& keyboard_props); void set_menu_title(const smart_objects::SmartObject& menu_title); void set_menu_icon(const smart_objects::SmartObject& menu_icon); + void set_day_color_scheme(const smart_objects::SmartObject& color_scheme); + void set_night_color_scheme(const smart_objects::SmartObject& color_scheme); /* * @brief Adds a command to the in application menu */ @@ -269,6 +268,8 @@ class DynamicApplicationDataImpl : public virtual Application { smart_objects::SmartObject* menu_title_; smart_objects::SmartObject* menu_icon_; smart_objects::SmartObject* tbt_show_command_; + smart_objects::SmartObject* day_color_scheme_; + smart_objects::SmartObject* night_color_scheme_; CommandsMap commands_; mutable sync_primitives::Lock commands_lock_; diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc index cecd8d2d6c..a5c39455ba 100644 --- a/src/components/application_manager/src/application_data_impl.cc +++ b/src/components/application_manager/src/application_data_impl.cc @@ -45,9 +45,7 @@ InitialApplicationDataImpl::InitialApplicationDataImpl() , tts_name_(NULL) , ngn_media_screen_name_(NULL) , language_(mobile_api::Language::INVALID_ENUM) - , ui_language_(mobile_api::Language::INVALID_ENUM) - , day_color_scheme_(NULL) - , night_color_scheme_(NULL) {} + , ui_language_(mobile_api::Language::INVALID_ENUM) {} InitialApplicationDataImpl::~InitialApplicationDataImpl() { if (app_types_) { @@ -69,16 +67,6 @@ InitialApplicationDataImpl::~InitialApplicationDataImpl() { delete ngn_media_screen_name_; ngn_media_screen_name_ = NULL; } - - if (day_color_scheme_) { - delete day_color_scheme_; - day_color_scheme_ = NULL; - } - - if (night_color_scheme_) { - delete night_color_scheme_; - night_color_scheme_ = NULL; - } } const smart_objects::SmartObject* InitialApplicationDataImpl::app_types() @@ -114,16 +102,6 @@ const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language() return ui_language_; } -const smart_objects::SmartObject* -InitialApplicationDataImpl::day_color_scheme() const { - return day_color_scheme_; -} - -const smart_objects::SmartObject* -InitialApplicationDataImpl::night_color_scheme() const { - return night_color_scheme_; -} - void InitialApplicationDataImpl::set_app_types( const smart_objects::SmartObject& app_types) { if (app_types_) { @@ -184,24 +162,6 @@ InitialApplicationDataImpl::perform_interaction_layout() const { return perform_interaction_layout_; } -void InitialApplicationDataImpl::set_day_color_scheme( - const smart_objects::SmartObject& color_scheme) { - if (day_color_scheme_) { - delete day_color_scheme_; - } - - day_color_scheme_ = new smart_objects::SmartObject(color_scheme); -} - -void InitialApplicationDataImpl::set_night_color_scheme( - const smart_objects::SmartObject& color_scheme) { - if (night_color_scheme_) { - delete night_color_scheme_; - } - - night_color_scheme_ = new smart_objects::SmartObject(color_scheme); -} - DynamicApplicationDataImpl::DynamicApplicationDataImpl() : help_prompt_(NULL) , timeout_prompt_(NULL) @@ -213,6 +173,8 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl() , menu_title_(NULL) , menu_icon_(NULL) , tbt_show_command_(NULL) + , day_color_scheme_(NULL) + , night_color_scheme_(NULL) , commands_() , commands_lock_(true) , sub_menu_() @@ -254,6 +216,16 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() { tbt_show_command_ = NULL; } + if (day_color_scheme_) { + delete day_color_scheme_; + day_color_scheme_ = NULL; + } + + if (night_color_scheme_) { + delete night_color_scheme_; + night_color_scheme_ = NULL; + } + for (CommandsMap::iterator command_it = commands_.begin(); commands_.end() != command_it; ++command_it) { @@ -330,6 +302,16 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon() return menu_icon_; } +const smart_objects::SmartObject* +DynamicApplicationDataImpl::day_color_scheme() const { + return day_color_scheme_; +} + +const smart_objects::SmartObject* +DynamicApplicationDataImpl::night_color_scheme() const { + return night_color_scheme_; +} + void DynamicApplicationDataImpl::load_global_properties( const smart_objects::SmartObject& properties_so) { SetGlobalProperties(properties_so.getElement(strings::vr_help_title), @@ -445,6 +427,24 @@ void DynamicApplicationDataImpl::set_menu_icon( menu_icon_ = new smart_objects::SmartObject(menu_icon); } +void DynamicApplicationDataImpl::set_day_color_scheme( + const smart_objects::SmartObject& color_scheme) { + if (day_color_scheme_) { + delete day_color_scheme_; + } + + day_color_scheme_ = new smart_objects::SmartObject(color_scheme); +} + +void DynamicApplicationDataImpl::set_night_color_scheme( + const smart_objects::SmartObject& color_scheme) { + if (night_color_scheme_) { + delete night_color_scheme_; + } + + night_color_scheme_ = new smart_objects::SmartObject(color_scheme); +} + void DynamicApplicationDataImpl::SetGlobalProperties( const smart_objects::SmartObject& param, void (DynamicApplicationData::*callback)( 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 38b62ce731..993e094647 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 @@ -48,7 +48,7 @@ SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {} void SetDisplayLayoutRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationConstSharedPtr app = + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { @@ -57,6 +57,17 @@ void SetDisplayLayoutRequest::Run() { return; } + const smart_objects::SmartObject& msg_params = + (*message_)[strings::msg_params]; + + if (msg_params.keyExists(strings::day_color_scheme)) { + app->set_day_color_scheme(msg_params[strings::day_color_scheme]); + } + + if (msg_params.keyExists(strings::night_color_scheme)) { + app->set_night_color_scheme(msg_params[strings::night_color_scheme]); + } + (*message_)[strings::msg_params][strings::app_id] = app->app_id(); StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout, -- cgit v1.2.1 From 47d09114d7a71c871b1b697c8f807de338995e0f Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 2 May 2018 11:41:29 -0400 Subject: Upadte Color Via Set Display Layout and add Reject Logic --- .../include/application_manager/application.h | 3 ++ .../application_manager/application_data_impl.h | 3 ++ .../application_manager/smart_object_keys.h | 1 + .../src/application_data_impl.cc | 9 ++++ .../commands/mobile/set_display_layout_request.cc | 48 +++++++++++++++++++++- .../application_manager/src/smart_object_keys.cc | 1 + 6 files changed, 63 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index aa607449a2..01e3bf6b56 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -191,6 +191,7 @@ class DynamicApplicationData { virtual const smart_objects::SmartObject* menu_icon() const = 0; virtual const smart_objects::SmartObject* day_color_scheme() const = 0; virtual const smart_objects::SmartObject* night_color_scheme() const = 0; + virtual const std::string& display_layout() const = 0; virtual void load_global_properties(const smart_objects::SmartObject& so) = 0; virtual void set_help_prompt( @@ -226,6 +227,8 @@ class DynamicApplicationData { const smart_objects::SmartObject& color_scheme) = 0; virtual void set_night_color_scheme( const smart_objects::SmartObject& color_scheme) = 0; + + virtual void set_display_layout(const std::string& layout) = 0; /** * @brief Checks if application is media, voice communication or navigation * @return true if application is media, voice communication or navigation, diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h index 6d47ba4736..dc9be4e1d8 100644 --- a/src/components/application_manager/include/application_manager/application_data_impl.h +++ b/src/components/application_manager/include/application_manager/application_data_impl.h @@ -98,6 +98,7 @@ class DynamicApplicationDataImpl : public virtual Application { const smart_objects::SmartObject* menu_icon() const; const smart_objects::SmartObject* day_color_scheme() const; const smart_objects::SmartObject* night_color_scheme() const; + const std::string& display_layout() const; void load_global_properties(const smart_objects::SmartObject& properties_so); void set_help_prompt(const smart_objects::SmartObject& help_prompt); @@ -114,6 +115,7 @@ class DynamicApplicationDataImpl : public virtual Application { void set_menu_icon(const smart_objects::SmartObject& menu_icon); void set_day_color_scheme(const smart_objects::SmartObject& color_scheme); void set_night_color_scheme(const smart_objects::SmartObject& color_scheme); + void set_display_layout(const std::string& layout); /* * @brief Adds a command to the in application menu */ @@ -270,6 +272,7 @@ class DynamicApplicationDataImpl : public virtual Application { smart_objects::SmartObject* tbt_show_command_; smart_objects::SmartObject* day_color_scheme_; smart_objects::SmartObject* night_color_scheme_; + std::string display_layout_; CommandsMap commands_; mutable sync_primitives::Lock commands_lock_; 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 8bcd69f896..4e12516280 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 @@ -186,6 +186,7 @@ extern const char* background_color; extern const char* red; extern const char* green; extern const char* blue; +extern const char* display_layout; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc index a5c39455ba..5e31995b7d 100644 --- a/src/components/application_manager/src/application_data_impl.cc +++ b/src/components/application_manager/src/application_data_impl.cc @@ -175,6 +175,7 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl() , tbt_show_command_(NULL) , day_color_scheme_(NULL) , night_color_scheme_(NULL) + , display_layout_("") , commands_() , commands_lock_(true) , sub_menu_() @@ -312,6 +313,10 @@ DynamicApplicationDataImpl::night_color_scheme() const { return night_color_scheme_; } +const std::string& DynamicApplicationDataImpl::display_layout() const { + return display_layout_; +} + void DynamicApplicationDataImpl::load_global_properties( const smart_objects::SmartObject& properties_so) { SetGlobalProperties(properties_so.getElement(strings::vr_help_title), @@ -445,6 +450,10 @@ void DynamicApplicationDataImpl::set_night_color_scheme( night_color_scheme_ = new smart_objects::SmartObject(color_scheme); } +void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) { + display_layout_ = layout; +} + void DynamicApplicationDataImpl::SetGlobalProperties( const smart_objects::SmartObject& param, void (DynamicApplicationData::*callback)( 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 993e094647..e80912f2d9 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 @@ -60,12 +60,56 @@ void SetDisplayLayoutRequest::Run() { const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + std::string old_layout = app->display_layout(); + std::string new_layout = ""; + bool allow_color_change = true; + + if (msg_params.keyExists(strings::display_layout)) { + new_layout = msg_params[strings::display_layout].asString(); + } + + if(new_layout != old_layout && !new_layout.empty()) { // Template switched, allow any color change + LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest New Layout: " << new_layout); + app->set_display_layout(new_layout); + } else { + LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change"); + // 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)) { + if(!(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"); + allow_color_change = false; + } + + } + + if ((msg_params.keyExists(strings::night_color_scheme) && app->night_color_scheme() != NULL)) { + if(!(msg_params[strings::night_color_scheme] == *(app->night_color_scheme())) ) { + //Color scheme param exists and has been previously set, do not allow color change + LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change"); + allow_color_change = false; + } + } + } + if (msg_params.keyExists(strings::day_color_scheme)) { - app->set_day_color_scheme(msg_params[strings::day_color_scheme]); + if(allow_color_change) { + LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change"); + app->set_day_color_scheme(msg_params[strings::day_color_scheme]); + } } if (msg_params.keyExists(strings::night_color_scheme)) { - app->set_night_color_scheme(msg_params[strings::night_color_scheme]); + if(allow_color_change) { + LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change"); + app->set_night_color_scheme(msg_params[strings::night_color_scheme]); + } + } + + if (!allow_color_change) { + SendResponse(false, mobile_apis::Result::REJECTED); + return; } (*message_)[strings::msg_params][strings::app_id] = app->app_id(); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 88ec5986f4..788f8d28fc 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -150,6 +150,7 @@ const char* background_color = "backgroundColor"; const char* red = "red"; const char* green = "green"; const char* blue = "blue"; +const char* display_layout = "displayLayout"; // PutFile const char* sync_file_name = "syncFileName"; -- cgit v1.2.1 From 37de8947449d951d7a495b12a0ce510e52481d19 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 2 May 2018 11:43:10 -0400 Subject: Fix Style --- .../src/application_data_impl.cc | 8 ++--- .../mobile/register_app_interface_request.cc | 3 +- .../commands/mobile/set_display_layout_request.cc | 42 ++++++++++++---------- .../src/message_helper/message_helper.cc | 7 ++-- 4 files changed, 33 insertions(+), 27 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc index 5e31995b7d..226c83dbf6 100644 --- a/src/components/application_manager/src/application_data_impl.cc +++ b/src/components/application_manager/src/application_data_impl.cc @@ -303,8 +303,8 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon() return menu_icon_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::day_color_scheme() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::day_color_scheme() + const { return day_color_scheme_; } @@ -433,7 +433,7 @@ void DynamicApplicationDataImpl::set_menu_icon( } void DynamicApplicationDataImpl::set_day_color_scheme( - const smart_objects::SmartObject& color_scheme) { + const smart_objects::SmartObject& color_scheme) { if (day_color_scheme_) { delete day_color_scheme_; } @@ -442,7 +442,7 @@ void DynamicApplicationDataImpl::set_day_color_scheme( } void DynamicApplicationDataImpl::set_night_color_scheme( - const smart_objects::SmartObject& color_scheme) { + const smart_objects::SmartObject& color_scheme) { if (night_color_scheme_) { delete night_color_scheme_; } 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 c0cbe80ae4..c799d68609 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 @@ -353,7 +353,8 @@ void RegisterAppInterfaceRequest::Run() { } if (msg_params.keyExists(strings::night_color_scheme)) { - application->set_night_color_scheme(msg_params[strings::night_color_scheme]); + application->set_night_color_scheme( + msg_params[strings::night_color_scheme]); } // Add device to policy table and set device info, if any 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 e80912f2d9..ba6bba8054 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 @@ -48,8 +48,7 @@ SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {} void SetDisplayLayoutRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -58,7 +57,7 @@ void SetDisplayLayoutRequest::Run() { } const smart_objects::SmartObject& msg_params = - (*message_)[strings::msg_params]; + (*message_)[strings::msg_params]; std::string old_layout = app->display_layout(); std::string new_layout = ""; @@ -68,25 +67,32 @@ void SetDisplayLayoutRequest::Run() { new_layout = msg_params[strings::display_layout].asString(); } - if(new_layout != old_layout && !new_layout.empty()) { // Template switched, allow any color change - LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest New Layout: " << new_layout); + if (new_layout != old_layout && + !new_layout.empty()) { // Template switched, allow any color change + LOG4CXX_DEBUG(logger_, + "SetDisplayLayoutRequest New Layout: " << new_layout); app->set_display_layout(new_layout); - } else { + } else { LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change"); // 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)) { - if(!(msg_params[strings::day_color_scheme] == *(app->day_color_scheme())) ) { - //Color scheme param exists and has been previously set, do not allow color change + if ((msg_params.keyExists(strings::day_color_scheme) && + app->day_color_scheme() != NULL)) { + if (!(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"); - allow_color_change = false; + allow_color_change = false; } - } - if ((msg_params.keyExists(strings::night_color_scheme) && app->night_color_scheme() != NULL)) { - if(!(msg_params[strings::night_color_scheme] == *(app->night_color_scheme())) ) { - //Color scheme param exists and has been previously set, do not allow color change + if ((msg_params.keyExists(strings::night_color_scheme) && + app->night_color_scheme() != NULL)) { + if (!(msg_params[strings::night_color_scheme] == + *(app->night_color_scheme()))) { + // Color scheme param exists and has been previously set, do not allow + // color change LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change"); allow_color_change = false; } @@ -94,17 +100,17 @@ void SetDisplayLayoutRequest::Run() { } if (msg_params.keyExists(strings::day_color_scheme)) { - if(allow_color_change) { + if (allow_color_change) { LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change"); app->set_day_color_scheme(msg_params[strings::day_color_scheme]); - } + } } if (msg_params.keyExists(strings::night_color_scheme)) { - if(allow_color_change) { + if (allow_color_change) { LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change"); app->set_night_color_scheme(msg_params[strings::night_color_scheme]); - } + } } if (!allow_color_change) { 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 41138784c2..80141aa7dc 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -1677,8 +1677,7 @@ bool MessageHelper::CreateHMIApplicationStruct( const smart_objects::SmartObject* app_types = app->app_types(); const smart_objects::SmartObject* ngn_media_screen_name = app->ngn_media_screen_name(); - const smart_objects::SmartObject* day_color_scheme = - app->day_color_scheme(); + const smart_objects::SmartObject* day_color_scheme = app->day_color_scheme(); const smart_objects::SmartObject* night_color_scheme = app->night_color_scheme(); std::string device_name; @@ -1718,11 +1717,11 @@ bool MessageHelper::CreateHMIApplicationStruct( message[strings::app_type] = *app_types; } - if (day_color_scheme) { + if (day_color_scheme) { message[strings::day_color_scheme] = *day_color_scheme; } - if (night_color_scheme) { + if (night_color_scheme) { message[strings::night_color_scheme] = *night_color_scheme; } -- cgit v1.2.1 From d2e877f94cc36182cbbe9b42b64edc9a98966e8d Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 2 May 2018 15:12:41 -0400 Subject: Fix typo in HMI API --- src/components/interfaces/HMI_API.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index c2178922d6..5780742859 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1880,13 +1880,13 @@ A color scheme for all display layout templates. - + The primary "accent" color - + The secondary "accent" color - + The color of the background -- cgit v1.2.1 From 1e9d9b20d7dd1599b21b3bebe75d993165745be0 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 24 Apr 2018 15:35:43 -0400 Subject: Add secondaryGraphic to ImageFieldName enum --- .../application_manager/src/hmi_capabilities_impl.cc | 3 +++ src/components/application_manager/test/hmi_capabilities.json | 10 +++++++++- src/components/interfaces/HMI_API.xml | 5 ++++- src/components/interfaces/MOBILE_API.xml | 6 +++++- 4 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index e39b728155..278e4761db 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -281,6 +281,9 @@ void InitCapabilities() { std::string("appIcon"), hmi_apis::Common_ImageFieldName::appIcon)); image_field_name_enum.insert(std::make_pair( std::string("graphic"), hmi_apis::Common_ImageFieldName::graphic)); + image_field_name_enum.insert( + std::make_pair(std::string("secondaryGraphic"), + hmi_apis::Common_ImageFieldName::secondaryGraphic)); image_field_name_enum.insert( std::make_pair(std::string("showConstantTBTIcon"), hmi_apis::Common_ImageFieldName::showConstantTBTIcon)); diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 9db6ee78ae..0efcc688bc 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -263,7 +263,15 @@ }, { "name": "graphic", - "imageTypeSupported": [], + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "secondaryGraphic", + "imageTypeSupported": [], "imageResolution": { "resolutionWidth": 35, "resolutionHeight": 35 diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index ab3933fc0f..a7302a31cf 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -624,7 +624,10 @@ The image field for the app icon (set by setAppIcon) - The image field for Show + The primary image field for Show + + + The secondary image field for Show The primary image field for ShowConstantTBT diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..d032247c85 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -781,7 +781,11 @@ - The image field for Show + The primary image field for Show + + + + The secondary image field for Show -- cgit v1.2.1 From ff50d25bd55d38b07ea2ca910dc4fd6f39b5a939 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 11:10:09 -0400 Subject: Implement Fuel Range Vehicle Data Parameter --- .../application_manager/smart_object_keys.h | 1 + .../src/message_helper/message_helper.cc | 2 + .../application_manager/src/smart_object_keys.cc | 1 + .../application_manager/test/sdl_preloaded_pt.json | 4 ++ .../application_manager/test/sdl_pt_update.json | 4 ++ src/components/interfaces/HMI_API.xml | 52 ++++++++++++++++++++++ src/components/interfaces/MOBILE_API.xml | 52 ++++++++++++++++++++++ .../include/policy/policy_table/enums.h | 1 + .../include/policy/policy_table_interface_ext.xml | 1 + .../policy_external/src/policy_table/enums.cc | 7 +++ .../policy/policy_external/test/json/PTU.json | 4 ++ .../policy/policy_external/test/json/PTU2.json | 4 ++ .../policy/policy_external/test/json/PTU3.json | 4 ++ .../json/PTU_with_empty_requestType_array.json | 4 ++ ...U_with_invalid_requestType_between_correct.json | 4 ++ .../json/PTU_with_one_invalid_requestType.json | 4 ++ .../test/json/PTU_without_requestType_field.json | 4 ++ ...h_invalid_default_reqestType_between_valid.json | 4 ++ ...eloadedPT_with_invalid_default_requestType.json | 4 ++ ..._with_several_invalid_default_requestTypes.json | 4 ++ .../test/json/ptu2_requestType.json | 4 ++ .../policy_external/test/json/ptu_requestType.json | 4 ++ .../test/json/sdl_preloaded_pt.json | 4 ++ .../test/json/sdl_preloaded_pt1.json | 4 ++ .../test/json/sdl_preloaded_pt_send_location.json | 4 ++ .../test/json/sdl_pt_first_update.json | 4 ++ .../test/json/sdl_pt_second_update.json | 4 ++ .../policy_external/test/json/sdl_pt_update.json | 4 ++ .../json/sdl_update_pt_2_groups_have_params.json | 4 ++ .../json/sdl_update_pt_2_groups_no_params_in1.json | 4 ++ ...date_pt_2_groups_no_params_in1_omitted_in2.json | 4 ++ .../test/json/sdl_update_pt_send_location.json | 4 ++ .../sdl_update_pt_send_location_all_params.json | 4 ++ .../sdl_update_pt_send_location_no_params.json | 4 ++ .../sdl_update_pt_send_location_some_params.json | 4 ++ .../test/json/valid_sdl_pt_update.json | 4 ++ .../include/policy/policy_table/enums.h | 1 + .../policy_regular/policy_table_interface_ext.xml | 2 + .../policy_regular/src/policy_table/enums.cc | 9 +++- src/components/policy/policy_regular/test/PTU.json | 4 ++ .../policy/policy_regular/test/PTU2.json | 4 ++ .../policy/policy_regular/test/PTU3.json | 4 ++ .../policy/policy_regular/test/PTU4.json | 4 ++ .../policy_regular/test/ptu2_requestType.json | 4 ++ .../policy_regular/test/ptu_requestType.json | 4 ++ .../policy_regular/test/sdl_preloaded_pt.json | 4 ++ .../policy_regular/test/sdl_pt_first_update.json | 4 ++ .../policy_regular/test/sdl_pt_second_update.json | 4 ++ .../policy/policy_regular/test/sdl_pt_update.json | 4 ++ .../policy_regular/test/valid_sdl_pt_update.json | 4 ++ 50 files changed, 284 insertions(+), 1 deletion(-) (limited to 'src/components') 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 32a2315f23..7809e5c542 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 @@ -238,6 +238,7 @@ extern const char* rpm; extern const char* fuel_level; extern const char* fuel_level_state; extern const char* instant_fuel_consumption; +extern const char* fuel_range; extern const char* external_temp; extern const char* vin; extern const char* prndl; 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 6a908c4ebc..229c49d63d 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -175,6 +175,8 @@ std::pair + + + + + + For vehicles using compressed natural gas. + + + + + For vehicles using liquefied petroleum gas. + + + + For FCEV (fuel cell electric vehicle). + + + For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery. + + + + + + + + The estimate range in KM the vehicle can travel based on fuel level and consumption. + + + + The volume status of a vehicle component. @@ -978,6 +1008,7 @@ + @@ -4195,6 +4226,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4271,6 +4305,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius. @@ -4353,6 +4390,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius. @@ -4429,6 +4469,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4506,6 +4549,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4583,6 +4629,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4661,6 +4710,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..5dc9feedbc 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -513,6 +513,7 @@ + @@ -1083,6 +1084,36 @@ + + + + + + For vehicles using compressed natural gas. + + + + + For vehicles using liquefied petroleum gas. + + + + For FCEV (fuel cell electric vehicle). + + + For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery. + + + + + + + + The estimate range in KM the vehicle can travel based on fuel level and consumption. + + + + See ComponentVolumeStatus. @@ -4056,6 +4087,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4159,6 +4193,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius. @@ -4240,6 +4277,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius. @@ -4341,6 +4381,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4422,6 +4465,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -4527,6 +4573,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius @@ -5745,6 +5794,9 @@ The instantaneous fuel consumption in microlitres + + The estimate range in KM the vehicle can travel based on fuel level and consumption + The external temperature in degrees celsius diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h index 4f8ae5c98d..cc785c1518 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h @@ -70,6 +70,7 @@ enum Parameter { P_FUELLEVEL_STATE, P_HEADLAMPSTATUS, P_INSTANTFUELCONSUMPTION, + P_FUELRANGE, P_ODOMETER, P_TIREPRESSURE, P_WIPERSTATUS, diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml index 91518f8f6e..878354fd19 100644 --- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml +++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml @@ -30,6 +30,7 @@ + diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index 168ff86b27..7a8bee93e2 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -126,6 +126,8 @@ bool IsValidEnum(Parameter val) { return true; case P_INSTANTFUELCONSUMPTION: return true; + case P_FUELRANGE: + return true; case P_ODOMETER: return true; case P_TIREPRESSURE: @@ -215,6 +217,8 @@ const char* EnumToJsonString(Parameter val) { return "headLampStatus"; case P_INSTANTFUELCONSUMPTION: return "instantFuelConsumption"; + case P_FUELRANGE: + return "fuelRange"; case P_ODOMETER: return "odometer"; case P_TIREPRESSURE: @@ -311,6 +315,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("instantFuelConsumption" == literal) { *result = P_INSTANTFUELCONSUMPTION; return true; + } else if ("fuelRange" == literal) { + *result = P_FUELRANGE; + return true; } else if ("odometer" == literal) { *result = P_ODOMETER; return true; diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json index c0f18bb6a9..bfc4d714f7 100644 --- a/src/components/policy/policy_external/test/json/PTU.json +++ b/src/components/policy/policy_external/test/json/PTU.json @@ -478,6 +478,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -499,6 +500,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -520,6 +522,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -540,6 +543,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json index 8ad6aefb83..e4d21a3aa1 100644 --- a/src/components/policy/policy_external/test/json/PTU2.json +++ b/src/components/policy/policy_external/test/json/PTU2.json @@ -478,6 +478,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -499,6 +500,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -520,6 +522,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -540,6 +543,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json index 33f699d068..40b69308cb 100644 --- a/src/components/policy/policy_external/test/json/PTU3.json +++ b/src/components/policy/policy_external/test/json/PTU3.json @@ -478,6 +478,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -499,6 +500,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -520,6 +522,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -540,6 +543,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json index 45e616c874..ba8e8affba 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json +++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json @@ -1598,6 +1598,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1613,6 +1614,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1628,6 +1630,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1642,6 +1645,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json index 917d53177f..3b96ab44a3 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json +++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json @@ -1601,6 +1601,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1616,6 +1617,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1631,6 +1633,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1645,6 +1648,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json index f514f279de..20bc102180 100644 --- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json +++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json @@ -1598,6 +1598,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1613,6 +1614,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1628,6 +1630,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1642,6 +1645,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json index 57c1bce8f1..d80a50add2 100644 --- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json +++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json @@ -1597,6 +1597,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1612,6 +1613,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1627,6 +1629,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1641,6 +1644,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json index 20023ba8e5..2705db87d7 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json index 5e4dffbc56..063c64dd5b 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json index 6b92db7c17..92d7329e1e 100644 --- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json +++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json index c12ec773e0..abf4a3d1d6 100644 --- a/src/components/policy/policy_external/test/json/ptu2_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json @@ -490,6 +490,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -511,6 +512,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -532,6 +534,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -552,6 +555,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json index 0b1f0ed469..d32f8dba38 100644 --- a/src/components/policy/policy_external/test/json/ptu_requestType.json +++ b/src/components/policy/policy_external/test/json/ptu_requestType.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json index 10894516cf..29ab49af27 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json index 79d1b572e6..d1c7302cae 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json @@ -2314,6 +2314,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -2333,6 +2334,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -2352,6 +2354,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -2370,6 +2373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json index 1401c3b7a1..b7db9518ca 100644 --- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json @@ -490,6 +490,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -511,6 +512,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -532,6 +534,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -552,6 +555,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json index ac2b18ab6f..f599c4d88d 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json @@ -1615,6 +1615,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1630,6 +1631,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1645,6 +1647,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1659,6 +1662,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json index 230ad1fa4f..5a063b397b 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json @@ -1615,6 +1615,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1630,6 +1631,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1645,6 +1647,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1659,6 +1662,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json index 4e2dd3a85c..1b4052a515 100644 --- a/src/components/policy/policy_external/test/json/sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json @@ -1599,6 +1599,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1614,6 +1615,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1629,6 +1631,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1643,6 +1646,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json index 8a3ef897c5..b2eda4e00d 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json index dcb96f147b..5dd50b01b2 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json index dd7a529ec8..0f8c81415f 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json index 14eb11d195..38b38ae63e 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json index f1e460e603..ca975bb16c 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json index 0ba24ce484..0c545f6fde 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json index 6e8ce0c6a7..d7f3b929c7 100644 --- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json +++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json @@ -489,6 +489,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -510,6 +511,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -531,6 +533,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -551,6 +554,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json index c384ea73e2..d0469c2558 100644 --- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json +++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json @@ -1591,6 +1591,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1606,6 +1607,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1621,6 +1623,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1635,6 +1638,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h index 4eb35d2aa4..7284ec7ebe 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h @@ -70,6 +70,7 @@ enum Parameter { P_FUELLEVEL_STATE, P_HEADLAMPSTATUS, P_INSTANTFUELCONSUMPTION, + P_FUELRANGE, P_ODOMETER, P_TIREPRESSURE, P_WIPERSTATUS, diff --git a/src/components/policy/policy_regular/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml index 468eec2b0b..246f04dae3 100644 --- a/src/components/policy/policy_regular/policy_table_interface_ext.xml +++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml @@ -1,3 +1,4 @@ + @@ -30,6 +31,7 @@ + diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 34d12420d8..2aab952f53 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -127,6 +127,8 @@ bool IsValidEnum(Parameter val) { return true; case P_INSTANTFUELCONSUMPTION: return true; + case P_FUELRANGE: + return true; case P_ODOMETER: return true; case P_TIREPRESSURE: @@ -185,6 +187,8 @@ const char* EnumToJsonString(Parameter val) { return "headLampStatus"; case P_INSTANTFUELCONSUMPTION: return "instantFuelConsumption"; + case P_FUELRANGE: + return "fuelRange"; case P_ODOMETER: return "odometer"; case P_TIREPRESSURE: @@ -251,7 +255,10 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("instantFuelConsumption" == literal) { *result = P_INSTANTFUELCONSUMPTION; return true; - } else if ("odometer" == literal) { + } else if ("fuelRange" == literal) { + *result = P_FUELRANGE; + return true; + }else if ("odometer" == literal) { *result = P_ODOMETER; return true; } else if ("tirePressure" == literal) { diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json index d9f70426d1..7a7b37f165 100644 --- a/src/components/policy/policy_regular/test/PTU.json +++ b/src/components/policy/policy_regular/test/PTU.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json index b4c3c0624c..2a5cec4bde 100644 --- a/src/components/policy/policy_regular/test/PTU2.json +++ b/src/components/policy/policy_regular/test/PTU2.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json index 6309bd9cfd..22a5ea9ee1 100644 --- a/src/components/policy/policy_regular/test/PTU3.json +++ b/src/components/policy/policy_regular/test/PTU3.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json index 651a4cb2ef..980869ac27 100644 --- a/src/components/policy/policy_regular/test/PTU4.json +++ b/src/components/policy/policy_regular/test/PTU4.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json index e25095bb9f..dc5174c158 100644 --- a/src/components/policy/policy_regular/test/ptu2_requestType.json +++ b/src/components/policy/policy_regular/test/ptu2_requestType.json @@ -491,6 +491,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -512,6 +513,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -533,6 +535,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -553,6 +556,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json index c5aa6f0a6c..668a40a832 100644 --- a/src/components/policy/policy_regular/test/ptu_requestType.json +++ b/src/components/policy/policy_regular/test/ptu_requestType.json @@ -491,6 +491,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -512,6 +513,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -533,6 +535,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -553,6 +556,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json index 10894516cf..29ab49af27 100644 --- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json +++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json @@ -355,6 +355,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -372,6 +373,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -389,6 +391,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] @@ -405,6 +408,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json index ac2b18ab6f..f599c4d88d 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json @@ -1615,6 +1615,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1630,6 +1631,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1645,6 +1647,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1659,6 +1662,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json index 230ad1fa4f..5a063b397b 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json @@ -1615,6 +1615,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1630,6 +1631,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1645,6 +1647,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1659,6 +1662,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json index f890e8e5ae..2db11ad818 100644 --- a/src/components/policy/policy_regular/test/sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/sdl_pt_update.json @@ -1593,6 +1593,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1608,6 +1609,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1623,6 +1625,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1637,6 +1640,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json index c384ea73e2..d0469c2558 100644 --- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json +++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json @@ -1591,6 +1591,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1606,6 +1607,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "vin", @@ -1621,6 +1623,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" @@ -1635,6 +1638,7 @@ "fuelLevel_State", "headLampStatus", "instantFuelConsumption", + "fuelRange", "odometer", "tirePressure", "wiperStatus" -- cgit v1.2.1 From d036d02eb275a82fb2526fc6b1024b15ed45d56d Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 13:12:28 -0400 Subject: Fix unit test compilation errors --- .../test/include/application_manager/mock_application.h | 9 +++++++++ src/components/remote_control/test/include/mock_application.h | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 5bf2f2368e..65c2057476 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -209,6 +209,9 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(day_color_scheme, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(night_color_scheme, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(display_layout, const std::string&()); MOCK_METHOD1(load_global_properties, void(const smart_objects::SmartObject& so)); MOCK_METHOD1(set_help_prompt, @@ -232,6 +235,12 @@ class MockApplication : public ::application_manager::Application { void(const smart_objects::SmartObject& menu_title)); MOCK_METHOD1(set_menu_icon, void(const smart_objects::SmartObject& menu_icon)); + MOCK_METHOD1(set_day_color_scheme, + void(const smart_objects::SmartObject& color_scheme)); + MOCK_METHOD1(set_night_color_scheme, + void(const smart_objects::SmartObject& color_scheme)); + MOCK_METHOD1(set_display_layout, + void(const std::string& layout)); MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); MOCK_METHOD1(set_audio_stream_retry_number, void(const uint32_t& audio_stream_retry_number)); diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h index a46b48673d..0eef0edbf9 100644 --- a/src/components/remote_control/test/include/mock_application.h +++ b/src/components/remote_control/test/include/mock_application.h @@ -216,6 +216,9 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(day_color_scheme, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(night_color_scheme, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(display_layout, const std::string&()); MOCK_METHOD1(load_global_properties, void(const smart_objects::SmartObject& so)); MOCK_METHOD1(set_help_prompt, @@ -239,6 +242,12 @@ class MockApplication : public ::application_manager::Application { void(const smart_objects::SmartObject& menu_title)); MOCK_METHOD1(set_menu_icon, void(const smart_objects::SmartObject& menu_icon)); + MOCK_METHOD1(set_day_color_scheme, + void(const smart_objects::SmartObject& color_scheme)); + MOCK_METHOD1(set_night_color_scheme, + void(const smart_objects::SmartObject& color_scheme)); + MOCK_METHOD1(set_display_layout, + void(const std::string& layout)); MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); MOCK_METHOD1(set_audio_stream_retry_number, void(const uint32_t& audio_stream_retry_number)); -- cgit v1.2.1 From d07370836373c33c0e58f8737cfcd5dc064384fe Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 14:42:34 -0400 Subject: Fix set display layout test --- .../application_manager/test/commands/mobile/set_display_layout_test.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc index 8444b88d63..3e1785a3bd 100644 --- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc @@ -69,6 +69,7 @@ const uint32_t kAppId = 1u; const uint32_t kCmdId = 1u; const uint32_t kConnectionKey = 2u; const uint32_t kCorrelationKey = 2u; +const std::string kLayout = "media"; } // namespace MATCHER_P(CheckMshCorrId, corr_id, "") { @@ -189,6 +190,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) { MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app)); + EXPECT_CALL(*mock_app, display_layout()).WillOnce(ReturnRef(kLayout)); EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) -- cgit v1.2.1 From c1b4b3ac89d94c2d623f7df4b016aa2bab5f24ff Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 14:54:14 -0400 Subject: Fix spacing --- src/components/interfaces/MOBILE_API.xml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/components') diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 9f13eb1c57..a37cc3ecd5 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2898,15 +2898,15 @@ A color scheme for all display layout templates. - - The primary "accent" color - - - The secondary "accent" color - - - The color of the background - + + The primary "accent" color + + + The secondary "accent" color + + + The color of the background + @@ -3008,7 +3008,9 @@ See AppInfo. + + @@ -5268,6 +5270,7 @@ + -- cgit v1.2.1 From 6d5271c700975ed5bdeda486844356cb03aaedc5 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 15:15:08 -0400 Subject: Style & Review Comments --- .../commands/mobile/set_display_layout_request.cc | 54 +++++++++------------- .../include/application_manager/mock_application.h | 3 +- .../remote_control/test/include/mock_application.h | 3 +- 3 files changed, 24 insertions(+), 36 deletions(-) (limited to 'src/components') 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 ba6bba8054..648a531e92 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 @@ -61,7 +61,6 @@ void SetDisplayLayoutRequest::Run() { std::string old_layout = app->display_layout(); std::string new_layout = ""; - bool allow_color_change = true; if (msg_params.keyExists(strings::display_layout)) { new_layout = msg_params[strings::display_layout].asString(); @@ -76,46 +75,37 @@ void SetDisplayLayoutRequest::Run() { LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change"); // 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)) { - if (!(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"); - allow_color_change = false; - } + if (msg_params.keyExists(strings::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"); + SendResponse(false, mobile_apis::Result::REJECTED); + return; } - if ((msg_params.keyExists(strings::night_color_scheme) && - app->night_color_scheme() != NULL)) { - if (!(msg_params[strings::night_color_scheme] == - *(app->night_color_scheme()))) { - // Color scheme param exists and has been previously set, do not allow - // color change - LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change"); - allow_color_change = false; - } + if (msg_params.keyExists(strings::night_color_scheme) && + app->night_color_scheme() != NULL && + !(msg_params[strings::night_color_scheme] == + *(app->night_color_scheme()))) { + // Color scheme param exists and has been previously set, do not allow + // color change + LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change"); + SendResponse(false, mobile_apis::Result::REJECTED); + return; } } if (msg_params.keyExists(strings::day_color_scheme)) { - if (allow_color_change) { - LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change"); - app->set_day_color_scheme(msg_params[strings::day_color_scheme]); - } + LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change"); + app->set_day_color_scheme(msg_params[strings::day_color_scheme]); } if (msg_params.keyExists(strings::night_color_scheme)) { - if (allow_color_change) { - LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change"); - app->set_night_color_scheme(msg_params[strings::night_color_scheme]); - } - } - - if (!allow_color_change) { - SendResponse(false, mobile_apis::Result::REJECTED); - return; + LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change"); + app->set_night_color_scheme(msg_params[strings::night_color_scheme]); } (*message_)[strings::msg_params][strings::app_id] = app->app_id(); diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 65c2057476..c46a0b994f 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -239,8 +239,7 @@ class MockApplication : public ::application_manager::Application { void(const smart_objects::SmartObject& color_scheme)); MOCK_METHOD1(set_night_color_scheme, void(const smart_objects::SmartObject& color_scheme)); - MOCK_METHOD1(set_display_layout, - void(const std::string& layout)); + MOCK_METHOD1(set_display_layout, void(const std::string& layout)); MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); MOCK_METHOD1(set_audio_stream_retry_number, void(const uint32_t& audio_stream_retry_number)); diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h index 0eef0edbf9..ef7c1d63a7 100644 --- a/src/components/remote_control/test/include/mock_application.h +++ b/src/components/remote_control/test/include/mock_application.h @@ -246,8 +246,7 @@ class MockApplication : public ::application_manager::Application { void(const smart_objects::SmartObject& color_scheme)); MOCK_METHOD1(set_night_color_scheme, void(const smart_objects::SmartObject& color_scheme)); - MOCK_METHOD1(set_display_layout, - void(const std::string& layout)); + MOCK_METHOD1(set_display_layout, void(const std::string& layout)); MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); MOCK_METHOD1(set_audio_stream_retry_number, void(const uint32_t& audio_stream_retry_number)); -- cgit v1.2.1 From b9c4fab74485af6fc3b2ec479b65a645eb848c09 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 15:17:06 -0400 Subject: Style Fix --- src/components/policy/policy_regular/src/policy_table/enums.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 2aab952f53..bd5ab780dd 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -258,7 +258,7 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("fuelRange" == literal) { *result = P_FUELRANGE; return true; - }else if ("odometer" == literal) { + } else if ("odometer" == literal) { *result = P_ODOMETER; return true; } else if ("tirePressure" == literal) { -- cgit v1.2.1 From 88569298b44899d31e57fac3a059aa17b816ccd3 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 3 May 2018 16:23:21 -0400 Subject: Update Fuel Range Param to Array --- src/components/interfaces/HMI_API.xml | 4 ++-- src/components/interfaces/MOBILE_API.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components') diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index d807138e12..323a07410f 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -4629,7 +4629,7 @@ The instantaneous fuel consumption in microlitres - + The estimate range in KM the vehicle can travel based on fuel level and consumption @@ -4710,7 +4710,7 @@ The instantaneous fuel consumption in microlitres - + The estimate range in KM the vehicle can travel based on fuel level and consumption diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 5dc9feedbc..826f02ec14 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -4573,7 +4573,7 @@ The instantaneous fuel consumption in microlitres - + The estimate range in KM the vehicle can travel based on fuel level and consumption @@ -5794,7 +5794,7 @@ The instantaneous fuel consumption in microlitres - + The estimate range in KM the vehicle can travel based on fuel level and consumption -- cgit v1.2.1 From 669b0066752959015f75b031bc31a7ede7d8f737 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Wed, 9 May 2018 13:54:59 -0700 Subject: Fix test failure in slider test due to undefined default timeout --- src/components/application_manager/test/commands/mobile/slider_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc index 54ac3cccc0..107b124e8d 100644 --- a/src/components/application_manager/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/test/commands/mobile/slider_test.cc @@ -284,7 +284,7 @@ TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) { EXPECT_CALL( app_mngr_, - updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout)); + updateRequestTimeout(kConnectionKey, kCorrelationId, _)); Event event(hmi_apis::FunctionID::UI_OnResetTimeout); event.set_smart_object(*msg_); -- cgit v1.2.1 From de1ec4dff650680a3dad09b692fafaa297ab9889 Mon Sep 17 00:00:00 2001 From: Elvis Kuliiev Date: Sun, 13 May 2018 23:47:04 +0300 Subject: Provide new image type Image.isTemplate --- .../application_manager/smart_object_keys.h | 1 + .../application_manager/src/smart_object_keys.cc | 1 + .../test/resumption/resumption_data_db_test.cc | 4 + .../test/resumption/resumption_data_test.cc | 1 + .../test/resumption_sql_queries_test.cc | 213 ++++++++++++++++----- src/components/interfaces/HMI_API.xml | 3 + src/components/interfaces/MOBILE_API.xml | 3 + 7 files changed, 180 insertions(+), 46 deletions(-) (limited to 'src/components') 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 32a2315f23..7c0f24bb3d 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 @@ -189,6 +189,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/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index c3aba90dd5..1004e6cf7c 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -153,6 +153,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/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 ab3933fc0f..9affbe567f 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1821,6 +1821,9 @@ Describes, whether it is a static or dynamic image. + + 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 + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..bede31c826 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -899,6 +899,9 @@ Describes, whether it is a static or dynamic image. + + 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 + -- cgit v1.2.1 From 028ca237522c1c1693ca54049cf462a5122598e4 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 14 May 2018 13:55:32 -0400 Subject: Prevent `INVALID_ID`responses from terminating valid requests --- .../application_manager/request_controller.h | 7 ++++++ .../application_manager/src/request_controller.cc | 25 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h index d3a5a0b821..c0bae1aac8 100644 --- a/src/components/application_manager/include/application_manager/request_controller.h +++ b/src/components/application_manager/include/application_manager/request_controller.h @@ -289,6 +289,13 @@ class RequestController { */ std::list notification_list_; + /** + * @brief Map keeping track of how many duplicate messages were sent for a + * given correlation id, to prevent early termination of a request + */ + std::map duplicate_message_count_; + sync_primitives::Lock duplicate_message_count_lock_; + /* * timer for checking requests timeout */ diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index a6d78f24de..f341967842 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -50,6 +50,7 @@ RequestController::RequestController(const RequestControlerSettings& settings) : pool_state_(UNDEFINED) , pool_size_(settings.thread_pool_size()) , request_tracker_(settings) + , duplicate_message_count_() , timer_("AM RequestCtrlTimer", new timer::TimerTaskImpl( this, &RequestController::TimeoutThread)) @@ -230,6 +231,21 @@ void RequestController::TerminateRequest(const uint32_t correlation_id, << correlation_id << " connection_key = " << connection_key << " function_id = " << function_id << " force_terminate = " << force_terminate); + { + AutoLock auto_lock(duplicate_message_count_lock_); + auto dup_it = duplicate_message_count_.find(correlation_id); + if (duplicate_message_count_.end() != dup_it) { + duplicate_message_count_[correlation_id]--; + if (0 == duplicate_message_count_[correlation_id]) { + duplicate_message_count_.erase(dup_it); + } + LOG4CXX_DEBUG(logger_, + "Ignoring termination request due to duplicate correlation " + "ID being sent"); + return; + } + } + RequestInfoPtr request = waiting_for_response_.Find(connection_key, correlation_id); if (!request) { @@ -478,6 +494,15 @@ void RequestController::Worker::threadMain() { commands::CommandRequestImpl* cmd_request = dynamic_cast(request_ptr.get()); if (cmd_request != NULL) { + uint32_t corr_id = cmd_request->correlation_id(); + request_controller_->duplicate_message_count_lock_.Acquire(); + auto dup_it = + request_controller_->duplicate_message_count_.find(corr_id); + if (request_controller_->duplicate_message_count_.end() == dup_it) { + request_controller_->duplicate_message_count_[corr_id] = 0; + } + request_controller_->duplicate_message_count_[corr_id]++; + request_controller_->duplicate_message_count_lock_.Release(); cmd_request->SendResponse( false, mobile_apis::Result::INVALID_ID, "Duplicate correlation_id"); } -- cgit v1.2.1 From 63349fe15538e3616484d3a7a96a5304cccb6047 Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Wed, 16 May 2018 11:13:30 +0300 Subject: Fix coding style issue --- .../application_manager/test/commands/mobile/slider_test.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc index 107b124e8d..53764e3fcd 100644 --- a/src/components/application_manager/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/test/commands/mobile/slider_test.cc @@ -282,9 +282,8 @@ TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) { CommandPtr command(CreateCommand(msg_)); EXPECT_TRUE(command->Init()); - EXPECT_CALL( - app_mngr_, - updateRequestTimeout(kConnectionKey, kCorrelationId, _)); + EXPECT_CALL(app_mngr_, + updateRequestTimeout(kConnectionKey, kCorrelationId, _)); Event event(hmi_apis::FunctionID::UI_OnResetTimeout); event.set_smart_object(*msg_); -- cgit v1.2.1 From 3c143c901e9c73858437db29c0a9bbad26428b66 Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Fri, 6 Apr 2018 19:33:55 +0300 Subject: Initial implementation Implemented function in PutFile which correctly calculates CRC32 checksum for std::vector Added comparison of calculated CRC checksum with received in PutFile request. Added PutFile response generation in case of CRC sum mismatch Fixed handling of unsigned integer values --- .../application_manager/smart_object_keys.h | 1 + .../src/commands/mobile/put_file_request.cc | 46 +++++++++++++++++++--- .../application_manager/src/smart_object_keys.cc | 1 + src/components/interfaces/MOBILE_API.xml | 7 ++++ .../include/smart_objects/number_schema_item.h | 16 ++++---- .../smart_objects/src/number_schema_item.cc | 2 +- 6 files changed, 59 insertions(+), 14 deletions(-) (limited to 'src/components') 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 32a2315f23..5a3a5fe8b6 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 @@ -184,6 +184,7 @@ extern const char* sync_file_name; extern const char* file_name; extern const char* file_type; extern const char* file_size; +extern const char* crc32_check_sum; extern const char* request_type; extern const char* persistent_file; extern const char* file_data; diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc index 602b420ba0..269c9c814e 100644 --- a/src/components/application_manager/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/src/commands/mobile/put_file_request.cc @@ -38,6 +38,22 @@ #include "application_manager/application_impl.h" #include "utils/file_system.h" +#include + +namespace { +/** +* Calculates CRC32 checksum +* @param binary_data - input data for which CRC32 should be calculated +* @return calculated CRC32 checksum +*/ +uint32_t GetCrc32CheckSum(const std::vector& binary_data) { + const std::size_t file_size = binary_data.size(); + boost::crc_32_type result; + result.process_bytes(&binary_data[0], file_size); + return result.checksum(); +} + +} // namespace namespace application_manager { @@ -137,7 +153,7 @@ void PutFileRequest::Run() { is_persistent_file_ = false; bool is_system_file = false; length_ = binary_data.size(); - bool is_download_compleate = true; + bool is_download_complete = true; bool offset_exist = (*message_)[strings::msg_params].keyExists(strings::offset); @@ -187,11 +203,29 @@ void PutFileRequest::Run() { return; } const std::string full_path = file_path + "/" + sync_file_name_; - UNUSED(full_path); + const size_t bin_data_size = binary_data.size(); + + if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) { + LOG4CXX_TRACE(logger_, "Binary Data Size: " << bin_data_size); + const uint32_t crc_received = + (*message_)[strings::msg_params][strings::crc32_check_sum].asUInt(); + LOG4CXX_TRACE(logger_, "CRC32 SUM Received: " << crc_received); + const uint32_t crc_calculated = GetCrc32CheckSum(binary_data); + LOG4CXX_TRACE(logger_, "CRC32 SUM Calculated: " << crc_calculated); + if (crc_calculated != crc_received) { + SendResponse(false, + mobile_apis::Result::CORRUPTED_DATA, + "CRC Check on file failed. File upload has been cancelled, " + "please retry.", + &response_params); + return; + } + } + LOG4CXX_DEBUG(logger_, - "Wrtiting " << binary_data.size() << "bytes to " << full_path - << " (current size is" - << file_system::FileSize(full_path) << ")"); + "Writing " << bin_data_size << " bytes to " << full_path + << " (current size is" + << file_system::FileSize(full_path) << ")"); mobile_apis::Result::eType save_result = application_manager_.SaveBinary( binary_data, file_path, sync_file_name_, offset_); @@ -211,7 +245,7 @@ void PutFileRequest::Run() { if (!is_system_file) { AppFile file(sync_file_name_, is_persistent_file_, - is_download_compleate, + is_download_complete, file_type_); if (0 == offset_) { diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index c3aba90dd5..75125ec90c 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -148,6 +148,7 @@ const char* sync_file_name = "syncFileName"; const char* file_name = "fileName"; const char* file_type = "fileType"; const char* file_size = "fileSize"; +const char* crc32_check_sum = "crc"; const char* request_type = "requestType"; const char* persistent_file = "persistentFile"; const char* file_data = "fileData"; diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a1c64aecda..ad9050fcf3 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -135,6 +135,9 @@ The value being set is read only + + The data sent failed to pass CRC check in receiver end + @@ -5073,6 +5076,9 @@ If offset is set to 0, then length is the total length of the file to be downloaded + + Additional CRC32 checksum to protect data integrity up to 512 Mbits . + @@ -5092,6 +5098,7 @@ + diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h index d549b9891a..34c5e3a8a6 100644 --- a/src/components/smart_objects/include/smart_objects/number_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h @@ -39,6 +39,7 @@ #include "smart_objects/default_shema_item.h" #include "smart_objects/schema_item_parameter.h" #include "utils/convert_utils.h" +#include "utils/helpers.h" namespace NsSmartDeviceLink { namespace NsSmartObjects { @@ -123,15 +124,16 @@ bool TNumberSchemaItem::isValidNumberType(SmartType type) { NumberType value(0); if ((SmartType_Double == type) && (typeid(double) == typeid(value))) { return true; - } else if ((SmartType_Integer == type) && - (typeid(int32_t) == typeid(value) || - typeid(uint32_t) == typeid(value) || - typeid(int64_t) == typeid(value) || - typeid(double) == typeid(value))) { + } else if (((SmartType_Integer == type) || (SmartType_UInteger == type)) && + helpers::Compare( + typeid(value), + typeid(int32_t), + typeid(uint32_t), + typeid(int64_t), + typeid(double))) { return true; - } else { - return false; } + return false; } template diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc index 78be9fe85d..9789434523 100644 --- a/src/components/smart_objects/src/number_schema_item.cc +++ b/src/components/smart_objects/src/number_schema_item.cc @@ -41,7 +41,7 @@ SmartType TNumberSchemaItem::getSmartType() const { template <> SmartType TNumberSchemaItem::getSmartType() const { - return SmartType_Integer; + return SmartType_UInteger; } template <> -- cgit v1.2.1 From a8967da62807c457983a029b83ec49a863f95ec0 Mon Sep 17 00:00:00 2001 From: BSolonenko Date: Thu, 12 Apr 2018 13:04:18 +0300 Subject: UT coverage checking CRC. Added Run_SrcSumEqual_SendSuccessResponse and Run_SrcSumEqual_SendCorruptedDataResponse test cases. --- .../test/commands/mobile/put_file_test.cc | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/test/commands/mobile/put_file_test.cc b/src/components/application_manager/test/commands/mobile/put_file_test.cc index b48ac67501..575daa7217 100644 --- a/src/components/application_manager/test/commands/mobile/put_file_test.cc +++ b/src/components/application_manager/test/commands/mobile/put_file_test.cc @@ -77,6 +77,7 @@ const std::string kFileName = "sync_file_name.txt"; const int64_t kOffset = 10u; const int64_t kZeroOffset = 0u; const std::string kStorageFolder = "./storage"; +const std::string kFolder = "folder"; const std::string kAppFolder = "app_folder"; } @@ -344,6 +345,64 @@ TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) { command->Run(); } +TEST_F(PutFileRequestTest, Run_CrcSumEqual_SendSuccessResponse) { + binary_data_ = {1u}; + (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_; + const uint32_t correct_crc_sum = + 2768625435u; // calculated using the GetCrc32CheckSum method + (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] = + correct_crc_sum; + + ExpectReceiveMessageFromSDK(); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(app_mngr_settings_)); + ON_CALL(app_mngr_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kStorageFolder)); + ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder)); + const size_t available_space = binary_data_.size() + 1; + ON_CALL(*mock_app_, GetAvailableDiskSpace()) + .WillByDefault(Return(available_space)); + ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true)); + + const std::string file_path = kStorageFolder + "/" + kFolder; + EXPECT_CALL(app_mngr_, SaveBinary(binary_data_, file_path, kFileName, 0u)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); + EXPECT_CALL(*mock_app_, increment_put_file_in_none_count()); + ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS); + PutFileRequestPtr command(CreateCommand(msg_)); + ASSERT_TRUE(command->Init()); + command->Run(); + // The folder was created in the "Run" method + EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true)); +} + +TEST_F(PutFileRequestTest, Run_CrcSumUnequal_SendCorruptedDataResponse) { + binary_data_ = {1u}; + (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_; + const uint32_t incorrect_crc_sum = 0u; + (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] = + incorrect_crc_sum; + + ExpectReceiveMessageFromSDK(); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(app_mngr_settings_)); + ON_CALL(app_mngr_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kStorageFolder)); + ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder)); + const size_t available_space = binary_data_.size() + 1; + ON_CALL(*mock_app_, GetAvailableDiskSpace()) + .WillByDefault(Return(available_space)); + ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true)); + + ExpectManageMobileCommandWithResultCode(mobile_apis::Result::CORRUPTED_DATA); + EXPECT_CALL(app_mngr_, SaveBinary(_, _, _, _)).Times(0); + PutFileRequestPtr command(CreateCommand(msg_)); + ASSERT_TRUE(command->Init()); + command->Run(); + // The folder was created in the "Run" method + EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true)); +} + } // namespace put_file } // namespace mobile_commands_test } // namespace commands_test -- cgit v1.2.1 From a70e3248cccadef27c608b2d7f7035d0b555f004 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 6 Apr 2018 11:26:18 +0300 Subject: Add API changes for support AppIcon resumption Implementation of proposal 0041-appicon-resumption.md Task : https://github.com/smartdevicelink/sdl_core/issues/1456 --- src/components/interfaces/MOBILE_API.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/components') diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 2cbae29c8c..c0caa4db1b 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -3153,6 +3153,10 @@ The software version of the system that implements the SmartDeviceLink core. + + Existence of apps icon at system. If true, apps icon + was resumed at system. If false, apps icon is not resumed at system + -- cgit v1.2.1 From 7fdf6ada7dbe538283538aed93a27c40e8f7d52c Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 6 Apr 2018 11:36:04 +0300 Subject: Add icon resumption parameter to strings Implementation of proposal 0041-appicon-resumption.md Technical task : https://github.com/smartdevicelink/sdl_core/issues/1456 Add response parameter IconResumed Set response parameter iconResumed to true in case if app icon exist otherwise set false Implementation of proposal 0041-appicon-resumption.md Technical task : https://github.com/smartdevicelink/sdl_core/issues/1456 --- .../include/application_manager/smart_object_keys.h | 1 + .../src/commands/mobile/register_app_interface_request.cc | 5 +++++ src/components/application_manager/src/smart_object_keys.cc | 1 + 3 files changed, 7 insertions(+) (limited to 'src/components') 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 b5bf111449..2e8f816cdb 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; 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 c799d68609..994e8f4995 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); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 421796c388..e4a31a2576 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"; -- cgit v1.2.1 From 6829877a77d01eaaa8718e0960feea8ea7966895 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 6 Apr 2018 11:36:54 +0300 Subject: Setting app icon to application in case if it exist on file system Implementation of proposal 0041-appicon-resumption.md Technical task : https://github.com/smartdevicelink/sdl_core/issues/1456 Setup Icon to application if icon exist on file system Implementation of proposal 0041-appicon-resumption.md Technical task : https://github.com/smartdevicelink/sdl_core/issues/1456 --- src/components/application_manager/src/application_manager_impl.cc | 7 +++++++ .../src/commands/mobile/register_app_interface_request.cc | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/components') 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 994e8f4995..d32afad00b 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 @@ -839,7 +839,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] = application_impl.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(); -- cgit v1.2.1 From 59a89274424db93a19f1b1a777e50af7bce3a949 Mon Sep 17 00:00:00 2001 From: Elvis Kuliiev Date: Fri, 6 Apr 2018 16:37:35 +0300 Subject: Save icon for resumtion after successful SetAppIcon --- .../src/commands/mobile/set_app_icon_request.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/components') 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 #include "application_manager/commands/mobile/set_app_icon_request.h" +#include + #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_, -- cgit v1.2.1 From 764a596b044839bca094836fbd4d74cc6547496c Mon Sep 17 00:00:00 2001 From: Andriy Byzhynar Date: Tue, 10 Apr 2018 16:10:18 +0300 Subject: Fix unit test according to code changes Added missed fields and expectations --- .../test/commands/mobile/set_app_icon_test.cc | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/components') 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 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)); -- cgit v1.2.1 From 1467e3ff0c6000b7eb686eaefd659469e574b207 Mon Sep 17 00:00:00 2001 From: BSolonenko Date: Fri, 6 Apr 2018 17:16:48 +0300 Subject: Set app icon ut coverage. test set appIcon when app register. --- .../test/application_manager_impl_test.cc | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/components') 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(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 -- cgit v1.2.1 From 9cd4c58a4f22243c29997211b2751f285b313679 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 29 May 2018 14:10:18 -0400 Subject: Add tire pressure parameters --- src/components/interfaces/HMI_API.xml | 35 +++++++++++++++++++++++++++++++- src/components/interfaces/MOBILE_API.xml | 34 +++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 2b34de0440..67cfade913 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -781,6 +781,33 @@ + + + If set the status of the tire is not known. + + + TPMS does not function. + + + The sensor of the tire does not function. + + + TPMS is reporting a low tire pressure for the tire. + + + TPMS is active and the tire pressure is monitored. + + + TPMS is reporting that the tire must be trained. + + + TPMS reports the training for the tire is completed. + + + TPMS reports the tire is not trained. + + + The selected gear. @@ -2311,7 +2338,13 @@ The status of component volume. See ComponentVolumeStatus. - + + + The status of TPMS according to the particular tire. + + + The pressure value of the particular tire in kilo pascal. + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 2cbae29c8c..0964164fb1 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1091,6 +1091,34 @@ + + + + If set the status of the tire is not known. + + + TPMS does not function. + + + The sensor of the tire does not function. + + + TPMS is reporting a low tire pressure for the tire. + + + TPMS is active and the tire pressure is monitored. + + + TPMS is reporting that the tire must be trained. + + + TPMS reports the training for the tire is completed. + + + TPMS reports the tire is not trained. + + + @@ -1126,6 +1154,12 @@ See ComponentVolumeStatus. + + The status of TPMS according to the particular tire. + + + The pressure value of the particular tire in kilo pascal. + -- cgit v1.2.1 From d073d384e0f1f65b26ea1be43bfc76752491fe4c Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 31 May 2018 10:27:59 -0400 Subject: Remove extra line and fix style --- .../src/commands/mobile/set_display_layout_request.cc | 6 +++--- src/components/interfaces/MOBILE_API.xml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/components') 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/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 0964164fb1..7780d80113 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1118,7 +1118,6 @@ TPMS reports the tire is not trained. - -- cgit v1.2.1