diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2016-03-22 10:13:28 +0200 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2016-03-23 09:56:19 +0200 |
commit | 7c978519fce74c2a94e292d830d125ca1b243950 (patch) | |
tree | 559f0418920b6f63c27632fc0be2e5ea11c72cd5 | |
parent | 98b34b9746e9c32b3453488d757632db2716f465 (diff) | |
download | sdl_core-7c978519fce74c2a94e292d830d125ca1b243950.tar.gz |
Fixes ressetting of default buttons capabilities
In case of error response for Buttons.GetCapabilities SDL was resetting
default buttons capabilities (from JSON file) to null. This change adds
checking of response result code to avoid that issue.
Closes-bug: APPLINK-22416
-rw-r--r-- | src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc index 69cfbe49c5..bb04636aba 100644 --- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc @@ -47,6 +47,14 @@ ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() { void ButtonGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); + const hmi_apis::Common_Result::eType code = + static_cast<hmi_apis::Common_Result::eType>( + (*message_)[strings::params][hmi_response::code].asInt()); + + if (hmi_apis::Common_Result::SUCCESS != code) { + LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated."); + return; + } HMICapabilities& hmi_capabilities = ApplicationManagerImpl::instance()->hmi_capabilities(); |