From 746a5fb492558ff0cb2c128ae15836d3fd6e5a4d Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 12 Apr 2016 10:42:24 -0400 Subject: Coverity travis.yml --- .travis.yml | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index eea4331127..a631fd6e29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,36 @@ +env: + global: + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: "YrUVgA4/Vs4YPINdq1hwc5Mv2SZEtq/XY/+Wg0hC6lpicRBLSiQEgsqmxZc0/OFIbxzTYSE080X8SA6DXp+A0MEVu94zYr9lS/jJ5cDi/2Cl8QV+S/q0nlvr8aJEmCjOFDQTvWMp32ajBIo9HKsN9WrfK6nHuGhBBkZHPjCiVSE=" language: cpp +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev libgtest-dev + - sudo add-apt-repository ppa:kalakris/cmake -y + - sudo apt-get update -q + - sudo apt-get install -y cmake + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get -qq update + - sudo apt-get -qq install g++-4.8 + - sudo rm /usr/bin/gcc + - sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc + - sudo rm /usr/bin/g++ + - sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++ addons: apt: sources: - travis-ci/sqlite3 packages: - sqlite3 -before_install: - - sudo apt-get -qq update - - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev - - sudo add-apt-repository ppa:kalakris/cmake -y - - sudo apt-get update -q - - sudo apt-get install -y cmake -script: - - mkdir build && cd build && cmake ../ && make && make install \ No newline at end of file + coverity_scan: + project: + name: "smartdevicelink/sdl_core" + description: "Build submitted via Travis CI" + notification_email: jack@livio.io + build_command_prepend: "mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON" + build_command: "make install" + branch_pattern: coverity +script: + - pwd + - cd build && make test \ No newline at end of file -- cgit v1.2.1 From fa162c6ccd8de0dd7bc050d844695fdc9fa67806 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 12 Apr 2016 10:46:18 -0400 Subject: Turn build_tests on --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5cf7d1186..e723663f40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ option(BUILD_BT_SUPPORT "Bluetooth support" ON) option(BUILD_USB_SUPPORT "libusb support" ON) option(BUILD_AVAHI_SUPPORT "libavahi support" ON) option(BUILD_BACKTRACE_SUPPORT "backtrace support" ON) -option(BUILD_TESTS "Possibility to build and run tests" OFF) +option(BUILD_TESTS "Possibility to build and run tests" ON) option(TIME_TESTER "Enable profiling time test util" ON) option(ENABLE_LOG "Logging feature" ON) option(ENABLE_GCOV "gcov code coverage feature" OFF) -- cgit v1.2.1 From 421812ecbabebeffe26cb0221167a7d95952b77a Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 14 Apr 2016 10:50:36 -0400 Subject: Add ldconfig --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a631fd6e29..f29d7e80de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,5 +32,5 @@ addons: build_command: "make install" branch_pattern: coverity script: - - pwd + - sudo ldconfig - cd build && make test \ No newline at end of file -- cgit v1.2.1 From 621780d52a35dd0a063e592885140fffbd6d283e Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 18 Apr 2016 10:57:12 -0400 Subject: Travis.yml additions Set ubuntu version to 14.04 (trusty) Set ld library path Add travis_wait to make test line --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f29d7e80de..d0f3832c67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,10 @@ env: global: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key + - LD_LIBRARY_PATH=. - secure: "YrUVgA4/Vs4YPINdq1hwc5Mv2SZEtq/XY/+Wg0hC6lpicRBLSiQEgsqmxZc0/OFIbxzTYSE080X8SA6DXp+A0MEVu94zYr9lS/jJ5cDi/2Cl8QV+S/q0nlvr8aJEmCjOFDQTvWMp32ajBIo9HKsN9WrfK6nHuGhBBkZHPjCiVSE=" language: cpp +dist: trusty before_install: - sudo apt-get -qq update - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev libgtest-dev @@ -33,4 +35,5 @@ addons: branch_pattern: coverity script: - sudo ldconfig - - cd build && make test \ No newline at end of file + - cd build + - travis_wait make test \ No newline at end of file -- cgit v1.2.1 From a1b89d1a5017bc1042848c9f01b76e85702fff56 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 18 Apr 2016 11:03:28 -0400 Subject: Remove update line --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d0f3832c67..09d4942d62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ env: language: cpp dist: trusty before_install: - - sudo apt-get -qq update - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev libgtest-dev - sudo add-apt-repository ppa:kalakris/cmake -y - sudo apt-get update -q -- cgit v1.2.1 From 23483c90f0dcc3263fade376208d3137e07d40d3 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 18 Apr 2016 11:12:16 -0400 Subject: Remove another update line Causing travis CI to crash on 404 error during update --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 09d4942d62..2cdabcf10a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ dist: trusty before_install: - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev libgtest-dev - sudo add-apt-repository ppa:kalakris/cmake -y - - sudo apt-get update -q - sudo apt-get install -y cmake - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get -qq update -- cgit v1.2.1 From 84715ef03588aaee2f1c89938915a63c16e5d91e Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 18 Apr 2016 11:17:00 -0400 Subject: Remove final update line in .yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2cdabcf10a..0c4f876af2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ before_install: - sudo add-apt-repository ppa:kalakris/cmake -y - sudo apt-get install -y cmake - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo apt-get -qq update - sudo apt-get -qq install g++-4.8 - sudo rm /usr/bin/gcc - sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc -- cgit v1.2.1 From 7c2cace7bf9d72027d21b2128b9ad1beab873d3f Mon Sep 17 00:00:00 2001 From: Justin Dickow Date: Mon, 25 Apr 2016 13:32:19 -0400 Subject: Don't use temp string for c_str () --- .../src/commands/mobile/set_global_properties_request.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc index 1c0948d07e..c51a7108a9 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc @@ -344,12 +344,12 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { mobile_apis::Result::eType result_code; const char* return_info = NULL; + const std::string return_string = "Unsupported phoneme type sent in a prompt"; if (result) { if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) { result_code = mobile_apis::Result::WARNINGS; - return_info = - std::string("Unsupported phoneme type sent in a prompt").c_str(); + return_info = return_string.c_str(); } else { result_code = static_cast( std::max(ui_result_, tts_result_)); -- cgit v1.2.1 From c7786e543aa8954159da3fa5b27e815d343c2996 Mon Sep 17 00:00:00 2001 From: Justin Dickow Date: Mon, 25 Apr 2016 13:34:04 -0400 Subject: Add isSDLAllowed to AppPermissions initializer list --- src/components/policy/src/policy/include/policy/policy_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/policy/src/policy/include/policy/policy_types.h b/src/components/policy/src/policy/include/policy/policy_types.h index 367d0f2a09..fc4b1a3bf0 100644 --- a/src/components/policy/src/policy/include/policy/policy_types.h +++ b/src/components/policy/src/policy/include/policy/policy_types.h @@ -234,7 +234,8 @@ struct AppPermissions { appRevoked(false), appPermissionsConsentNeeded(false), appUnauthorized(false), - requestTypeChanged(false) { + requestTypeChanged(false), + isSDLAllowed(false) { } std::string application_id; -- cgit v1.2.1 From a0a979e868a9b950279bf9ace26cb39a110c1194 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 2 May 2016 10:27:05 -0400 Subject: Remove Gtest for Coverity Coverity branch is only used for testing code defects. Unit test coverage not needed. --- .travis.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c4f876af2..9f8f3fd38c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ env: language: cpp dist: trusty before_install: - - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev libgtest-dev + - sudo apt-get install -y libavahi-client-dev libssl-dev libbluetooth3 libbluetooth-dev bluez-tools libudev-dev - sudo add-apt-repository ppa:kalakris/cmake -y - sudo apt-get install -y cmake - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test @@ -27,10 +27,6 @@ addons: name: "smartdevicelink/sdl_core" description: "Build submitted via Travis CI" notification_email: jack@livio.io - build_command_prepend: "mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON" + build_command_prepend: "mkdir build && cd build && cmake ../" build_command: "make install" - branch_pattern: coverity -script: - - sudo ldconfig - - cd build - - travis_wait make test \ No newline at end of file + branch_pattern: coverity \ No newline at end of file -- cgit v1.2.1 From 45b441acffefa193af7a1114e355ca6b51cdcdfa Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 2 May 2016 11:05:05 -0400 Subject: Add Script Block Travis adds this build command by default if no script block specified: './configure && make && make test'. Printing 'Build Complete' to avoid this issue. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f8f3fd38c..7805596513 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,6 @@ addons: notification_email: jack@livio.io build_command_prepend: "mkdir build && cd build && cmake ../" build_command: "make install" - branch_pattern: coverity \ No newline at end of file + branch_pattern: coverity +script: + - echo "Build Complete" \ No newline at end of file -- cgit v1.2.1 From 7ac06d8e935aaab2da50b030b8a33b8f3fbc7b1c Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 2 May 2016 14:03:35 -0400 Subject: Fix initiliazer list order --- src/components/policy/src/policy/include/policy/policy_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/policy/src/policy/include/policy/policy_types.h b/src/components/policy/src/policy/include/policy/policy_types.h index fc4b1a3bf0..ded7a530fc 100644 --- a/src/components/policy/src/policy/include/policy/policy_types.h +++ b/src/components/policy/src/policy/include/policy/policy_types.h @@ -234,8 +234,8 @@ struct AppPermissions { appRevoked(false), appPermissionsConsentNeeded(false), appUnauthorized(false), - requestTypeChanged(false), - isSDLAllowed(false) { + isSDLAllowed(false), + requestTypeChanged(false) { } std::string application_id; -- cgit v1.2.1 From 3dd76cd9ca2489b3be6e5917453053add94dd612 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 15 Jul 2016 11:30:26 -0400 Subject: Fix issues with freed string before use (CIDs 80093, 80094) --- .../application_manager/src/commands/mobile/alert_maneuver_request.cc | 3 +-- .../src/commands/mobile/reset_global_properties_request.cc | 2 +- .../src/commands/mobile/set_global_properties_request.cc | 3 +-- .../application_manager/src/commands/mobile/speak_request.cc | 3 +-- .../src/commands/mobile/subscribe_vehicle_data_request.cc | 3 +-- .../src/commands/mobile/unsubscribe_vehicle_data_request.cc | 3 +-- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index f1575a1a4b..4ce38ef575 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -195,8 +195,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { if (result && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == static_cast(tts_speak_result_code_)) { result_code = mobile_apis::Result::WARNINGS; - return_info = - std::string("Unsupported phoneme type sent in a prompt").c_str(); + return_info = "Unsupported phoneme type sent in a prompt"; } SendResponse(result, result_code, return_info, diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc index 2e1483eff6..2089d429ac 100644 --- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc @@ -278,7 +278,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { if (result) { if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) { result_code = mobile_apis::Result::WARNINGS; - return_info = std::string("Unsupported phoneme type sent in a prompt").c_str(); + return_info = "Unsupported phoneme type sent in a prompt"; } else { result_code = static_cast( std::max(ui_result_, tts_result_)); diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc index c51a7108a9..aef167cb54 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc @@ -344,12 +344,11 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { mobile_apis::Result::eType result_code; const char* return_info = NULL; - const std::string return_string = "Unsupported phoneme type sent in a prompt"; if (result) { if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) { result_code = mobile_apis::Result::WARNINGS; - return_info = return_string.c_str(); + return_info = "Unsupported phoneme type sent in a prompt"; } else { result_code = static_cast( std::max(ui_result_, tts_result_)); diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc index b2f112a64a..4845bc1256 100644 --- a/src/components/application_manager/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/src/commands/mobile/speak_request.cc @@ -125,8 +125,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == static_cast(result_code)) { result_code = mobile_apis::Result::WARNINGS; - return_info = std::string( - "Unsupported phoneme type sent in a prompt").c_str(); + return_info = "Unsupported phoneme type sent in a prompt"; } SendResponse(result, static_cast(result_code), diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc index f00527037e..a22f7c0dda 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -254,8 +254,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (result) { if (IsAnythingAlreadySubscribed(message[strings::msg_params])) { result_code = mobile_apis::Result::IGNORED; - return_info = - std::string("Already subscribed on some provided VehicleData.").c_str(); + return_info = "Already subscribed on some provided VehicleData."; } } diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc index 7d05ce328f..051f1819ba 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -245,8 +245,7 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (result) { if (IsAnythingAlreadyUnsubscribed(message[strings::msg_params])) { result_code = mobile_apis::Result::IGNORED; - return_info = - std::string("Some provided VehicleData was not subscribed.").c_str(); + return_info = "Some provided VehicleData was not subscribed."; } } -- cgit v1.2.1 From b3fa432b4d50124847d74830036d7d8969866fc4 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 14 Jul 2016 13:53:11 -0400 Subject: Free opened file before returning from function (CID 80040) --- src/components/config_profile/src/ini_file.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc index 236dd1ae2b..5ec77d183b 100644 --- a/src/components/config_profile/src/ini_file.cc +++ b/src/components/config_profile/src/ini_file.cc @@ -186,15 +186,18 @@ char ini_write_value(const char *fname, fd = mkstemp(temp_fname); if (-1 == fd) { + fclose(rd_fp); return FALSE; } wr_fp = fdopen(fd, "w"); if (NULL == wr_fp) { unlink(temp_fname); close(fd); + fclose(rd_fp); return FALSE; } } else { + fclose(rd_fp); return FALSE; } } -- cgit v1.2.1 From f95d608893b6a537ec2e7e753a6b162f067c1c01 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 14 Jul 2016 13:55:32 -0400 Subject: Close socket connection before returning from function (CID 80039) --- .../transport_manager/src/bluetooth/bluetooth_socket_connection.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc index d6f9f26317..4240c9a3a4 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc @@ -120,6 +120,7 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) { "Failed to Connect to remote device " << BluetoothDevice::GetUniqueDeviceId( remoteSocketAddress.rc_bdaddr) << " for session " << this); *error = new ConnectError(); + close(rfcomm_socket); LOG4CXX_TRACE(logger_, "exit with FALSE"); return false; } -- cgit v1.2.1 From 2bd169cbb73cbc34dddea6dc7ff43c9f63d40e4d Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 15 Jul 2016 09:04:46 -0400 Subject: Null terminate char buffer after strncpy (CID 79979) --- .../transport_manager/src/bluetooth/bluetooth_device_scanner.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc index c422d895d0..2a5eb35162 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc @@ -230,9 +230,11 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices( if (hci_read_remote_name_ret != 0) { LOG4CXX_ERROR_WITH_ERRNO(logger_, "hci_read_remote_name failed"); + int name_len = sizeof(deviceName) / sizeof(deviceName[0]); strncpy(deviceName, BluetoothDevice::GetUniqueDeviceId(bd_address).c_str(), - sizeof(deviceName) / sizeof(deviceName[0])); + name_len - 1); + deviceName[name_len - 1] = '\0'; } Device* bluetooth_device = new BluetoothDevice(bd_address, deviceName, -- cgit v1.2.1 From 9061f7332dc5a9d8d212ce51e8b11ab74ba53bbe Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 15 Jul 2016 13:35:22 -0400 Subject: Initialize current_application_ before use in functions (CID 80089) --- src/components/media_manager/src/audio/from_mic_recorder_listener.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc index 3718e82c60..93c85b2ae7 100644 --- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc +++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc @@ -42,7 +42,8 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "FromMicRecorderListener") FromMicRecorderListener::FromMicRecorderListener( const std::string& file_name) : reader_(NULL) - , file_name_(file_name) { + , file_name_(file_name) + , current_application_(0) { } FromMicRecorderListener::~FromMicRecorderListener() { -- cgit v1.2.1 From 6718dbe0582b74c2f4fc4bba1aced8fa73ea0dcd Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 15 Jul 2016 14:52:02 -0400 Subject: Initialize offset_ before use in functions (CID 80084) --- src/components/media_manager/src/audio/audio_stream_sender_thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc index a78ca8b49c..d43d5461e0 100644 --- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc +++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc @@ -63,6 +63,7 @@ AudioStreamSenderThread::AudioStreamSenderThread( const std::string fileName, uint32_t session_key) : session_key_(session_key), fileName_(fileName), + offset_(0), shouldBeStoped_(false), shouldBeStoped_lock_(), shouldBeStoped_cv_() { -- cgit v1.2.1 From b13f1ec8eee721350214c54e724511dabc585eac Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Tue, 26 Jul 2016 10:12:57 -0400 Subject: Only send frames when POLLOUT set (CID 79995) --- .../src/transport_adapter/threaded_socket_connection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc index f520841a47..8cf79c3ce9 100644 --- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc +++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc @@ -244,7 +244,7 @@ void ThreadedSocketConnection::Transmit() { const bool is_queue_empty = IsFramesToSendQueueEmpty(); // Send data if possible - if (!is_queue_empty && (poll_fds[0].revents | POLLOUT)) { + if (!is_queue_empty && (poll_fds[0].revents & POLLOUT)) { LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() "); // send data -- cgit v1.2.1 From c3559498c7b53e1d898e77d6b58c5335565207df Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 18 Jul 2016 13:42:54 -0400 Subject: Add default enum values to initialize StatisticsDelegate (CID 80080,80081,80082,80083) --- .../src/policies/delegates/statistics_delegate.cc | 12 ++++++++++++ .../include/usage_statistics/statistics_manager.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc index d4335cec8c..a1f46a0373 100644 --- a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc +++ b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc @@ -38,6 +38,9 @@ namespace policy { StatisticsDelegate::StatisticsDelegate(usage_statistics::GlobalCounterId type) : type_(INCREMENT_GLOBAL), global_counter_(type), + app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE), + app_info_(usage_statistics::AppInfoId::APP_INFO_NONE), + stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE), app_id_(""), value_(""), timespan_seconds_(0) { @@ -47,7 +50,10 @@ namespace policy { StatisticsDelegate::StatisticsDelegate(const std::string& app_id, usage_statistics::AppCounterId type) : type_(INCREMENT_APP), + global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE), app_counter_(type), + app_info_(usage_statistics::AppInfoId::APP_INFO_NONE), + stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE), app_id_(app_id), value_(""), timespan_seconds_(0) { @@ -58,7 +64,10 @@ namespace policy { usage_statistics::AppInfoId type, const std::string& value) : type_(SET), + global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE), + app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE), app_info_(type), + stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE), app_id_(app_id), value_(value), timespan_seconds_(0) { @@ -69,6 +78,9 @@ namespace policy { usage_statistics::AppStopwatchId type, int32_t timespan_seconds) : type_(ADD), + global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE), + app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE), + app_info_(usage_statistics::AppInfoId::APP_INFO_NONE), stop_watch_(type), app_id_(app_id), value_(""), diff --git a/src/components/policy/src/policy/usage_statistics/include/usage_statistics/statistics_manager.h b/src/components/policy/src/policy/usage_statistics/include/usage_statistics/statistics_manager.h index 3af8f4c195..bf1c9f7bf2 100644 --- a/src/components/policy/src/policy/usage_statistics/include/usage_statistics/statistics_manager.h +++ b/src/components/policy/src/policy/usage_statistics/include/usage_statistics/statistics_manager.h @@ -39,17 +39,20 @@ namespace usage_statistics { enum GlobalCounterId { + GLOBAL_COUNTER_NONE, IAP_BUFFER_FULL, SYNC_OUT_OF_MEMORY, SYNC_REBOOTS }; enum AppInfoId { + APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI }; enum AppStopwatchId { + STOPWATCH_NONE, SECONDS_HMI_FULL, SECONDS_HMI_LIMITED, SECONDS_HMI_BACKGROUND, @@ -57,6 +60,7 @@ enum AppStopwatchId { }; enum AppCounterId { + APP_COUNTER_NONE, USER_SELECTIONS, REJECTIONS_SYNC_OUT_OF_MEMORY, REJECTIONS_NICKNAME_MISMATCH, -- cgit v1.2.1 From 6367262bcef03e4c0bfb1df163abb7c162df71ba Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 18 Jul 2016 14:04:11 -0400 Subject: Initialize port with default value of 0 (CID 80079). --- src/components/media_manager/src/socket_streamer_adapter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc index 45b1f63a17..0027589420 100644 --- a/src/components/media_manager/src/socket_streamer_adapter.cc +++ b/src/components/media_manager/src/socket_streamer_adapter.cc @@ -49,7 +49,8 @@ namespace media_manager { CREATE_LOGGERPTR_GLOBAL(logger, "SocketStreamerAdapter") SocketStreamerAdapter::SocketStreamerAdapter() - : socket_fd_(0), + : port_(0), + socket_fd_(0), is_ready_(false), streamer_(new Streamer(this)), thread_(threads::CreateThread("SocketStreamer", streamer_)), -- cgit v1.2.1 From 29f67f00ddbefb56d83accb2256e0d7749427c7a Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 21 Jul 2016 13:17:30 -0400 Subject: Initialize cmd_id_ and successful_response_received_ before use in functions (CID 80077) --- .../commands/mobile/create_interaction_choice_set_request.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h index 615416fac5..b9992fc1fe 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h @@ -103,7 +103,9 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl { * processing deleting sent commands if error from HMI received */ struct VRCommandInfo { - VRCommandInfo() {} + VRCommandInfo(): + cmd_id_(0), + succesful_response_received_(false) {} explicit VRCommandInfo(uint32_t cmd_id): cmd_id_(cmd_id), succesful_response_received_(false) {} -- cgit v1.2.1 From ddcf7b2abceefe13272a223e149bb995bbaca163 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 21 Jul 2016 16:36:44 -0400 Subject: Initialize choice_set_id_ and is_timed_out_ before use in functions (CID 80076) --- .../src/commands/mobile/create_interaction_choice_set_request.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc index 58c6d7e192..0dceaf0fa1 100644 --- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc @@ -47,9 +47,11 @@ namespace commands { CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest( const MessageSharedPtr& message) : CommandRequestImpl(message), + choice_set_id_(0), expected_chs_count_(0), received_chs_count_(0), - error_from_hmi_(false) { + error_from_hmi_(false), + is_timed_out_(false) { } CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() { -- cgit v1.2.1 From b51e65f616d3b30146c28eb95ffe7169eed2677c Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 21 Jul 2016 16:50:34 -0400 Subject: Initialize app_state_ and connection_id_ before use in functions (CID 80075) --- .../application_manager/include/application_manager/application.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 1197bbb813..0b6a97bb79 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -367,7 +367,8 @@ class Application : public virtual InitialApplicationData, }; public: - Application() : + Application() : app_state_(ApplicationState::kWaitingForRegistration), + connection_id_(0), is_greyed_out_(false) { } -- cgit v1.2.1 From 7d8dc821d2c1c9e67ca0c7933f735b762f470e01 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 22 Jul 2016 09:48:48 -0400 Subject: Initialize max_block_size_ before use in functions (CID 80074) --- src/components/security_manager/src/ssl_context_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc index 09c2efd196..877b0d8093 100644 --- a/src/components/security_manager/src/ssl_context_impl.cc +++ b/src/components/security_manager/src/ssl_context_impl.cc @@ -52,7 +52,8 @@ CryptoManagerImpl::SSLContextImpl::SSLContextImpl(SSL *conn, Mode mode) buffer_size_(1500), buffer_(new uint8_t[buffer_size_]), is_handshake_pending_(false), - mode_(mode) { + mode_(mode), + max_block_size_(0) { SSL_set_bio(connection_, bioIn_, bioOut_); } -- cgit v1.2.1 From a27e7bb9e390b81543beb1ecc165395d03e15715 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 22 Jul 2016 11:47:57 -0400 Subject: Initialize is_persistent, is_download_complete, and file_type before use in functions (CID 80073) --- .../application_manager/include/application_manager/application.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 0b6a97bb79..c0f10d7fba 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -88,7 +88,10 @@ struct Version { struct AppFile { // need to use in std::map; - AppFile() { + AppFile() + : is_persistent(false), + is_download_complete(false), + file_type(mobile_apis::FileType::INVALID_ENUM) { } AppFile(const std::string& name, bool persistent, bool download_complete, mobile_apis::FileType::eType type) -- cgit v1.2.1 From 0b1b68d18950fdb1bf735dd80090aef9d6fcf0ab Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 22 Jul 2016 13:19:52 -0400 Subject: Initialize is_ready_ before use in functions (CID 80072) --- src/components/time_tester/src/time_manager.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/time_tester/src/time_manager.cc b/src/components/time_tester/src/time_manager.cc index db389dbda0..b880854fd1 100644 --- a/src/components/time_tester/src/time_manager.cc +++ b/src/components/time_tester/src/time_manager.cc @@ -50,6 +50,7 @@ namespace time_tester { CREATE_LOGGERPTR_GLOBAL(logger_, "TimeManager") TimeManager::TimeManager(): + is_ready_(false), thread_(NULL), streamer_(NULL), app_observer(this), -- cgit v1.2.1 From 19f2ed4c5e5613d8ea4bc200df3daf7e92ee2108 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Fri, 22 Jul 2016 16:19:01 -0400 Subject: Initialize RequestInfo members, add new RequestType (CID 80058, 80066, 80067) --- .../include/application_manager/request_info.h | 19 +++++++++++++++---- .../application_manager/src/request_info.cc | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index 3b48d78d48..25fd025f76 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -55,16 +55,27 @@ namespace request_controller { typedef utils::SharedPtr RequestPtr; struct RequestInfo { - enum RequestType {MobileRequest, HMIRequest}; - - RequestInfo() {} + enum RequestType {RequestNone, MobileRequest, HMIRequest}; + + RequestInfo() + : timeout_sec_(0), + app_id_(0), + hmi_level_(mobile_apis::HMILevel::INVALID_ENUM), + requst_type_(RequestNone), + correlation_id_(0) { + start_time_ = date_time::DateTime::getCurrentTime(); + updateEndTime(); + } virtual ~RequestInfo() {} RequestInfo(RequestPtr request, const RequestType requst_type, const uint64_t timeout_sec) : request_(request), - timeout_sec_(timeout_sec) { + timeout_sec_(timeout_sec), + app_id_(0), + hmi_level_(mobile_apis::HMILevel::INVALID_ENUM), + correlation_id_(0) { start_time_ = date_time::DateTime::getCurrentTime(); updateEndTime(); requst_type_ = requst_type; diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 26af81ea53..2b2dae443b 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -84,7 +84,8 @@ RequestInfo::RequestInfo(RequestPtr request, const uint64_t timeout_sec): request_(request), start_time_(start_time), - timeout_sec_(timeout_sec) { + timeout_sec_(timeout_sec), + hmi_level_(mobile_apis::HMILevel::INVALID_ENUM) { updateEndTime(); requst_type_ = requst_type; correlation_id_ = request_->correlation_id(); -- cgit v1.2.1 From 5ec6571a2a5e404a467ec1aea67b36c027da0379 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 09:12:33 -0400 Subject: Initialize state_ctrl_ to constructor parameter (CID 80054) --- .../application_manager/include/application_manager/state_controller.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/state_controller.h b/src/components/application_manager/include/application_manager/state_controller.h index a09d11f18e..6d5946124b 100644 --- a/src/components/application_manager/include/application_manager/state_controller.h +++ b/src/components/application_manager/include/application_manager/state_controller.h @@ -241,7 +241,7 @@ private: StateController *state_ctrl_; HmiLevelConflictResolver(ApplicationSharedPtr app, HmiStatePtr state, StateController *state_ctrl) - : applied_(app), state_(state) {} + : applied_(app), state_(state), state_ctrl_(state_ctrl) {} void operator()(ApplicationSharedPtr to_resolve); }; -- cgit v1.2.1 From d0a1b61b5b17f2997c7268a8642496254015577d Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 10:05:05 -0400 Subject: Initialize Profile members to defaults (CID 80053) --- src/components/config_profile/src/profile.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 700c52fff8..3e52f4c658 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -258,6 +258,7 @@ Profile::Profile() server_port_(kDefaultServerPort), video_streaming_port_(kDefaultVideoStreamingPort), audio_streaming_port_(kDefaultAudioStreamingPort), + stop_streaming_timeout_(kDefaultStopStreamingTimeout), time_testing_port_(kDefaultTimeTestingPort), hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName), help_prompt_(), @@ -268,6 +269,7 @@ Profile::Profile() max_cmd_id_(kDefaultMaxCmdId), default_timeout_(kDefaultTimeout), app_resuming_timeout_(kDefaultAppResumingTimeout), + app_resumption_save_persistent_data_timeout_(kDefaultAppSavePersistentDataTimeout), app_dir_quota_(kDefaultDirQuota), app_hmi_level_none_time_scale_max_requests_( kDefaultAppHmiLevelNoneTimeScaleMaxRequests), @@ -298,6 +300,8 @@ Profile::Profile() recording_file_source_(kDefaultRecordingFileSourceName), recording_file_name_(kDefaultRecordingFileName), application_list_update_timeout_(kDefaultApplicationListUpdateTimeout), + max_thread_pool_size_(kDefaultMaxThreadPoolSize), + default_hub_protocol_index_(kDefaultHubProtocolIndex), iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask), iap_hub_protocol_mask_(kDefaultHubProtocolMask), iap_pool_protocol_mask_(kDefaultPoolProtocolMask), @@ -308,6 +312,8 @@ Profile::Profile() tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout), attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB), open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB), + resumption_delay_before_ign_(kDefaultResumptionDelayBeforeIgn), + resumption_delay_after_ign_(kDefaultResumptionDelayAfterIgn), hash_string_size_(kDefaultHashStringSize) { ReadStringValue(&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey); -- cgit v1.2.1 From 4e7df81d55146328ae2b4c3a01cbddd1e4db74f9 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 13:48:58 -0400 Subject: Initialize protocol_version to V2 (CID 80051) --- .../connection_handler/include/connection_handler/connection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h index d20ddc1c00..c78fb83c4f 100644 --- a/src/components/connection_handler/include/connection_handler/connection.h +++ b/src/components/connection_handler/include/connection_handler/connection.h @@ -41,6 +41,7 @@ #include "connection_handler/device.h" #include "connection_handler/heartbeat_monitor.h" #include "protocol/service_type.h" +#include "protocol_handler/protocol_packet.h" #ifdef ENABLE_SECURITY namespace security_manager { @@ -97,7 +98,8 @@ struct Session { security_manager::SSLContext *ssl_context; #endif // ENABLE_SECURITY Session() - : service_list() + : service_list(), + protocol_version(::protocol_handler::PROTOCOL_VERSION_2) #ifdef ENABLE_SECURITY , ssl_context(NULL) #endif // ENABLE_SECURITY -- cgit v1.2.1 From 9bfffdea3c545b8573b113442b7c70f9cf642d29 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 14:54:05 -0400 Subject: Initialize policy_table_type_ to INVALID_PT_TYPE for Optional template class (CID 80046, 80047, 80048) --- src/components/rpc_base/include/rpc_base/rpc_base_inl.h | 6 ++++-- src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h index 2241a4707b..4112c95474 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h @@ -574,13 +574,15 @@ void Nullable::ReportErrors(ValidationReport* report) const { * Optional class */ template -Optional::Optional() { +Optional::Optional() + : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE) { } template template Optional::Optional(const U& value) - : value_(value) { + : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE), + value_(value) { } template diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h index b5fd9a567a..1e1bdadb4f 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h @@ -356,7 +356,8 @@ inline Json::Value Nullable::ToJsonValue() const { template template Optional::Optional(const Json::Value* value, const U& def_value) - : value_(value, def_value) { + : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE), + value_(value, def_value) { } template -- cgit v1.2.1 From 2c65a9643624d9081cb178b376f60804d3f724cc Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 17:28:11 -0400 Subject: Initialize thread delegate to NULL before use (CID 80087) --- src/components/hmi_message_handler/src/mqueue_adapter.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/hmi_message_handler/src/mqueue_adapter.cc b/src/components/hmi_message_handler/src/mqueue_adapter.cc index 825c27c048..171f6e25e4 100644 --- a/src/components/hmi_message_handler/src/mqueue_adapter.cc +++ b/src/components/hmi_message_handler/src/mqueue_adapter.cc @@ -78,6 +78,7 @@ MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler) : HMIMessageAdapter(hmi_message_handler), sdl_to_hmi_mqueue_(-1), hmi_to_sdl_mqueue_(-1), + receiver_thread_delegate_(NULL), receiver_thread_(NULL) { mq_attr mq_attributes; mq_attributes.mq_maxmsg = kMqueueSize; -- cgit v1.2.1 From 1b50f59073fa3939314e02bffc871c26b8748c68 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Mon, 25 Jul 2016 17:35:10 -0400 Subject: Initialize binary_data_ to NULL (CID 80088) --- src/components/application_manager/src/message.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index bb500687dd..2e4920d262 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -68,7 +68,8 @@ Message::Message(protocol_handler::MessagePriority priority) } Message::Message(const Message& message) - : priority_(message.priority_) { + : priority_(message.priority_), + binary_data_(NULL) { *this = message; } -- cgit v1.2.1 From f0328a9e332f4d24631fada437548603ffe800c1 Mon Sep 17 00:00:00 2001 From: Justin Dickow Date: Wed, 27 Jul 2016 09:32:35 -0400 Subject: forcing a coverity build --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 2384d2cc70..df1c741c08 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,7 @@ Pull Requests Welcome! ## Documentation - * [Software Architecture Document](https://app.box.com/s/v5ymu5kathzkwfx8iigxxdpr7d5a2xhh) - * [Transport Manager Programming Guide](https://app.box.com/s/1pjquttvmhf19uujtw4x4fv4t1leqasa) - * [Software Detailed Design](https://app.box.com/s/ohgrvemtx39f8hfea1ab676xxrzvyx1y) - * [Integration Guidelines](https://app.box.com/s/ohcgjv61cykgkuhycglju6cc4efr0ym3) +For documentation please visit the [SmartDeviceLink Developer Portal](https://smartdevicelink.com) SmartDeviceLink -- cgit v1.2.1 From b01f3bafe6a74a21109355573328b2dd8c35a5b9 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Wed, 27 Jul 2016 11:07:37 -0400 Subject: Change socket close logic to prevent double close (CID 137866) This simplifies the logic used to connect to bluetooth sockets. It prevents the rfcomm_socket from being closed twice or being left unclosed. --- .../src/bluetooth/bluetooth_socket_connection.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc index 4240c9a3a4..4b092bcf50 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc @@ -103,14 +103,12 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) { if (0 == connect_status) { LOG4CXX_DEBUG(logger_, "rfcomm Connect ok"); break; - } - if (errno != 111 && errno != 104) { - LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno); - break; - } - if (errno) { - LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno); - close(rfcomm_socket); + } else { // If connect_status is not 0, an errno is returned + LOG4CXX_WARN_WITH_ERRNO(logger_, "rfcomm Connect failed"); + close(rfcomm_socket); // Always close the socket upon error + if (errno != ECONNREFUSED && errno != ECONNRESET) { + break; + } } sleep(2); } while (--attempts > 0); @@ -120,7 +118,6 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) { "Failed to Connect to remote device " << BluetoothDevice::GetUniqueDeviceId( remoteSocketAddress.rc_bdaddr) << " for session " << this); *error = new ConnectError(); - close(rfcomm_socket); LOG4CXX_TRACE(logger_, "exit with FALSE"); return false; } -- cgit v1.2.1 From 79f550a50bd6e227dc1c8a56959b9081e641d54b Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 28 Jul 2016 14:22:49 -0400 Subject: Check return values for tcp socket functions (CIDs 79989, 79990, 79991) --- .../src/tcp/tcp_client_listener.cc | 40 ++++++++++++++++------ 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc index 28a3c389da..2ee2e432cb 100644 --- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc +++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc @@ -92,7 +92,9 @@ TransportAdapter::Error TcpClientListener::Init() { server_address.sin_addr.s_addr = INADDR_ANY; int optval = 1; - setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); + if (0 != setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed"); + } if (bind(socket_, reinterpret_cast(&server_address), sizeof(server_address)) != 0) { @@ -144,12 +146,24 @@ void SetKeepaliveOptions(const int fd) { int keepintvl = 1; #ifdef __linux__ int user_timeout = 7000; // milliseconds - setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes)); - setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle)); - setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt)); - setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl)); - setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, - sizeof(user_timeout)); + if (0 != setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_KEEPALIVE failed"); + } + if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, + &keepidle, sizeof(keepidle))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPIDLE failed"); + } + if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPCNT failed"); + } + if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, + &keepintvl, sizeof(keepintvl))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPINTVL failed"); + } + if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, + &user_timeout, sizeof(user_timeout))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_USER_TIMEOUT failed"); + } #elif defined(__QNX__) // __linux__ // TODO(KKolodiy): Out of order! const int kMidLength = 4; @@ -241,9 +255,15 @@ void TcpClientListener::StopLoop() { server_address.sin_family = AF_INET; server_address.sin_port = htons(port_); server_address.sin_addr.s_addr = INADDR_ANY; - connect(byesocket, reinterpret_cast(&server_address), - sizeof(server_address)); - shutdown(byesocket, SHUT_RDWR); + if (0 != connect(byesocket, reinterpret_cast(&server_address), + sizeof(server_address))) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to connect byesocket"); + } else { + // Can only shutdown socket if connected + if (0 != shutdown(byesocket, SHUT_RDWR)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to shutdown byesocket"); + } + } close(byesocket); } -- cgit v1.2.1 From 744873a918282760d59a57ec95821c409be69d5c Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 28 Jul 2016 16:06:35 -0400 Subject: Check return values for file functions (CIDs 79980, 79981, 79982, 79983, 79984) --- src/components/utils/src/file_system.cc | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc index f9e3bb2dbc..1e7f25f342 100644 --- a/src/components/utils/src/file_system.cc +++ b/src/components/utils/src/file_system.cc @@ -59,8 +59,11 @@ uint64_t file_system::GetAvailableDiskSpace(const std::string& path) { int64_t file_system::FileSize(const std::string &path) { if (file_system::FileExists(path)) { struct stat file_info = { 0 }; - stat(path.c_str(), &file_info); - return file_info.st_size; + if (0 != stat(path.c_str(), &file_info)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file size: " << path); + } else { + return file_info.st_size; + } } return 0; } @@ -94,8 +97,12 @@ size_t file_system::DirectorySize(const std::string& path) { if (file_system::IsDirectory(full_element_path)) { size += DirectorySize(full_element_path); } else { - stat(full_element_path.c_str(), &file_info); - size += file_info.st_size; + if (0 != stat(full_element_path.c_str(), &file_info)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file info: " + << full_element_path); + } else { + size += file_info.st_size; + } } } } @@ -108,7 +115,9 @@ size_t file_system::DirectorySize(const std::string& path) { std::string file_system::CreateDirectory(const std::string& name) { if (!DirectoryExists(name)) { - mkdir(name.c_str(), S_IRWXU); + if (0 != mkdir(name.c_str(), S_IRWXU)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to create directory: " << name); + } } return name; @@ -254,7 +263,10 @@ void file_system::remove_directory_content(const std::string& directory_name) { remove_directory_content(full_element_path); rmdir(full_element_path.c_str()); } else { - remove(full_element_path.c_str()); + if (0 != remove(full_element_path.c_str())) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to remove file: " + << full_element_path); + } } } } @@ -416,7 +428,9 @@ bool file_system::CreateFile(const std::string& path) { uint64_t file_system::GetFileModificationTime(const std::string& path) { struct stat info; - stat(path.c_str(), &info); + if (0 != stat(path.c_str(), &info)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file mod time: " << path); + } #ifndef __QNXNTO__ return static_cast(info.st_mtim.tv_nsec); #else -- cgit v1.2.1 From 1fd05a8a5ce6b567d573e5933eea2aa1be1f6d6d Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 28 Jul 2016 16:41:22 -0400 Subject: Check return values for profile file functions (CID 79994) This commit addresses the Coverity defect indicating that the remove() library function was unchecked. The first remove should no be there since rename will replace and remove the file already. If rename does not work, that file should also not be destroyed. The second remove has its return value checked and logged if an error exists. --- src/components/config_profile/src/ini_file.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc index 5ec77d183b..924c10d652 100644 --- a/src/components/config_profile/src/ini_file.cc +++ b/src/components/config_profile/src/ini_file.cc @@ -39,6 +39,8 @@ #include #include +#include "utils/logger.h" + #ifndef _WIN32 #include #else @@ -53,6 +55,8 @@ namespace profile { +CREATE_LOGGERPTR_GLOBAL(logger_, "Profile") + char* ini_write_inst(const char *fname, uint8_t flag) { FILE *fp = 0; @@ -270,9 +274,10 @@ char ini_write_value(const char *fname, fclose(wr_fp); fclose(rd_fp); - remove(fname); if (0 != rename(temp_fname, fname)) { - remove(temp_fname); + if (0 != remove(temp_fname)) { + LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to remove temp file: " << std::string(temp_fname)); + } return FALSE; } -- cgit v1.2.1 From 4dfa65a35ee165176afe79b2e4f5a6aa4ce36ac4 Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 28 Jul 2016 17:01:35 -0400 Subject: Check return of command init before running it (CID 79987) --- src/components/application_manager/src/application_manager_impl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 2aba14ec30..626cc4fc0e 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2468,9 +2468,10 @@ void ApplicationManagerImpl::Handle(const impl::AudioData message) { LOG4CXX_INFO_EXT(logger_, "Send data"); CommandSharedPtr command(MobileCommandFactory::CreateCommand( on_audio_pass, commands::Command::ORIGIN_SDL)); - command->Init(); - command->Run(); - command->CleanUp(); + if (command->Init()) { + command->Run(); + command->CleanUp(); + } } mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions( -- cgit v1.2.1 From c4759a59f853c23d5552c90c68467df2db6fc67d Mon Sep 17 00:00:00 2001 From: Brad Pankow Date: Thu, 28 Jul 2016 17:27:15 -0400 Subject: Check return value of SQL exec (CID 79986) --- src/components/policy/src/policy/src/sql_pt_representation.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/policy/src/policy/src/sql_pt_representation.cc b/src/components/policy/src/policy/src/sql_pt_representation.cc index b0afde343e..77e491e864 100644 --- a/src/components/policy/src/policy/src/sql_pt_representation.cc +++ b/src/components/policy/src/policy/src/sql_pt_representation.cc @@ -372,7 +372,9 @@ InitResult SQLPTRepresentation::Init() { << check_first_run.GetBoolean(0)); if (check_first_run.GetBoolean(0)) { dbms::SQLQuery set_not_first_run(db()); - set_not_first_run.Exec(sql_pt::kSetNotFirstRun); + if (!set_not_first_run.Exec(sql_pt::kSetNotFirstRun)) { + LOG4CXX_WARN(logger_, "Failed update is_first_run"); + } return InitResult::SUCCESS; } } else { -- cgit v1.2.1 From 3a071dff27caa2f3cac4bbe96a1f701cead93f45 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 29 Jul 2016 09:58:08 -0400 Subject: Fixed unnecessary mixing of enums (CID 80023, 80024, 80026, 80030) --- .../src/commands/mobile/alert_maneuver_request.cc | 24 ++++++++++------------ .../commands/mobile/get_vehicle_data_request.cc | 3 +-- .../src/commands/mobile/speak_request.cc | 6 ++---- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index 4ce38ef575..c33d2e477a 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -174,17 +174,15 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { if (pending_requests_.IsFinal(event_id)) { - bool result = ((hmi_apis::Common_Result::SUCCESS == - static_cast(tts_speak_result_code_) || - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast(tts_speak_result_code_) || - (hmi_apis::Common_Result::INVALID_ENUM == - static_cast(tts_speak_result_code_))) && - (hmi_apis::Common_Result::SUCCESS == - static_cast(navi_alert_maneuver_result_code_))) || - (hmi_apis::Common_Result::SUCCESS == static_cast( - tts_speak_result_code_) && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast(navi_alert_maneuver_result_code_)); + bool result = ((mobile_apis::Result::SUCCESS == tts_speak_result_code_ || + mobile_apis::Result::UNSUPPORTED_RESOURCE == + tts_speak_result_code_ || + mobile_apis::Result::INVALID_ENUM == tts_speak_result_code_) && + mobile_apis::Result::SUCCESS == + navi_alert_maneuver_result_code_) || + (mobile_apis::Result::SUCCESS == tts_speak_result_code_ && + mobile_apis::Result::UNSUPPORTED_RESOURCE == + navi_alert_maneuver_result_code_); mobile_apis::Result::eType result_code = static_cast(std::max(tts_speak_result_code_, @@ -192,8 +190,8 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { const char* return_info = NULL; - if (result && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast(tts_speak_result_code_)) { + if (result && mobile_apis::Result::UNSUPPORTED_RESOURCE == + tts_speak_result_code_) { result_code = mobile_apis::Result::WARNINGS; return_info = "Unsupported phoneme type sent in a prompt"; } diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index ed75e62c0c..719cae11b7 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -259,8 +259,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { message[strings::params][hmi_response::code].asInt()); bool result = false; if (mobile_apis::Result::SUCCESS == result_code || - (hmi_apis::Common_Result::DATA_NOT_AVAILABLE == - static_cast(result_code) + (mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE == result_code && message[strings::msg_params].length() > 1)) { result = true; } diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc index 4845bc1256..894b97ea9b 100644 --- a/src/components/application_manager/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/src/commands/mobile/speak_request.cc @@ -113,8 +113,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( mobile_apis::Result::eType result_code = static_cast( message[strings::params][hmi_response::code].asInt()); - if (hmi_apis::Common_Result::SUCCESS == - static_cast(result_code)) { + if (mobile_apis::Result::SUCCESS == result_code) { result = true; } (*message_)[strings::params][strings::function_id] = @@ -122,8 +121,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( const char* return_info = NULL; - if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast(result_code)) { + if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) { result_code = mobile_apis::Result::WARNINGS; return_info = "Unsupported phoneme type sent in a prompt"; } -- cgit v1.2.1 From 567dcb4d8894c8ebf13ea9ae7be5f0f490a99eb6 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 29 Jul 2016 14:25:39 -0400 Subject: Fixed another Coverity issue involving mixed enums (CID 80028) --- .../src/commands/mobile/alert_maneuver_request.cc | 6 ++---- .../application_manager/src/commands/mobile/slider_request.cc | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index c33d2e477a..cdeccd86f4 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -175,11 +175,9 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { if (pending_requests_.IsFinal(event_id)) { bool result = ((mobile_apis::Result::SUCCESS == tts_speak_result_code_ || - mobile_apis::Result::UNSUPPORTED_RESOURCE == - tts_speak_result_code_ || + mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_result_code_ || mobile_apis::Result::INVALID_ENUM == tts_speak_result_code_) && - mobile_apis::Result::SUCCESS == - navi_alert_maneuver_result_code_) || + mobile_apis::Result::SUCCESS == navi_alert_maneuver_result_code_) || (mobile_apis::Result::SUCCESS == tts_speak_result_code_ && mobile_apis::Result::UNSUPPORTED_RESOURCE == navi_alert_maneuver_result_code_); diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc index cef2bed1fc..c46311c667 100644 --- a/src/components/application_manager/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/src/commands/mobile/slider_request.cc @@ -130,10 +130,11 @@ void SliderRequest::on_event(const event_engine::Event& event) { //event_id == hmi_apis::FunctionID::UI_Slider: LOG4CXX_INFO(logger_, "Received UI_Slider event"); - const int response_code = - message[strings::params][hmi_response::code].asInt(); + const mobile_apis::Result::eType response_code = + static_cast( + message[strings::params][hmi_response::code].asInt()); smart_objects::SmartObject response_msg_params = message[strings::msg_params]; - if (response_code == hmi_apis::Common_Result::ABORTED && + if (response_code == mobile_apis::Result::ABORTED && message[strings::params][strings::data].keyExists(strings::slider_position)) { //Copy slider_position info to msg_params section response_msg_params[strings::slider_position] = -- cgit v1.2.1 From 1b96b7c02d2e338b846a7314c6fa0bdaa31f7c5e Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Wed, 3 Aug 2016 17:13:34 -0400 Subject: Forcing a Coverity build --- COMMITTERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COMMITTERS.md b/COMMITTERS.md index df5fee94df..79d63444d7 100644 --- a/COMMITTERS.md +++ b/COMMITTERS.md @@ -36,7 +36,7 @@ set in the form of a pull request. there must be comment which explains: When method will be called by thread? Which thread calls the method? e.g.) * Do you have specific realization code comments? * Add log messages. -* There are no Google code style errors. (You can download Google [cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)) +* There are no Google code style errors. (You can download Google [cpplint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)) * Check branch naming. * Check correct commit messages in commits (see Pull request message section). * Check correct pull request target (`master` or `develop`) -- cgit v1.2.1 From b749d71e496f133437d5bd44860a6dcfdd7df9e7 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 20 Sep 2016 14:47:08 -0400 Subject: Add coverity branch to travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 22a0085e34..692c8d181d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ sudo: required only: - master - develop + - coverity - \/feature\/.+ - \/fix\/.+ - \/hotfix\/.+ -- cgit v1.2.1 From 2046c39bf84b6f118ce0977243520b7f66636dbb Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 20 Sep 2016 16:24:56 -0400 Subject: Fix Coverity build submission --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 692c8d181d..9f177357f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,3 @@ -env: - global: - # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key - - LD_LIBRARY_PATH=. - - secure: "YrUVgA4/Vs4YPINdq1hwc5Mv2SZEtq/XY/+Wg0hC6lpicRBLSiQEgsqmxZc0/OFIbxzTYSE080X8SA6DXp+A0MEVu94zYr9lS/jJ5cDi/2Cl8QV+S/q0nlvr8aJEmCjOFDQTvWMp32ajBIo9HKsN9WrfK6nHuGhBBkZHPjCiVSE=" language: cpp dist: trusty sudo: required @@ -57,6 +51,9 @@ env: - CMAKE_CXX_COMPILER=g++-4.9 - CMAKE_C_COMPILER=gcc-4.9 - LD_LIBRARY_PATH=. + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: "gGRieQzK0ExcuQRaMs/8mbXK4gitDSBs9RFV/iIqVUeKv+1ZyA4UP4tGAFXeY8Kl0sbRtld7t03Wx1/u0JI1bON2XMn/wCj0Hr8kbwt3eJr1bpG8dVr0tqDpfYVsBjX/nMxwNNBillvBpyXRoZf8z7ukZJAyRMMVG5tHqUVJM4k=" after_success: - pwd ; bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.info || echo "Codecov did not collect coverage reports" deploy: -- cgit v1.2.1 From dd6c53b143992f967cd42a7c5c327e57e80a217e Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 20 Sep 2016 17:37:37 -0400 Subject: Fix Coverity build --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f177357f7..8b2ba0051b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ addons: name: "smartdevicelink/sdl_core" description: "Build submitted via Travis CI" notification_email: jack@livio.io - build_command_prepend: "mkdir build && cd build && cmake ../" + build_command_prepend: "mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON" build_command: "make install" branch_pattern: coverity before_install: @@ -40,8 +40,8 @@ before_install: script: - sudo ln -sf /usr/bin/gcov-4.9 /usr/bin/gcov - bash -e tools/infrastructure/check_style.sh - - mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON && make install - sudo ldconfig + - cd build - make test - bash -ex ../tools/infrastructure/collect_coverage.sh ./ env: @@ -52,7 +52,7 @@ env: - CMAKE_C_COMPILER=gcc-4.9 - LD_LIBRARY_PATH=. # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key + # via the "travis encrypt" command using the project repo's public key - secure: "gGRieQzK0ExcuQRaMs/8mbXK4gitDSBs9RFV/iIqVUeKv+1ZyA4UP4tGAFXeY8Kl0sbRtld7t03Wx1/u0JI1bON2XMn/wCj0Hr8kbwt3eJr1bpG8dVr0tqDpfYVsBjX/nMxwNNBillvBpyXRoZf8z7ukZJAyRMMVG5tHqUVJM4k=" after_success: - pwd ; bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.info || echo "Codecov did not collect coverage reports" -- cgit v1.2.1 From 0fdd32f58dbedf7e175d5ab8b3e04b4edd3d9526 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Wed, 21 Sep 2016 10:27:43 -0400 Subject: Fix style issues --- .../include/application_manager/application.h | 5 ++--- .../mobile/create_interaction_choice_set_request.h | 3 +-- .../include/application_manager/request_info.h | 2 +- .../commands/mobile/get_vehicle_data_request.cc | 4 ++-- src/components/application_manager/src/message.cc | 3 +-- .../application_manager/src/request_info.cc | 2 +- src/components/config_profile/src/ini_file.cc | 3 ++- src/components/config_profile/src/profile.cc | 3 ++- .../policy/usage_statistics/statistics_manager.h | 10 ++++----- .../src/audio/from_mic_recorder_listener.cc | 2 +- .../rpc_base/include/rpc_base/rpc_base_json_inl.h | 4 ++-- .../src/bluetooth/bluetooth_socket_connection.cc | 4 ++-- .../src/tcp/tcp_client_listener.cc | 24 ++++++++++++++-------- src/components/utils/src/file_system.cc | 8 ++++---- 14 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 20a8c9b3b0..2c6a27c5f4 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -87,11 +87,10 @@ struct Version { struct AppFile { // need to use in std::map; - AppFile() + AppFile() : is_persistent(false) , is_download_complete(false) - , file_type(mobile_apis::FileType::INVALID_ENUM) { - } + , file_type(mobile_apis::FileType::INVALID_ENUM) {} AppFile(const std::string& name, bool persistent, bool download_complete, diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h index 32fed1eee1..d66db3d548 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h @@ -103,8 +103,7 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl { * processing deleting sent commands if error from HMI received */ struct VRCommandInfo { - VRCommandInfo() - : cmd_id_(0), succesful_response_received_(false) {} + VRCommandInfo() : cmd_id_(0), succesful_response_received_(false) {} VRCommandInfo(uint32_t cmd_id) : cmd_id_(cmd_id), succesful_response_received_(false) {} uint32_t cmd_id_; diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index c0a85e1f5e..0d4a147bda 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -53,7 +53,7 @@ namespace request_controller { * */ typedef utils::SharedPtr RequestPtr; - + struct RequestInfo { enum RequestType { RequestNone, MobileRequest, HMIRequest }; diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index b4c6db9b91..dc36e9ad3a 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -271,8 +271,8 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { message[strings::params][hmi_response::code].asInt()); bool result = false; if (mobile_apis::Result::SUCCESS == result_code || - (mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE == result_code - && message[strings::msg_params].length() > 1)) { + (mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE == result_code && + message[strings::msg_params].length() > 1)) { result = true; } const char* info = NULL; diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index 1dbac42010..2206cf479f 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -67,8 +67,7 @@ Message::Message(protocol_handler::MessagePriority priority) , version_(kUnknownProtocol) {} Message::Message(const Message& message) - : priority_(message.priority_), - binary_data_(NULL) { + : priority_(message.priority_), binary_data_(NULL) { *this = message; } diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 1826e67a0d..d951d396d9 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -76,7 +76,7 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request, RequestInfo::RequestInfo(RequestPtr request, const RequestInfo::RequestType requst_type, const TimevalStruct& start_time, - const uint64_t timeout_msec) + const uint64_t timeout_msec) : request_(request) , start_time_(start_time) , timeout_msec_(timeout_msec) diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc index d4d6208401..3245b096cb 100644 --- a/src/components/config_profile/src/ini_file.cc +++ b/src/components/config_profile/src/ini_file.cc @@ -278,7 +278,8 @@ char ini_write_value(const char* fname, if (0 != rename(temp_fname, fname)) { if (0 != remove(temp_fname)) { - LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to remove temp file: " << std::string(temp_fname)); + LOG4CXX_WARN_WITH_ERRNO( + logger_, "Unable to remove temp file: " << std::string(temp_fname)); } return FALSE; } diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 9224a454a3..b5ea924b49 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -315,7 +315,8 @@ Profile::Profile() , max_cmd_id_(kDefaultMaxCmdId) , default_timeout_(kDefaultTimeout) , app_resuming_timeout_(kDefaultAppResumingTimeout) - , app_resumption_save_persistent_data_timeout_(kDefaultAppSavePersistentDataTimeout) + , app_resumption_save_persistent_data_timeout_( + kDefaultAppSavePersistentDataTimeout) , app_dir_quota_(kDefaultDirQuota) , app_hmi_level_none_time_scale_max_requests_( kDefaultAppHmiLevelNoneTimeScaleMaxRequests) diff --git a/src/components/include/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/usage_statistics/statistics_manager.h index 6f52c89f30..4a387b8b13 100644 --- a/src/components/include/policy/usage_statistics/statistics_manager.h +++ b/src/components/include/policy/usage_statistics/statistics_manager.h @@ -38,11 +38,11 @@ namespace usage_statistics { -enum GlobalCounterId { - GLOBAL_COUNTER_NONE, - IAP_BUFFER_FULL, - SYNC_OUT_OF_MEMORY, - SYNC_REBOOTS +enum GlobalCounterId { + GLOBAL_COUNTER_NONE, + IAP_BUFFER_FULL, + SYNC_OUT_OF_MEMORY, + SYNC_REBOOTS }; enum AppInfoId { APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI }; diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc index fc55e69d28..647db1e1a3 100644 --- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc +++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc @@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager") FromMicRecorderListener::FromMicRecorderListener( const std::string& file_name, application_manager::ApplicationManager& app_mngr) - : reader_(NULL) + : reader_(NULL) , file_name_(file_name) , current_application_(0) , application_manager_(app_mngr) {} diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h index c7854ede43..31f8c90872 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h @@ -351,8 +351,8 @@ inline Json::Value Nullable::ToJsonValue() const { template template Optional::Optional(const Json::Value* value, const U& def_value) - : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE) - , value_(value, def_value) {} + : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE) + , value_(value, def_value) {} template inline Json::Value Optional::ToJsonValue() const { diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc index 3d136532d9..ad000ab901 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc @@ -104,9 +104,9 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) { if (0 == connect_status) { LOG4CXX_DEBUG(logger_, "rfcomm Connect ok"); break; - } else { // If connect_status is not 0, an errno is returned + } else { // If connect_status is not 0, an errno is returned LOG4CXX_WARN_WITH_ERRNO(logger_, "rfcomm Connect failed"); - close(rfcomm_socket); // Always close the socket upon error + close(rfcomm_socket); // Always close the socket upon error if (errno != ECONNREFUSED && errno != ECONNRESET) { break; } diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc index 7a074d9ae9..6458310da8 100644 --- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc +++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc @@ -92,7 +92,8 @@ TransportAdapter::Error TcpClientListener::Init() { server_address.sin_addr.s_addr = INADDR_ANY; int optval = 1; - if (0 != setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) { + if (0 != + setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed"); } @@ -150,19 +151,23 @@ void SetKeepaliveOptions(const int fd) { if (0 != setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_KEEPALIVE failed"); } - if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, - &keepidle, sizeof(keepidle))) { + if (0 != + setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPIDLE failed"); } - if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) { + if (0 != + setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPCNT failed"); } - if (0 != setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, - &keepintvl, sizeof(keepintvl))) { + if (0 != setsockopt( + fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPINTVL failed"); } - if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, - &user_timeout, sizeof(user_timeout))) { + if (0 != setsockopt(fd, + IPPROTO_TCP, + TCP_USER_TIMEOUT, + &user_timeout, + sizeof(user_timeout))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_USER_TIMEOUT failed"); } #elif defined(__QNX__) // __linux__ @@ -255,7 +260,8 @@ void TcpClientListener::StopLoop() { server_address.sin_family = AF_INET; server_address.sin_port = htons(port_); server_address.sin_addr.s_addr = INADDR_ANY; - if (0 != connect(byesocket, reinterpret_cast(&server_address), + if (0 != connect(byesocket, + reinterpret_cast(&server_address), sizeof(server_address))) { LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to connect byesocket"); } else { diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc index 0ae6f973be..947b5b090a 100644 --- a/src/components/utils/src/file_system.cc +++ b/src/components/utils/src/file_system.cc @@ -98,8 +98,8 @@ size_t file_system::DirectorySize(const std::string& path) { size += DirectorySize(full_element_path); } else { if (0 != stat(full_element_path.c_str(), &file_info)) { - LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file info: " - << full_element_path); + LOG4CXX_WARN_WITH_ERRNO( + logger_, "Could not get file info: " << full_element_path); } else { size += file_info.st_size; } @@ -271,8 +271,8 @@ void file_system::remove_directory_content(const std::string& directory_name) { rmdir(full_element_path.c_str()); } else { if (0 != remove(full_element_path.c_str())) { - LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to remove file: " - << full_element_path); + LOG4CXX_WARN_WITH_ERRNO( + logger_, "Unable to remove file: " << full_element_path); } } } -- cgit v1.2.1 From d4d66bafe7c9bc6982140ee662de0c263e45f154 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 13 Jun 2017 16:10:05 +0300 Subject: Fixed sending OnSystemRequest with HTTP mode Changes from PR #1602 --- .../include/application_manager/policies/policy_handler.h | 5 ----- .../application_manager/src/policies/policy_handler.cc | 12 ++---------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index e2c4d73f5c..3d6a125251 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -445,10 +445,6 @@ class PolicyHandler : public PolicyHandlerInterface, void SetPolicyManager(utils::SharedPtr pm) { policy_manager_ = pm; } - - AppIds& last_used_app_ids() { - return last_used_app_ids_; - } #endif // BUILD_TESTS #ifdef ENABLE_SECURITY @@ -609,7 +605,6 @@ class PolicyHandler : public PolicyHandlerInterface, mutable sync_primitives::RWLock policy_manager_lock_; utils::SharedPtr policy_manager_; void* dl_handle_; - AppIds last_used_app_ids_; utils::SharedPtr event_observer_; uint32_t last_activated_app_id_; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 840b1ae0f8..f3ab96a0fe 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1021,16 +1021,8 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string, LOG4CXX_AUTO_TRACE(logger_); POLICY_LIB_CHECK(false); - ApplicationSharedPtr app; - uint32_t app_id = 0; - if (last_used_app_ids_.empty()) { - LOG4CXX_WARN(logger_, "last_used_app_ids_ is empty"); - return false; - } else { - app_id = last_used_app_ids_.back(); - - app = application_manager_.application(app_id); - } + const uint32_t app_id = GetAppIdForSending(); + ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { LOG4CXX_WARN(logger_, -- cgit v1.2.1 From 638d17aa4821c5d1eb4b4e9009c027086d26d88a Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 13 Jun 2017 16:12:01 +0300 Subject: Fixed sending timeout param via OnSystemRequest Also added const for methods TimeoutExchangeSec/TimeoutExchangeMSec Changes from PR #1496 --- .../include/application_manager/policies/policy_handler.h | 4 ++-- .../src/commands/mobile/on_system_request_notification.cc | 4 ++++ src/components/application_manager/src/policies/policy_handler.cc | 4 ++-- .../include/application_manager/policies/policy_handler_interface.h | 4 ++-- .../test/application_manager/policies/mock_policy_handler_interface.h | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 3d6a125251..0b808b13f5 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -123,8 +123,8 @@ class PolicyHandler : public PolicyHandlerInterface, EndpointUrls& out_end_points) OVERRIDE; virtual std::string GetLockScreenIconUrl() const OVERRIDE; uint32_t NextRetryTimeout() OVERRIDE; - uint32_t TimeoutExchangeSec() OVERRIDE; - uint32_t TimeoutExchangeMSec() OVERRIDE; + uint32_t TimeoutExchangeSec() const OVERRIDE; + uint32_t TimeoutExchangeMSec() const OVERRIDE; void OnExceededTimeout() OVERRIDE; void OnSystemReady() OVERRIDE; void PTUpdatedAt(Counters counter, int value) OVERRIDE; diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc index a17c76d9c1..c29ff3e2d3 100644 --- a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc @@ -99,6 +99,10 @@ void OnSystemRequestNotification::Run() { (*message_)[strings::msg_params][strings::file_type] = FileType::JSON; } else if (RequestType::HTTP == request_type) { (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY; + if ((*message_)[strings::msg_params].keyExists(strings::url)) { + (*message_)[strings::msg_params][strings::timeout] = + policy_handler.TimeoutExchangeSec(); + } } SendNotification(); diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index f3ab96a0fe..89ae6c2c4b 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1565,11 +1565,11 @@ uint32_t PolicyHandler::NextRetryTimeout() { return policy_manager_->NextRetryTimeout(); } -uint32_t PolicyHandler::TimeoutExchangeSec() { +uint32_t PolicyHandler::TimeoutExchangeSec() const { return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND; } -uint32_t PolicyHandler::TimeoutExchangeMSec() { +uint32_t PolicyHandler::TimeoutExchangeMSec() const { POLICY_LIB_CHECK(0); return policy_manager_->TimeoutExchangeMSec(); } diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index c5af16863a..a1c45c0bd6 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -105,8 +105,8 @@ class PolicyHandlerInterface { EndpointUrls& out_end_points) = 0; virtual std::string GetLockScreenIconUrl() const = 0; virtual uint32_t NextRetryTimeout() = 0; - virtual uint32_t TimeoutExchangeSec() = 0; - virtual uint32_t TimeoutExchangeMSec() = 0; + virtual uint32_t TimeoutExchangeSec() const = 0; + virtual uint32_t TimeoutExchangeMSec() const = 0; virtual void OnExceededTimeout() = 0; virtual void OnSystemReady() = 0; virtual void PTUpdatedAt(Counters counter, int value) = 0; diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 8f6972fd52..2fad7b757e 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -104,8 +104,8 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string()); MOCK_METHOD0(ResetRetrySequence, void()); MOCK_METHOD0(NextRetryTimeout, uint32_t()); - MOCK_METHOD0(TimeoutExchangeSec, uint32_t()); - MOCK_METHOD0(TimeoutExchangeMSec, uint32_t()); + MOCK_CONST_METHOD0(TimeoutExchangeSec, uint32_t()); + MOCK_CONST_METHOD0(TimeoutExchangeMSec, uint32_t()); MOCK_METHOD0(OnExceededTimeout, void()); MOCK_METHOD0(OnSystemReady, void()); MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value)); -- cgit v1.2.1 From 4f6da5f3797b4982215cf0e470232234a95ef7a2 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 13 Jun 2017 16:14:08 +0300 Subject: Fixed retry sequence timeout for PTU After clarification UPDATE_NEEDED should be sent after retry sequence timeout, not after fixed timeout. For this purpose there was removed thread for update status manager. Changes from PR #1533 and #1542 --- .../include/policy/update_status_manager.h | 21 +----- .../policy/update_status_manager_interface.h | 3 +- .../policy_regular/src/policy_manager_impl.cc | 31 ++++----- .../policy_regular/src/update_status_manager.cc | 77 +--------------------- .../include/policy/mock_update_status_manager.h | 2 +- 5 files changed, 18 insertions(+), 116 deletions(-) diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h index 89c6b7e7bb..a68d986d10 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h @@ -83,9 +83,8 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { /** * @brief Update status hanlder for PTS sending out - * @param update_timeout Timeout for waiting of incoming PTU (msec) */ - void OnUpdateSentOut(uint32_t update_timeout); + void OnUpdateSentOut(); /** * @brief Update status handler for PTU waiting timeout @@ -216,24 +215,6 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { bool apps_search_in_progress_; bool app_registered_from_non_consented_device_; sync_primitives::Lock apps_search_in_progress_lock_; - - class UpdateThreadDelegate : public threads::ThreadDelegate { - public: - UpdateThreadDelegate(UpdateStatusManager* update_status_manager); - ~UpdateThreadDelegate(); - virtual void threadMain(); - virtual void exitThreadMain(); - void updateTimeOut(const uint32_t timeout_ms); - - volatile uint32_t timeout_; - volatile bool stop_flag_; - sync_primitives::Lock state_lock_; - sync_primitives::ConditionalVariable termination_condition_; - UpdateStatusManager* update_status_manager_; - }; - - UpdateThreadDelegate* update_status_thread_delegate_; - threads::Thread* thread_; }; } diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h index e8da7b9b69..e118f9974f 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h @@ -71,9 +71,8 @@ class UpdateStatusManagerInterface { /** * @brief Update status hanlder for PTS sending out - * @param update_timeout Timeout for waiting of incoming PTU */ - virtual void OnUpdateSentOut(uint32_t update_timeout) = 0; + virtual void OnUpdateSentOut() = 0; /** * @brief Update status handler for PTU waiting timeout 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 bb7c68d22d..7a374920c2 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -319,10 +319,10 @@ void PolicyManagerImpl::StartPTExchange() { if (update_status_manager_.IsUpdateRequired()) { if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) { // Start retry sequency - const int timeout_sec = NextRetryTimeout(); + const uint32_t timeout_msec = NextRetryTimeout(); LOG4CXX_DEBUG(logger_, - "Start retry sequence timeout = " << timeout_sec); - timer_retry_sequence_.Start(timeout_sec, timer::kPeriodic); + "Start retry sequence timeout = " << timeout_msec); + timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); } } } @@ -805,7 +805,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() { LOG4CXX_DEBUG(logger_, "Index: " << retry_sequence_index_); uint32_t next = 0u; if (retry_sequence_seconds_.empty() || - retry_sequence_index_ >= retry_sequence_seconds_.size()) { + retry_sequence_index_ > retry_sequence_seconds_.size()) { return next; } @@ -853,16 +853,7 @@ void PolicyManagerImpl::OnExceededTimeout() { } 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(); - - if (send_on_update_sent_out_) { - update_status_manager_.OnUpdateSentOut(update_timeout); - } + update_status_manager_.OnUpdateSentOut(); cache_->SaveUpdateRequired(true); } @@ -1118,15 +1109,17 @@ void PolicyManagerImpl::set_cache_manager( void PolicyManagerImpl::RetrySequence() { LOG4CXX_INFO(logger_, "Start new retry sequence"); - RequestPTUpdate(); - - uint32_t timeout = NextRetryTimeout(); + update_status_manager_.OnUpdateTimeoutOccurs(); - if (!timeout && timer_retry_sequence_.is_running()) { + const uint32_t timeout_msec = NextRetryTimeout(); + LOG4CXX_DEBUG(logger_, "New retry sequence timeout = " << timeout_msec); + if (!timeout_msec && timer_retry_sequence_.is_running()) { timer_retry_sequence_.Stop(); return; } - timer_retry_sequence_.Start(timeout, timer::kPeriodic); + + RequestPTUpdate(); + timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); } } // namespace policy diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index d683249718..89e44e90b6 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -43,21 +43,9 @@ UpdateStatusManager::UpdateStatusManager() : listener_(NULL) , current_status_(utils::MakeShared()) , apps_search_in_progress_(false) - , app_registered_from_non_consented_device_(true) { - update_status_thread_delegate_ = new UpdateThreadDelegate(this); - thread_ = threads::CreateThread("UpdateStatusThread", - update_status_thread_delegate_); - thread_->start(); -} + , app_registered_from_non_consented_device_(true) {} -UpdateStatusManager::~UpdateStatusManager() { - LOG4CXX_AUTO_TRACE(logger_); - DCHECK(update_status_thread_delegate_); - DCHECK(thread_); - thread_->join(); - delete update_status_thread_delegate_; - threads::DeleteThread(thread_); -} +UpdateStatusManager::~UpdateStatusManager() {} void UpdateStatusManager::ProcessEvent(UpdateEvent event) { sync_primitives::AutoLock lock(status_lock_); @@ -78,29 +66,23 @@ void UpdateStatusManager::set_listener(PolicyListener* listener) { listener_ = listener; } -void UpdateStatusManager::OnUpdateSentOut(uint32_t update_timeout) { +void UpdateStatusManager::OnUpdateSentOut() { LOG4CXX_AUTO_TRACE(logger_); - DCHECK(update_status_thread_delegate_); - update_status_thread_delegate_->updateTimeOut(update_timeout); ProcessEvent(kOnUpdateSentOut); } void UpdateStatusManager::OnUpdateTimeoutOccurs() { LOG4CXX_AUTO_TRACE(logger_); ProcessEvent(kOnUpdateTimeout); - DCHECK(update_status_thread_delegate_); - update_status_thread_delegate_->updateTimeOut(0); // Stop Timer } void UpdateStatusManager::OnValidUpdateReceived() { LOG4CXX_AUTO_TRACE(logger_); - update_status_thread_delegate_->updateTimeOut(0); // Stop Timer ProcessEvent(kOnValidUpdateReceived); } void UpdateStatusManager::OnWrongUpdateReceived() { LOG4CXX_AUTO_TRACE(logger_); - update_status_thread_delegate_->updateTimeOut(0); // Stop Timer ProcessEvent(kOnWrongUpdateReceived); } @@ -204,57 +186,4 @@ void UpdateStatusManager::DoTransition() { postponed_status_.reset(); } -UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate( - UpdateStatusManager* update_status_manager) - : timeout_(0) - , stop_flag_(false) - , state_lock_(true) - , update_status_manager_(update_status_manager) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate"); -} - -UpdateStatusManager::UpdateThreadDelegate::~UpdateThreadDelegate() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Delete UpdateThreadDelegate"); -} - -void UpdateStatusManager::UpdateThreadDelegate::threadMain() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "UpdateStatusManager thread started (started normal)"); - sync_primitives::AutoLock auto_lock(state_lock_); - while (false == stop_flag_) { - if (timeout_ > 0) { - LOG4CXX_DEBUG(logger_, "Timeout is greater then 0"); - sync_primitives::ConditionalVariable::WaitStatus wait_status = - termination_condition_.WaitFor(auto_lock, timeout_); - if (sync_primitives::ConditionalVariable::kTimeout == wait_status) { - if (update_status_manager_) { - update_status_manager_->OnUpdateTimeoutOccurs(); - } - } - } else { - // Time is not active, wait until timeout will be set, - // or UpdateStatusManager will be deleted - termination_condition_.Wait(auto_lock); - } - } -} - -void UpdateStatusManager::UpdateThreadDelegate::exitThreadMain() { - LOG4CXX_AUTO_TRACE(logger_); - sync_primitives::AutoLock auto_lock(state_lock_); - stop_flag_ = true; - LOG4CXX_DEBUG(logger_, "before notify"); - termination_condition_.NotifyOne(); -} - -void UpdateStatusManager::UpdateThreadDelegate::updateTimeOut( - const uint32_t timeout_ms) { - LOG4CXX_AUTO_TRACE(logger_); - sync_primitives::AutoLock auto_lock(state_lock_); - timeout_ = timeout_ms; - termination_condition_.NotifyOne(); -} - } // namespace policy diff --git a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h index 981ff1ca9e..924284c8cc 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h @@ -41,7 +41,7 @@ namespace policy { class MockUpdateStatusManager : public UpdateStatusManager { public: MOCK_METHOD1(set_listener, void(PolicyListener* listener)); - MOCK_METHOD1(OnUpdateSentOut, void(uint32_t update_timeout)); + MOCK_METHOD0(OnUpdateSentOut, void()); MOCK_METHOD0(OnUpdateTimeoutOccurs, void()); MOCK_METHOD0(OnValidUpdateReceived, void()); MOCK_METHOD0(OnWrongUpdateReceived, void()); -- cgit v1.2.1 From 1e6188c8fa8932bd3e0b0aae4e60e6a4bd90dca9 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 13 Jun 2017 16:16:21 +0300 Subject: Updated/added unit tests for provided fixes --- .../test/policy_handler_test.cc | 45 +++++++++++++++++----- .../test/update_status_manager_test.cc | 4 +- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 9713989f81..4c3e882eae 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -1997,34 +1997,59 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) { EXPECT_EQ(app_in_none_id_1 || app_in_none_id_2, app_id); } -TEST_F(PolicyHandlerTest, SendMessageToSDK) { - // Precondition +TEST_F(PolicyHandlerTest, + SendMessageToSDK_SuitableAppPresent_ExpectedNotificationSending) { BinaryMessage msg; const std::string url = "test_url"; EnablePolicyAndPolicyManagerMock(); test_app.insert(mock_app_); - // Expectations + EXPECT_CALL(app_manager_, application(kAppId1_)) .WillRepeatedly(Return(mock_app_)); - EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_)); + EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillRepeatedly(Return(kPolicyAppId_)); + EXPECT_CALL(*mock_app_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true)); + + const connection_handler::DeviceHandle test_device_id = 1u; + EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id)); + EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)) + .WillOnce(Return(kDeviceAllowed)); // Act - policy_handler_.last_used_app_ids().push_back(kAppId1_); EXPECT_CALL(mock_message_helper_, SendPolicySnapshotNotification(kAppId1_, msg, url, _)); EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, url)); } -TEST_F(PolicyHandlerTest, SendMessageToSDK_InavalidApp_UNSUCCESS) { +TEST_F(PolicyHandlerTest, + SendMessageToSDK_NoSuitableApp_ExpectedNotificationNotSent) { BinaryMessage msg; const std::string url = "test_url"; EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr invalid_app; - policy_handler_.last_used_app_ids().push_back(kAppId1_); + test_app.insert(mock_app_); EXPECT_CALL(app_manager_, application(kAppId1_)) - .WillOnce(Return(invalid_app)); - EXPECT_CALL(*mock_app_, policy_app_id()).Times(0); + .WillRepeatedly(Return(mock_app_)); + EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillRepeatedly(Return(kPolicyAppId_)); + EXPECT_CALL(*mock_app_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true)); + + const connection_handler::DeviceHandle test_device_id = 1u; + EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id)); + EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)) + .WillOnce(Return(kDeviceDisallowed)); + + // Expected to get 0 as application id so SDL does not have valid application + // with such id + EXPECT_CALL(app_manager_, application(0)) + .WillOnce(Return( + utils::SharedPtr())); EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url)); } diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 910494ff0d..9d0326d0be 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -47,13 +47,11 @@ using ::testing::Return; class UpdateStatusManagerTest : public ::testing::Test { protected: utils::SharedPtr manager_; - const uint32_t k_timeout_; utils::SharedPtr listener_; public: UpdateStatusManagerTest() : manager_(utils::MakeShared()) - , k_timeout_(1000) , listener_(utils::MakeShared()) {} void SetUp() OVERRIDE { @@ -73,7 +71,7 @@ TEST_F(UpdateStatusManagerTest, manager_->OnPolicyInit(true); // Check EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus()); - manager_->OnUpdateSentOut(k_timeout_); + manager_->OnUpdateSentOut(); // Check EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus()); } -- cgit v1.2.1 From c5cc49618cbfb8b0b93fbc0e5cf8c9365ce1d5ed Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 14 Jun 2017 14:56:02 -0400 Subject: Start Retry Sequence if timeout is valid and not 0 --- .../policy/policy_regular/src/policy_manager_impl.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 7a374920c2..b1a8c82f89 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -320,9 +320,12 @@ void PolicyManagerImpl::StartPTExchange() { if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) { // Start retry sequency const uint32_t timeout_msec = NextRetryTimeout(); - LOG4CXX_DEBUG(logger_, - "Start retry sequence timeout = " << timeout_msec); - timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); + + if(timeout_msec) { + LOG4CXX_DEBUG(logger_, + "Start retry sequence timeout = " << timeout_msec); + timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); + } } } } @@ -1113,8 +1116,10 @@ void PolicyManagerImpl::RetrySequence() { const uint32_t timeout_msec = NextRetryTimeout(); LOG4CXX_DEBUG(logger_, "New retry sequence timeout = " << timeout_msec); - if (!timeout_msec && timer_retry_sequence_.is_running()) { - timer_retry_sequence_.Stop(); + if (!timeout_msec) { + if(timer_retry_sequence_.is_running()) { + timer_retry_sequence_.Stop(); + } return; } -- cgit v1.2.1 From 83be860791dc7b264982155a1357cc048b004559 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 14 Jun 2017 17:46:13 -0400 Subject: Add Changelogs --- CHANGELOG.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..0f5c51957d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,86 @@ +# New Features + +### EXTENDED_POLICY modes: +- The `EXTENDED_POLICY` CMake variable (previously `ENABLE_EXTENDED_POLICY`) now has three possible configurations + - `HTTP` (previously `ENABLE_EXTENDED_POLICY: OFF`) - #941 + - `PROPRIETARY` (previously `ENABLE_EXTENDED_POLICY: ON`) - #940 + - `EXTERNAL_PROPRIETARY` (new, fully featured version of `PROPRIETARY` mode) - #942 + +### EXTERNAL_PROPRIETARY mode: +#### New policy table update sequence +A new policy table update flow was created specifically for the `EXTERNAL_PROPRIETARY` policy mode + +- Requirements/Details - #933 +- Diagram - https://user-images.githubusercontent.com/10549248/26896053-9417c604-4b91-11e7-9e47-524c930eb542.png + +#### External Policy Manager +As part of the `EXTERNAL_PROPRIETARY` policy mode, the concept of an "external policy manager" is necessary. This policy manager is a separate program which is in charge of encrypting/decrypting policy tables and attaching an HTTP header to the OnSystemRequest payload when performing a Policy Table Update. + +As part of this release, a sample application which performs this function was added to this repository for those who wish to implement this new policy mode, and this program can be started along with Core using an included bash script. This sample application does nothing with the policy table snapshot during the encryption and decryption phases, allowing for OEMs to implement their own encryption algorithms in their place. + +#### App permissions/User consent +Users can now control what functional groups that they want apps to be able to access, as well as decide whether to enable SDL functionality at all on a device-by-device basis. + + - Logic was added to allow the user to control what devices are permitted to use SDL functionality - #934 + - Users are prompted when activating an app on a new device for the first time whether or not to allow the device to use SDL functionality (sequence shown in [this diagram](https://user-images.githubusercontent.com/10549248/26897493-ba378f2c-4b96-11e7-93b0-b24f01c7dc28.png)) + - Logic was added to the Policy Manager to allow the user to control what apps have access to specific functional groups - #939 + - Users are prompted when activating an app for the first time (or modifying permissions in settings) with information on what access a requested functional group requires. The user responds to determine whether or not to allow this functionality within the new app (sequence shown in [this diagram](https://user-images.githubusercontent.com/10549248/26902322-e6e02bf0-4ba6-11e7-98b3-c285396061a4.png)) + + +#### External user consent +External user consent allows the HMI to define several groups of permissions within the policy table. This allows the user to enable/disable several functional groups at once. + + - The `externalConsentStatus` field is included as part of a GetListOfPermissions response from SDL Core to communicate which groups are activated - #1047 + - External consent groups can be used to enable sets of functional groups using the `disallowed_by_external_consent_entities_off` field in the Policy Table - #1049 + - If this external consent group is set to `ON`, all functional groupings with this parameter are allowed by the user - #1048 + - If this external consent group is set to `OFF`, all functional groupings with this parameter are disallowed by the user - #1050 + - External consent groups can be used to disable sets of functional groups using the `disallowed_by_external_consent_entities_on` field in the Policy Table + - If this external consent group is set to `ON`, all functional groupings with this parameter are disallowed by the user + - If this external consent group is set to `OFF`, all functional groupings with this parameter are allowed by the user + +#### Cache Manager Function Implementations +Prior to this release, several functions included in cache_manager.cc were not fully implemented and would not query the local policy table for defined rules and policies. The newly implemented functions for the `EXTERNAL_PROPRIETARY` cache manager are listed below: + - [CanAppKeepContext()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L310) + - [CanAppStealFocus()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L363) + - [GetDefaultHMI()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L374) + - [ResetUserConsent()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L391) + - [GetUserPermissionsForDevice()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L406) + - [GetPreconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L477) + - [GetConsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L514) + - [GetUnconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L549) + - [RemoveAppConsentForGroup()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L605) + - [GetDeviceGroupsFromPolicies()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L799) + - [SetDeviceData()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L975) + - [SetUserPermissionsForDevice()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1008) + - [ReactOnUserDevConsentForApp()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1043) + - [SetUserPermissionsForApp()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1076) + - [CountUnconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1768) + - [SetMetaInfo()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1868) + - [IsMetaInfoPresent()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1884) + - [SetSystemLanguage()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1893) + - [CleanupUnpairedDevices()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1919) + - [SetVinValue()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L2175) + - [ResetPT()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L2309) + +#### Security behavior +Requirements/Details - #937 + +### HMI_API additions: + +A new RPC was added as part of the implementation of `EXTERNAL_PROPRIETARY` policy mode + + - [DecryptCertificate](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L2468-L2476) RPC + +Several API additions were made as part of the implementation of the external user consent feature + + - [EntityStatus](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L1263-L1266) enum + - [ExternalConsentStatus](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L1268-L1278) struct + - externalConsentStatus field added to [OnAppPermissionConsent](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172) and [GetListOfPermissions](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172) + +## Implemented proposals +Two new evolution proposals were implemented in release 4.3.0: + +- Add API Patch Version [SDL-0050](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0050-add-api-patch-version.md) + - A patch version was added to the MOBILE API version, HMI API interface versions, and SyncMsgVersion struct +- External Policy Manager [SDL-0045](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0045-external-policy-manager.md) + - Details for the implementation of this proposal can be found in the `External Policy Manager` section of these release notes \ No newline at end of file -- cgit v1.2.1 From 70eac687c9753cebe3a78037790139041af6d40f Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 19 Jun 2017 15:37:04 -0400 Subject: Fix Coverity Issue 171129 Current is an unsigned int so it can never be less than 0. I removed the condition that looks for current < 0 --- src/components/policy/policy_external/src/sql_pt_representation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 48985fa835..c49cd5ac29 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -224,7 +224,7 @@ int SQLPTRepresentation::DaysBeforeExchange(uint16_t current) { return limit; } - if (limit < 0 || last < 0 || current < 0 || current < last || + if (limit < 0 || last < 0 || current < last || limit < (current - last)) { return 0; } -- cgit v1.2.1 From aae63bd2c597418d4ab9ffe546a60cd2da8764ba Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 19 Jun 2017 16:47:00 -0400 Subject: Fix for coverity issues 171128, 171127, 171125 Removed const iterator since the permissions it is compared to is not a const object. --- src/components/policy/policy_external/src/policy_helper.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 12a02824f2..c8719eff16 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -576,11 +576,11 @@ void FillNotificationData::UpdateParameters( void FillNotificationData::ExcludeSame(RpcPermissions& rpc) { HMIPermissions& rpc_hmi_permissions = rpc.hmi_permissions; - HMIPermissions::const_iterator it_hmi_allowed = + HMIPermissions::iterator it_hmi_allowed = rpc.hmi_permissions.find(kAllowedKey); - HMIPermissions::const_iterator it_hmi_undefined = + HMIPermissions::iterator it_hmi_undefined = rpc.hmi_permissions.find(kUndefinedKey); - HMIPermissions::const_iterator it_hmi_user_disallowed = + HMIPermissions::iterator it_hmi_user_disallowed = rpc.hmi_permissions.find(kUserDisallowedKey); // There is different logic of processing RPCs with and w/o 'parameters' -- cgit v1.2.1 From c1078a2a74534c3b36bd4f4805cc87cd4a3aaefa Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 19 Jun 2017 16:59:32 -0400 Subject: Fix for 171126 out_ap_permissions_changed is always a valid pointer and it is set to false prior to the SetUserPemissionsForApp function call. --- src/components/policy/policy_external/src/cache_manager.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 7c247f1759..b1bd73538e 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1082,9 +1082,6 @@ bool CacheManager::SetUserPermissionsForApp( permissions.group_permissions.begin(); std::vector::const_iterator iter_end = permissions.group_permissions.end(); - if (out_app_permissions_changed) { - *out_app_permissions_changed = false; - } std::string group_name; for (; iter != iter_end; ++iter) { -- cgit v1.2.1 From ca54d1f63a65b68e3597cd1650bd6c712935925c Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 19 Jun 2017 17:01:23 -0400 Subject: Fix coverity 171124 Fix copy paste error --- src/components/policy/policy_external/src/policy_table/types.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index d7dd986abc..528d70a426 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -1660,7 +1660,7 @@ void ConsentRecords::ReportErrors(rpc::ValidationReport* report__) const { if (!consent_groups.is_valid()) { consent_groups.ReportErrors(&report__->ReportSubobject("consent_groups")); } - if (!consent_groups.is_valid()) { + if (!external_consent_status_groups.is_valid()) { external_consent_status_groups.ReportErrors( &report__->ReportSubobject("external_consent_status_groups")); } -- cgit v1.2.1 From b7563577cd3cfffb3dca535c702b49f0691f00fc Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 20 Jun 2017 11:18:29 -0400 Subject: Fix for coverity issue 170762 Add retry_index_ to Launcher initializer list. --- src/components/application_manager/src/app_launch/apps_launcher.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc index 41465ae985..23ac02156d 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -95,9 +95,10 @@ AppsLauncher::Launcher::Launcher( connection_handler::ConnectionHandler& connection_handler, const uint16_t app_launch_max_retry_attempt, const uint16_t app_launch_retry_wait_time) - : retry_timer_( - "AppsLauncherTimer", - new timer::TimerTaskImpl(this, &Launcher::LaunchNow)) + : retry_index_(0) + , retry_timer_( + "AppsLauncherTimer", + new timer::TimerTaskImpl(this, &Launcher::LaunchNow)) , app_launch_max_retry_attempt_(app_launch_max_retry_attempt) , app_launch_retry_wait_time_(app_launch_retry_wait_time) , connection_handler_(connection_handler) -- cgit v1.2.1 From fa40630def5aeb4871a131d55ef9ee5d5195cf9a Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 20 Jun 2017 11:38:15 -0400 Subject: Fix for 170761 Removed is_ready_ since it is never used by the telemetry monitor --- .../telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h index ba8cbceb23..80338804ee 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h @@ -95,7 +95,6 @@ class TelemetryMonitor { private: std::string server_address_; int16_t port_; - bool is_ready_; threads::Thread* thread_; Streamer* streamer_; ApplicationManagerObserver app_observer; -- cgit v1.2.1 From ca7523ac3bab7c8baf224d80e250726d928acd6f Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 20 Jun 2017 11:57:55 -0400 Subject: Fixes for Coverity Issues: 170755, 170756, 170757, 170758, 170759 Add mobile_apis scope to avoid ambigous naming. --- .../src/policies/policy_handler.cc | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 89ae6c2c4b..4a90cbd3cd 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -64,29 +64,29 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler") namespace { using namespace mobile_apis; -typedef std::map RequestTypeMap; +typedef std::map RequestTypeMap; RequestTypeMap TypeToString = { - {RequestType::INVALID_ENUM, "INVALID_ENUM"}, - {RequestType::HTTP, "HTTP"}, - {RequestType::FILE_RESUME, "FILE_RESUME"}, - {RequestType::AUTH_REQUEST, "AUTH_REQUEST"}, - {RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"}, - {RequestType::AUTH_ACK, "AUTH_ACK"}, - {RequestType::PROPRIETARY, "PROPRIETARY"}, - {RequestType::QUERY_APPS, "QUERY_APPS"}, - {RequestType::LAUNCH_APP, "LAUNCH_APP"}, - {RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"}, - {RequestType::TRAFFIC_MESSAGE_CHANNEL, "TRAFFIC_MESSAGE_CHANNEL"}, - {RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"}, - {RequestType::VOICE_SEARCH, "VOICE_SEARCH"}, - {RequestType::NAVIGATION, "NAVIGATION"}, - {RequestType::PHONE, "PHONE"}, - {RequestType::CLIMATE, "CLIMATE"}, - {RequestType::SETTINGS, "SETTINGS"}, - {RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"}, - {RequestType::EMERGENCY, "EMERGENCY"}, - {RequestType::MEDIA, "MEDIA"}, - {RequestType::FOTA, "FOTA"}}; + {mobile_apis::RequestType::INVALID_ENUM, "INVALID_ENUM"}, + {mobile_apis::RequestType::HTTP, "HTTP"}, + {mobile_apis::RequestType::FILE_RESUME, "FILE_RESUME"}, + {mobile_apis::RequestType::AUTH_REQUEST, "AUTH_REQUEST"}, + {mobile_apis::RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"}, + {mobile_apis::RequestType::AUTH_ACK, "AUTH_ACK"}, + {mobile_apis::RequestType::PROPRIETARY, "PROPRIETARY"}, + {mobile_apis::RequestType::QUERY_APPS, "QUERY_APPS"}, + {mobile_apis::RequestType::LAUNCH_APP, "LAUNCH_APP"}, + {mobile_apis::RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"}, + {mobile_apis::RequestType::TRAFFIC_MESSAGE_CHANNEL, "TRAFFIC_MESSAGE_CHANNEL"}, + {mobile_apis::RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"}, + {mobile_apis::RequestType::VOICE_SEARCH, "VOICE_SEARCH"}, + {mobile_apis::RequestType::NAVIGATION, "NAVIGATION"}, + {mobile_apis::RequestType::PHONE, "PHONE"}, + {mobile_apis::RequestType::CLIMATE, "CLIMATE"}, + {mobile_apis::RequestType::SETTINGS, "SETTINGS"}, + {mobile_apis::RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"}, + {mobile_apis::RequestType::EMERGENCY, "EMERGENCY"}, + {mobile_apis::RequestType::MEDIA, "MEDIA"}, + {mobile_apis::RequestType::FOTA, "FOTA"}}; const std::string RequestTypeToString(RequestType::eType type) { RequestTypeMap::const_iterator it = TypeToString.find(type); -- cgit v1.2.1 From e371baa2c6a0f683e74a4130623bf3d0b9fcc262 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 21 Jun 2017 10:48:23 -0400 Subject: Fix for coverity issue 170752 --- .../application_manager/src/resumption/resume_ctrl_impl.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index ad50bbf104..996f3d365c 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -796,11 +796,15 @@ void ResumeCtrlImpl::OnAppRegistrationEnd() { StartSavePersistentDataTimer(); } -int32_t ResumeCtrlImpl::GetSavedAppHmiLevel( - const std::string& app_id, const std::string& device_id) const { +int32_t ResumeCtrlImpl::GetSavedAppHmiLevel(const std::string& app_id, + const std::string& device_id) const { + using namespace mobile_apis; smart_objects::SmartObject saved_app; if (resumption_storage_->GetSavedApplication(app_id, device_id, saved_app)) { - const int32_t saved_hmi_level = saved_app[strings::hmi_level].asInt(); + const HMILevel::eType saved_hmi_level = + static_cast( + saved_app[strings::hmi_level].asInt()); + return saved_hmi_level; } return static_cast(mobile_apis::HMILevel::INVALID_ENUM); -- cgit v1.2.1 From 18172d58258874c8ef3852de3cdc4978a3cb9cd8 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 21 Jun 2017 16:27:35 -0400 Subject: Fix for cov 171196 + style fixes --- .../application_manager/src/app_launch/apps_launcher.cc | 4 ++-- src/components/application_manager/src/policies/policy_handler.cc | 5 +++-- .../application_manager/src/resumption/resume_ctrl_impl.cc | 8 ++++---- .../policy/policy_external/src/sql_pt_representation.cc | 3 +-- src/components/policy/policy_regular/src/policy_manager_impl.cc | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc index 23ac02156d..bf3ce1e0a9 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -97,8 +97,8 @@ AppsLauncher::Launcher::Launcher( const uint16_t app_launch_retry_wait_time) : retry_index_(0) , retry_timer_( - "AppsLauncherTimer", - new timer::TimerTaskImpl(this, &Launcher::LaunchNow)) + "AppsLauncherTimer", + new timer::TimerTaskImpl(this, &Launcher::LaunchNow)) , app_launch_max_retry_attempt_(app_launch_max_retry_attempt) , app_launch_retry_wait_time_(app_launch_retry_wait_time) , connection_handler_(connection_handler) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 4a90cbd3cd..3ff7fcfa9a 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -76,7 +76,8 @@ RequestTypeMap TypeToString = { {mobile_apis::RequestType::QUERY_APPS, "QUERY_APPS"}, {mobile_apis::RequestType::LAUNCH_APP, "LAUNCH_APP"}, {mobile_apis::RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"}, - {mobile_apis::RequestType::TRAFFIC_MESSAGE_CHANNEL, "TRAFFIC_MESSAGE_CHANNEL"}, + {mobile_apis::RequestType::TRAFFIC_MESSAGE_CHANNEL, + "TRAFFIC_MESSAGE_CHANNEL"}, {mobile_apis::RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"}, {mobile_apis::RequestType::VOICE_SEARCH, "VOICE_SEARCH"}, {mobile_apis::RequestType::NAVIGATION, "NAVIGATION"}, @@ -88,7 +89,7 @@ RequestTypeMap TypeToString = { {mobile_apis::RequestType::MEDIA, "MEDIA"}, {mobile_apis::RequestType::FOTA, "FOTA"}}; -const std::string RequestTypeToString(RequestType::eType type) { +const std::string RequestTypeToString(mobile_apis::RequestType::eType type) { RequestTypeMap::const_iterator it = TypeToString.find(type); if (TypeToString.end() != it) { return (*it).second; diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index 996f3d365c..e7788bf9ff 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -644,7 +644,7 @@ bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff( DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false); const time_t time_stamp = - static_cast(saved_app[strings::time_stamp].asUInt()); + static_cast(saved_app[strings::time_stamp].asInt()); time_t ign_off_time = static_cast(resumption_storage_->GetIgnOffTime()); const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp); @@ -796,15 +796,15 @@ void ResumeCtrlImpl::OnAppRegistrationEnd() { StartSavePersistentDataTimer(); } -int32_t ResumeCtrlImpl::GetSavedAppHmiLevel(const std::string& app_id, - const std::string& device_id) const { +int32_t ResumeCtrlImpl::GetSavedAppHmiLevel( + const std::string& app_id, const std::string& device_id) const { using namespace mobile_apis; smart_objects::SmartObject saved_app; if (resumption_storage_->GetSavedApplication(app_id, device_id, saved_app)) { const HMILevel::eType saved_hmi_level = static_cast( saved_app[strings::hmi_level].asInt()); - + return saved_hmi_level; } return static_cast(mobile_apis::HMILevel::INVALID_ENUM); 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 c49cd5ac29..1732f3c774 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -224,8 +224,7 @@ int SQLPTRepresentation::DaysBeforeExchange(uint16_t current) { return limit; } - if (limit < 0 || last < 0 || current < last || - limit < (current - last)) { + if (limit < 0 || last < 0 || current < last || limit < (current - last)) { return 0; } 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 b1a8c82f89..f05ac9cb67 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -321,9 +321,9 @@ void PolicyManagerImpl::StartPTExchange() { // Start retry sequency const uint32_t timeout_msec = NextRetryTimeout(); - if(timeout_msec) { + if (timeout_msec) { LOG4CXX_DEBUG(logger_, - "Start retry sequence timeout = " << timeout_msec); + "Start retry sequence timeout = " << timeout_msec); timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); } } @@ -1117,7 +1117,7 @@ void PolicyManagerImpl::RetrySequence() { const uint32_t timeout_msec = NextRetryTimeout(); LOG4CXX_DEBUG(logger_, "New retry sequence timeout = " << timeout_msec); if (!timeout_msec) { - if(timer_retry_sequence_.is_running()) { + if (timer_retry_sequence_.is_running()) { timer_retry_sequence_.Stop(); } return; -- cgit v1.2.1 From 5c1b879ac3227570d33d5161dd22d217444c6538 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 21 Jun 2017 16:42:14 -0400 Subject: Fix for 170753 & 170763 --- .../application_manager/src/commands/mobile/system_request.cc | 7 ++++--- src/components/policy/policy_external/include/policy/status.h | 3 ++- src/components/policy/policy_regular/include/policy/status.h | 3 ++- src/components/policy/policy_regular/src/update_status_manager.cc | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc index 74d25508e0..866c3b950c 100644 --- a/src/components/application_manager/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/src/commands/mobile/system_request.cc @@ -118,8 +118,7 @@ class QueryAppsDataValidator { smart_objects::SmartArray::iterator applications_iterator = objects_array->begin(); - for (; applications_iterator != objects_array->end(); - ++applications_iterator) { + for (; applications_iterator != objects_array->end(); ) { const smart_objects::SmartObject& app_data = *applications_iterator; if (!app_data.isValid()) { @@ -133,7 +132,8 @@ class QueryAppsDataValidator { LOG4CXX_WARN(logger_, "Application hasn`t some of mandatory parameters. " "Application will be skipped."); - objects_array->erase(applications_iterator); + + applications_iterator = objects_array->erase(applications_iterator); continue; } @@ -186,6 +186,7 @@ class QueryAppsDataValidator { return false; } has_response_valid_application = true; + ++applications_iterator; } return has_response_valid_application; } diff --git a/src/components/policy/policy_external/include/policy/status.h b/src/components/policy/policy_external/include/policy/status.h index 53925c599a..18789ecf99 100644 --- a/src/components/policy/policy_external/include/policy/status.h +++ b/src/components/policy/policy_external/include/policy/status.h @@ -53,7 +53,8 @@ enum UpdateEvent { kOnResetPolicyTableNoUpdate, kScheduleUpdate, kScheduleManualUpdate, - kOnResetRetrySequence + kOnResetRetrySequence, + kNoEvent }; const std::string kUpToDate = "UP_TO_DATE"; diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h index 074e3c1eef..c1ea2de4c1 100644 --- a/src/components/policy/policy_regular/include/policy/status.h +++ b/src/components/policy/policy_regular/include/policy/status.h @@ -53,7 +53,8 @@ enum UpdateEvent { kOnResetPolicyTableNoUpdate, kScheduleUpdate, kScheduleManualUpdate, - kOnResetRetrySequence + kOnResetRetrySequence, + kNoEvent }; const std::string kUpToDate = "UP_TO_DATE"; diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index 89e44e90b6..941113c753 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -42,6 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") UpdateStatusManager::UpdateStatusManager() : listener_(NULL) , current_status_(utils::MakeShared()) + , last_processed_event_(kNoEvent) , apps_search_in_progress_(false) , app_registered_from_non_consented_device_(true) {} -- cgit v1.2.1 From 61f9cbe7309b52702def20682e4c6dce699bb1dd Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 22 Jun 2017 10:00:31 -0400 Subject: Fix for coverity 171199 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “SmartObjectToInt” is never actually used anywhere in the project… goodbye! --- src/components/application_manager/src/policies/policy_handler.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 3ff7fcfa9a..2fe6d1a257 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -537,12 +537,6 @@ void PolicyHandler::GetAvailableApps(std::queue& apps) { } } -struct SmartObjectToInt { - int operator()(const smart_objects::SmartObject& item) const { - return item.asInt(); - } -}; - StatusNotifier PolicyHandler::AddApplication( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) { -- cgit v1.2.1 From c79822b4674a5e0ca1a1cfbfbe4756baf9952c83 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 22 Jun 2017 11:53:23 -0400 Subject: Coverity Fixes in cache manager --- src/components/policy/policy_external/src/cache_manager.cc | 3 ++- src/components/policy/policy_external/src/update_status_manager.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index b1bd73538e..44e7b627c6 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1082,7 +1082,8 @@ bool CacheManager::SetUserPermissionsForApp( permissions.group_permissions.begin(); std::vector::const_iterator iter_end = permissions.group_permissions.end(); - + *out_app_permissions_changed = false; + std::string group_name; for (; iter != iter_end; ++iter) { if (policy::kGroupUndefined != (*iter).state) { diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc index 8b7635c25c..087db1149b 100644 --- a/src/components/policy/policy_external/src/update_status_manager.cc +++ b/src/components/policy/policy_external/src/update_status_manager.cc @@ -42,6 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") UpdateStatusManager::UpdateStatusManager() : listener_(NULL) , current_status_(utils::MakeShared()) + , last_processed_event_(kNoEvent) , apps_search_in_progress_(false) , app_registered_from_non_consented_device_(true) { update_status_thread_delegate_ = new UpdateThreadDelegate(this); @@ -62,6 +63,7 @@ UpdateStatusManager::~UpdateStatusManager() { void UpdateStatusManager::ProcessEvent(UpdateEvent event) { sync_primitives::AutoLock lock(status_lock_); current_status_->ProcessEvent(this, event); + last_processed_event_ = event; DoTransition(); } -- cgit v1.2.1 From c877a40c26977f0e465289d61c7ca82735ada7f8 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 22 Jun 2017 13:44:16 -0400 Subject: New fix for CID 171125, 171127, and 171128 Removed the rpc_hmi_permissions and rpc_parameter_permissions variables and used the rpc accessors instead. Otherwise comparisons were being made from iterators made from two different variables --- .../policy/policy_external/src/policy_helper.cc | 64 +++++++++++----------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index c8719eff16..cb27e7f0b3 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -575,40 +575,38 @@ void FillNotificationData::UpdateParameters( } void FillNotificationData::ExcludeSame(RpcPermissions& rpc) { - HMIPermissions& rpc_hmi_permissions = rpc.hmi_permissions; - HMIPermissions::iterator it_hmi_allowed = + HMIPermissions::const_iterator it_hmi_allowed = rpc.hmi_permissions.find(kAllowedKey); - HMIPermissions::iterator it_hmi_undefined = + HMIPermissions::const_iterator it_hmi_undefined = rpc.hmi_permissions.find(kUndefinedKey); - HMIPermissions::iterator it_hmi_user_disallowed = + HMIPermissions::const_iterator it_hmi_user_disallowed = rpc.hmi_permissions.find(kUserDisallowedKey); // There is different logic of processing RPCs with and w/o 'parameters' if (RpcParametersEmpty(rpc)) { // First, remove disallowed from other types - if (rpc_hmi_permissions.end() != it_hmi_user_disallowed) { - if (rpc_hmi_permissions.end() != it_hmi_allowed) { - ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey], - rpc_hmi_permissions[kUserDisallowedKey]); + if (rpc.hmi_permissions.end() != it_hmi_user_disallowed) { + if (rpc.hmi_permissions.end() != it_hmi_allowed) { + ExcludeSameHMILevels(rpc.hmi_permissions[kAllowedKey], + rpc.hmi_permissions[kUserDisallowedKey]); } - if (rpc_hmi_permissions.end() != it_hmi_undefined) { - ExcludeSameHMILevels(rpc_hmi_permissions[kUndefinedKey], - rpc_hmi_permissions[kUserDisallowedKey]); + if (rpc.hmi_permissions.end() != it_hmi_undefined) { + ExcludeSameHMILevels(rpc.hmi_permissions[kUndefinedKey], + rpc.hmi_permissions[kUserDisallowedKey]); } } // Then, remove undefined from allowed - if (rpc_hmi_permissions.end() != it_hmi_undefined) { - if (rpc_hmi_permissions.end() != it_hmi_allowed) { - ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey], - rpc_hmi_permissions[kUndefinedKey]); + if (rpc.hmi_permissions.end() != it_hmi_undefined) { + if (rpc.hmi_permissions.end() != it_hmi_allowed) { + ExcludeSameHMILevels(rpc.hmi_permissions[kAllowedKey], + rpc.hmi_permissions[kUndefinedKey]); } } return; } - ParameterPermissions& rpc_parameter_permissions = rpc.parameter_permissions; ParameterPermissions::const_iterator it_parameter_allowed = rpc.parameter_permissions.find(kAllowedKey); ParameterPermissions::const_iterator it_parameter_undefined = @@ -619,34 +617,34 @@ void FillNotificationData::ExcludeSame(RpcPermissions& rpc) { // First, removing allowed HMI levels from other types, permissions will be // dependent on parameters instead of HMI levels since w/o parameters RPC // won't passed to HMI - if (rpc_hmi_permissions.end() != it_hmi_allowed) { - if (rpc_hmi_permissions.end() != it_hmi_user_disallowed) { - ExcludeSameHMILevels(rpc_hmi_permissions[kUserDisallowedKey], - rpc_hmi_permissions[kAllowedKey]); + if (rpc.hmi_permissions.end() != it_hmi_allowed) { + if (rpc.hmi_permissions.end() != it_hmi_user_disallowed) { + ExcludeSameHMILevels(rpc.hmi_permissions[kUserDisallowedKey], + rpc.hmi_permissions[kAllowedKey]); } if (rpc.hmi_permissions.end() != it_hmi_undefined) { - ExcludeSameHMILevels(rpc_hmi_permissions[kUndefinedKey], - rpc_hmi_permissions[kAllowedKey]); + ExcludeSameHMILevels(rpc.hmi_permissions[kUndefinedKey], + rpc.hmi_permissions[kAllowedKey]); } } // Removing disallowed parameters from allowed and undefined (by user consent) - if (rpc_parameter_permissions.end() != it_parameter_user_disallowed) { - if (rpc_parameter_permissions.end() != it_parameter_allowed) { - ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey], - rpc_parameter_permissions[kUserDisallowedKey]); + if (rpc.parameter_permissions.end() != it_parameter_user_disallowed) { + if (rpc.parameter_permissions.end() != it_parameter_allowed) { + ExcludeSameParameters(rpc.parameter_permissions[kAllowedKey], + rpc.parameter_permissions[kUserDisallowedKey]); } - if (rpc_parameter_permissions.end() != it_parameter_undefined) { - ExcludeSameParameters(rpc_parameter_permissions[kUndefinedKey], - rpc_parameter_permissions[kUserDisallowedKey]); + if (rpc.parameter_permissions.end() != it_parameter_undefined) { + ExcludeSameParameters(rpc.parameter_permissions[kUndefinedKey], + rpc.parameter_permissions[kUserDisallowedKey]); } } // Removing undefined (by user consent) parameters from allowed - if (rpc_parameter_permissions.end() != it_parameter_undefined) { - if (rpc_parameter_permissions.end() != it_parameter_allowed) { - ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey], - rpc_parameter_permissions[kUndefinedKey]); + if (rpc.parameter_permissions.end() != it_parameter_undefined) { + if (rpc.parameter_permissions.end() != it_parameter_allowed) { + ExcludeSameParameters(rpc.parameter_permissions[kAllowedKey], + rpc.parameter_permissions[kUndefinedKey]); } } } -- cgit v1.2.1 From ef91e367969fc78d9ab9e91fc17595a7e85c5075 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 22 Jun 2017 13:45:45 -0400 Subject: Fix CID 171131 Initialize variables in empty constructor for ExternalConsentStatusItem --- .../application_manager/src/commands/mobile/system_request.cc | 2 +- src/components/policy/policy_external/include/policy/policy_types.h | 3 ++- src/components/policy/policy_external/src/cache_manager.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc index 866c3b950c..0d3334a1a1 100644 --- a/src/components/application_manager/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/src/commands/mobile/system_request.cc @@ -118,7 +118,7 @@ class QueryAppsDataValidator { smart_objects::SmartArray::iterator applications_iterator = objects_array->begin(); - for (; applications_iterator != objects_array->end(); ) { + for (; applications_iterator != objects_array->end();) { const smart_objects::SmartObject& app_data = *applications_iterator; if (!app_data.isValid()) { diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index eff8cfdf7b..ab95659917 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -401,7 +401,8 @@ struct ExternalConsentStatusItem { const EntityStatus status) : entity_type_(type), entity_id_(id), status_(status) {} - ExternalConsentStatusItem() {} + ExternalConsentStatusItem() + : entity_type_(0), entity_id_(0), status_(kStatusOff) {} ExternalConsentStatusItem operator=(const ExternalConsentStatusItem& rhs) { this->entity_id_ = rhs.entity_id_; diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 44e7b627c6..22040c88b2 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1083,7 +1083,7 @@ bool CacheManager::SetUserPermissionsForApp( std::vector::const_iterator iter_end = permissions.group_permissions.end(); *out_app_permissions_changed = false; - + std::string group_name; for (; iter != iter_end; ++iter) { if (policy::kGroupUndefined != (*iter).state) { -- cgit v1.2.1 From 5d686f126cdaec3d5a0728d66644893f6ac1e4b3 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 22 Jun 2017 13:51:34 -0400 Subject: Fix for CID 171208 Check return value for GetDeviceID --- src/components/application_manager/src/policies/policy_handler.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 2fe6d1a257..ec8b36477c 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -472,8 +472,12 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id, const bool is_allowed) { POLICY_LIB_CHECK_VOID(); connection_handler::DeviceHandle device_handle; - application_manager_.connection_handler().GetDeviceID(device_id, - &device_handle); + if (!application_manager_.connection_handler().GetDeviceID(device_id, + &device_handle)) { + LOG4CXX_ERROR(logger_, + "Unable to get device handle for device_id: " << device_id); + return; + } // In case of changed consent for device, related applications will be // limited to pre_DataConsent permissions, if device disallowed, or switch // back to their own permissions, if device allowed again, and must be -- cgit v1.2.1 From 0887e3b18b0c532447dbfa35cc0e33f28b73cc29 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 22 Jun 2017 16:22:10 -0400 Subject: Fix error caused by merge of `develop` into `coverity_fixes` branch --- src/components/telemetry_monitor/src/telemetry_monitor.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc index 4d2beade16..759b843961 100644 --- a/src/components/telemetry_monitor/src/telemetry_monitor.cc +++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc @@ -52,7 +52,6 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address, uint16_t port) : server_address_(server_address) , port_(port) - , is_ready_(false) , thread_(NULL) , streamer_(NULL) , app_observer(this) -- cgit v1.2.1 From d377cd5610b419cfd5f24f690dc5de27414aff44 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 22 Jun 2017 17:24:56 -0400 Subject: Fix resource leak The `release` function for `auto_ptr` does not free the allocated memory, `reset` does. --- src/components/utils/src/timer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/utils/src/timer.cc b/src/components/utils/src/timer.cc index 642f16e574..b819b56f54 100644 --- a/src/components/utils/src/timer.cc +++ b/src/components/utils/src/timer.cc @@ -64,7 +64,7 @@ timer::Timer::~Timer() { StopDelegate(); single_shot_ = true; - delegate_.release(); + delegate_.reset(); DeleteThread(thread_); DCHECK(task_); delete task_; -- cgit v1.2.1 From 3299b82ac7ca466c670d80081c9ea051e828955b Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Mon, 26 Jun 2017 16:33:06 -0400 Subject: Update Changelog for 4.3.0RC.2 --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f5c51957d..7b97dd0471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -# New Features +# 4.3.0 Release Candidate + +## New Features ### EXTENDED_POLICY modes: - The `EXTENDED_POLICY` CMake variable (previously `ENABLE_EXTENDED_POLICY`) now has three possible configurations @@ -77,10 +79,14 @@ Several API additions were made as part of the implementation of the external us - [ExternalConsentStatus](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L1268-L1278) struct - externalConsentStatus field added to [OnAppPermissionConsent](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172) and [GetListOfPermissions](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172) +## Fixes +- Includes fixes for all defects found by the Coverity scan tool that were introduced in this release - #1641 +- Includes fixes for several Coverity defects that were previously implemented in the `coverity` branch - #1637 + ## Implemented proposals Two new evolution proposals were implemented in release 4.3.0: - Add API Patch Version [SDL-0050](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0050-add-api-patch-version.md) - A patch version was added to the MOBILE API version, HMI API interface versions, and SyncMsgVersion struct - External Policy Manager [SDL-0045](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0045-external-policy-manager.md) - - Details for the implementation of this proposal can be found in the `External Policy Manager` section of these release notes \ No newline at end of file + - Details for the implementation of this proposal can be found in the `External Policy Manager` section of these release notes -- cgit v1.2.1