summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-07-13 10:42:20 -0400
committerJackLivio <jack@livio.io>2017-07-13 10:42:20 -0400
commit2c325e18c2ee1db4efb17f330440423a00514f79 (patch)
tree8f90df627c94255134a2fc03b1eff705d124b999 /src/components/application_manager/src
parentb453e3b7f800a2ebcbd40a458ad4a8b7334a147e (diff)
downloadsdl_core-2c325e18c2ee1db4efb17f330440423a00514f79.tar.gz
Add system capabilities to HMI RPC UI.getCapabilitiesResponse
Diffstat (limited to 'src/components/application_manager/src')
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc9
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc30
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc3
3 files changed, 27 insertions, 15 deletions
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
index de0a2f2157..bf89b3d5a7 100644
--- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
@@ -79,6 +79,15 @@ void UIGetCapabilitiesResponse::Run() {
msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
}
}
+
+ if(msg_params.keyExists(strings::system_capabilities)) {
+ if(msg_params[strings::system_capabilities].keyExists(strings::navigation_capability)) {
+ hmi_capabilities.set_navigation_capability(msg_params[strings::system_capabilities][strings::navigation_capability]);
+ }
+ if(msg_params[strings::system_capabilities].keyExists(strings::phone_capability)) {
+ hmi_capabilities.set_phone_capability(msg_params[strings::system_capabilities][strings::phone_capability]);
+ }
+ }
}
} // namespace commands
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index 6ffc501439..9b4d62ed2d 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -988,6 +988,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
soft_button_capabilities, soft_button_capabilities_so);
set_soft_button_capabilities(soft_button_capabilities_so);
}
+ if(check_existing_json_member(ui, "systemCapabilities")) {
+ Json::Value system_capabilities = ui.get("systemCapabilities", "");
+ if (check_existing_json_member(system_capabilities, "navigationCapability")) {
+ Json::Value navigation_capability = system_capabilities.get("navigationCapability","");
+ smart_objects::SmartObject navigation_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so);
+ set_navigation_capability(navigation_capability_so);
+ }
+ if (check_existing_json_member(system_capabilities, "phoneCapability")) {
+ Json::Value phone_capability = system_capabilities.get("phoneCapability","");
+ smart_objects::SmartObject phone_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so);
+ set_phone_capability(phone_capability_so);
+ }
+ }
} // UI end
// VR
@@ -1093,21 +1108,6 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
vehicle_type_so);
set_vehicle_type(vehicle_type_so);
} // VehicleType end
- if(check_existing_json_member(root_json, "SystemCapabilities")) {
- Json::Value system_capabilities = root_json.get("SystemCapabilities", "");
- if (check_existing_json_member(system_capabilities, "NavigationCapability")) {
- Json::Value navigation_capability = system_capabilities.get("NavigationCapability","");
- smart_objects::SmartObject navigation_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so);
- set_navigation_capability(navigation_capability_so);
- }
- if (check_existing_json_member(system_capabilities, "PhoneCapability")) {
- Json::Value phone_capability = system_capabilities.get("PhoneCapability","");
- smart_objects::SmartObject phone_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so);
- set_phone_capability(phone_capability_so);
- }
- }
} catch (...) {
return false;
}
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 2a86c6c1c0..7f8fd5d00f 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -136,6 +136,9 @@ const char* audio_pass_thru_icon = "audioPassThruIcon";
const char* way_points = "wayPoints";
const char* system_capability = "systemCapability";
const char* system_capability_type = "systemCapabilityType";
+const char* system_capabilities = "systemCapabilities";
+const char* navigation_capability = "navigationCapability";
+const char* phone_capability = "phoneCapability";
// PutFile
const char* sync_file_name = "syncFileName";