From 7c978519fce74c2a94e292d830d125ca1b243950 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Tue, 22 Mar 2016 10:13:28 +0200 Subject: 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 --- .../src/commands/hmi/button_get_capabilities_response.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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( + (*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(); -- cgit v1.2.1