summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
index 93e37b95a7..4d12b4f375 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
@@ -89,11 +89,36 @@ bool GetInteriorVehicleDataRequest::ProcessCapabilities() {
return true;
}
+void GetInteriorVehicleDataRequest::FilterDisabledModuleData(
+ smart_objects::SmartObject& module_data) {
+ // If radioEnable is false, remove all other radio parameters from the
+ // message.
+ if (module_data.keyExists(message_params::kRadioEnable) &&
+ module_data[message_params::kRadioEnable].asBool() == false) {
+ for (auto data = module_data.map_begin(); data != module_data.map_end();) {
+ auto key = data->first;
+ ++data;
+ if (key != message_params::kRadioEnable) {
+ module_data.erase(key);
+ }
+ }
+ }
+ // If hdRadioEnable is false, find and remove the HDChannel if parameter is
+ // present.
+ if (module_data.keyExists(message_params::kHdRadioEnable) &&
+ module_data[message_params::kHdRadioEnable].asBool() == false) {
+ module_data.erase(message_params::kHdChannel);
+ module_data.erase(message_params::kAvailableHDs);
+ module_data.erase(message_params::kSisData);
+ }
+}
+
void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache(
app_mngr::ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
auto data = interior_data_cache_.Retrieve(ModuleType());
+ FilterDisabledModuleData(data);
auto response_msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
response_msg_params[message_params::kModuleData][data_mapping(ModuleType())] =