diff options
author | JackLivio <jack@livio.io> | 2018-05-25 13:43:25 -0400 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2018-05-25 13:43:25 -0400 |
commit | bd5a426de8c197eab2f0f2277d48dfef51b2a989 (patch) | |
tree | f7a3c32298f4e511c9c0866ca6ea614afbdae8c6 | |
parent | dd8c006ecd1c5c696e696584aff694462a54ac4b (diff) | |
download | sdl_core-bd5a426de8c197eab2f0f2277d48dfef51b2a989.tar.gz |
Add checks to display capabilities
-rw-r--r-- | src/components/application_manager/src/commands/mobile/register_app_interface_request.cc | 100 |
1 files changed, 56 insertions, 44 deletions
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index c799d68609..64d549b6d5 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -449,50 +449,62 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params, smart_objects::SmartObject& display_caps = response_params[hmi_response::display_capabilities]; - display_caps[hmi_response::display_type] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::display_type); - - display_caps[hmi_response::text_fields] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::text_fields); - - display_caps[hmi_response::image_fields] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::image_fields); - - display_caps[hmi_response::media_clock_formats] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::media_clock_formats); - - display_caps[hmi_response::templates_available] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::templates_available); - - display_caps[hmi_response::screen_params] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::screen_params); - - display_caps[hmi_response::num_custom_presets_available] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::num_custom_presets_available); - - display_caps[hmi_response::graphic_supported] = - (hmi_capabilities.display_capabilities() - ->getElement(hmi_response::image_capabilities) - .length() > 0); - - display_caps[hmi_response::templates_available] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::templates_available); - - display_caps[hmi_response::screen_params] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::screen_params); - - display_caps[hmi_response::num_custom_presets_available] = - hmi_capabilities.display_capabilities()->getElement( - hmi_response::num_custom_presets_available); + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::display_type)) { + display_caps[hmi_response::display_type] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::display_type); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::text_fields)) { + display_caps[hmi_response::text_fields] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::text_fields); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::image_fields)) { + display_caps[hmi_response::image_fields] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::image_fields); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::media_clock_formats)) { + display_caps[hmi_response::media_clock_formats] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::media_clock_formats); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::templates_available)) { + display_caps[hmi_response::templates_available] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::templates_available); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::screen_params)) { + display_caps[hmi_response::screen_params] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::screen_params); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::num_custom_presets_available)) { + display_caps[hmi_response::num_custom_presets_available] = + hmi_capabilities.display_capabilities()->getElement( + hmi_response::num_custom_presets_available); + } + + if (hmi_capabilities.display_capabilities()->keyExists( + hmi_response::image_capabilities)) { + display_caps[hmi_response::graphic_supported] = + (hmi_capabilities.display_capabilities() + ->getElement(hmi_response::image_capabilities) + .length() > 0); + } } if (hmi_capabilities.audio_pass_thru_capabilities()) { |