summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2019-08-28 14:16:52 -0400
committerJackLivio <jack@livio.io>2019-08-28 14:16:52 -0400
commit92e68450a16b70f2c4b11edb3df6f8cd449f6523 (patch)
treeafa825caf38db171d9d4fe5001fa2e60b3f95ce7
parent687478c2d0acbd01664dcd0bc8d518d9900ce905 (diff)
parentc42cbc9cf60754baac573193f7f8ca8222157c2e (diff)
downloadsdl_core-fix/pipe_audiostream_cutoff.tar.gz
Merge remote-tracking branch 'origin/develop' into fix/pipe_audiostream_cutofffix/pipe_audiostream_cutoff
-rw-r--r--CMakeLists.txt2
-rw-r--r--README.md1
-rwxr-xr-xsrc/appMain/hmi_capabilities.json23
-rw-r--r--src/appMain/sdl_preloaded_pt.json5117
-rw-r--r--src/appMain/smartDeviceLink.ini9
-rw-r--r--src/components/application_manager/include/application_manager/application.h235
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h50
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h60
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h48
-rw-r--r--src/components/application_manager/include/application_manager/application_state.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/display_capabilities_builder.h96
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h40
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h14
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h83
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h1
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h5
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h40
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h22
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h34
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h27
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h41
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h245
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt13
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc97
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt12
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt12
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h9
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h3
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h1
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc30
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt11
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc151
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc117
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_request.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_response.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_request.h117
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_response.h67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_request.h91
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_response.h67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_request.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h25
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc131
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc117
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc370
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc162
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc53
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc222
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc45
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc120
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc143
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc193
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc47
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc35
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc104
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc159
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc271
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc457
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc278
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc236
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc245
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc447
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc32
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt11
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc98
-rw-r--r--src/components/application_manager/src/app_service_manager.cc58
-rw-r--r--src/components/application_manager/src/application_data_impl.cc324
-rw-r--r--src/components/application_manager/src/application_impl.cc155
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc289
-rw-r--r--src/components/application_manager/src/application_state.cc253
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc11
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc17
-rw-r--r--src/components/application_manager/src/display_capabilities_builder.cc128
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc171
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc8
-rw-r--r--src/components/application_manager/src/hmi_state.cc44
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc194
-rw-r--r--src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc50
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc249
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc177
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc46
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc6
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc6
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc5
-rw-r--r--src/components/application_manager/src/rpc_passing_handler.cc4
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc15
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc38
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc426
-rwxr-xr-xsrc/components/application_manager/test/CMakeLists.txt3
-rw-r--r--src/components/application_manager/test/app_service_manager_test.cc8
-rw-r--r--src/components/application_manager/test/application_impl_test.cc52
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc52
-rw-r--r--src/components/application_manager/test/application_state_test.cc86
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt2
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc32
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc6
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json4
-rw-r--r--src/components/application_manager/test/hmi_capabilities_old_apt.json9
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc60
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h110
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h32
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_request.h1
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h12
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h11
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt2
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc21
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc55
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc222
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc312
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc66
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc849
-rw-r--r--src/components/config_profile/include/config_profile/profile.h13
-rw-r--r--src/components/config_profile/src/profile.cc87
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/include/application_manager/application_manager.h36
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h38
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h36
-rw-r--r--src/components/include/application_manager/state_controller.h139
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h20
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h60
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h20
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h54
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h11
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h49
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h60
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h14
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h33
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h56
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h12
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h33
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h44
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h6
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h7
-rw-r--r--src/components/interfaces/HMI_API.xml584
-rw-r--r--src/components/interfaces/MOBILE_API.xml629
-rw-r--r--src/components/media_manager/test/CMakeLists.txt2
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt19
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h8
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h21
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h79
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h30
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h1
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc36
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc194
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc30
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc20
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc10
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc7
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt2
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc384
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc17
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc84
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc77
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc158
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt11
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h21
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h53
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h30
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h1
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc47
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc43
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc110
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc54
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc20
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc16
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc26
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc286
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h2
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h4
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_handler.cc12
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_device_scanner.cc25
-rw-r--r--src/components/utils/CMakeLists.txt5
-rw-r--r--src/components/utils/src/push_log.cc18
-rw-r--r--src/components/utils/test/CMakeLists.txt2
-rwxr-xr-xtools/InterfaceGenerator/generator/parsers/RPCBase.py2
288 files changed, 18769 insertions, 5181 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38bb95c9fa..69c81f3310 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,7 +237,7 @@ set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
set(EXCLUDE_ERROR_FLAGS "-Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations")
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror ${EXCLUDE_ERROR_FLAGS} -Wuninitialized -Wvla")
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -fvisibility=hidden -Werror ${EXCLUDE_ERROR_FLAGS} -Wuninitialized -Wvla")
if (USE_GOLD_LD)
execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
diff --git a/README.md b/README.md
index 86d07c3d83..6166a51344 100644
--- a/README.md
+++ b/README.md
@@ -97,6 +97,7 @@ There are several RPCs that are "required" to be implemented in order for SDL to
* DeleteCommand
* AddSubMenu
* DeleteSubMenu
+ * ShowAppMenu
* CreateInteractionChoiceSet
* PerformInteraction
* DeleteInteractionChoiceSet
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 873c80d32e..4f35059bd5 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -242,6 +242,16 @@
"resolutionWidth": 35,
"resolutionHeight": 35
}
+ },
+ {
+ "name": "alertIcon",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 225,
+ "resolutionHeight": 225
+ }
}
],
@@ -249,6 +259,7 @@
"CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
],
"graphicSupported": true,
+ "menuLayoutsAvailable": [ "LIST", "TILES" ],
"templatesAvailable": [
"DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD",
"GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY",
@@ -274,11 +285,11 @@
"STATIC"
]
},
- "audioPassThruCapabilities": {
+ "audioPassThruCapabilities": [{
"samplingRate": "44KHZ",
"bitsPerSample": "RATE_8_BIT",
"audioType": "PCM"
- },
+ }],
"pcmStreamCapabilities": {
"samplingRate": "16KHZ",
"bitsPerSample": "RATE_16_BIT",
@@ -309,7 +320,10 @@
"protocol": "RAW",
"codec": "H264"
}],
- "hapticSpatialDataSupported": false
+ "hapticSpatialDataSupported": false,
+ "diagonalScreenSize": 8,
+ "pixelPerInch": 117,
+ "scale": 1
},
"remoteControlCapability": {
"buttonCapabilities": [
@@ -428,6 +442,7 @@
"acMaxEnableAvailable": true,
"autoModeEnableAvailable": true,
"circulateAirEnableAvailable": true,
+ "climateEnableAvailable": true,
"currentTemperatureAvailable": true,
"defrostZone": [
"FRONT",
@@ -455,7 +470,7 @@
],
"radioControlCapabilities": [
{
- "availableHDsAvailable": true,
+ "availableHdChannelsAvailable": true,
"hdChannelAvailable": true,
"moduleName": "radio",
"radioBandAvailable": true,
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 4e39a735d1..ade41f209f 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -1,2529 +1,2588 @@
-{
- "policy_table": {
- "module_config": {
- "preloaded_pt": true,
- "exchange_after_x_ignition_cycles": 100,
- "exchange_after_x_kilometers": 1800,
- "exchange_after_x_days": 30,
- "timeout_after_x_seconds": 60,
- "seconds_between_retries": [1,
- 5,
- 25,
- 125,
- 625],
- "endpoints": {
- "0x07": {
- "default": ["http://x.x.x.x:3000/api/1/policies/proprietary"]
- },
- "0x04": {
- "default": ["http://x.x.x.x:3000/api/1/softwareUpdate"]
- },
- "queryAppsUrl": {
- "default": ["http://sdl.shaid.server"]
- },
- "lock_screen_icon_url": {
- "default": ["http://i.imgur.com/TgkvOIZ.png"]
- }
- },
- "notifications_per_minute_by_priority": {
- "EMERGENCY": 60,
- "NAVIGATION": 15,
- "PROJECTION": 15,
- "VOICECOM": 20,
- "COMMUNICATION": 6,
- "NORMAL": 4,
- "NONE": 0
- }
- },
- "functional_groupings": {
- "Base-4": {
- "rpcs": {
- "AddCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "AddSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Alert": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "CreateInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EndAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GenericResponse": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetSystemCapability": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnButtonEvent": {
- "hmi_levels": ["FULL",
- "LIMITED",
- "BACKGROUND"]
- },
- "OnButtonPress": {
- "hmi_levels": ["FULL",
- "LIMITED",
- "BACKGROUND"]
- },
- "OnCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnDriverDistraction": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemCapabilityUpdated": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PerformAudioPassThru": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PerformInteraction": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ResetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ScrollableMessage": {
- "hmi_levels": ["FULL"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetMediaClockTimer": {
- "hmi_levels": ["FULL",
- "LIMITED",
- "BACKGROUND"]
- },
- "Show": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Slider": {
- "hmi_levels": ["FULL"]
- },
- "Speak": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "SubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnsubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Location-1": {
- "user_consent_prompt": "Location",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- }
- }
- },
- "Notifications": {
- "user_consent_prompt": "Notifications",
- "rpcs": {
- "Alert": {
- "hmi_levels": ["BACKGROUND"]
- }
- }
- },
- "Notifications-RC": {
- "rpcs": {
- "OnHMIStatus": {
- "hmi_levels": [
- "BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"
- ]
- },
- "OnPermissionsChange": {
- "hmi_levels": [
- "BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"
- ]
- },
- "OnSystemRequest": {
- "hmi_levels": [
- "BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"
- ]
- }
- }
- },
- "DrivingCharacteristics-3": {
- "user_consent_prompt": "DrivingCharacteristics",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "electronicParkBrakeStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "electronicParkBrakeStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "electronicParkBrakeStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "electronicParkBrakeStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- }
- }
- },
- "VehicleInfo-3": {
- "user_consent_prompt": "VehicleInfo",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineOilLife",
- "engineTorque",
- "externalTemperature",
- "turnSignal",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "fuelRange",
- "cloudAppVehicleID",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineOilLife",
- "engineTorque",
- "externalTemperature",
- "turnSignal",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "fuelRange",
- "cloudAppVehicleID",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineOilLife",
- "engineTorque",
- "externalTemperature",
- "turnSignal",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "fuelRange",
- "cloudAppVehicleID",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineOilLife",
- "engineTorque",
- "externalTemperature",
- "turnSignal",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "fuelRange",
- "cloudAppVehicleID",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- }
- }
- },
- "PropriataryData-1": {
- "rpcs": {
- "DiagnosticMessage": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetDTCs": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ReadDID": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "PropriataryData-2": {
- "rpcs": {
- "DiagnosticMessage": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetDTCs": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ReadDID": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "ProprietaryData-3": {
- "rpcs": {
- "GetDTCs": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ReadDID": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "CloudAppStore": {
- "rpcs": {
- "SetCloudAppProperties":{
- "hmi_levels":["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetCloudAppProperties":{
- "hmi_levels":["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "CloudApp": {
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": [
- "cloudAppVehicleID"
- ]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": [
- "cloudAppVehicleID"
- ]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": [
- "cloudAppVehicleID"
- ]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": [
- "cloudAppVehicleID"
- ]
- }
- }
- },
- "AppServiceProvider": {
- "rpcs": {
- "PublishAppService": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "GetAppServiceData": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "OnAppServiceData": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "PerformAppServiceInteraction": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- }
- }
- },
- "AppServiceConsumer": {
- "rpcs": {
- "GetFile": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "GetAppServiceData": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "OnAppServiceData": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- },
- "PerformAppServiceInteraction": {
- "hmi_levels": [
- "FULL",
- "LIMITED",
- "BACKGROUND",
- "NONE"
- ]
- }
- }
- },
- "RemoteControl": {
- "rpcs": {
- "ButtonPress": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetInteriorVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SetInteriorVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnInteriorVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnRCStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- }
- }
- },
- "Emergency-1": {
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- }
- }
- },
- "Navigation-1": {
- "rpcs": {
- "AlertManeuver": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ShowConstantTBT": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "UpdateTurnList": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Base-6": {
- "rpcs": {
- "AddCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "AddSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Alert": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "CreateInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EndAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GenericResponse": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnButtonEvent": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnButtonPress": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnCommand": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnDriverDistraction": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnTBTClientState": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "PerformAudioPassThru": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PerformInteraction": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ResetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ScrollableMessage": {
- "hmi_levels": ["FULL"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SetMediaClockTimer": {
- "hmi_levels": ["FULL"]
- },
- "Show": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Slider": {
- "hmi_levels": ["FULL"]
- },
- "Speak": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "SubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnsubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "OnKeyboardInputOnlyGroup": {
- "rpcs": {
- "OnKeyboardInput": {
- "hmi_levels": ["FULL"]
- }
- }
- },
- "OnTouchEventOnlyGroup": {
- "rpcs": {
- "OnTouchEvent": {
- "hmi_levels": ["FULL"]
- }
- }
- },
- "DiagnosticMessageOnly": {
- "rpcs": {
- "DiagnosticMessage": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "DataConsent-2": {
- "user_consent_prompt": "DataConsent",
- "rpcs": null
- },
- "BaseBeforeDataConsent": {
- "rpcs": {
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ResetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- }
- }
- },
- "SendLocation": {
- "rpcs": {
- "SendLocation": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "WayPoints": {
- "rpcs": {
- "GetWayPoints": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SubscribeWayPoints": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "UnsubscribeWayPoints": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnWayPointChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "BackgroundAPT": {
- "rpcs": {
- "EndAudioPassThru": {
- "hmi_levels": ["BACKGROUND"]
- },
- "OnAudioPassThru": {
- "hmi_levels": ["BACKGROUND"]
- },
- "PerformAudioPassThru": {
- "hmi_levels": ["BACKGROUND"]
- }
- }
- },
- "HapticGroup": {
- "rpcs": {
- "OnTouchEvent": {
- "hmi_levels": ["FULL"]
- },
- "SendHapticData": {
- "hmi_levels": ["FULL"]
- }
- }
- }
- },
- "consumer_friendly_messages": {
- "version": "001.001.021",
- "messages": {
- "AppPermissions": {
- "languages": {
- "de-de": {
- "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
- "line1": "Zugriffsanfrage(n)",
- "line2": "erlauben?"
- },
- "en-au": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-gb": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "en-ie": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-us": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
- "line1": "Grant Requested",
- "line2": "Permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "es-en": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?",
- "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
- },
- "es-es": {
- "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
- "line1": "¿Conceder permisos",
- "line2": "solicitados?"
- },
- "es-mx": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?",
- "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)",
- "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)"
- },
- "it-it": {
- "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
- "line1": "Concedi autorizzaz.",
- "line2": "richiesta(e)?"
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
- "line1": "Aangevraagde",
- "line2": "permissie(s) verlenen?"
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
- "line1": "Udzielić żądanych",
- "line2": "pozwoleń?"
- },
- "pt-br": {
- "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
- "line1": "Conceder permissão",
- "line2": "solicitada?"
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
- "line1": "Conceder permiss.",
- "line2": "solicitada(s)?"
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
- "line1": "Предост. заправш.",
- "line2": "разрешения?"
- },
- "sv-se": {
- "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
- "line1": "Vill du ge",
- "line2": "tillstånd?"
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
- "line1": "İstenen izinler",
- "line2": "verilsin mi?"
- },
- "zh-cn": {
- "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
- "line1": "是否允许请求的",
- "line2": "权限?"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
- "line1": "允許",
- "line2": "授權請求?"
- }
- }
- },
- "AppPermissionsHelp": {
- "languages": {
- "de-de": {
- "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
- },
- "en-au": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-gb": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-ie": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-us": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
- },
- "es-en": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "es-es": {
- "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
- },
- "es-mx": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "it-it": {
- "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
- },
- "pt-br": {
- "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
- },
- "sv-se": {
- "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
- },
- "zh-cn": {
- "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
- }
- }
- },
- "AppPermissionsRevoked": {
- "languages": {
- "de-de": {
- "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
- },
- "en-au": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-gb": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-ie": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-us": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "es-en": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "es-es": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
- },
- "es-mx": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "fr-ca": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "fr-fr": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "it-it": {
- "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
- },
- "nl-nl": {
- "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
- },
- "pl-pl": {
- "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
- },
- "pt-br": {
- "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
- },
- "pt-pt": {
- "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
- },
- "ru-ru": {
- "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
- },
- "sv-se": {
- "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
- },
- "tr-tr": {
- "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
- },
- "zh-cn": {
- "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
- },
- "zh-tw": {
- "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
- }
- }
- },
- "AppUnauthorized": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
- "line1": "nicht autorisiert"
- },
- "en-au": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-gb": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized",
- "textBody": "This version of %appName% is not authorized and will not work with SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-us": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "Not Authorized",
- "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada",
- "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
- "line1": "No autorizada"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada",
- "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée",
- "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
- "line1": "non autorizzata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
- "line1": "niet geautoriseerd"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
- "line1": "brak autoryzacji"
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
- "line1": "não autorizado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
- "line1": "não autorizada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
- "line1": "не авторизировано"
- },
- "sv-se": {
- "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
- "line1": "är ej godkänd"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
- "line1": "için izin yok"
- },
- "zh-cn": {
- "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
- "line1": "未得到授权"
- },
- "zh-tw": {
- "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
- "line1": "無授權"
- }
- }
- },
- "AppUnsupported": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
- "line1": "nicht unterstützt"
- },
- "en-au": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-gb": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported",
- "textBody": "This version of %appName% is not supported by SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-us": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "Not Supported",
- "textBody": "Your version of %appName% is not supported by SYNC."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible",
- "textBody": "Esta versión de %appName% no es compatible con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "No compatible"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible",
- "textBody": "Esta versión de %appName% no es compatible con SYNC."
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible",
- "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è supportata dal SYNC.",
- "line1": "non supportata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
- "line1": "niet ondersteund"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
- "line1": "aplikacja nie obsług."
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
- "line1": "não suportado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
- "line1": "não suportada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не поддерживается SYNC.",
- "line1": "не поддерживается"
- },
- "sv-se": {
- "tts": "SYNC har inte stöd för den här versionen av %appName%.",
- "line1": "stöds ej"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
- "line1": "desteklenmiyor"
- },
- "zh-cn": {
- "tts": "SYNC不支持此版本的%appName%。",
- "line1": "不受支持"
- },
- "zh-tw": {
- "tts": "SYNC 不支援此版本的%appName% 。",
- "line1": "不支援"
- }
- }
- },
- "DataConsent": {
- "languages": {
- "en-gb": {
- "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. \r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "en-us": {
- "line1": "Enable Mobile Apps",
- "line2": "on SYNC? (Uses Data)",
- "textBody": "Would you like to enable Mobile Apps on SYNC?\r\n\r\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "es-mx": {
- "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. \n\nLas actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. \n\nPresione Sí para permitir y No para denegar."
- },
- "fr-ca": {
- "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements.\r\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
- }
- }
- },
- "DataConsentHelp": {
- "languages": {
- "en-us": {
- "textBody": "By enabling mobile apps, you consent to allowing SYNC to communicate with Ford at least once per month using your mobile device’s data plan. Disabling will stop all data usage, but you will not be able to use mobile apps on SYNC. See your Owner Guide for more information."
- },
- "es-mx": {
- "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
- },
- "fr-ca": {
- "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
- }
- }
- },
- "DisableApps": {
- "languages": {
- "de-de": {
- "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
- "line1": "Auto-Update",
- "line2": "und Mobile Apps deaktivieren"
- },
- "en-au": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-gb": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?",
- "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
- },
- "en-ie": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-us": {
- "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
- "line1": "Disable Auto-Updates",
- "line2": "and Mobile Apps?",
- "textBody": "If you disable, you will not be able to use any mobile apps with SYNC and your vehicle will stop receiving mobile app permission updates via your device`s data plan. Please press yes to disable mobile apps or no to cancel."
- },
- "es-en": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?",
- "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
- },
- "es-es": {
- "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
- "line1": "¿Desact. actual. auto",
- "line2": "y apl. móviles?"
- },
- "es-mx": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?",
- "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
- },
- "fr-ca": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?",
- "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
- },
- "fr-fr": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?"
- },
- "it-it": {
- "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
- "line1": "Disabilitare agg. aut.",
- "line2": "e app mobili?"
- },
- "nl-nl": {
- "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
- "line1": "Auto-updates en mob.",
- "line2": "apps uitschakelen?"
- },
- "pl-pl": {
- "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
- "line1": "Wył. automat. aktual.",
- "line2": "i aplikacje mobilne?"
- },
- "pt-br": {
- "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
- "line1": "Desativar atualizações",
- "line2": "autom. e aplicativos?"
- },
- "pt-pt": {
- "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
- "line1": "Desact. actual. autom.",
- "line2": "e aplicações móveis?"
- },
- "ru-ru": {
- "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
- "line1": "Откл. автообновления",
- "line2": "и мобил. прилож.?"
- },
- "sv-se": {
- "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
- "line1": "Avaktiverar autouppdat.",
- "line2": "och mobilappar?"
- },
- "tr-tr": {
- "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
- "line1": "Oto. güncelleme ve",
- "line2": "mobil uygul. kapat?"
- },
- "zh-cn": {
- "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
- "line1": "是否禁用自动更新和",
- "line2": "移动应用程序?"
- },
- "zh-tw": {
- "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
- "line1": "停用自動更新",
- "line2": "和行動應用程式?"
- }
- }
- },
- "DrivingCharacteristics": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
- "label": "Fahreigenschaften"
- },
- "en-au": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-gb": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
- "en-ie": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-us": {
- "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
- "label": "Driving Characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo",
- "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
- "label": "Características de conducción"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo",
- "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite",
- "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
- "label": "Caratteristiche di guida"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
- "label": "Rijkenmerken"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
- "label": "Informacje dotyczące stylu jazdy"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
- "label": "Características de condução"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
- "label": "Características de condução"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
- "label": "Характеристики движения"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
- "label": "Köregenskaper"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
- "label": "Sürüş karakteristikleri"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
- "label": "行驶特性"
- },
- "zh-tw": {
- "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
- "label": "駕駛特性"
- }
- }
- },
- "Location": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
- "label": "GPS und Geschwindigkeit"
- },
- "en-au": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-gb": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "en-ie": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-us": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad",
- "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
- "label": "GPS y velocidad"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad",
- "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
- "fr-ca": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse",
- "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
- },
- "fr-fr": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse"
- },
- "it-it": {
- "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
- "label": "GPS e velocità"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
- "label": "Gps en snelheid"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
- "label": "GPS i prędkość"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
- "label": "GPS и скорость"
- },
- "sv-se": {
- "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
- "label": "GPS och hastighet"
- },
- "tr-tr": {
- "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
- "label": "GPS ve hız"
- },
- "zh-cn": {
- "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
- "label": "GPS 和车速"
- },
- "zh-tw": {
- "tts": "應用程式可存取車輛的GPS和速度。",
- "label": "GPS和車速"
- }
- }
- },
- "Notifications": {
- "languages": {
- "de-de": {
- "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
- "label": "Push-Benachrichtigungen"
- },
- "en-au": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-gb": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "en-ie": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-us": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push",
- "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
- "es-es": {
- "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
- "label": "Notificaciones push"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push",
- "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
- "fr-ca": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications instantanées",
- "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
- },
- "fr-fr": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications push"
- },
- "it-it": {
- "tts": "Un'app può inviare notifiche se eseguita in background.",
- "label": "Notifiche push"
- },
- "nl-nl": {
- "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
- "label": "Push-meldingen"
- },
- "pl-pl": {
- "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
- "label": "Powiadomienia Push"
- },
- "pt-br": {
- "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
- "label": "Notificações Push"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
- "label": "Notificações push"
- },
- "ru-ru": {
- "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
- "label": "Оповещения о пересылке"
- },
- "sv-se": {
- "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
- "label": "Push-notiser"
- },
- "tr-tr": {
- "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
- "label": "Anlık bildirimleri"
- },
- "zh-cn": {
- "tts": "移动应用程序在后台运行时可推送通知。",
- "label": "推送通知"
- },
- "zh-tw": {
- "tts": "車輛行進時,應用程式可在背景中傳送通知。",
- "label": "傳送通知"
- }
- }
- },
- "SettingDisableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Updates deakt."
- },
- "en-au": {
- "line1": "Disable updates"
- },
- "en-gb": {
- "line1": "Disable updates"
- },
- "en-ie": {
- "line1": "Disable updates"
- },
- "en-us": {
- "line1": "Disable Updates",
- "textBody": "Disable Updates"
- },
- "es-en": {
- "line1": "Deshab. actual.",
- "textBody": "Deshab. actual."
- },
- "es-es": {
- "line1": "Desact. actual."
- },
- "es-mx": {
- "line1": "Deshab. actual.",
- "textBody": "Deshab. actual."
- },
- "fr-ca": {
- "line1": "Désactiver MAJ",
- "textBody": "Désactiver MAJ"
- },
- "fr-fr": {
- "line1": "Désactiver màj"
- },
- "it-it": {
- "line1": "Disabilita agg."
- },
- "nl-nl": {
- "line1": "Upd. uitschak."
- },
- "pl-pl": {
- "line1": "Wyłącz aktual."
- },
- "pt-br": {
- "line1": "Desat. atualiz."
- },
- "pt-pt": {
- "line1": "Desact. actualiz."
- },
- "ru-ru": {
- "line1": "Откл. обновл."
- },
- "sv-se": {
- "line1": "Inaktivera uppd."
- },
- "tr-tr": {
- "line1": "Güncell. Kapat"
- },
- "zh-cn": {
- "line1": "禁用更新"
- },
- "zh-tw": {
- "line1": "停用更新"
- }
- }
- },
- "SettingEnableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Apps aktivieren"
- },
- "en-au": {
- "line1": "Enable Apps"
- },
- "en-gb": {
- "line1": "Enable Apps"
- },
- "en-ie": {
- "line1": "Enable Apps"
- },
- "en-us": {
- "line1": "Enable Apps"
- },
- "es-en": {
- "line1": "Hab. aplic."
- },
- "es-es": {
- "line1": "Activar apl."
- },
- "es-mx": {
- "line1": "Hab. aplic."
- },
- "fr-ca": {
- "line1": "Activer app.",
- "textBody": "Activer app."
- },
- "fr-fr": {
- "line1": "Activer app."
- },
- "it-it": {
- "line1": "Abilita app"
- },
- "nl-nl": {
- "line1": "Apps inschak."
- },
- "pl-pl": {
- "line1": "Włącz aplikacje"
- },
- "pt-br": {
- "line1": "Ativar aplic."
- },
- "pt-pt": {
- "line1": "Activar actualiz."
- },
- "ru-ru": {
- "line1": "Вкл. прилож."
- },
- "sv-se": {
- "line1": "Aktivera appar"
- },
- "tr-tr": {
- "line1": "Uygulamaları aç"
- },
- "zh-cn": {
- "line1": "启用应用程序"
- },
- "zh-tw": {
- "line1": "啟用應用程式"
- }
- }
- },
- "SettingUpdateAuto": {
- "languages": {
- "de-de": {
- "line1": "Update anford."
- },
- "en-au": {
- "line1": "Request update"
- },
- "en-gb": {
- "line1": "Request update"
- },
- "en-ie": {
- "line1": "Request update"
- },
- "en-us": {
- "line1": "Request Update",
- "textBody": "Select `Update now` to receive app permissions for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
- },
- "es-en": {
- "line1": "Solicit. actualiz.",
- "textBody": "Solicit. actualiz."
- },
- "es-es": {
- "line1": "Solicitar actual."
- },
- "es-mx": {
- "line1": "Solicit. actualiz.",
- "textBody": "Solicit. actualiz."
- },
- "fr-ca": {
- "line1": "Demander MAJ",
- "textBody": "Demander MAJ"
- },
- "fr-fr": {
- "line1": "Demander màj"
- },
- "it-it": {
- "line1": "Rich. aggiorn."
- },
- "nl-nl": {
- "line1": "Upd. aanvragen"
- },
- "pl-pl": {
- "line1": "Zażądaj aktual."
- },
- "pt-br": {
- "line1": "Solicitar atualiz."
- },
- "pt-pt": {
- "line1": "Solicit. actualiz."
- },
- "ru-ru": {
- "line1": "Запрос на обн."
- },
- "sv-se": {
- "line1": "Begär uppdat."
- },
- "tr-tr": {
- "line1": "Güncelleme iste"
- },
- "zh-cn": {
- "line1": "请求更新"
- },
- "zh-tw": {
- "line1": "請求更新"
- }
- }
- },
- "StatusNeeded": {
- "languages": {
- "de-de": {
- "line1": "Update benötigt"
- },
- "en-au": {
- "line1": "Update needed"
- },
- "en-gb": {
- "line1": "Update needed",
- "textBody": "Update needed"
- },
- "en-ie": {
- "line1": "Update needed"
- },
- "en-us": {
- "line1": "Update Needed",
- "textBody": "Update Needed"
- },
- "es-en": {
- "line1": "Actualiz. neces.",
- "textBody": "Actualiz. neces."
- },
- "es-es": {
- "line1": "Actu. necesaria"
- },
- "es-mx": {
- "line1": "Actualiz. neces.",
- "textBody": "Actualiz. neces."
- },
- "fr-ca": {
- "line1": "Màj requise",
- "textBody": "Màj requise"
- },
- "fr-fr": {
- "line1": "Mise à jour requise"
- },
- "it-it": {
- "line1": "Necess. aggiorn."
- },
- "nl-nl": {
- "line1": "Update nodig"
- },
- "pl-pl": {
- "line1": "Potrzeba aktual."
- },
- "pt-br": {
- "line1": "Atualiz. necess."
- },
- "pt-pt": {
- "line1": "Actual. necess."
- },
- "ru-ru": {
- "line1": "Необх. обновл."
- },
- "sv-se": {
- "line1": "Uppdat. krävs"
- },
- "tr-tr": {
- "line1": "Güncellenmeli"
- },
- "zh-cn": {
- "line1": "需要进行更新"
- },
- "zh-tw": {
- "line1": "需更新"
- }
- }
- },
- "StatusPending": {
- "languages": {
- "de-de": {
- "line1": "Aktualisieren..."
- },
- "en-au": {
- "line1": "Updating..."
- },
- "en-gb": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "en-ie": {
- "line1": "Updating..."
- },
- "en-us": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "es-en": {
- "line1": "Actualizando...",
- "textBody": "Actualizando..."
- },
- "es-es": {
- "line1": "Actualizando..."
- },
- "es-mx": {
- "line1": "Actualizando...",
- "textBody": "Actualizando..."
- },
- "fr-ca": {
- "line1": "MAJ en cours...",
- "textBody": "MAJ en cours..."
- },
- "fr-fr": {
- "line1": "Màj en cours..."
- },
- "it-it": {
- "line1": "Aggiornamento"
- },
- "nl-nl": {
- "line1": "Updaten..."
- },
- "pl-pl": {
- "line1": "Aktualizowanie"
- },
- "pt-br": {
- "line1": "Atualizando..."
- },
- "pt-pt": {
- "line1": "A actualizar..."
- },
- "ru-ru": {
- "line1": "Обновление..."
- },
- "sv-se": {
- "line1": "Uppdaterar..."
- },
- "tr-tr": {
- "line1": "Güncelleniyor..."
- },
- "zh-cn": {
- "line1": "正在更新......"
- },
- "zh-tw": {
- "line1": "更新中..."
- }
- }
- },
- "StatusUpToDate": {
- "languages": {
- "de-de": {
- "line1": "Aktuelle Version"
- },
- "en-au": {
- "line1": "Up-to-date"
- },
- "en-gb": {
- "line1": "Up-to-date",
- "textBody": "Up-to-date"
- },
- "en-ie": {
- "line1": "Up-to-date"
- },
- "en-us": {
- "line1": "Up-To-Date",
- "textBody": "Up-To-Date"
- },
- "es-en": {
- "line1": "Actualizado",
- "textBody": "Actualizado"
- },
- "es-es": {
- "line1": "Actualizada"
- },
- "es-mx": {
- "line1": "Actualizado",
- "textBody": "Actualizado"
- },
- "fr-ca": {
- "line1": "Déjà à jour",
- "textBody": "Déjà à jour"
- },
- "fr-fr": {
- "line1": "Déjà à jour"
- },
- "it-it": {
- "line1": "più recente"
- },
- "nl-nl": {
- "line1": "Up-to-date"
- },
- "pl-pl": {
- "line1": "Aktualne"
- },
- "pt-br": {
- "line1": "Atualizado"
- },
- "pt-pt": {
- "line1": "Actualizado"
- },
- "ru-ru": {
- "line1": "Обновлено"
- },
- "sv-se": {
- "line1": "Uppdat. krävs ej"
- },
- "tr-tr": {
- "line1": "Güncel"
- },
- "zh-cn": {
- "line1": "最新更新"
- },
- "zh-tw": {
- "line1": "更新最新"
- }
- }
- },
- "VehicleInfo": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
- "label": "Fahrzeuginformationen"
- },
- "en-au": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-gb": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
- },
- "en-ie": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-us": {
- "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo",
- "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
- "label": "Información del vehículo"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo",
- "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
- "label": "Renseignements du véhicule",
- "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
- "label": "Renseignements du véhicule"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
- "label": "Informazioni sul veicolo"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
- "label": "Voertuiginformatie"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
- "label": "Informacje o pojeździe"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
- "label": "Informações sobre o veículo"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
- "label": "Informações do veículo"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
- "label": "Информация об автомобиле"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
- "label": "Fordonsinformation"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
- "label": "Araç bilgisi"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
- "label": "车辆信息"
- },
- "zh-tw": {
- "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
- "label": "車輛資訊"
- }
- }
- }
- }
- },
- "app_policies": {
- "default": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["Base-4"],
- "RequestType": [],
- "RequestSubType": []
- },
- "device": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["DataConsent-2"]
- },
- "pre_DataConsent": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["BaseBeforeDataConsent"]
- }
- }
- }
-}
+{
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 60,
+ "seconds_between_retries": [1,
+ 5,
+ 25,
+ 125,
+ 625],
+ "endpoints": {
+ "0x07": {
+ "default": ["http://x.x.x.x:3000/api/1/policies/proprietary"]
+ },
+ "0x04": {
+ "default": ["http://x.x.x.x:3000/api/1/softwareUpdate"]
+ },
+ "queryAppsUrl": {
+ "default": ["http://sdl.shaid.server"]
+ },
+ "lock_screen_icon_url": {
+ "default": ["http://i.imgur.com/TgkvOIZ.png"]
+ }
+ },
+ "notifications_per_minute_by_priority": {
+ "EMERGENCY": 60,
+ "NAVIGATION": 15,
+ "PROJECTION": 15,
+ "VOICECOM": 20,
+ "COMMUNICATION": 6,
+ "NORMAL": 4,
+ "NONE": 0
+ },
+ "lock_screen_dismissal_enabled": true
+ },
+ "functional_groupings": {
+ "Base-4": {
+ "rpcs": {
+ "AddCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "AddSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ShowAppMenu": {
+ "hmi_levels": ["FULL"]
+ },
+ "Alert": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "CreateInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EndAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GenericResponse": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetSystemCapability": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnButtonEvent": {
+ "hmi_levels": ["FULL",
+ "LIMITED",
+ "BACKGROUND"]
+ },
+ "OnButtonPress": {
+ "hmi_levels": ["FULL",
+ "LIMITED",
+ "BACKGROUND"]
+ },
+ "OnCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemCapabilityUpdated": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PerformInteraction": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ScrollableMessage": {
+ "hmi_levels": ["FULL"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetMediaClockTimer": {
+ "hmi_levels": ["FULL",
+ "LIMITED",
+ "BACKGROUND"]
+ },
+ "Show": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Slider": {
+ "hmi_levels": ["FULL"]
+ },
+ "Speak": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "SubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "CancelInteraction": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "CloseApplication": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ }
+ }
+ },
+ "Location-1": {
+ "user_consent_prompt": "Location",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ }
+ }
+ },
+ "Notifications": {
+ "user_consent_prompt": "Notifications",
+ "rpcs": {
+ "Alert": {
+ "hmi_levels": ["BACKGROUND"]
+ }
+ }
+ },
+ "Notifications-RC": {
+ "rpcs": {
+ "OnHMIStatus": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3": {
+ "user_consent_prompt": "DrivingCharacteristics",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "electronicParkBrakeStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "electronicParkBrakeStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "electronicParkBrakeStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "electronicParkBrakeStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ }
+ }
+ },
+ "VehicleInfo-3": {
+ "user_consent_prompt": "VehicleInfo",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineOilLife",
+ "engineTorque",
+ "externalTemperature",
+ "turnSignal",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "fuelRange",
+ "cloudAppVehicleID",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineOilLife",
+ "engineTorque",
+ "externalTemperature",
+ "turnSignal",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "fuelRange",
+ "cloudAppVehicleID",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineOilLife",
+ "engineTorque",
+ "externalTemperature",
+ "turnSignal",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "fuelRange",
+ "cloudAppVehicleID",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineOilLife",
+ "engineTorque",
+ "externalTemperature",
+ "turnSignal",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "fuelRange",
+ "cloudAppVehicleID",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ }
+ }
+ },
+ "PropriataryData-1": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetDTCs": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ReadDID": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "PropriataryData-2": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetDTCs": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ReadDID": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "ProprietaryData-3": {
+ "rpcs": {
+ "GetDTCs": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ReadDID": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "CloudAppStore": {
+ "rpcs": {
+ "SetCloudAppProperties":{
+ "hmi_levels":["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetCloudAppProperties":{
+ "hmi_levels":["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "CloudApp": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ }
+ }
+ },
+ "AppServiceProvider": {
+ "rpcs": {
+ "PublishAppService": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "UnpublishAppService": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "GetAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "OnAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "PerformAppServiceInteraction": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ }
+ }
+ },
+ "AppServiceConsumer": {
+ "rpcs": {
+ "GetFile": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "GetAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "OnAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "PerformAppServiceInteraction": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ }
+ }
+ },
+ "RemoteControl": {
+ "rpcs": {
+ "ButtonPress": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SetInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnRCStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ },
+ "Emergency-1": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ }
+ }
+ },
+ "Navigation-1": {
+ "rpcs": {
+ "AlertManeuver": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ShowConstantTBT": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "UpdateTurnList": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "Base-6": {
+ "rpcs": {
+ "AddCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "AddSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ShowAppMenu": {
+ "hmi_levels": ["FULL"]
+ },
+ "Alert": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "CreateInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EndAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GenericResponse": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnButtonEvent": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnButtonPress": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnCommand": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnTBTClientState": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PerformInteraction": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ScrollableMessage": {
+ "hmi_levels": ["FULL"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SetMediaClockTimer": {
+ "hmi_levels": ["FULL"]
+ },
+ "Show": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Slider": {
+ "hmi_levels": ["FULL"]
+ },
+ "Speak": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "SubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "OnKeyboardInputOnlyGroup": {
+ "rpcs": {
+ "OnKeyboardInput": {
+ "hmi_levels": ["FULL"]
+ }
+ }
+ },
+ "OnTouchEventOnlyGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": ["FULL"]
+ }
+ }
+ },
+ "DiagnosticMessageOnly": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "DataConsent-2": {
+ "user_consent_prompt": "DataConsent",
+ "rpcs": null
+ },
+ "BaseBeforeDataConsent": {
+ "rpcs": {
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ },
+ "SendLocation": {
+ "rpcs": {
+ "SendLocation": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "WayPoints": {
+ "rpcs": {
+ "GetWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SubscribeWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "UnsubscribeWayPoints": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnWayPointChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "BackgroundAPT": {
+ "rpcs": {
+ "EndAudioPassThru": {
+ "hmi_levels": ["BACKGROUND"]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": ["BACKGROUND"]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": ["BACKGROUND"]
+ }
+ }
+ },
+ "HapticGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": ["FULL"]
+ },
+ "SendHapticData": {
+ "hmi_levels": ["FULL"]
+ }
+ }
+ },
+ "WidgetSupport": {
+ "rpcs": {
+ "CreateWindow": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteWindow": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Show": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnSystemCapabilityUpdated": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.021",
+ "messages": {
+ "AppPermissions": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
+ "line1": "Zugriffsanfrage(n)",
+ "line2": "erlauben?"
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
+ "line1": "Grant Requested",
+ "line2": "Permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "es-en": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
+ "line1": "¿Conceder permisos",
+ "line2": "solicitados?"
+ },
+ "es-mx": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)",
+ "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)"
+ },
+ "it-it": {
+ "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
+ "line1": "Concedi autorizzaz.",
+ "line2": "richiesta(e)?"
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
+ "line1": "Aangevraagde",
+ "line2": "permissie(s) verlenen?"
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
+ "line1": "Udzielić żądanych",
+ "line2": "pozwoleń?"
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
+ "line1": "Conceder permissão",
+ "line2": "solicitada?"
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
+ "line1": "Conceder permiss.",
+ "line2": "solicitada(s)?"
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
+ "line1": "Предост. заправш.",
+ "line2": "разрешения?"
+ },
+ "sv-se": {
+ "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
+ "line1": "Vill du ge",
+ "line2": "tillstånd?"
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
+ "line1": "İstenen izinler",
+ "line2": "verilsin mi?"
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
+ "line1": "是否允许请求的",
+ "line2": "权限?"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
+ "line1": "允許",
+ "line2": "授權請求?"
+ }
+ }
+ },
+ "AppPermissionsHelp": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
+ },
+ "es-en": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
+ },
+ "es-mx": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "it-it": {
+ "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
+ },
+ "sv-se": {
+ "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsRevoked": {
+ "languages": {
+ "de-de": {
+ "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
+ },
+ "en-au": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-gb": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-ie": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-us": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "es-en": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "es-es": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
+ },
+ "es-mx": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "fr-ca": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "fr-fr": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "it-it": {
+ "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
+ },
+ "nl-nl": {
+ "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
+ },
+ "pl-pl": {
+ "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
+ },
+ "pt-br": {
+ "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
+ },
+ "pt-pt": {
+ "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
+ },
+ "ru-ru": {
+ "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
+ },
+ "sv-se": {
+ "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
+ },
+ "tr-tr": {
+ "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
+ },
+ "zh-cn": {
+ "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
+ },
+ "zh-tw": {
+ "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
+ }
+ }
+ },
+ "AppUnauthorized": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
+ "line1": "nicht autorisiert"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized",
+ "textBody": "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "Not Authorized",
+ "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
+ "line1": "No autorizada"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée",
+ "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
+ "line1": "non autorizzata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
+ "line1": "niet geautoriseerd"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
+ "line1": "brak autoryzacji"
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
+ "line1": "não autorizado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
+ "line1": "não autorizada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
+ "line1": "не авторизировано"
+ },
+ "sv-se": {
+ "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
+ "line1": "är ej godkänd"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
+ "line1": "için izin yok"
+ },
+ "zh-cn": {
+ "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
+ "line1": "未得到授权"
+ },
+ "zh-tw": {
+ "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
+ "line1": "無授權"
+ }
+ }
+ },
+ "AppUnsupported": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
+ "line1": "nicht unterstützt"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported",
+ "textBody": "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "Not Supported",
+ "textBody": "Your version of %appName% is not supported by SYNC."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "No compatible"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible",
+ "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è supportata dal SYNC.",
+ "line1": "non supportata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
+ "line1": "niet ondersteund"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
+ "line1": "aplikacja nie obsług."
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
+ "line1": "não suportado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
+ "line1": "não suportada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не поддерживается SYNC.",
+ "line1": "не поддерживается"
+ },
+ "sv-se": {
+ "tts": "SYNC har inte stöd för den här versionen av %appName%.",
+ "line1": "stöds ej"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
+ "line1": "desteklenmiyor"
+ },
+ "zh-cn": {
+ "tts": "SYNC不支持此版本的%appName%。",
+ "line1": "不受支持"
+ },
+ "zh-tw": {
+ "tts": "SYNC 不支援此版本的%appName% 。",
+ "line1": "不支援"
+ }
+ }
+ },
+ "DataConsent": {
+ "languages": {
+ "en-gb": {
+ "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. \r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "en-us": {
+ "line1": "Enable Mobile Apps",
+ "line2": "on SYNC? (Uses Data)",
+ "textBody": "Would you like to enable Mobile Apps on SYNC?\r\n\r\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "es-mx": {
+ "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. \n\nLas actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. \n\nPresione Sí para permitir y No para denegar."
+ },
+ "fr-ca": {
+ "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements.\r\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ }
+ }
+ },
+ "DataConsentHelp": {
+ "languages": {
+ "en-us": {
+ "textBody": "By enabling mobile apps, you consent to allowing SYNC to communicate with Ford at least once per month using your mobile device’s data plan. Disabling will stop all data usage, but you will not be able to use mobile apps on SYNC. See your Owner Guide for more information."
+ },
+ "es-mx": {
+ "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
+ },
+ "fr-ca": {
+ "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
+ }
+ }
+ },
+ "DisableApps": {
+ "languages": {
+ "de-de": {
+ "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
+ "line1": "Auto-Update",
+ "line2": "und Mobile Apps deaktivieren"
+ },
+ "en-au": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-gb": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-ie": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-us": {
+ "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
+ "line1": "Disable Auto-Updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "If you disable, you will not be able to use any mobile apps with SYNC and your vehicle will stop receiving mobile app permission updates via your device`s data plan. Please press yes to disable mobile apps or no to cancel."
+ },
+ "es-en": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "es-es": {
+ "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
+ "line1": "¿Desact. actual. auto",
+ "line2": "y apl. móviles?"
+ },
+ "es-mx": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "fr-ca": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?",
+ "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "fr-fr": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?"
+ },
+ "it-it": {
+ "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
+ "line1": "Disabilitare agg. aut.",
+ "line2": "e app mobili?"
+ },
+ "nl-nl": {
+ "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
+ "line1": "Auto-updates en mob.",
+ "line2": "apps uitschakelen?"
+ },
+ "pl-pl": {
+ "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
+ "line1": "Wył. automat. aktual.",
+ "line2": "i aplikacje mobilne?"
+ },
+ "pt-br": {
+ "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
+ "line1": "Desativar atualizações",
+ "line2": "autom. e aplicativos?"
+ },
+ "pt-pt": {
+ "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
+ "line1": "Desact. actual. autom.",
+ "line2": "e aplicações móveis?"
+ },
+ "ru-ru": {
+ "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
+ "line1": "Откл. автообновления",
+ "line2": "и мобил. прилож.?"
+ },
+ "sv-se": {
+ "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
+ "line1": "Avaktiverar autouppdat.",
+ "line2": "och mobilappar?"
+ },
+ "tr-tr": {
+ "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
+ "line1": "Oto. güncelleme ve",
+ "line2": "mobil uygul. kapat?"
+ },
+ "zh-cn": {
+ "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
+ "line1": "是否禁用自动更新和",
+ "line2": "移动应用程序?"
+ },
+ "zh-tw": {
+ "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
+ "line1": "停用自動更新",
+ "line2": "和行動應用程式?"
+ }
+ }
+ },
+ "DrivingCharacteristics": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
+ "label": "Fahreigenschaften"
+ },
+ "en-au": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-gb": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-us": {
+ "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
+ "label": "Driving Characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
+ "label": "Características de conducción"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite",
+ "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
+ "label": "Caratteristiche di guida"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
+ "label": "Rijkenmerken"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
+ "label": "Informacje dotyczące stylu jazdy"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
+ "label": "Características de condução"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
+ "label": "Características de condução"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
+ "label": "Характеристики движения"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
+ "label": "Köregenskaper"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
+ "label": "Sürüş karakteristikleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
+ "label": "行驶特性"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
+ "label": "駕駛特性"
+ }
+ }
+ },
+ "Location": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
+ "label": "GPS und Geschwindigkeit"
+ },
+ "en-au": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-gb": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "en-ie": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-us": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse",
+ "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
+ "label": "GPS e velocità"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
+ "label": "Gps en snelheid"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
+ "label": "GPS i prędkość"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
+ "label": "GPS и скорость"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
+ "label": "GPS och hastighet"
+ },
+ "tr-tr": {
+ "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
+ "label": "GPS ve hız"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
+ "label": "GPS 和车速"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取車輛的GPS和速度。",
+ "label": "GPS和車速"
+ }
+ }
+ },
+ "LockScreenDismissalWarning":{
+ "languages":{
+ "en-us":{
+ "textBody": "Swipe down to dismiss, acknowledging that you are not the driver"
+ }
+ }
+ },
+ "Notifications": {
+ "languages": {
+ "de-de": {
+ "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
+ "label": "Push-Benachrichtigungen"
+ },
+ "en-au": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-gb": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "en-ie": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-us": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
+ "label": "Notificaciones push"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications instantanées",
+ "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications push"
+ },
+ "it-it": {
+ "tts": "Un'app può inviare notifiche se eseguita in background.",
+ "label": "Notifiche push"
+ },
+ "nl-nl": {
+ "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
+ "label": "Push-meldingen"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
+ "label": "Powiadomienia Push"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
+ "label": "Notificações Push"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
+ "label": "Notificações push"
+ },
+ "ru-ru": {
+ "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
+ "label": "Оповещения о пересылке"
+ },
+ "sv-se": {
+ "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
+ "label": "Push-notiser"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
+ "label": "Anlık bildirimleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序在后台运行时可推送通知。",
+ "label": "推送通知"
+ },
+ "zh-tw": {
+ "tts": "車輛行進時,應用程式可在背景中傳送通知。",
+ "label": "傳送通知"
+ }
+ }
+ },
+ "SettingDisableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Updates deakt."
+ },
+ "en-au": {
+ "line1": "Disable updates"
+ },
+ "en-gb": {
+ "line1": "Disable updates"
+ },
+ "en-ie": {
+ "line1": "Disable updates"
+ },
+ "en-us": {
+ "line1": "Disable Updates",
+ "textBody": "Disable Updates"
+ },
+ "es-en": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "es-es": {
+ "line1": "Desact. actual."
+ },
+ "es-mx": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "fr-ca": {
+ "line1": "Désactiver MAJ",
+ "textBody": "Désactiver MAJ"
+ },
+ "fr-fr": {
+ "line1": "Désactiver màj"
+ },
+ "it-it": {
+ "line1": "Disabilita agg."
+ },
+ "nl-nl": {
+ "line1": "Upd. uitschak."
+ },
+ "pl-pl": {
+ "line1": "Wyłącz aktual."
+ },
+ "pt-br": {
+ "line1": "Desat. atualiz."
+ },
+ "pt-pt": {
+ "line1": "Desact. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Откл. обновл."
+ },
+ "sv-se": {
+ "line1": "Inaktivera uppd."
+ },
+ "tr-tr": {
+ "line1": "Güncell. Kapat"
+ },
+ "zh-cn": {
+ "line1": "禁用更新"
+ },
+ "zh-tw": {
+ "line1": "停用更新"
+ }
+ }
+ },
+ "SettingEnableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Apps aktivieren"
+ },
+ "en-au": {
+ "line1": "Enable Apps"
+ },
+ "en-gb": {
+ "line1": "Enable Apps"
+ },
+ "en-ie": {
+ "line1": "Enable Apps"
+ },
+ "en-us": {
+ "line1": "Enable Apps"
+ },
+ "es-en": {
+ "line1": "Hab. aplic."
+ },
+ "es-es": {
+ "line1": "Activar apl."
+ },
+ "es-mx": {
+ "line1": "Hab. aplic."
+ },
+ "fr-ca": {
+ "line1": "Activer app.",
+ "textBody": "Activer app."
+ },
+ "fr-fr": {
+ "line1": "Activer app."
+ },
+ "it-it": {
+ "line1": "Abilita app"
+ },
+ "nl-nl": {
+ "line1": "Apps inschak."
+ },
+ "pl-pl": {
+ "line1": "Włącz aplikacje"
+ },
+ "pt-br": {
+ "line1": "Ativar aplic."
+ },
+ "pt-pt": {
+ "line1": "Activar actualiz."
+ },
+ "ru-ru": {
+ "line1": "Вкл. прилож."
+ },
+ "sv-se": {
+ "line1": "Aktivera appar"
+ },
+ "tr-tr": {
+ "line1": "Uygulamaları aç"
+ },
+ "zh-cn": {
+ "line1": "启用应用程序"
+ },
+ "zh-tw": {
+ "line1": "啟用應用程式"
+ }
+ }
+ },
+ "SettingUpdateAuto": {
+ "languages": {
+ "de-de": {
+ "line1": "Update anford."
+ },
+ "en-au": {
+ "line1": "Request update"
+ },
+ "en-gb": {
+ "line1": "Request update"
+ },
+ "en-ie": {
+ "line1": "Request update"
+ },
+ "en-us": {
+ "line1": "Request Update",
+ "textBody": "Select `Update now` to receive app permissions for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
+ },
+ "es-en": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "es-es": {
+ "line1": "Solicitar actual."
+ },
+ "es-mx": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "fr-ca": {
+ "line1": "Demander MAJ",
+ "textBody": "Demander MAJ"
+ },
+ "fr-fr": {
+ "line1": "Demander màj"
+ },
+ "it-it": {
+ "line1": "Rich. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Upd. aanvragen"
+ },
+ "pl-pl": {
+ "line1": "Zażądaj aktual."
+ },
+ "pt-br": {
+ "line1": "Solicitar atualiz."
+ },
+ "pt-pt": {
+ "line1": "Solicit. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Запрос на обн."
+ },
+ "sv-se": {
+ "line1": "Begär uppdat."
+ },
+ "tr-tr": {
+ "line1": "Güncelleme iste"
+ },
+ "zh-cn": {
+ "line1": "请求更新"
+ },
+ "zh-tw": {
+ "line1": "請求更新"
+ }
+ }
+ },
+ "StatusNeeded": {
+ "languages": {
+ "de-de": {
+ "line1": "Update benötigt"
+ },
+ "en-au": {
+ "line1": "Update needed"
+ },
+ "en-gb": {
+ "line1": "Update needed",
+ "textBody": "Update needed"
+ },
+ "en-ie": {
+ "line1": "Update needed"
+ },
+ "en-us": {
+ "line1": "Update Needed",
+ "textBody": "Update Needed"
+ },
+ "es-en": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "es-es": {
+ "line1": "Actu. necesaria"
+ },
+ "es-mx": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "fr-ca": {
+ "line1": "Màj requise",
+ "textBody": "Màj requise"
+ },
+ "fr-fr": {
+ "line1": "Mise à jour requise"
+ },
+ "it-it": {
+ "line1": "Necess. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Update nodig"
+ },
+ "pl-pl": {
+ "line1": "Potrzeba aktual."
+ },
+ "pt-br": {
+ "line1": "Atualiz. necess."
+ },
+ "pt-pt": {
+ "line1": "Actual. necess."
+ },
+ "ru-ru": {
+ "line1": "Необх. обновл."
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs"
+ },
+ "tr-tr": {
+ "line1": "Güncellenmeli"
+ },
+ "zh-cn": {
+ "line1": "需要进行更新"
+ },
+ "zh-tw": {
+ "line1": "需更新"
+ }
+ }
+ },
+ "StatusPending": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktualisieren..."
+ },
+ "en-au": {
+ "line1": "Updating..."
+ },
+ "en-gb": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "en-ie": {
+ "line1": "Updating..."
+ },
+ "en-us": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "es-en": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "es-es": {
+ "line1": "Actualizando..."
+ },
+ "es-mx": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "fr-ca": {
+ "line1": "MAJ en cours...",
+ "textBody": "MAJ en cours..."
+ },
+ "fr-fr": {
+ "line1": "Màj en cours..."
+ },
+ "it-it": {
+ "line1": "Aggiornamento"
+ },
+ "nl-nl": {
+ "line1": "Updaten..."
+ },
+ "pl-pl": {
+ "line1": "Aktualizowanie"
+ },
+ "pt-br": {
+ "line1": "Atualizando..."
+ },
+ "pt-pt": {
+ "line1": "A actualizar..."
+ },
+ "ru-ru": {
+ "line1": "Обновление..."
+ },
+ "sv-se": {
+ "line1": "Uppdaterar..."
+ },
+ "tr-tr": {
+ "line1": "Güncelleniyor..."
+ },
+ "zh-cn": {
+ "line1": "正在更新......"
+ },
+ "zh-tw": {
+ "line1": "更新中..."
+ }
+ }
+ },
+ "StatusUpToDate": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktuelle Version"
+ },
+ "en-au": {
+ "line1": "Up-to-date"
+ },
+ "en-gb": {
+ "line1": "Up-to-date",
+ "textBody": "Up-to-date"
+ },
+ "en-ie": {
+ "line1": "Up-to-date"
+ },
+ "en-us": {
+ "line1": "Up-To-Date",
+ "textBody": "Up-To-Date"
+ },
+ "es-en": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "es-es": {
+ "line1": "Actualizada"
+ },
+ "es-mx": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "fr-ca": {
+ "line1": "Déjà à jour",
+ "textBody": "Déjà à jour"
+ },
+ "fr-fr": {
+ "line1": "Déjà à jour"
+ },
+ "it-it": {
+ "line1": "più recente"
+ },
+ "nl-nl": {
+ "line1": "Up-to-date"
+ },
+ "pl-pl": {
+ "line1": "Aktualne"
+ },
+ "pt-br": {
+ "line1": "Atualizado"
+ },
+ "pt-pt": {
+ "line1": "Actualizado"
+ },
+ "ru-ru": {
+ "line1": "Обновлено"
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs ej"
+ },
+ "tr-tr": {
+ "line1": "Güncel"
+ },
+ "zh-cn": {
+ "line1": "最新更新"
+ },
+ "zh-tw": {
+ "line1": "更新最新"
+ }
+ }
+ },
+ "VehicleInfo": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
+ "label": "Fahrzeuginformationen"
+ },
+ "en-au": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-gb": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
+ },
+ "en-ie": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-us": {
+ "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
+ "label": "Renseignements du véhicule",
+ "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
+ "label": "Renseignements du véhicule"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
+ "label": "Informazioni sul veicolo"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
+ "label": "Voertuiginformatie"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
+ "label": "Informacje o pojeździe"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
+ "label": "Informações sobre o veículo"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
+ "label": "Informações do veículo"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
+ "label": "Информация об автомобиле"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
+ "label": "Fordonsinformation"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
+ "label": "Araç bilgisi"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
+ "label": "车辆信息"
+ },
+ "zh-tw": {
+ "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
+ "label": "車輛資訊"
+ }
+ }
+ }
+ }
+ },
+ "app_policies": {
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["Base-4"],
+ "RequestType": [],
+ "RequestSubType": []
+ },
+ "device": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["DataConsent-2"]
+ },
+ "pre_DataConsent": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["BaseBeforeDataConsent"]
+ }
+ }
+ }
+}
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 40c1bf08a7..0c85a867d0 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -205,6 +205,15 @@ TCPAdapterNetworkInterface =
; 128 bit uuid for bluetooth device discovery. Please format as 16 seperate bytes.
;BluetoothUUID = 0x93, 0x6D, 0xA0, 0x1F, 0x9A, 0xBD, 0x4D, 0x9D, 0x80, 0xC7, 0x02, 0xAF, 0x85, 0xC8, 0x22, 0xA8
+; AOA USB Transport Configuration
+; USBAccessory Filter Parameters
+AOAFilterManufacturer = SDL
+AOAFilterModelName = Core
+AOAFilterDescription = SmartDeviceLink Core Component USB
+AOAFilterVersion = 1.0
+AOAFilterURI = http://www.smartdevicelink.org
+AOAFilterSerialNumber = N000000
+
[CloudAppConnections]
; Value in milliseconds for time between retry attempts on a failed websocket connection
CloudAppRetryTimeout = 1000
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 72122ff3ec..de4319acb7 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -62,13 +62,17 @@ typedef int32_t ErrorCode;
class UsageStatistics;
+class DisplayCapabilitiesBuilder;
+
enum APIVersion {
kUnknownAPI = -1,
kAPIV0 = 0,
kAPIV1 = 1,
kAPIV2 = 2,
kAPIV3 = 3,
- kAPIV4 = 4
+ kAPIV4 = 4,
+ kAPIV5 = 5,
+ kAPIV6 = 6
};
enum TLimitSource { POLICY_TABLE = 0, CONFIG_FILE };
@@ -146,6 +150,12 @@ typedef std::map<uint32_t, smart_objects::SmartObject*> SubMenuMap;
typedef std::map<uint32_t, smart_objects::SmartObject*> ChoiceSetMap;
/*
+ * @brief Typedef for map of window ids to data used as parameters
+ * to CreateWindow request.
+ */
+typedef std::map<WindowID, smart_objects::SmartObjectSPtr> WindowParamsMap;
+
+/*
* @brief Typedef for perform interaction choice
* @param choice id
* @param SmartObject choice
@@ -162,7 +172,7 @@ typedef std::map<uint32_t, PerformChoice> PerformChoiceSetMap;
/**
* @brief Defines id of SoftButton
*/
-typedef std::set<uint32_t> SoftButtonID;
+typedef std::set<std::pair<uint32_t, WindowID> > SoftButtonID;
/**
* @brief Defines set of buttons subscription
@@ -188,9 +198,25 @@ class DynamicApplicationData {
virtual const smart_objects::SmartObject* keyboard_props() const = 0;
virtual const smart_objects::SmartObject* menu_title() const = 0;
virtual const smart_objects::SmartObject* menu_icon() const = 0;
- virtual const smart_objects::SmartObject* day_color_scheme() const = 0;
- virtual const smart_objects::SmartObject* night_color_scheme() const = 0;
- virtual const std::string& display_layout() const = 0;
+ virtual smart_objects::SmartObject day_color_scheme() const = 0;
+ virtual smart_objects::SmartObject night_color_scheme() const = 0;
+ virtual std::string display_layout() const = 0;
+
+ /**
+ * @brief Specific display capabilities of application
+ * @return display capabilities of application or NULL-initialized pointer if
+ * not specified
+ */
+ virtual smart_objects::SmartObjectSPtr display_capabilities() const = 0;
+
+ /**
+ * @brief Specific display capabilities of application
+ * @param window id - id of an affected widget
+ * @return display capabilities of application or NULL-initialized pointer if
+ * not specified
+ */
+ virtual smart_objects::SmartObjectSPtr display_capabilities(
+ const WindowID window_id) const = 0;
virtual void load_global_properties(const smart_objects::SmartObject& so) = 0;
virtual void set_help_prompt(
@@ -222,12 +248,77 @@ class DynamicApplicationData {
virtual void set_video_stream_retry_number(
const uint32_t& video_stream_retry_number) = 0;
+ virtual void set_display_layout(const std::string& layout) = 0;
virtual void set_day_color_scheme(
const smart_objects::SmartObject& color_scheme) = 0;
virtual void set_night_color_scheme(
const smart_objects::SmartObject& color_scheme) = 0;
- virtual void set_display_layout(const std::string& layout) = 0;
+ /**
+ * @brief Set specific application display capabilities
+ * @param display_capabilities new display capabilities of application
+ */
+ virtual void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) = 0;
+
+ /**
+ * @brief deletes stored window capability for given window id
+ * @param window id of capability to remove
+ */
+ virtual void remove_window_capability(const WindowID window_id) = 0;
+
+ /**
+ * @brief Sets layout for application's specific window
+ * @param window_id window id for which layout should be set
+ * @param layout - layout to be set
+ */
+ virtual void set_window_layout(const WindowID window_id,
+ const std::string& layout) = 0;
+
+ /**
+ * @brief Sets day color scheme for application's specific window
+ * @param window_id window id for which day color scheme should be set
+ * @param color_scheme - color scheme to be set
+ */
+ virtual void set_day_color_scheme(
+ const WindowID window_id,
+ const smart_objects::SmartObject& color_scheme) = 0;
+
+ /**
+ * @brief Sets night color scheme for application's specific window
+ * @param window_id window id for which night color scheme should be set
+ * @param color_scheme - color scheme to be set
+ */
+ virtual void set_night_color_scheme(
+ const WindowID window_id,
+ const smart_objects::SmartObject& color_scheme) = 0;
+
+ /**
+ * @brief Gets window layout for application's specific window_id
+ * @param window_id window id for which display layout should be returned
+ * @return string containing set display layout,
+ * if no display layout is set - empty string is returned
+ */
+ virtual std::string window_layout(const WindowID window_id) const = 0;
+
+ /**
+ * @brief Gets day color scheme for application's specific window_id
+ * @param window_id window id for which color scheme should be returned
+ * @return day color scheme which is set for specified app window,
+ * if no day color scheme is set - Smart object with NullType is returned
+ */
+ virtual smart_objects::SmartObject day_color_scheme(
+ const WindowID window_id) const = 0;
+
+ /**
+ * @brief Gets night color scheme for application's specific window_id
+ * @param window_id window id for which color scheme should be returned
+ * @return night color scheme which is set for specified app window
+ * if no night color scheme is set - Smart object with NullType is returned
+ */
+ virtual smart_objects::SmartObject night_color_scheme(
+ const WindowID window_id) const = 0;
+
/**
* @brief Checks if application is media, voice communication or navigation
* @return true if application is media, voice communication or navigation,
@@ -290,6 +381,20 @@ class DynamicApplicationData {
virtual void RemoveChoiceSet(uint32_t choice_set_id) = 0;
/*
+ * @brief Adds window info
+ * @param window_id unique id of a window
+ * @param window_info SmartObject that represent window info
+ */
+ virtual void SetWindowInfo(const WindowID window_id,
+ const smart_objects::SmartObject& window_info) = 0;
+
+ /*
+ * @brief Removes window info
+ * @param window_id unique id of a window
+ */
+ virtual void RemoveWindowInfo(const WindowID window_id) = 0;
+
+ /*
* @brief Finds choice set with the specified choice_set_id id
*
* @param choice_set_id Unique ID of the interaction choice set
@@ -324,6 +429,16 @@ class DynamicApplicationData {
const = 0;
/*
+ * @brief Retrieves window info map
+ */
+ virtual DataAccessor<WindowParamsMap> window_optional_params_map() const = 0;
+
+ /*
+ * @brief Retrieves display capabilities builder
+ */
+ virtual DisplayCapabilitiesBuilder& display_capabilities_builder() = 0;
+
+ /*
* @brief Retrieve application commands
*/
virtual DataAccessor<CommandsMap> commands_map() const = 0;
@@ -449,6 +564,20 @@ class Application : public virtual InitialApplicationData,
*/
virtual void set_is_application_data_changed(bool state_application_data) = 0;
+ /**
+ * @brief Checks if application data is allowed to be resumed
+ * @return TRUE if data of application is allowed to be resumed, otherwise
+ * return FALSE
+ */
+ virtual bool is_app_data_resumption_allowed() const = 0;
+
+ /**
+ * @brief Sets resumption allowance for application data
+ * @param allowed - true if app data allowed to be resumed,
+ * false value means that app data is disallowed for resumption
+ */
+ virtual void set_app_data_resumption_allowance(const bool allowed) = 0;
+
virtual void CloseActiveMessage() = 0;
virtual bool IsFullscreen() const = 0;
virtual void ChangeSupportingAppHMIType() = 0;
@@ -545,11 +674,26 @@ class Application : public virtual InitialApplicationData,
virtual bool is_media_application() const = 0;
virtual bool is_foreground() const = 0;
virtual void set_foreground(const bool is_foreground) = 0;
- virtual const mobile_api::HMILevel::eType hmi_level() const = 0;
+
+ /**
+ * @brief hmi_level current HMI level of application's window
+ * @param window_id id of application's window to get
+ * @return HMI level of application's window
+ */
+ virtual const mobile_api::HMILevel::eType hmi_level(
+ const WindowID window_id) const = 0;
+
virtual const uint32_t put_file_in_none_count() const = 0;
virtual const uint32_t delete_file_in_none_count() const = 0;
virtual const uint32_t list_files_in_none_count() const = 0;
- virtual const mobile_api::SystemContext::eType system_context() const = 0;
+
+ /**
+ * @brief system_context current system context of application's window
+ * @param window_id id of application's window to get
+ * @return system context of application's window
+ */
+ virtual const mobile_api::SystemContext::eType system_context(
+ const WindowID window_id) const = 0;
virtual const mobile_api::AudioStreamingState::eType audio_streaming_state()
const = 0;
virtual const mobile_api::VideoStreamingState::eType video_streaming_state()
@@ -694,58 +838,91 @@ class Application : public virtual InitialApplicationData,
/**
* @brief SetInitialState sets initial HMI state for application on
* registration
+ * @param window_id window id for HMI state
+ * @param window_name name of inited window
* @param state Hmi state value
*/
- virtual void SetInitialState(HmiStatePtr state) = 0;
+ virtual void SetInitialState(const WindowID window_id,
+ const std::string& window_name,
+ HmiStatePtr state) = 0;
/**
* @brief SetRegularState set permanent state of application
- *
+ * @param window_id window id for HMI state
* @param state state to setup
*/
- virtual void SetRegularState(HmiStatePtr state) = 0;
+ virtual void SetRegularState(const WindowID window_id, HmiStatePtr state) = 0;
/**
* @brief SetPostponedState sets postponed state to application.
* This state could be set as regular later
- *
+ * @param window_id window id for HMI state
* @param state state to setup
*/
- virtual void SetPostponedState(HmiStatePtr state) = 0;
+ virtual void SetPostponedState(const WindowID window_id,
+ HmiStatePtr state) = 0;
- virtual void RemovePostponedState() = 0;
+ /**
+ * @brief RemovePostponedState removes postponed state for application
+ * After removal, this state will not be set as regular later
+ * @param window_id window id for HMI state
+ */
+ virtual void RemovePostponedState(const WindowID window_id) = 0;
/**
* @brief AddHMIState the function that will change application's
* hmi state.
*
- * @param app_id id of the application whose hmi level should be changed.
+ * @param window_id window id for HMI state
*
* @param state new hmi state for certain application.
*/
- virtual void AddHMIState(HmiStatePtr state) = 0;
+ virtual void AddHMIState(const WindowID window_id, HmiStatePtr state) = 0;
/**
* @brief RemoveHMIState the function that will turn back hmi_level after end
* of some event
*
- * @param app_id id of the application whose hmi level should be changed.
+ * @param window_id window id for HMI state
*
* @param state_id that should be removed
*/
- virtual void RemoveHMIState(HmiState::StateID state_id) = 0;
+ virtual void RemoveHMIState(const WindowID window_id,
+ HmiState::StateID state_id) = 0;
/**
* @brief HmiState of application within active events PhoneCall, TTS< etc ...
+ * @param window_id window id for HMI state
* @return Active HmiState of application
*/
- virtual const HmiStatePtr CurrentHmiState() const = 0;
+ virtual const HmiStatePtr CurrentHmiState(const WindowID window_id) const = 0;
+
+ /**
+ * @brief Getter for a list of available application windows including the
+ * main
+ * @return list of available window IDs created by application
+ */
+ virtual WindowIds GetWindowIds() const = 0;
+
+ /**
+ * @brief Getter for a list of all existing window names
+ * @return list of available window names created by application
+ */
+ virtual WindowNames GetWindowNames() const = 0;
+
+ /**
+ * @brief Check if application has specified window
+ * @param window_id - id of window to check
+ * @return true if app has specified window , otherwise false
+ */
+ virtual bool WindowIdExists(const WindowID window_id) const = 0;
/**
* @brief RegularHmiState of application without active events VR, TTS etc ...
+ * @param window_id window id for HMI state
* @return HmiState of application
*/
- virtual const HmiStatePtr RegularHmiState() const = 0;
+ virtual const HmiStatePtr RegularHmiState(const WindowID window_id) const = 0;
/**
* @brief Checks if app is allowed to change audio source
@@ -756,10 +933,11 @@ class Application : public virtual InitialApplicationData,
/**
* @brief PostponedHmiState returns postponed hmi state of application
* if it's present
- *
+ * @param window_id window id for HMI state
* @return Postponed hmi state of application
*/
- virtual const HmiStatePtr PostponedHmiState() const = 0;
+ virtual const HmiStatePtr PostponedHmiState(
+ const WindowID window_id) const = 0;
/**
* @brief Keeps id of softbuttons which is created in commands:
@@ -772,6 +950,13 @@ class Application : public virtual InitialApplicationData,
const SoftButtonID& softbuttons_id) = 0;
/**
+ * @brief Retreives window id on which given button is created
+ * @param button_id identifier of a button
+ * @param window id of a widget containing button
+ */
+ virtual WindowID GetSoftButtonWindowID(const uint32_t button_id) = 0;
+
+ /**
* @brief Determine the existence of softbutton
* @param Softbutton_id contains id of softbutton
* @return Returns true if application contains softbutton id otherwise
@@ -901,9 +1086,11 @@ class Application : public virtual InitialApplicationData,
/**
* @brief set_system_context Set system context for application
+ * @param window_id window id for HMI state
* @param system_context Current context
*/
virtual void set_system_context(
+ const WindowID window_id,
const mobile_api::SystemContext::eType& system_context) = 0;
/**
@@ -915,9 +1102,11 @@ class Application : public virtual InitialApplicationData,
/**
* @brief set_hmi_level Set HMI level for application
+ * @param window_id window id for HMI state
* @param hmi_level Current HMI level
*/
- virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
+ virtual void set_hmi_level(const WindowID window_id,
+ const mobile_api::HMILevel::eType& hmi_level) = 0;
/**
* @brief Return pointer to extension by uid
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 7852d6805b..dd093c9890 100644
--- a/src/components/application_manager/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -35,6 +35,7 @@
#include <string>
#include "application_manager/application.h"
+#include "application_manager/display_capabilities_builder.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/smart_object.h"
#include "utils/lock.h"
@@ -88,6 +89,7 @@ class InitialApplicationDataImpl : public virtual Application {
class DynamicApplicationDataImpl : public virtual Application {
public:
+ typedef std::map<WindowID, smart_objects::SmartObject> AppWindowsTemplates;
DynamicApplicationDataImpl();
~DynamicApplicationDataImpl();
const smart_objects::SmartObject* help_prompt() const;
@@ -100,9 +102,31 @@ class DynamicApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* keyboard_props() const;
const smart_objects::SmartObject* menu_title() const;
const smart_objects::SmartObject* menu_icon() const;
- const smart_objects::SmartObject* day_color_scheme() const;
- const smart_objects::SmartObject* night_color_scheme() const;
- const std::string& display_layout() const;
+
+ smart_objects::SmartObject day_color_scheme() const OVERRIDE;
+ smart_objects::SmartObject night_color_scheme() const OVERRIDE;
+ std::string display_layout() const OVERRIDE;
+ smart_objects::SmartObjectSPtr display_capabilities() const OVERRIDE;
+ smart_objects::SmartObjectSPtr display_capabilities(
+ const WindowID window_id) const OVERRIDE;
+
+ void set_window_layout(const WindowID window_id,
+ const std::string& layout) OVERRIDE;
+
+ void set_day_color_scheme(
+ const WindowID window_id,
+ const smart_objects::SmartObject& color_scheme) OVERRIDE;
+ void set_night_color_scheme(
+ const WindowID window_id,
+ const smart_objects::SmartObject& color_scheme) OVERRIDE;
+
+ std::string window_layout(const WindowID window_id) const OVERRIDE;
+
+ smart_objects::SmartObject day_color_scheme(
+ const WindowID window_id) const OVERRIDE;
+
+ smart_objects::SmartObject night_color_scheme(
+ const WindowID window_id) const OVERRIDE;
void load_global_properties(const smart_objects::SmartObject& properties_so);
void set_help_prompt(const smart_objects::SmartObject& help_prompt);
@@ -120,6 +144,9 @@ class DynamicApplicationDataImpl : public virtual Application {
void set_day_color_scheme(const smart_objects::SmartObject& color_scheme);
void set_night_color_scheme(const smart_objects::SmartObject& color_scheme);
void set_display_layout(const std::string& layout);
+ void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) OVERRIDE;
+ void remove_window_capability(const WindowID window_id) OVERRIDE;
/*
* @brief Adds a command to the in application menu
*/
@@ -156,6 +183,11 @@ class DynamicApplicationDataImpl : public virtual Application {
*/
bool IsSubMenuNameAlreadyExist(const std::string& name);
+ void SetWindowInfo(const WindowID window_id,
+ const smart_objects::SmartObject& window_info) OVERRIDE;
+
+ void RemoveWindowInfo(const WindowID window_id) OVERRIDE;
+
/*
* @brief Adds a interaction choice set to the application
*
@@ -221,6 +253,10 @@ class DynamicApplicationDataImpl : public virtual Application {
*/
inline DataAccessor<ChoiceSetMap> choice_set_map() const;
+ DataAccessor<WindowParamsMap> window_optional_params_map() const;
+
+ DisplayCapabilitiesBuilder& display_capabilities_builder();
+
/*
* @brief Sets perform interaction state
*
@@ -274,9 +310,8 @@ class DynamicApplicationDataImpl : public virtual Application {
smart_objects::SmartObject* menu_title_;
smart_objects::SmartObject* menu_icon_;
smart_objects::SmartObject* tbt_show_command_;
- smart_objects::SmartObject* day_color_scheme_;
- smart_objects::SmartObject* night_color_scheme_;
- std::string display_layout_;
+ smart_objects::SmartObjectSPtr display_capabilities_;
+ AppWindowsTemplates window_templates_;
CommandsMap commands_;
mutable std::shared_ptr<sync_primitives::RecursiveLock> commands_lock_ptr_;
@@ -287,9 +322,12 @@ class DynamicApplicationDataImpl : public virtual Application {
PerformChoiceSetMap performinteraction_choice_set_map_;
mutable std::shared_ptr<sync_primitives::RecursiveLock>
performinteraction_choice_set_lock_ptr_;
+ WindowParamsMap window_params_map_;
+ mutable std::shared_ptr<sync_primitives::Lock> window_params_map_lock_ptr_;
uint32_t is_perform_interaction_active_;
bool is_reset_global_properties_active_;
int32_t perform_interaction_mode_;
+ DisplayCapabilitiesBuilder display_capabilities_builder_;
private:
void SetGlobalProperties(
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index fd9b77eb0f..40bb58c009 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -158,11 +158,13 @@ class ApplicationImpl : public virtual Application,
bool is_media_application() const;
bool is_foreground() const OVERRIDE;
void set_foreground(const bool is_foreground) OVERRIDE;
- const mobile_apis::HMILevel::eType hmi_level() const;
+ const mobile_apis::HMILevel::eType hmi_level(
+ const WindowID window_id) const OVERRIDE;
const uint32_t put_file_in_none_count() const;
const uint32_t delete_file_in_none_count() const;
const uint32_t list_files_in_none_count() const;
- const mobile_api::SystemContext::eType system_context() const;
+ const mobile_api::SystemContext::eType system_context(
+ const WindowID window_id) const OVERRIDE;
inline const mobile_apis::AudioStreamingState::eType audio_streaming_state()
const;
inline const mobile_apis::VideoStreamingState::eType video_streaming_state()
@@ -229,6 +231,8 @@ class ApplicationImpl : public virtual Application,
bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
+ WindowID GetSoftButtonWindowID(const uint32_t button_id) OVERRIDE;
+
inline bool IsRegistered() const OVERRIDE;
/**
@@ -279,6 +283,9 @@ class ApplicationImpl : public virtual Application,
virtual bool is_application_data_changed() const;
+ bool is_app_data_resumption_allowed() const OVERRIDE;
+ void set_app_data_resumption_allowance(const bool allowed) OVERRIDE;
+
virtual void set_is_application_data_changed(bool state_application_data);
/**
@@ -299,26 +306,35 @@ class ApplicationImpl : public virtual Application,
/**
* @brief SetInitialState sets initial HMI state for application on
* registration
+ * @param window_id window id for HMI state
+ * @param window_name name of inited window
* @param state Hmi state value
*/
- void SetInitialState(HmiStatePtr state) FINAL;
+ void SetInitialState(const WindowID window_id,
+ const std::string& window_name,
+ HmiStatePtr state) FINAL;
/**
* @brief SetRegularState set permanent state of application
- *
+ * @param window_id window id for HMI state
* @param state state to setup
*/
- virtual void SetRegularState(HmiStatePtr state);
+ void SetRegularState(const WindowID window_id, HmiStatePtr state) FINAL;
/**
* @brief SetPostponedState sets postponed state to application.
* This state could be set as regular later
- *
+ * @param window_id window id for HMI state
* @param state state to setup
*/
- virtual void SetPostponedState(HmiStatePtr state);
+ void SetPostponedState(const WindowID window_id, HmiStatePtr state) FINAL;
- virtual void RemovePostponedState();
+ /**
+ * @brief RemovePostponedState removes postponed state for application
+ * After removal, this state will not be set as regular later
+ * @param window_id window id for HMI state
+ */
+ void RemovePostponedState(const WindowID window_id) FINAL;
/**
* @brief AddHMIState the function that will change application's
@@ -328,7 +344,7 @@ class ApplicationImpl : public virtual Application,
*
* @param state new hmi state for certain application.
*/
- virtual void AddHMIState(HmiStatePtr state);
+ void AddHMIState(const WindowID window_id, HmiStatePtr state) FINAL;
/**
* @brief RemoveHMIState the function that will turn back hmi_level after end
@@ -338,13 +354,20 @@ class ApplicationImpl : public virtual Application,
*
* @param state_id that should be removed
*/
- virtual void RemoveHMIState(HmiState::StateID state_id);
+ void RemoveHMIState(const WindowID window_id,
+ HmiState::StateID state_id) FINAL;
/**
* @brief HmiState of application within active events PhoneCall, TTS< etc ...
* @return Active HmiState of application
*/
- virtual const HmiStatePtr CurrentHmiState() const;
+ const HmiStatePtr CurrentHmiState(const WindowID window_i) const FINAL;
+
+ WindowNames GetWindowNames() const FINAL;
+
+ WindowIds GetWindowIds() const FINAL;
+
+ bool WindowIdExists(const WindowID window_id) const FINAL;
/**
* @brief Checks if app is allowed to change audio source
@@ -356,7 +379,7 @@ class ApplicationImpl : public virtual Application,
* @brief RegularHmiState of application without active events VR, TTS etc ...
* @return HmiState of application
*/
- virtual const HmiStatePtr RegularHmiState() const;
+ const HmiStatePtr RegularHmiState(const WindowID window_id) const FINAL;
/**
* @brief PostponedHmiState returns postponed hmi state of application
@@ -364,7 +387,7 @@ class ApplicationImpl : public virtual Application,
*
* @return Postponed hmi state of application
*/
- virtual const HmiStatePtr PostponedHmiState() const;
+ const HmiStatePtr PostponedHmiState(const WindowID window_id) const FINAL;
uint32_t audio_stream_retry_number() const;
@@ -391,6 +414,7 @@ class ApplicationImpl : public virtual Application,
* @param system_context new system context
*/
void set_system_context(
+ const WindowID window_id,
const mobile_api::SystemContext::eType& system_context) OVERRIDE;
/**
* @brief Sets current audio streaming state
@@ -402,7 +426,8 @@ class ApplicationImpl : public virtual Application,
* @brief Sets current HMI level
* @param hmi_level new HMI level
*/
- void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) OVERRIDE;
+ void set_hmi_level(const WindowID window_id,
+ const mobile_api::HMILevel::eType& hmi_level) OVERRIDE;
void PushMobileMessage(
smart_objects::SmartObjectSPtr mobile_message) OVERRIDE;
@@ -546,6 +571,7 @@ class ApplicationImpl : public virtual Application,
sync_primitives::Lock streaming_stop_lock_;
bool is_app_allowed_;
+ bool is_app_data_resumption_allowed_;
bool has_been_activated_;
bool tts_properties_in_none_;
bool tts_properties_in_full_;
@@ -632,7 +658,8 @@ uint32_t ApplicationImpl::app_id() const {
const mobile_api::AudioStreamingState::eType
ApplicationImpl::audio_streaming_state() const {
using namespace mobile_apis;
- const HmiStatePtr hmi_state = CurrentHmiState();
+ const HmiStatePtr hmi_state =
+ CurrentHmiState(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
return hmi_state ? hmi_state->audio_streaming_state()
: AudioStreamingState::INVALID_ENUM;
}
@@ -640,7 +667,8 @@ ApplicationImpl::audio_streaming_state() const {
const mobile_api::VideoStreamingState::eType
ApplicationImpl::video_streaming_state() const {
using namespace mobile_apis;
- const HmiStatePtr hmi_state = CurrentHmiState();
+ const HmiStatePtr hmi_state =
+ CurrentHmiState(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
return hmi_state ? hmi_state->video_streaming_state()
: VideoStreamingState::INVALID_ENUM;
}
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index c34affbf13..a224d51a33 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -203,9 +203,6 @@ class ApplicationManagerImpl
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) OVERRIDE;
- void SendHMIStatusNotification(
- const std::shared_ptr<Application> app) OVERRIDE;
-
void SendDriverDistractionState(ApplicationSharedPtr application);
void SendGetIconUrlNotifications(const uint32_t connection_key,
@@ -476,6 +473,7 @@ class ApplicationManagerImpl
/**
* @brief CreateRegularState create regular HMI state for application
* @param app Application
+ * @param window_type type of window
* @param hmi_level of returned state
* @param audio_state of returned state
* @param system_context of returned state
@@ -483,16 +481,17 @@ class ApplicationManagerImpl
*/
HmiStatePtr CreateRegularState(
std::shared_ptr<Application> app,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::VideoStreamingState::eType video_state,
- mobile_apis::SystemContext::eType system_context) const OVERRIDE;
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
+ const mobile_apis::SystemContext::eType system_context) const OVERRIDE;
/**
* @brief Checks, if given RPC is allowed at current HMI level for specific
* application in policy table
* @param app Application
- * @param hmi_level Current HMI level of application
+ * @param window_id id of application's window
* @param function_id FunctionID of RPC
* @param params_permissions Permissions for RPC parameters (e.g.
* SubscribeVehicleData) defined in policy table
@@ -500,6 +499,7 @@ class ApplicationManagerImpl
*/
mobile_apis::Result::eType CheckPolicyPermissions(
const ApplicationSharedPtr app,
+ const WindowID window_id,
const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions = NULL) OVERRIDE;
@@ -517,32 +517,6 @@ class ApplicationManagerImpl
bool IsApplicationForbidden(uint32_t connection_key,
const std::string& mobile_app_id);
- struct ApplicationsAppIdSorter {
- bool operator()(const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) {
- return lhs->app_id() < rhs->app_id();
- }
- };
-
- struct ApplicationsMobileAppIdSorter {
- bool operator()(const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) {
- if (lhs->policy_app_id() == rhs->policy_app_id()) {
- return lhs->device() < rhs->device();
- }
- return lhs->policy_app_id() < rhs->policy_app_id();
- }
- };
-
- // typedef for Applications list
- typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplictionSet;
-
- // typedef for Applications list iterator
- typedef ApplictionSet::iterator ApplictionSetIt;
-
- // typedef for Applications list const iterator
- typedef ApplictionSet::const_iterator ApplictionSetConstIt;
-
/**
* @brief Notification from PolicyHandler about PTU.
* Compares AppHMIType between saved in app and received from PTU. If they are
@@ -1065,10 +1039,12 @@ class ApplicationManagerImpl
* @brief IsAppInReconnectMode check if application belongs to session
* affected by transport switching at the moment by checking internal
* waiting list prepared on switching start
+ * @param device_id device identifier
* @param policy_app_id Application id
* @return True if application is in the waiting list, otherwise - false
*/
- bool IsAppInReconnectMode(const std::string& policy_app_id) const FINAL;
+ bool IsAppInReconnectMode(const connection_handler::DeviceHandle& device_id,
+ const std::string& policy_app_id) const FINAL;
bool IsStopping() const OVERRIDE {
return is_stopping_;
@@ -1452,8 +1428,8 @@ class ApplicationManagerImpl
connection_handler::ConnectionHandler* connection_handler_;
std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
- request_controller::RequestController request_ctrl_;
std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
+ request_controller::RequestController request_ctrl_;
std::unique_ptr<application_manager::AppServiceManager> app_service_manager_;
/**
diff --git a/src/components/application_manager/include/application_manager/application_state.h b/src/components/application_manager/include/application_manager/application_state.h
index d708a6188d..8c4d2d49d6 100644
--- a/src/components/application_manager/include/application_manager/application_state.h
+++ b/src/components/application_manager/include/application_manager/application_state.h
@@ -32,14 +32,21 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_
+
+#include <map>
#include <vector>
+
#include "application_manager/hmi_state.h"
#include "utils/lock.h"
#include "utils/macro.h"
namespace application_manager {
+typedef std::vector<WindowID> WindowIds;
typedef std::vector<HmiStatePtr> HmiStates;
+typedef std::map<WindowID, HmiStates> HmiStatesMap;
+typedef std::vector<std::string> WindowNames;
+typedef std::map<WindowID, std::string> WindowNamesMap;
/*
* Class represents application state, i.e. current HMI level, audio streaming
@@ -63,94 +70,137 @@ class ApplicationState {
/**
* @brief Init state
+ * @param window_id window id for HMI state
+ * @param window_name name of inited window
* @param state Initial state
*/
- void InitState(HmiStatePtr state);
+ void InitState(const WindowID window_id,
+ const std::string& window_name,
+ HmiStatePtr state);
/**
* @brief Adds state to states storage
+ * @param window_id window id for HMI state
* @param state State of application
*/
- void AddState(HmiStatePtr state);
+ void AddState(const WindowID window_id, HmiStatePtr state);
/**
* @brief Removes state from states storage
+ * @param window_id window id for HMI state
* @param state State of application
*/
- void RemoveState(HmiState::StateID state);
+ void RemoveState(const WindowID window_id, HmiState::StateID state);
/**
* @brief Gets state by state id
+ * @param window_id window id for HMI state
* @param state_id State id
* @return Pointer to application state
*/
- HmiStatePtr GetState(HmiState::StateID state_id) const;
+ HmiStatePtr GetState(const WindowID window_id,
+ HmiState::StateID state_id) const;
+
+ /**
+ * @brief Gets the list of all states matches provided state id
+ * @param state_id state id to get
+ * @return list of all states matches provided state id
+ */
+ HmiStates GetStates(const HmiState::StateID state_id) const;
+
+ /**
+ * @brief Getter for a list of available application windows including the
+ * main
+ * @return list of available window ids
+ */
+ WindowIds GetWindowIds() const;
+
+ /**
+ * @brief Getter f0r a list of all existing window names
+ * @return list of available window names
+ */
+ WindowNames GetWindowNames() const;
private:
/**
* @brief AddHMIState the function that will change application's
* hmi state.
*
- * @param app_id id of the application whose hmi level should be changed.
+ * @param window_id window id for HMI state
*
* @param state new hmi state for certain application.
*/
- void AddHMIState(HmiStatePtr state);
+ void AddHMIState(const WindowID window_id, HmiStatePtr state);
/**
* @brief RemoveHMIState the function that will turn back hmi_level after end
* of some event
*
- * @param app_id id of the application whose hmi level should be changed.
+ * @param window_id window id for HMI state.
*
* @param state_id that should be removed
*/
- void RemoveHMIState(HmiState::StateID state_id);
+ void RemoveHMIState(const WindowID window_id, HmiState::StateID state_id);
+
+ /**
+ * @brief RemoveWindowHMIStates removes all HMI states related to specified
+ * window
+ * @param window_id window ID to remove
+ */
+ void RemoveWindowHMIStates(const WindowID window_id);
/**
* @brief Removes postponed state
+ * @param window_id window id for HMI state
*/
- void RemovePostponedState();
+ void RemovePostponedState(const WindowID window_id);
/**
* @brief Sets regular state of application
+ * @param window_id window id for HMI state
* @param state State of application
*/
- void SetRegularState(HmiStatePtr state);
+ void SetRegularState(const WindowID window_id, HmiStatePtr state);
/**
* @brief Sets postponed state of application.
* This state could be set as regular later on
- *
+ * @param window_id window id for HMI state
* @param state state to setup
*/
- void SetPostponedState(HmiStatePtr state);
+ void SetPostponedState(const WindowID window_id, HmiStatePtr state);
/**
* @brief HmiState of application within active events PhoneCall, TTS< etc ...
+ * @param window_id window id for HMI state
* @return Active HmiState of application
*/
- HmiStatePtr CurrentHmiState() const;
+ HmiStatePtr CurrentHmiState(const WindowID window_id) const;
/**
* @brief RegularHmiState of application without active events VR, TTS etc ...
+ * @param window_id window id for HMI state
* @return HmiState of application
*/
- HmiStatePtr RegularHmiState() const;
+ HmiStatePtr RegularHmiState(const WindowID window_id) const;
/**
* @brief PostponedHmiState returns postponed hmi state of application
* if it's present
- *
+ * @param window_id window id for HMI state
* @return Postponed hmi state of application
*/
- HmiStatePtr PostponedHmiState() const;
+ HmiStatePtr PostponedHmiState(const WindowID window_id) const;
/**
* @brief Active states of application
*/
- HmiStates hmi_states_;
- mutable sync_primitives::Lock hmi_states_lock_;
+ HmiStatesMap hmi_states_map_;
+
+ /**
+ * @brief hmi_states_map_lock_
+ */
+ mutable sync_primitives::Lock hmi_states_map_lock_;
DISALLOW_COPY_AND_ASSIGN(ApplicationState);
};
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
index 0693f9868d..0536c7aee1 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
#include <stdint.h>
+#include "application_manager/hmi_state.h"
#include "smart_objects/smart_object.h"
namespace application_manager {
@@ -93,6 +94,11 @@ class Command {
virtual int32_t function_id() const = 0;
/*
+ * @brief Retrieves Window ID
+ */
+ virtual WindowID window_id() const = 0;
+
+ /*
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
index 4e52ac23ce..a526fede6e 100644
--- a/src/components/application_manager/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -118,6 +118,11 @@ class CommandImpl : public Command {
int32_t function_id() const OVERRIDE;
/*
+ * @brief Retrieves Window ID
+ */
+ WindowID window_id() const OVERRIDE;
+
+ /*
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*
diff --git a/src/components/application_manager/include/application_manager/display_capabilities_builder.h b/src/components/application_manager/include/application_manager/display_capabilities_builder.h
new file mode 100644
index 0000000000..529c9a32c1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/display_capabilities_builder.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DISPLAY_CAPABILITIES_BUILDER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DISPLAY_CAPABILITIES_BUILDER_H_
+#include "application_manager/application.h"
+
+namespace application_manager {
+/**
+ * @brief DisplayCapabilitiesBuilder utility class used for building cached
+ * notification, which is sent to mobile on resumption finish
+ */
+class DisplayCapabilitiesBuilder {
+ typedef std::function<void(Application&, const smart_objects::SmartObject)>
+ ResumeCallback;
+
+ public:
+ /**
+ * @brief DisplayCapabilitiesBuilder class constructor
+ * @param Application reference to application owner
+ */
+ DisplayCapabilitiesBuilder(Application& application);
+
+ /**
+ * @brief InitBuilder initialize builder with callback and windows to be
+ * restored
+ * @param resume_callback callback to be called when notifications for all
+ * windows have been received
+ * @param windows_info SO containing data of windows to be restored
+ */
+ void InitBuilder(ResumeCallback resume_callback,
+ const smart_objects::SmartObject& windows_info);
+
+ /**
+ * @brief UpdateDisplayCapabilities update cached notification
+ * @param display_capabilities to update cached notification with
+ */
+ void UpdateDisplayCapabilities(
+ const smart_objects::SmartObject& display_capabilities);
+
+ /**
+ * @brief ResetDisplayCapabilities resets stored notification
+ */
+ void ResetDisplayCapabilities();
+
+ /**
+ * @brief StopWaitingForWindow stop waiting for window resumption by removing
+ * window_id from windows pending resumption
+ * @param window_id window id to be removed
+ */
+ void StopWaitingForWindow(const WindowID window_id);
+
+ /**
+ * @brief retreives stored notification data
+ */
+ const smart_objects::SmartObjectSPtr display_capabilities() const;
+
+ private:
+ smart_objects::SmartObjectSPtr display_capabilities_;
+ typedef std::set<WindowID> WindowIDsToResume;
+ WindowIDsToResume window_ids_to_resume_;
+ Application& owner_;
+ ResumeCallback resume_callback_;
+ sync_primitives::Lock display_capabilities_lock_;
+};
+} // namespace application_manager
+#endif
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
index 94fc293c3e..c75306345b 100644
--- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
@@ -230,6 +230,20 @@ class HMICapabilitiesImpl : public HMICapabilities {
const smart_objects::SmartObject& display_capabilities) OVERRIDE;
/*
+ * @brief Retrieves information about the display capability
+ * @return Currently supported display capability
+ */
+ const smart_objects::SmartObjectSPtr system_display_capabilities()
+ const OVERRIDE;
+
+ /*
+ * @brief Sets supported display capability
+ * @param display_capabilities supported display capability
+ */
+ void set_system_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities);
+
+ /*
* @brief Retrieves information about the HMI zone capabilities
*
* @return Currently supported HMI zone capabilities
@@ -439,6 +453,14 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool rc_supported() const OVERRIDE;
/*
+ * @brief Retrieves whether HMI supports passed Menu Layout
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool menu_layout_supported(
+ mobile_apis::MenuLayout::eType layout) const OVERRIDE;
+
+ /*
* @brief Interface used to store information regarding
* the navigation "System Capability"
*
@@ -542,6 +564,18 @@ class HMICapabilitiesImpl : public HMICapabilities {
const Json::Value& json_languages,
smart_objects::SmartObject& languages) const OVERRIDE;
+ /*
+ * @brief function that converts a single entry of audio pass thru capability
+ * to smart object
+ *
+ * @param capability json object that represents a single entry of audio pass
+ * thru capability
+ * @param output_so the converted object
+ */
+ void convert_audio_capability_to_obj(
+ const Json::Value& capability,
+ smart_objects::SmartObject& output_so) const OVERRIDE;
+
private:
bool is_vr_cooperating_;
bool is_tts_cooperating_;
@@ -558,7 +592,13 @@ class HMICapabilitiesImpl : public HMICapabilities {
smart_objects::SmartObject* ui_supported_languages_;
smart_objects::SmartObject* tts_supported_languages_;
smart_objects::SmartObject* vr_supported_languages_;
+ /*
+ * display_capabilities_ is deprecated and replaced by
+ * system_display_capabilities_. For backward compatibility
+ * display_capabilities_ is not removed.
+ */
smart_objects::SmartObject* display_capabilities_;
+ smart_objects::SmartObjectSPtr system_display_capabilities_;
smart_objects::SmartObject* hmi_zone_capabilities_;
smart_objects::SmartObject* soft_buttons_capabilities_;
smart_objects::SmartObject* button_capabilities_;
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index b6a4c180e6..e8c2f8b914 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -46,6 +46,7 @@ class ApplicationManager;
class Application;
typedef std::shared_ptr<HmiState> HmiStatePtr;
+typedef int32_t WindowID;
/**
* @brief The HmiState class
@@ -206,11 +207,24 @@ class HmiState {
state_id_ = state_id;
}
+ /**
+ * @brief window_type getter for a window type for this type
+ * @return current state window type
+ */
+ mobile_apis::WindowType::eType window_type() const;
+
+ /**
+ * @brief set_window_type sets current state window type
+ * @param window_type new window type
+ */
+ void set_window_type(const mobile_apis::WindowType::eType window_type);
+
protected:
uint32_t hmi_app_id_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
+ mobile_apis::WindowType::eType window_type_;
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
mobile_apis::VideoStreamingState::eType video_streaming_state_;
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 0642dd3cd1..44046be523 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -42,6 +42,7 @@
#include <application_manager/smart_object_keys.h>
#include "application_manager/application.h"
+#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "connection_handler/device.h"
#include "interfaces/HMI_API.h"
@@ -302,6 +303,30 @@ class MessageHelper {
const uint32_t app_id,
ApplicationManager& app_mngr);
+ /**
+ * @brief Creates UI.CreateWindow request
+ * @param application application instance
+ * @param app_mngr reference to application manager
+ * @param windows_info smart object containing saved windows info
+ * @return smart object with UI.CreateWindow request
+ */
+ static smart_objects::SmartObjectSPtr CreateUICreateWindowRequestToHMI(
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& window_info);
+
+ /**
+ * @brief Creates UI.CreateWindow requests
+ * @param application application instance
+ * @param app_mngr reference to application manager
+ * @param windows_info smart object containing saved windows info
+ * @return list of smart objects with UI.CreateWindow requests
+ */
+ static smart_objects::SmartObjectList CreateUICreateWindowRequestsToHMI(
+ application_manager::ApplicationSharedPtr application,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& windows_info);
+
/*
* @brief Create Common.DeviceInfo struct from device handle
* @param device_handle device handle of the app
@@ -348,15 +373,16 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
- GetBCActivateAppRequestToHMI(
+ static smart_objects::SmartObjectSPtr GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr);
+ static smart_objects::SmartObjectSPtr GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr);
+
static void SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr);
@@ -694,6 +720,23 @@ class MessageHelper {
* @param app current application
*
* @param function_id Unique command id from mobile API
+ *
+ * @param window_id window id containing soft buttons
+ */
+ static void SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id,
+ const WindowID window_id);
+
+ /*
+ * @brief subscribe application to softbutton
+ *
+ * @param message_params contains data of request
+ *
+ * @param app current application
+ *
+ * @param function_id Unique command id from mobile API
*/
static void SubscribeApplicationToSoftButton(
smart_objects::SmartObject& message_params,
@@ -710,6 +753,15 @@ class MessageHelper {
*/
static bool PrintSmartObject(const smart_objects::SmartObject& object);
+ /**
+ * @brief Extract window unique ID from message, this id is used for identify
+ * the window
+ * @param s_map contains application's window id
+ * @return window id from current message
+ */
+ static WindowID ExtractWindowIdFromSmartObject(
+ const smart_objects::SmartObject& s_map);
+
template <typename From, typename To>
static To ConvertEnumAPINoCheck(const From& input) {
return static_cast<To>(input);
@@ -725,6 +777,14 @@ class MessageHelper {
hmi_apis::Common_Language::eType language);
/**
+ * @brief Converts mobile language to string representation
+ * @param language Mobile UI language
+ * @return Mobile language string representation
+ */
+ static std::string MobileLanguageToString(
+ mobile_apis::Language::eType language);
+
+ /**
* @brief Converts string to mobile language enum value
* @param language language as string
* @return Mobile language enum value
@@ -855,10 +915,13 @@ class MessageHelper {
/**
* @brief Sends HMI status notification to mobile
- * @param application_impl application with changed HMI status
+ * @param application application with changed HMI status
+ * @param window_id id of affected window
+ * @param application_manager reference to application manager
**/
static void SendHMIStatusNotification(
- const Application& application_impl,
+ ApplicationSharedPtr application,
+ const WindowID window_id,
ApplicationManager& application_manager);
/**
@@ -892,6 +955,16 @@ class MessageHelper {
static void BroadcastCapabilityUpdate(smart_objects::SmartObject& msg_params,
ApplicationManager& app_mngr);
+ /**
+ * @brief CreateDisplayCapabilityUpdateToMobile creates notification with
+ * updated display capabilities acccoring to message type
+ * @param system_capabilities SO containing notification data
+ * @param app reference to application
+ * @return shared ptr to notification SO
+ */
+ static smart_objects::SmartObjectSPtr CreateDisplayCapabilityUpdateToMobile(
+ const smart_objects::SmartObject& system_capabilities, Application& app);
+
private:
/**
* @brief Allows to fill SO according to the current permissions.
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
index aea0361f19..c3b0d67d67 100644
--- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
@@ -117,7 +117,6 @@ class RPCPlugin {
ApplicationEvent event,
application_manager::ApplicationSharedPtr application) = 0;
};
-typedef std::unique_ptr<RPCPlugin> RPCPluginPtr;
} // namespace plugin_manager
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
index b658e40b1c..abf5494ecb 100644
--- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
@@ -44,6 +44,10 @@ namespace application_manager {
namespace plugin_manager {
class RPCPluginManager {
+ protected:
+ typedef std::unique_ptr<RPCPlugin, std::function<void(RPCPlugin*)> >
+ RPCPluginPtr;
+
public:
virtual ~RPCPluginManager() {}
/**
@@ -59,6 +63,7 @@ class RPCPluginManager {
* @brief GetPlugins get list of plugins
* @return list of loaded plugins
*/
+ DEPRECATED
virtual std::vector<RPCPluginPtr>& GetPlugins() = 0;
/**
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
index 885181e9c4..368817c89c 100644
--- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
@@ -58,12 +58,17 @@ class RPCPluginManagerImpl : public RPCPluginManager {
policy::PolicyHandlerInterface& policy_handler);
uint32_t LoadPlugins(const std::string& plugins_path) OVERRIDE;
+
+ DEPRECATED
std::vector<RPCPluginPtr>& GetPlugins() OVERRIDE;
+
utils::Optional<RPCPlugin> FindPluginToProcess(
const int32_t function_id,
const commands::Command::CommandSource message_source) OVERRIDE;
private:
+ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) const;
+
std::vector<RPCPluginPtr> loaded_plugins_;
ApplicationManager& app_manager_;
rpc_service::RPCService& rpc_service_;
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index abffd3eebb..ccbd466cdd 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -87,11 +87,14 @@ class PolicyHandler : public PolicyHandlerInterface,
bool ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string) OVERRIDE;
bool UnloadPolicyLibrary() OVERRIDE;
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions,
const HMILevel& default_hmi) OVERRIDE;
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions) OVERRIDE;
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -105,6 +108,7 @@ class PolicyHandler : public PolicyHandlerInterface,
std::string* priority) const OVERRIDE;
virtual void CheckPermissions(
const application_manager::ApplicationSharedPtr app,
+ const application_manager::WindowID window_id,
const PTString& rpc,
const RPCParams& rpc_params,
CheckPermissionResult& result) OVERRIDE;
@@ -115,10 +119,12 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Sets HMI default type for specified application
+ * @param device_handle device identifier
* @param application_id ID application
* @param app_types list of HMI types
*/
- void SetDefaultHmiTypes(const std::string& application_id,
+ void SetDefaultHmiTypes(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const smart_objects::SmartObject* app_types) OVERRIDE;
/**
@@ -177,7 +183,8 @@ class PolicyHandler : public PolicyHandlerInterface,
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
- bool GetDefaultHmi(const std::string& policy_app_id,
+ bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -204,6 +211,9 @@ class PolicyHandler : public PolicyHandlerInterface,
uint32_t TimeoutExchangeMSec() const OVERRIDE;
void OnExceededTimeout() OVERRIDE;
void OnSystemReady() OVERRIDE;
+ const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
+ const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const OVERRIDE;
void PTUpdatedAt(Counters counter, int value) OVERRIDE;
void add_listener(PolicyHandlerObserver* listener) OVERRIDE;
void remove_listener(PolicyHandlerObserver* listener) OVERRIDE;
@@ -247,7 +257,8 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
void OnIgnitionCycleOver() OVERRIDE;
- void OnPendingPermissionChange(const std::string& policy_app_id) OVERRIDE;
+ void OnPendingPermissionChange(const std::string& device_id,
+ const std::string& policy_app_id) OVERRIDE;
/**
* Initializes PT exchange at user request
@@ -334,9 +345,11 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Update currently used device id in policies manager for given
* application
+ * @param device_handle device identifier
* @param policy_app_id Application id
*/
std::string OnCurrentDeviceIdUpdateRequired(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) OVERRIDE;
/**
@@ -500,6 +513,7 @@ class PolicyHandler : public PolicyHandlerInterface,
virtual void SendOnAppPermissionsChanged(
const AppPermissions& permissions,
+ const std::string& device_id,
const std::string& policy_app_id) const OVERRIDE;
virtual void OnPTExchangeNeeded() OVERRIDE;
@@ -509,11 +523,13 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Allows to add new or update existed application during
* registration process
+ * @param device_id device identifier
* @param application_id The policy aplication id.
* @param hmi_types list of hmi types
* @return function that will notify update manager about new application
*/
StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
@@ -557,17 +573,21 @@ class PolicyHandler : public PolicyHandlerInterface,
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU.
*
+ * @param device_id device identifier
* @param application_id registered application.
*/
- void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+ void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
/**
* @brief Checks if certain request type is allowed for application
+ * @param device_handle device identifier
* @param policy_app_id Unique applicaion id
* @param type Request type
* @return true, if allowed, otherwise - false
*/
bool IsRequestTypeAllowed(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id,
mobile_apis::RequestType::eType type) const OVERRIDE;
@@ -599,10 +619,12 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Gets application request types
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @return request types
*/
const std::vector<std::string> GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_id,
const std::string& policy_app_id) const OVERRIDE;
/**
@@ -661,6 +683,8 @@ class PolicyHandler : public PolicyHandlerInterface,
void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) FINAL;
+ void OnLockScreenDismissalStateChanged() FINAL;
+
protected:
/**
* Starts next retry exchange policy table
@@ -720,7 +744,7 @@ class PolicyHandler : public PolicyHandlerInterface,
void UpdateHMILevel(application_manager::ApplicationSharedPtr app,
mobile_apis::HMILevel::eType level);
std::vector<std::string> GetDevicesIds(
- const std::string& policy_app_id) OVERRIDE;
+ const std::string& policy_app_id) const OVERRIDE;
/**
* @brief Sets days after epoch on successful policy update
@@ -807,7 +831,6 @@ class PolicyHandler : public PolicyHandlerInterface,
std::vector<FunctionalGroupPermission> CollectAppPermissions(
const uint32_t connection_key);
- private:
static const std::string kLibrary;
/**
@@ -817,7 +840,6 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
void GetRegisteredLinks(std::map<std::string, std::string>& out_links) const;
- private:
mutable sync_primitives::RWLock policy_manager_lock_;
std::shared_ptr<PolicyManager> policy_manager_;
void* dl_handle_;
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 0b744eec7f..11b1bcf926 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -81,6 +81,13 @@ class ResumeCtrl {
application_manager::ApplicationSharedPtr application) = 0;
/**
+ * @brief Restore widgets HMI level on the resumption response from HMI
+ * @param response_message smart_object with HMI message
+ */
+ virtual void RestoreWidgetsHMIState(
+ const smart_objects::SmartObject& response_message) = 0;
+
+ /**
* @brief Set application HMI Level as stored in policy
* @param application is application witch HMI Level is need to setup
* @return true if success, otherwise return false
@@ -103,6 +110,16 @@ class ResumeCtrl {
bool check_policy = true) = 0;
/**
+ * @brief RestoreAppWidgets add widgets for the application
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ * @return true if widgets resumed successfully otherwise - false
+ */
+ virtual void RestoreAppWidgets(
+ application_manager::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) = 0;
+
+ /**
* @brief Remove application from list of saved applications
* @param application is application which need to be removed
* @return return true, if success, otherwise return false
@@ -233,7 +250,7 @@ class ResumeCtrl {
* @param application - application to restore hmi level
* and audio streaming state
*/
- virtual void StartAppHmiStateResumption(
+ virtual bool StartAppHmiStateResumption(
application_manager::ApplicationSharedPtr application) = 0;
/**
@@ -282,6 +299,9 @@ class ResumeCtrl {
virtual int32_t GetSavedAppHmiLevel(const std::string& app_id,
const std::string& device_id) const = 0;
+ virtual void StartWaitingForDisplayCapabilitiesUpdate(
+ app_mngr::ApplicationSharedPtr application) = 0;
+
virtual time_t LaunchTime() const = 0;
#ifdef BUILD_TESTS
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
index a70e2453de..5e6fb58671 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -95,6 +95,9 @@ class ResumeCtrlImpl : public ResumeCtrl,
*/
bool RestoreAppHMIState(app_mngr::ApplicationSharedPtr application) OVERRIDE;
+ void RestoreWidgetsHMIState(
+ const smart_objects::SmartObject& response_message) OVERRIDE;
+
/**
* @brief Set application HMI Level as stored in policy
* @param application is application witch HMI Level is need to setup
@@ -117,6 +120,14 @@ class ResumeCtrlImpl : public ResumeCtrl,
bool check_policy = true) OVERRIDE;
/**
+ * @brief RestoreAppWidgets add widgets for the application
+ * @param application application which will be resumed
+ * @param saved_app application specific section from backup file
+ */
+ void RestoreAppWidgets(application_manager::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) OVERRIDE;
+
+ /**
* @brief Remove application from list of saved applications
* @param application is application which need to be removed
* @return return true, if success, otherwise return false
@@ -250,8 +261,9 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Resume HMI Level and audio streaming state if needed
* @param application - application to restore hmi level
* and audio streaming state
+ * @return true if success otherwise false
*/
- void StartAppHmiStateResumption(
+ bool StartAppHmiStateResumption(
app_mngr::ApplicationSharedPtr application) OVERRIDE;
/**
@@ -296,6 +308,9 @@ class ResumeCtrlImpl : public ResumeCtrl,
int32_t GetSavedAppHmiLevel(const std::string& app_id,
const std::string& device_id) const OVERRIDE;
+ void StartWaitingForDisplayCapabilitiesUpdate(
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
/**
* @brief geter for launch_time_
* @return value of launch_time_
@@ -592,6 +607,16 @@ class ResumeCtrlImpl : public ResumeCtrl,
app_mngr::ApplicationConstSharedPtr application) const;
/**
+ * @brief Constructs and sends system capability mobile notification
+ *
+ * @param app to send display capabilities updated
+ * @param display_capabilities SO containing notification data
+ */
+ void ProcessSystemCapabilityUpdated(
+ app_mngr::Application& app,
+ const smart_objects::SmartObject& display_capabilities);
+
+ /**
*@brief Mapping applications to time_stamps
* wait for timer to resume HMI Level
*
@@ -609,6 +634,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
time_t wake_up_time_;
std::shared_ptr<ResumptionData> resumption_storage_;
application_manager::ApplicationManager& application_manager_;
+ /**
+ *@brief Mapping correlation id to request
+ *wait for on event response from HMI to resume HMI Level
+ */
+ typedef std::map<int32_t, smart_objects::SmartObjectSPtr>
+ WaitingResponseToRequest;
+ WaitingResponseToRequest requests_msg_;
};
} // namespace resumption
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index 7db7a09cb4..d1dada345c 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
+/*
+ * Copyright (c) 2019, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -256,6 +256,14 @@ class ResumptionData {
app_mngr::ApplicationConstSharedPtr application) const;
/**
+ * @brief Retrieves of windows info from list of available window
+ * @param application contains list of available windows
+ * @return windows info from list of available window
+ */
+ smart_objects::SmartObject GetApplicationWidgetsInfo(
+ app_mngr::ApplicationConstSharedPtr application) const;
+
+ /**
* @brief checks pointer that it is not equal NULL
* @param ptr - contains pointer which need to check
* @return smartObject from pointer
@@ -264,6 +272,21 @@ class ResumptionData {
const smart_objects::SmartObject* ptr) const;
/**
+ * @brief creates smart object containing window info
+ * @param window_id window id
+ * @param window_type window type
+ * @param window_name window name
+ * @param window_optional_params_map collection containing optional params for
+ * creating window
+ * @return smart object with window data
+ */
+ smart_objects::SmartObject CreateWindowInfoSO(
+ const application_manager::WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const application_manager::WindowParamsMap& window_optional_params_map)
+ const;
+
+ /**
* @brief Creates smart array from received data
* @param first - iterator points to beginning of the data
* @param last - iterator points to ending of the data
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index fc124f7558..1831d8cb4d 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2019, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -53,6 +53,7 @@ extern const char* info;
extern const char* app_id;
extern const char* full_app_id;
extern const char* bundle_id;
+extern const char* window_id;
extern const char* app_info;
extern const char* app_launch;
extern const char* app_launch_list;
@@ -92,6 +93,7 @@ extern const char* main_field_1;
extern const char* main_field_2;
extern const char* main_field_3;
extern const char* main_field_4;
+extern const char* template_title;
extern const char* metadata_tags;
extern const char* eta;
extern const char* time_to_destination;
@@ -114,6 +116,8 @@ extern const char* num_ticks;
extern const char* slider_footer;
extern const char* menu_id;
extern const char* menu_name;
+extern const char* menu_layout;
+extern const char* menu_layouts_available;
extern const char* interaction_choice_set_id;
extern const char* interaction_choice_set_id_list;
extern const char* choice_set;
@@ -129,7 +133,10 @@ extern const char* initial_prompt;
extern const char* initial_text;
extern const char* duration;
extern const char* progress_indicator;
+extern const char* func_id;
+extern const char* cancel_id;
extern const char* alert_type;
+extern const char* alert_icon;
extern const char* play_tone;
extern const char* soft_buttons;
extern const char* soft_button_id;
@@ -166,9 +173,17 @@ extern const char* activate_app_hmi_level;
extern const char* audio_streaming_state;
extern const char* video_streaming_state;
extern const char* system_context;
+extern const char* window_name;
+extern const char* window_type;
+extern const char* window_type_supported;
+extern const char* maximum_number_of_windows;
+extern const char* window_capabilities;
+extern const char* associated_service_type;
+extern const char* duplicate_updates_from_window_id;
extern const char* speech_capabilities;
extern const char* vr_capabilities;
extern const char* audio_pass_thru_capabilities;
+extern const char* audio_pass_thru_capabilities_list;
extern const char* pcm_stream_capabilities;
extern const char* audio_pass_thru_icon;
extern const char* way_points;
@@ -189,6 +204,8 @@ extern const char* red;
extern const char* green;
extern const char* blue;
extern const char* display_layout;
+extern const char* template_configuration;
+extern const char* template_layout;
extern const char* icon_resumed;
extern const char* nicknames;
extern const char* enabled;
@@ -198,6 +215,7 @@ extern const char* hybrid_app_preference;
extern const char* is_cloud_application;
extern const char* cloud_connection_status;
extern const char* endpoint;
+extern const char* display_capabilities;
// PutFile
extern const char* sync_file_name;
@@ -216,6 +234,7 @@ extern const char* is_template;
extern const char* image;
extern const char* type;
extern const char* system_file;
+extern const char* is_system_file;
extern const char* offset;
extern const char* length;
extern const char* secondary_image;
@@ -254,6 +273,7 @@ extern const char* key_press_mode;
// duplicate names from hmi_request
extern const char* limited_character_list;
extern const char* auto_complete_text;
+extern const char* auto_complete_list;
extern const char* navigation_text;
// vehicle info
@@ -344,6 +364,10 @@ extern const char* activate;
extern const char* set_as_default;
extern const char* origin_app;
+// sis data
+extern const char* station_short_name;
+extern const char* station_location;
+
// resuming
extern const char* application_commands;
extern const char* application_submenus;
@@ -364,11 +388,16 @@ extern const char* ign_off_count;
extern const char* global_ign_on_counter;
+extern const char* suspend_count;
+
extern const char* connection_info;
extern const char* is_download_complete;
+extern const char* shifted;
+extern const char* altitude;
extern const char* longitude_degrees;
extern const char* latitude_degrees;
+
extern const char* address;
extern const char* country_name;
extern const char* country_code;
@@ -397,6 +426,8 @@ extern const char* delivery_mode;
extern const char* audio_streaming_indicator;
+extern const char* windows_info;
+
// keys for default parameters loaded from hmi_capabilities.json:
extern const char* const keyboard_properties_default;
extern const char* const language_default;
@@ -409,7 +440,6 @@ extern const char* const language_supported;
extern const char* const keyboard_layout_supported;
extern const char* const keypress_mode_supported;
extern const char* const limited_characters_list_supported;
-extern const char* const auto_complete_text_supported;
extern const char* const send_location_enabled;
extern const char* const get_way_points_enabled;
extern const char* const entity_type;
@@ -430,6 +460,9 @@ extern const char* const resolution_height;
extern const char* const max_bitrate;
extern const char* const supported_formats;
extern const char* const haptic_spatial_data_supported;
+extern const char* const diagonal_screen_size;
+extern const char* const pixel_per_inch;
+extern const char* const scale;
extern const char* const haptic_rect_data;
extern const char* const rect;
extern const char* const x;
@@ -472,6 +505,8 @@ namespace mobile_notification {
extern const char* state;
extern const char* syncp_timeout;
extern const char* syncp_url;
+extern const char* lock_screen_dismissal_enabled;
+extern const char* lock_screen_dismissal_warning;
} // namespace mobile_notification
namespace hmi_levels {
@@ -518,7 +553,7 @@ extern const char* keyboard_properties;
extern const char* method_name;
extern const char* keyboard_layout;
extern const char* limited_character_list;
-extern const char* auto_complete_text;
+extern const char* auto_complete_list;
extern const char* file;
extern const char* file_name;
extern const char* retry;
diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h
index f3b2966fca..000569e450 100644
--- a/src/components/application_manager/include/application_manager/state_controller_impl.h
+++ b/src/components/application_manager/include/application_manager/state_controller_impl.h
@@ -52,155 +52,101 @@ class StateControllerImpl : public event_engine::EventObserver,
public:
explicit StateControllerImpl(ApplicationManager& app_mngr);
- /**
- * @brief SetRegularState setup regular hmi state, that will appear if
- * no specific events are active
- * @param app appication to setup regular State
- * @param state state of new regular state
- */
-
- virtual void SetRegularState(ApplicationSharedPtr app,
- HmiStatePtr state,
- const bool SendActivateApp);
-
- /**
- * @brief SetRegularState Change regular hmi level and audio state
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @paran video_state of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
+ void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr state,
+ const bool SendActivateApp) OVERRIDE;
- virtual void SetRegularState(
+ void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp);
-
- /**
- * @brief SetRegularState Change regular hmi level
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI
- */
- virtual void SetRegularState(ApplicationSharedPtr app,
- const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp);
+ const bool SendActivateApp) OVERRIDE;
- /**
- * @brief SetRegularState Change regular hmi level, audio state and system
- * context
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @param video_state of new regular state
- * @param system_context of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
+ void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const bool SendActivateApp) OVERRIDE;
- virtual void SetRegularState(
+ void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp);
+ const bool SendActivateApp) OVERRIDE;
- /**
- * @brief SetRegularState Sets regular state with new hmi level
- * to application
- * @param app appication to setup regular state
- * @param hmi_level new hmi level for application
- */
- virtual void SetRegularState(ApplicationSharedPtr app,
- const mobile_apis::HMILevel::eType hmi_level);
+ void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ const mobile_apis::HMILevel::eType hmi_level) OVERRIDE;
- /**
- * @brief SetRegularState Change regular audio state
- * @param app appication to setup regular State
- * @param audio_state of new regular state
- * @param video_state of new regular state
- */
- virtual void SetRegularState(
+ void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::AudioStreamingState::eType audio_state,
- const mobile_apis::VideoStreamingState::eType video_state);
+ const mobile_apis::VideoStreamingState::eType video_state) OVERRIDE;
- /**
- * @brief SetRegularState Change regular system context
- * @param app appication to setup regular State
- * @param system_context of new regular state
- */
- virtual void SetRegularState(
+ void SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::SystemContext::eType system_context);
+ const WindowID window_id,
+ const mobile_apis::SystemContext::eType system_context) OVERRIDE;
- /**
- * @brief SetRegularState Sets new regular state to application
- * @param app appication to setup regular state
- * @param state new hmi state for application
- */
- virtual void SetRegularState(ApplicationSharedPtr app, HmiStatePtr state);
+ void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr state) OVERRIDE;
- // EventObserver interface
- void on_event(const event_engine::Event& event);
- void on_event(const event_engine::MobileEvent& event);
+ void OnApplicationRegistered(
+ ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType default_level) OVERRIDE;
- /**
- * @brief Sets default application state and apply currently active HMI states
- * on application registration
- * @param app application to apply states
- * @param default_level default HMI level
- */
- virtual void OnApplicationRegistered(
+ void OnAppWindowAdded(
ApplicationSharedPtr app,
- const mobile_apis::HMILevel::eType default_level);
+ const WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType default_level) OVERRIDE;
- /**
- * @brief OnVideoStreamingStarted process video streaming started
- * @param app projection or navigation application starting streaming
- */
- virtual void OnVideoStreamingStarted(ApplicationConstSharedPtr app);
+ void OnVideoStreamingStarted(ApplicationConstSharedPtr app) OVERRIDE;
- /**
- * @brief OnVideoStreamingStopped process video streaming stopped
- * @param app projection or navigation application stopping streaming
- */
- virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app);
+ void OnVideoStreamingStopped(ApplicationConstSharedPtr app) OVERRIDE;
- /**
- * @brief OnStateChanged send HMIStatusNotification if needed
- * @param app application
- * @param old_state state before change
- * @param new_state state after change
- */
- virtual void OnStateChanged(ApplicationSharedPtr app,
- HmiStatePtr old_state,
- HmiStatePtr new_state);
+ void OnStateChanged(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr old_state,
+ HmiStatePtr new_state) OVERRIDE;
- /**
- * @brief Checks activity of Deactivate HMI state.
- * @return Returns TRUE if deactivate HMI state is active, otherwise returns
- * FALSE.
- */
- virtual bool IsStateActive(HmiState::StateID state_id) const;
+ bool IsStateActive(HmiState::StateID state_id) const OVERRIDE;
+
+ // EventObserver interface
+ void on_event(const event_engine::Event& event) OVERRIDE;
+ void on_event(const event_engine::MobileEvent& event) OVERRIDE;
+
+ void ActivateDefaultWindow(ApplicationSharedPtr app) OVERRIDE;
+ void ExitDefaultWindow(ApplicationSharedPtr app) OVERRIDE;
private:
- int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority);
+ int64_t RequestHMIStateChange(ApplicationConstSharedPtr app,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority);
/**
* @brief The HmiLevelConflictResolver struct
* Move other application to HmiStates if applied moved to FULL or LIMITED
*/
struct HmiLevelConflictResolver {
const ApplicationSharedPtr applied_;
+ const WindowID window_id_;
const HmiStatePtr state_;
StateControllerImpl* state_ctrl_;
HmiLevelConflictResolver(const ApplicationSharedPtr app,
+ const WindowID window_id,
const HmiStatePtr state,
StateControllerImpl* state_ctrl)
- : applied_(app), state_(state), state_ctrl_(state_ctrl) {}
+ : applied_(app)
+ , window_id_(window_id)
+ , state_(state)
+ , state_ctrl_(state_ctrl) {}
void operator()(ApplicationSharedPtr to_resolve);
};
@@ -298,14 +244,19 @@ class StateControllerImpl : public event_engine::EventObserver,
template <HmiState::StateID ID>
void HMIStateStarted(ApplicationSharedPtr app) {
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr old_hmi_state = app->CurrentHmiState();
- HmiStatePtr new_hmi_state = CreateHmiState(app, ID);
- DCHECK_OR_RETURN_VOID(new_hmi_state);
- DCHECK_OR_RETURN_VOID(new_hmi_state->state_id() !=
- HmiState::STATE_ID_REGULAR);
- new_hmi_state->set_parent(old_hmi_state);
- app->AddHMIState(new_hmi_state);
- OnStateChanged(app, old_hmi_state, new_hmi_state);
+ const WindowIds window_ids = app->GetWindowIds();
+
+ for (auto window_id : window_ids) {
+ HmiStatePtr old_hmi_state = app->CurrentHmiState(window_id);
+ HmiStatePtr new_hmi_state = CreateHmiState(app, ID);
+ DCHECK_OR_RETURN_VOID(new_hmi_state);
+ DCHECK_OR_RETURN_VOID(new_hmi_state->state_id() !=
+ HmiState::STATE_ID_REGULAR);
+ new_hmi_state->set_parent(old_hmi_state);
+ new_hmi_state->set_window_type(old_hmi_state->window_type());
+ app->AddHMIState(window_id, new_hmi_state);
+ OnStateChanged(app, window_id, old_hmi_state, new_hmi_state);
+ }
}
/**
@@ -326,7 +277,7 @@ class StateControllerImpl : public event_engine::EventObserver,
* depends on application type
* @param app Application to deactivate
*/
- void DeactivateApp(ApplicationSharedPtr app);
+ void DeactivateApp(ApplicationSharedPtr app, const WindowID window_id);
/**
* Function to remove temporary HmiState for application
@@ -334,54 +285,78 @@ class StateControllerImpl : public event_engine::EventObserver,
template <HmiState::StateID ID>
void HMIStateStopped(ApplicationSharedPtr app) {
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr cur = app->CurrentHmiState();
- HmiStatePtr old_hmi_state =
- CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
- DCHECK_OR_RETURN_VOID(old_hmi_state);
- old_hmi_state->set_hmi_level(cur->hmi_level());
- old_hmi_state->set_audio_streaming_state(cur->audio_streaming_state());
- old_hmi_state->set_video_streaming_state(cur->video_streaming_state());
- old_hmi_state->set_system_context(cur->system_context());
- app->RemoveHMIState(ID);
- HmiStatePtr new_hmi_state = app->CurrentHmiState();
- OnStateChanged(app, old_hmi_state, new_hmi_state);
+ const WindowIds window_ids = app->GetWindowIds();
+
+ for (auto window_id : window_ids) {
+ HmiStatePtr cur = app->CurrentHmiState(window_id);
+ HmiStatePtr old_hmi_state =
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(old_hmi_state);
+ old_hmi_state->set_hmi_level(cur->hmi_level());
+ old_hmi_state->set_window_type(cur->window_type());
+ old_hmi_state->set_audio_streaming_state(cur->audio_streaming_state());
+ old_hmi_state->set_video_streaming_state(cur->video_streaming_state());
+ old_hmi_state->set_system_context(cur->system_context());
+ app->RemoveHMIState(window_id, ID);
+ HmiStatePtr new_hmi_state = app->CurrentHmiState(window_id);
+ OnStateChanged(app, window_id, old_hmi_state, new_hmi_state);
+ }
}
/**
* @brief ApplyRegularState setup regular hmi state, that will appear if no
* specific events are active, without sending ActivateApp
* @param app appication to setup default State
+ * @param window_id id of applicaion's window to apply HMI state
* @param state state of new defailt state
*/
- void ApplyRegularState(ApplicationSharedPtr app, HmiStatePtr state);
+ void ApplyRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr state);
+
+ /**
+ * @brief UpdateAppWindowsStreamingState updates all application windows
+ * audio/video streaming state according to a new HMI state of the main window
+ * @param app pointer to affected application
+ * @param state pointer to state with the new streaming state of the main
+ * window
+ */
+ void UpdateAppWindowsStreamingState(ApplicationSharedPtr app,
+ HmiStatePtr state);
/**
* @brief SetupRegularHmiState set regular HMI State without
* resolving conflicts and ActivateApp request
* @param app application
+ * @param window_id id of applicaion's window to apply HMI state
* @param state hmi_state to setup
*/
- void SetupRegularHmiState(ApplicationSharedPtr app, HmiStatePtr state);
+ void SetupRegularHmiState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr state);
/**
* @brief SetupRegularHmiState set regular HMI State without
* resolving conflicts and ActivateApp request
* @param app application
+ * @param window_id id of applicaion's window to apply HMI state
* @param hmi_level of new regular state
* @param audio_state of new regular state
* @param video_state of new regular state
*/
void SetupRegularHmiState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state);
/**
- * @brief OnActivateAppResponse calback for activate app response
+ * @brief OnHMIResponse callback for activate app or close application
+ * response
* @param message Smart Object
*/
- void OnActivateAppResponse(const smart_objects::SmartObject& message);
+ void OnHMIResponse(const smart_objects::SmartObject& message);
/**
* @brief OnAppDeactivated callback for OnAppDeactivated notification
@@ -449,7 +424,7 @@ class StateControllerImpl : public event_engine::EventObserver,
typedef std::list<HmiState::StateID> StateIDList;
StateIDList active_states_;
mutable sync_primitives::Lock active_states_lock_;
- std::map<uint32_t, HmiStatePtr> waiting_for_activate_;
+ std::map<uint32_t, HmiStatePtr> waiting_for_response_;
ApplicationManager& app_mngr_;
};
} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
index 1e23aac8ee..ef215cdd5a 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
@@ -53,22 +53,25 @@ collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands")
set(LIBRARIES
HMI_API
MOBILE_API
+ MessageHelper
ApplicationManager
+ Resumption
v4_protocol_v1_2_no_extra
SmartObjects
Utils
- sdl_rpc_plugin
+ sdl_rpc_plugin_static
)
if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_library("app_service_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES})
-target_link_libraries("app_service_rpc_plugin" ${LIBRARIES})
+add_library("app_service_rpc_plugin_static" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
+target_link_libraries("app_service_rpc_plugin_static" ${LIBRARIES})
+
+add_library("app_service_rpc_plugin" SHARED "src/app_service_rpc_plugin.cc")
+target_link_libraries("app_service_rpc_plugin" app_service_rpc_plugin_static)
-add_library("AppServiceRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
-target_link_libraries("AppServiceRpcPluginStaticLib" ${LIBRARIES})
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
index c9cb98cdfb..1120f68327 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
@@ -69,5 +69,6 @@ class AppServiceRpcPlugin : public plugins::RPCPlugin {
} // namespace app_service_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data);
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h
new file mode 100644
index 0000000000..fdeadfa7c0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASUnpublishAppServiceRequest command class
+ **/
+class ASUnpublishAppServiceRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASUnpublishAppServiceRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASUnpublishAppServiceRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ASUnpublishAppServiceRequest class destructor
+ **/
+ virtual ~ASUnpublishAppServiceRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASUnpublishAppServiceRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h
new file mode 100644
index 0000000000..51edd2dadb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASUnpublishAppServiceResponse command class
+ **/
+class ASUnpublishAppServiceResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASUnpublishAppServiceResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASUnpublishAppServiceResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ASUnpublishAppServiceResponse class destructor
+ **/
+ virtual ~ASUnpublishAppServiceResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASUnpublishAppServiceResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_UNPUBLISH_APP_SERVICE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h
new file mode 100644
index 0000000000..4a883b92ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnpublishAppServiceRequest command class
+ **/
+class UnpublishAppServiceRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UnpublishAppServiceRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnpublishAppServiceRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UnpublishAppServiceRequest class destructor
+ **/
+ virtual ~UnpublishAppServiceRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnpublishAppServiceRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h
new file mode 100644
index 0000000000..512e39eea0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnpublishAppServiceResponse command class
+ **/
+class UnpublishAppServiceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UnpublishAppServiceResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnpublishAppServiceResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UnpublishAppServiceResponse class destructor
+ **/
+ virtual ~UnpublishAppServiceResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnpublishAppServiceResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_UNPUBLISH_APP_SERVICE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
index 1cec2ccdce..3090ea8ced 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
@@ -50,6 +50,8 @@
#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h"
#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h"
#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h"
+#include "app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h"
+#include "app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h"
#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h"
#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h"
@@ -126,6 +128,11 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator(
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::ASPublishAppServiceRequest>()
: factory.GetCreator<commands::ASPublishAppServiceResponse>();
+ case hmi_apis::FunctionID::AppService_UnpublishAppService:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ASUnpublishAppServiceRequest>()
+ : factory
+ .GetCreator<commands::ASUnpublishAppServiceResponse>();
case hmi_apis::FunctionID::AppService_OnAppServiceData:
return app_mngr::commands::Command::CommandSource::SOURCE_HMI == source
? factory.GetCreator<
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
index 76be96cf8f..5c44fb5fae 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
@@ -47,6 +47,8 @@
#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h"
#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h"
#include "app_service_rpc_plugin/commands/mobile/publish_app_service_response.h"
+#include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h"
+#include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
@@ -120,6 +122,16 @@ app_mngr::CommandCreator& AppServiceMobileCommandFactory::buildCommandCreator(
return factory.GetCreator<commands::PublishAppServiceResponse>();
}
break;
+ case mobile_apis::FunctionID::UnpublishAppServiceID:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source &&
+ mobile_apis::messageType::response != message_type) {
+ return factory.GetCreator<commands::UnpublishAppServiceRequest>();
+ } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL ==
+ source &&
+ mobile_apis::messageType::request != message_type) {
+ return factory.GetCreator<commands::UnpublishAppServiceResponse>();
+ }
+ break;
case mobile_apis::FunctionID::OnAppServiceDataID:
return app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source
? factory.GetCreator<
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
index 3b1b0715d4..7195ce234f 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
@@ -93,6 +93,13 @@ void AppServiceRpcPlugin::DeleteSubscriptions(
} // namespace app_service_rpc_plugin
-extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+extern "C" __attribute__((visibility("default")))
+application_manager::plugin_manager::RPCPlugin*
+Create() {
return new app_service_rpc_plugin::AppServiceRpcPlugin();
}
+
+extern "C" __attribute__((visibility("default"))) void Delete(
+ application_manager::plugin_manager::RPCPlugin* data) {
+ delete data;
+} \ No newline at end of file
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc
new file mode 100644
index 0000000000..30905b5fa2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc
@@ -0,0 +1,97 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_request.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASUnpublishAppServiceRequest::ASUnpublishAppServiceRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASUnpublishAppServiceRequest::~ASUnpublishAppServiceRequest() {}
+
+void ASUnpublishAppServiceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::service_id].asString();
+
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service || service->mobile_service) {
+ SendErrorResponse(
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_UnpublishAppService,
+ hmi_apis::Common_Result::INVALID_ID,
+ "Invalid Service ID",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return;
+ }
+
+ bool ret = application_manager_.GetAppServiceManager().UnpublishAppService(
+ service_id);
+
+ if (!ret) {
+ SendErrorResponse(
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_UnpublishAppService,
+ hmi_apis::Common_Result::REJECTED,
+ "The app service with that requested service ID does not exist",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return;
+ }
+
+ SendResponse(true,
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_UnpublishAppService,
+ hmi_apis::Common_Result::SUCCESS,
+ NULL,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc
new file mode 100644
index 0000000000..0c8b479da8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_unpublish_app_service_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASUnpublishAppServiceResponse::ASUnpublishAppServiceResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASUnpublishAppServiceResponse::~ASUnpublishAppServiceResponse() {}
+
+void ASUnpublishAppServiceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
index c168b4bf2f..53d1bf82fa 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
@@ -120,12 +120,6 @@ void PublishAppServiceRequest::Run() {
return;
}
- if (app->IsFullscreen()) {
- // Service should be activated if app is in the foreground
- application_manager_.GetAppServiceManager().ActivateAppService(
- service_record[strings::service_id].asString());
- }
-
response_params[strings::app_service_record] = service_record;
SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc
new file mode 100644
index 0000000000..2cb43bce07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnpublishAppServiceRequest::UnpublishAppServiceRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnpublishAppServiceRequest::~UnpublishAppServiceRequest() {}
+
+void UnpublishAppServiceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::service_id].asString();
+
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+
+ if (!service || service->connection_key != connection_key()) {
+ SendResponse(false,
+ mobile_apis::Result::INVALID_ID,
+ "No app service with the requested service ID was published "
+ "by this application");
+ return;
+ }
+
+ bool ret = application_manager_.GetAppServiceManager().UnpublishAppService(
+ service_id);
+
+ if (!ret) {
+ SendResponse(
+ false,
+ mobile_apis::Result::INVALID_ID,
+ "The app service with that requested service ID does not exist");
+ return;
+ }
+
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, NULL);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc
new file mode 100644
index 0000000000..22450ecc4c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnpublishAppServiceResponse::UnpublishAppServiceResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnpublishAppServiceResponse::~UnpublishAppServiceResponse() {}
+
+void UnpublishAppServiceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
index 0b56ddb7e9..0b69c01606 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
@@ -25,16 +25,8 @@ file(GLOB SOURCES
set(LIBRARIES
gmock
- Utils
- SmartObjects
- HMI_API
- MOBILE_API
- connectionHandler
- app_service_rpc_plugin
- sdl_rpc_plugin
- jsoncpp
- Policy
- Resumption
+ sdl_rpc_plugin_static
+ app_service_rpc_plugin_static
)
create_cotired_test("app_services_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index f64f353767..4236ac23f9 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -53,6 +53,8 @@
#include "hmi/as_perform_app_service_interaction_response_to_hmi.h"
#include "hmi/as_publish_app_service_request.h"
#include "hmi/as_publish_app_service_response.h"
+#include "hmi/as_unpublish_app_service_request.h"
+#include "hmi/as_unpublish_app_service_response.h"
#include "hmi/on_as_app_service_data_notification.h"
#include "hmi/on_as_app_service_data_notification_from_hmi.h"
@@ -132,6 +134,8 @@ typedef Types<commands::ASAppServiceActivationRequest,
commands::ASPerformAppServiceInteractionResponseToHMI,
commands::ASPublishAppServiceRequest,
commands::ASPublishAppServiceResponse,
+ commands::ASUnpublishAppServiceRequest,
+ commands::ASUnpublishAppServiceResponse,
commands::OnASAppServiceDataNotification,
commands::OnASAppServiceDataNotificationFromHMI>
HMICommandsListFirst;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
index e77b21ca6d..69bff3ad76 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -49,6 +49,8 @@
#include "mobile/perform_app_service_interaction_response_from_mobile.h"
#include "mobile/publish_app_service_request.h"
#include "mobile/publish_app_service_response.h"
+#include "mobile/unpublish_app_service_request.h"
+#include "mobile/unpublish_app_service_response.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
@@ -118,7 +120,9 @@ typedef Types<commands::GetAppServiceDataRequest,
commands::PerformAppServiceInteractionResponse,
commands::PerformAppServiceInteractionResponseFromMobile,
commands::PublishAppServiceRequest,
- commands::PublishAppServiceResponse>
+ commands::PublishAppServiceResponse,
+ commands::UnpublishAppServiceRequest,
+ commands::UnpublishAppServiceResponse>
MobileCommandsListFirst;
TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
index 00de927b6e..8129e1240d 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
@@ -50,7 +50,10 @@ collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands")
set(LIBRARIES
HMI_API
MOBILE_API
+ MessageHelper
ApplicationManager
+ ProtocolHandler
+ connectionHandler
v4_protocol_v1_2_no_extra
SmartObjects
Utils
@@ -60,11 +63,12 @@ if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_library("rc_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES})
-target_link_libraries("rc_rpc_plugin" ${LIBRARIES})
+add_library("rc_rpc_plugin_static" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
+target_link_libraries("rc_rpc_plugin_static" ${LIBRARIES})
+
+add_library("rc_rpc_plugin" SHARED "src/rc_rpc_plugin.cc")
+target_link_libraries("rc_rpc_plugin" rc_rpc_plugin_static)
-add_library("RCRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
-target_link_libraries("RCRpcPluginStaticLib" ${LIBRARIES})
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
index cd87ad326e..e85ab758ad 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
@@ -91,6 +91,15 @@ class RCHelpers {
AppsModules;
static AppsModules GetApplicationsAllowedModules(
application_manager::ApplicationManager& app_mngr);
+
+ /**
+ * @brief RemoveRedundantGPSDataFromVIDataMsg removes redundant GPS data
+ * params from interior vehicle data response message if one contains radio
+ * station location data
+ * @param msg_params Params of the interior vehicle data response message
+ */
+ static void RemoveRedundantGPSDataFromIVDataMsg(
+ smart_objects::SmartObject& msg_params);
};
} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
index 92ff7e5f01..b9f922a1be 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
@@ -152,6 +152,7 @@ const char kBand[] = "band";
const char kRdsData[] = "rdsData";
const char kHdRadioEnable[] = "hdRadioEnable";
const char kAvailableHDs[] = "availableHDs";
+const char kAvailableHdChannels[] = "availableHdChannels";
const char kHdChannel[] = "hdChannel";
const char kSignalStrength[] = "signalStrength";
const char kSignalChangeThreshold[] = "signalChangeThreshold";
@@ -176,6 +177,8 @@ const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable";
const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable";
const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable";
const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable";
+const char kClimateEnable[] = "climateEnable";
+const char kClimateEnableAvailable[] = "climateEnableAvailable";
// ClimateControlData struct
// LightControlData
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
index 303b31f857..cd15674889 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
@@ -109,5 +109,6 @@ class RCRPCPlugin : public plugins::RPCPlugin {
} // namespace rc_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data);
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
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 47363bddcd..ded96461f5 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
@@ -109,6 +109,7 @@ void GetInteriorVehicleDataRequest::FilterDisabledModuleData(
module_data[message_params::kHdRadioEnable].asBool() == false) {
module_data.erase(message_params::kHdChannel);
module_data.erase(message_params::kAvailableHDs);
+ module_data.erase(message_params::kAvailableHdChannels);
module_data.erase(message_params::kSisData);
}
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
index a7572f1d62..b1fa8d6ea0 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
@@ -31,6 +31,7 @@
*/
#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -49,6 +50,9 @@ GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {}
void GetInteriorVehicleDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
+
+ RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ (*message_)[app_mngr::strings::msg_params]);
application_manager_.GetRPCService().SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
index 53b04ce3ef..06b5218bb3 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
@@ -75,6 +75,8 @@ void OnInteriorVehicleDataNotification::Run() {
typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_);
+ RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ (*message_)[app_mngr::strings::msg_params]);
for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
DCHECK(*it);
application_manager::Application& app = **it;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
index 2bf8fbbe92..44d302276d 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
@@ -55,6 +55,7 @@ std::vector<std::string> GetModuleReadOnlyParams(
} else if (enums_value::kRadio == module_type) {
module_ro_params.push_back(kRdsData);
module_ro_params.push_back(kAvailableHDs);
+ module_ro_params.push_back(kAvailableHdChannels);
module_ro_params.push_back(kSignalStrength);
module_ro_params.push_back(kSignalChangeThreshold);
module_ro_params.push_back(kState);
@@ -92,6 +93,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable";
mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable";
mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable";
+ mapping["climateEnable"] = "climateEnableAvailable";
+ mapping["climateEnableAvailable"] = "climateEnableAvailable";
// radio
mapping["band"] = "radioBandAvailable";
@@ -99,7 +102,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["frequencyFraction"] = "radioFrequencyAvailable";
mapping["rdsData"] = "rdsDataAvailable";
mapping["availableHDs"] = "availableHDsAvailable";
- mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["availableHdChannels"] = "availableHdChannelsAvailable";
+ mapping["hdChannel"] = "availableHdChannelsAvailable";
mapping["hdRadioEnable"] = "hdRadioEnableAvailable";
mapping["signalStrength"] = "signalStrengthAvailable";
mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
@@ -716,21 +720,6 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
const smart_objects::SmartObject& module_type_params =
ControlData(module_data);
const std::string module_type = ModuleType();
- std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
-
- for (auto& it : ro_params) {
- if (module_type_params.keyExists(it)) {
- if (enums_value::kClimate == module_type) {
- module_data[message_params::kClimateControlData].erase(it);
- } else if (enums_value::kRadio == module_type) {
- module_data[message_params::kRadioControlData].erase(it);
- } else {
- continue;
- }
-
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
- }
- }
if (enums_value::kAudio == module_type) {
auto& equalizer_settings = module_data[message_params::kAudioControlData]
@@ -745,6 +734,15 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
}
}
}
+
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ for (const auto& param : ro_params) {
+ if (module_type_params.keyExists(param)) {
+ module_data[data_mapping(module_type)].erase(param);
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << param);
+ }
+ }
}
std::string SetInteriorVehicleDataRequest::ModuleType() {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
index b39b67d669..5785e58e5b 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
@@ -115,4 +115,30 @@ RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules(
}
return result;
}
+
+void RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ smart_objects::SmartObject& msg_params) {
+ using namespace message_params;
+ using namespace application_manager::strings;
+
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto& module_data = msg_params[kModuleData];
+ if (!module_data.keyExists(kRadioControlData) ||
+ !module_data[kRadioControlData].keyExists(kSisData) ||
+ !module_data[kRadioControlData][kSisData].keyExists(station_location)) {
+ return;
+ }
+
+ auto& location_data =
+ module_data[kRadioControlData][kSisData][station_location];
+ auto new_location_data =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ new_location_data[latitude_degrees] = location_data[latitude_degrees];
+ new_location_data[longitude_degrees] = location_data[longitude_degrees];
+ if (location_data.keyExists(altitude)) {
+ new_location_data[altitude] = location_data[altitude];
+
+ location_data = new_location_data;
+ }
+}
} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
index 026e03eeff..0c4a5a4e53 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
@@ -136,6 +136,13 @@ RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications(
} // namespace rc_rpc_plugin
-extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+extern "C" __attribute__((visibility("default")))
+application_manager::plugin_manager::RPCPlugin*
+Create() {
return new rc_rpc_plugin::RCRPCPlugin();
} // namespace rc_rpc_plugin
+
+extern "C" __attribute__((visibility("default"))) void Delete(
+ application_manager::plugin_manager::RPCPlugin* data) {
+ delete data;
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
index cf1df2cb68..0a512b2839 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
@@ -94,7 +94,7 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
}
const mobile_apis::HMILevel::eType acquiring_app_hmi_level =
- acquiring_app->hmi_level();
+ acquiring_app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) {
LOG4CXX_DEBUG(logger_,
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
index c1c59d7e78..c5a191650e 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
@@ -52,17 +52,8 @@ file(GLOB SOURCES
)
set(LIBRARIES
- RCRpcPluginStaticLib
- ApplicationManager
- connectionHandler
- SmartObjects
- ProtocolHandler
- MessageHelper
- connectionHandler
- Utils
- jsoncpp
+ rc_rpc_plugin_static
gmock_main
- dl
)
if(ENABLE_LOG)
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
index 9549830cec..123c22b944 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2019, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,7 @@
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include <stdint.h>
#include <chrono>
#include <thread>
@@ -205,6 +206,8 @@ TEST_F(GetInteriorVehicleDataRequestTest,
HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
+
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -232,6 +235,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -244,7 +248,19 @@ TEST_F(
(*mobile_message)[application_manager::strings::msg_params]
[message_params::kModuleType] = module_type;
smart_objects::SmartObject radio_data;
+ smart_objects::SmartObject sis_data;
+ smart_objects::SmartObject gps_data;
+
+ gps_data[application_manager::strings::longitude_degrees] = 1.0;
+ gps_data[application_manager::strings::latitude_degrees] = 1.0;
+
+ sis_data[application_manager::strings::station_short_name] =
+ "dummy_short_name";
+ sis_data[application_manager::strings::station_location] = gps_data;
+
radio_data[message_params::kBand] = enums_value::kAM;
+ radio_data[message_params::kSisData] = sis_data;
+
std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
command = CreateRCCommand<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
@@ -263,6 +279,7 @@ TEST_F(
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -314,6 +331,7 @@ TEST_F(
command = CreateRCCommand<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -358,6 +376,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -393,6 +412,7 @@ TEST_F(
MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _))
.WillOnce((Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -418,6 +438,7 @@ TEST_F(
.WillOnce((Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -458,6 +479,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_response_message);
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -498,6 +520,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_message);
auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -542,6 +565,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
command = CreateRCCommand<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -583,6 +607,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
_))
.WillRepeatedly(Return(true));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -597,6 +622,130 @@ TEST_F(GetInteriorVehicleDataRequestTest,
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_AvailableHDChanelsIsArrayWithHDChanels) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ const uint32_t chanel1_index = 1u;
+ const uint32_t chanel2_index = 2u;
+ const uint32_t chanel3_index = 3u;
+
+ const uint32_t expected_array_length = 3u;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kAppId;
+
+ auto& msg_params = (*hmi_response_message)[strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ auto available_hd_chanels =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ available_hd_chanels[0] = chanel1_index;
+ available_hd_chanels[1] = chanel2_index;
+ available_hd_chanels[2] = chanel3_index;
+
+ msg_params[message_params::kModuleData][message_params::kRadioControlData]
+ [message_params::kAvailableHdChannels] = available_hd_chanels;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr message_to_mob = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true)));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ event.set_smart_object(*hmi_response_message);
+ command->on_event(event);
+
+ auto& hd_chanels =
+ (*message_to_mob)[strings::msg_params][message_params::kModuleData]
+ [message_params::kRadioControlData]
+ [message_params::kAvailableHdChannels];
+ const size_t array_length = hd_chanels.length();
+
+ EXPECT_EQ(expected_array_length, array_length);
+
+ EXPECT_EQ(chanel1_index, hd_chanels[0].asUInt());
+ EXPECT_EQ(chanel2_index, hd_chanels[1].asUInt());
+ EXPECT_EQ(chanel3_index, hd_chanels[2].asUInt());
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ClimateEnableAvailable) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kAppId;
+
+ auto& msg_params = (*hmi_response_message)[strings::msg_params];
+
+ auto climate_control_data =
+ smart_objects::SmartObject(smart_objects::SmartType_Boolean);
+ climate_control_data = true;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData]
+ [message_params::kClimateEnableAvailable] = climate_control_data;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ auto message_to_mob = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true)));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ event.set_smart_object(*hmi_response_message);
+ command->on_event(event);
+
+ const bool climate_enable_available =
+ (*message_to_mob)[strings::msg_params][message_params::kModuleData]
+ [message_params::kClimateControlData]
+ [message_params::kClimateEnableAvailable]
+ .asBool();
+
+ EXPECT_TRUE(climate_enable_available);
+}
+
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
index 66280eb183..f7718a7248 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -34,7 +34,6 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
-#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
@@ -42,15 +41,20 @@
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include <stdint.h>
+#include "gtest/gtest.h"
+
using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
using ::testing::_;
using ::testing::NiceMock;
using ::testing::Return;
+using ::testing::SaveArg;
namespace {
const uint32_t kAppId = 0u;
@@ -140,8 +144,11 @@ TEST_F(SetInteriorVehicleDataRequestTest,
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::CLIMATE;
+ smart_objects::SmartObject climate_control_data(smart_objects::SmartType_Map);
+ climate_control_data[message_params::kFanSpeed] = 10;
+
msg_params[message_params::kModuleData][message_params::kClimateControlData] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
+ climate_control_data;
// Expectations
EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
.WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
@@ -151,14 +158,15 @@ TEST_F(SetInteriorVehicleDataRequestTest,
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::READ_ONLY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -189,15 +197,16 @@ TEST_F(
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::OUT_OF_MEMORY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -229,7 +238,99 @@ TEST_F(
command = CreateRCCommand<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableParams_SUCCESSSendToHMI) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData]
+ [message_params::kClimateEnable] = true;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ MessageSharedPtr message_from_mobile = CreateBasicMessage();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true)));
+
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ auto& msg_params_from_mobile =
+ (*message_from_mobile)[application_manager::strings::msg_params];
+
+ const bool climate_enable =
+ msg_params_from_mobile[message_params::kModuleData]
+ [message_params::kClimateControlData]
+ [message_params::kClimateEnable]
+ .asBool();
+ EXPECT_TRUE(climate_enable);
+}
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableParams_SUCCESSSendToHMI_HDChannel) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+
+ msg_params[message_params::kModuleData][message_params::kRadioControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ const std::uint32_t hd_channel = 2u;
+ msg_params[message_params::kModuleData][message_params::kRadioControlData]
+ [message_params::kHdChannel] = hd_channel;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ auto message_from_mobile = CreateBasicMessage();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true)));
+
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ command->Init();
+ command->Run();
+
+ auto& msg_params_from_mobile =
+ (*message_from_mobile)[application_manager::strings::msg_params];
+
+ const uint64_t hd_channel_from_hmi =
+ msg_params_from_mobile[message_params::kModuleData]
+ [message_params::kRadioControlData]
+ [message_params::kHdChannel]
+ .asUInt();
+
+ EXPECT_EQ(hd_channel, hd_channel_from_hmi);
+}
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
index a72b89b9de..bbf9032c96 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
@@ -72,6 +72,8 @@ const uint32_t kHMIAppId1 = 1u;
const uint32_t kAppId2 = 22u;
const std::string policy_app_id_1_ = "policy_id_1";
const uint32_t kSizeOfModules = 6u;
+const application_manager::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
namespace rc_rpc_plugin_test {
@@ -134,7 +136,8 @@ void RAManagerTest::CheckResultWithHMILevelAndAccessMode(
ra_manager.AcquireResource(kModuleType1, kAppId1));
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level));
+ EXPECT_CALL(*mock_app_2_, hmi_level(kDefaultWindowId))
+ .WillOnce(Return(app_level));
// Second app tries to get already acquired resource by 1st app
EXPECT_EQ(expected_result, ra_manager.AcquireResource(kModuleType1, kAppId2));
}
@@ -306,7 +309,7 @@ TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
+ EXPECT_CALL(*mock_app_2_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
ra_manager.AcquireResource(kModuleType1, kAppId2));
@@ -360,7 +363,7 @@ TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
+ EXPECT_CALL(*mock_app_2_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
ra_manager.AcquireResource(kModuleType1, kAppId2));
@@ -400,7 +403,7 @@ TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillRepeatedly(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
+ EXPECT_CALL(*mock_app_2_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
ra_manager.AcquireResource(kModuleType1, kAppId2));
@@ -461,7 +464,7 @@ TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillRepeatedly(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
+ EXPECT_CALL(*mock_app_2_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
ra_manager.AcquireResource(kModuleType1, kAppId2));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
index fdf02b57cb..fe8857b6b1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
@@ -51,21 +51,27 @@ collect_sources(APP_EXTENSIONS "${EXTENSIONS_SOURCE_DIR}")
collect_sources(RPC_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(LIBRARIES
+ ApplicationManager
HMI_API
MOBILE_API
- ApplicationManager
+ MessageHelper
+ connectionHandler
v4_protocol_v1_2_no_extra
SmartObjects
Utils
- Policy
+ PolicyStatic
+ jsoncpp
)
if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES} ${APP_EXTENSIONS})
-target_link_libraries("sdl_rpc_plugin" ${LIBRARIES})
+add_library("sdl_rpc_plugin_static" ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES} ${APP_EXTENSIONS})
+target_link_libraries("sdl_rpc_plugin_static" ${LIBRARIES})
+
+add_library("sdl_rpc_plugin" SHARED "src/sdl_rpc_plugin.cc")
+target_link_libraries("sdl_rpc_plugin" sdl_rpc_plugin_static)
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
new file mode 100644
index 0000000000..9847f567e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationCloseApplicationRequest command class
+ **/
+class BasicCommunicationCloseApplicationRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationCloseApplicationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationCloseApplicationRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationCloseApplicationRequest class destructor
+ **/
+ ~BasicCommunicationCloseApplicationRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
new file mode 100644
index 0000000000..9576684b77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationCloseApplicationResponse command class
+ **/
+class BasicCommunicationCloseApplicationResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationCloseApplicationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationCloseApplicationResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationCloseApplicationResponse class destructor
+ **/
+ ~BasicCommunicationCloseApplicationResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h
new file mode 100644
index 0000000000..39b5c3aee3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_FROM_HMI_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnBCSystemCapabilityUpdatedNotificationFromHMI command class
+ **/
+class OnBCSystemCapabilityUpdatedNotificationFromHMI
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnBCSystemCapabilityUpdatedNotificationFromHMI class constructor
+ * @param message Incoming SmartObject message from HMI
+ * @note all parameters described below required for base class
+ * @param application_manager Application manager instance to interact with
+ * related application
+ * @param rpc_service - service to handle appropriate RPC
+ * @param hmi_capabilities - HMI capabilities
+ * @param policy_handle - instance which allows interaction between
+ * application manager and application policies
+ **/
+ OnBCSystemCapabilityUpdatedNotificationFromHMI(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnBCSystemCapabilityUpdatedNotificationFromHMI class destructor
+ **/
+ ~OnBCSystemCapabilityUpdatedNotificationFromHMI() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ enum ProcessSystemDisplayCapabilitiesResult {
+ SUCCESS,
+ FAIL,
+ CAPABILITIES_CACHED
+ };
+ /**
+ * @brief ProcessSystemDisplayCapabilities processes provided display
+ * capabilities according to its structure
+ * @param display_capabilities display capabilities to process
+ * @return true if display capabilities have been processed properly,
+ * otherwise returns false
+ */
+ ProcessSystemDisplayCapabilitiesResult ProcessSystemDisplayCapabilities(
+ const smart_objects::SmartObject& display_capabilities);
+
+ DISALLOW_COPY_AND_ASSIGN(OnBCSystemCapabilityUpdatedNotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h
new file mode 100644
index 0000000000..a637f53df3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UICancelInteractionRequest command class
+ **/
+class UICancelInteractionRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UICancelInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UICancelInteractionRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UICancelInteractionRequest class destructor
+ **/
+ virtual ~UICancelInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UICancelInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h
new file mode 100644
index 0000000000..751a2ceef8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UICancelInteractionResponse command class
+ **/
+class UICancelInteractionResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UICancelInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UICancelInteractionResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UICancelInteractionResponse class destructor
+ **/
+ virtual ~UICancelInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UICancelInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CANCEL_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_request.h
new file mode 100644
index 0000000000..6fe8e182c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_request.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UI.CreateWindow request command class
+ **/
+class UICreateWindowRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ UICreateWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~UICreateWindowRequest() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UICreateWindowRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_response.h
new file mode 100644
index 0000000000..b9452fce1f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_response.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UI.CreateWindow response command class
+ **/
+class UICreateWindowResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ UICreateWindowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~UICreateWindowResponse() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UICreateWindowResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CREATE_WINDOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h
new file mode 100644
index 0000000000..58b2c3989f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UI.DeleteWindow request command class
+ **/
+class UIDeleteWindowRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ UIDeleteWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~UIDeleteWindowRequest() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteWindowRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h
new file mode 100644
index 0000000000..1500a3f9b2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UI.DeleteWindow response command class
+ **/
+class UIDeleteWindowResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ UIDeleteWindowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~UIDeleteWindowResponse() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteWindowResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_WINDOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h
new file mode 100644
index 0000000000..c47d73b858
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowAppMenuRequest command class
+ **/
+class UIShowAppMenuRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIShowAppMenuRequest class constructor
+ **/
+ UIShowAppMenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIShowAppMenuRequest class destructor
+ **/
+ ~UIShowAppMenuRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowAppMenuRequest);
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h
new file mode 100644
index 0000000000..c03a043e12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowAppMenuResponse command class
+ **/
+class UIShowAppMenuResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIShowAppMenuResponse class constructor
+ **/
+ UIShowAppMenuResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIShowAppMenuResponse class destructor
+ **/
+ ~UIShowAppMenuResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowAppMenuResponse);
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_APP_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
index 2da94ae67e..d99c5dab38 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
@@ -88,6 +88,8 @@ class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
*/
bool CheckSubMenuName();
+ bool is_menu_layout_available_ = true;
+
DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h
new file mode 100644
index 0000000000..0063c07512
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CancelInteractionRequest command class
+ **/
+class CancelInteractionRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief CancelInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CancelInteractionRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CancelInteractionRequest class destructor
+ **/
+ virtual ~CancelInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CancelInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h
new file mode 100644
index 0000000000..3e8536e617
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CancelInteractionResponse command class
+ **/
+class CancelInteractionResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief CancelInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CancelInteractionResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CancelInteractionResponse class destructor
+ **/
+ virtual ~CancelInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CancelInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CANCEL_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
index 01f20a68e3..f9f780b84b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
@@ -123,11 +123,12 @@ class ChangeRegistrationRequest
/**
* @brief Check parameters (name, vr) for
* coincidence with already known parameters of registered applications
- *
+ * @param device_id device identifier
* @return SUCCESS if there is no coincidence of app.name/VR synonyms,
* otherwise appropriate error code returns
*/
- mobile_apis::Result::eType CheckCoincidence();
+ mobile_apis::Result::eType CheckCoincidence(
+ const connection_handler::DeviceHandle& device_id);
/**
* @brief Checks if requested name is allowed by policy
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
new file mode 100644
index 0000000000..b965e880b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CloseApplicationRequest command class
+ **/
+class CloseApplicationRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief CloseApplicationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CloseApplicationRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CloseApplicationRequest class destructor
+ **/
+ ~CloseApplicationRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CloseApplicationRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
new file mode 100644
index 0000000000..c7b649f4e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CloseApplicationResponse command class
+ **/
+class CloseApplicationResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief CloseApplicationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CloseApplicationResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CloseApplicationResponse class destructor
+ **/
+ ~CloseApplicationResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CloseApplicationResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_request.h
new file mode 100644
index 0000000000..cfbfc460b7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_request.h
@@ -0,0 +1,117 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/hmi_state.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CreateWindow request command class
+ **/
+class CreateWindowRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ CreateWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ ~CreateWindowRequest() FINAL;
+
+ app_mngr::WindowID window_id() const FINAL;
+
+ void Run() FINAL;
+
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief CheckWindowName checks if provided window_name exists and allowed to
+ * be created
+ * @param app pointer to application owns affected window
+ * @param window_name window name to check
+ * @return true if window_name is valid, otherwise returns false
+ */
+ bool CheckWindowName(app_mngr::ApplicationSharedPtr app,
+ const app_mngr::WindowID window_id,
+ const std::string& window_name) const;
+
+ /**
+ * @brief ValidateWindowCreation checks whether window can be created
+ * @return true if window can be created, otherwise returns false
+ */
+ bool ValidateWindowCreation(app_mngr::ApplicationSharedPtr app,
+ const app_mngr::WindowID window_id);
+
+ /**
+ * @brief IsWindowForAssociatedServiceCreated check whether a window with
+ * current associated type has already been created
+ * @return true if window has been created, otherwise returns false
+ */
+ bool IsWindowForAssociatedServiceCreated(
+ app_mngr::ApplicationSharedPtr app) const;
+
+ /**
+ * @brief DoesExceedMaxAllowedWindows check wheter max allowed amount of
+ * windows is exceeded
+ * @return true if amount us exceeded, otherwise returns false
+ */
+ bool DoesExceedMaxAllowedWindows(app_mngr::ApplicationSharedPtr app) const;
+
+ /**
+ * @brief ApplyWindowInitialState apply changes related to window HMI state
+ * initialization
+ * @param app pointer to application owns affected window
+ */
+ void ApplyWindowInitialState(app_mngr::ApplicationSharedPtr app) const;
+
+ DISALLOW_COPY_AND_ASSIGN(CreateWindowRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_response.h
new file mode 100644
index 0000000000..5163293a7c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_response.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CreateWindow response command class
+ **/
+class CreateWindowResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ CreateWindowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ ~CreateWindowResponse() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CreateWindowResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_WINDOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_request.h
new file mode 100644
index 0000000000..b837724d7b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_request.h
@@ -0,0 +1,91 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/hmi_state.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CreateWindow request command class
+ **/
+class DeleteWindowRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ DeleteWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ ~DeleteWindowRequest() FINAL;
+
+ void Run() FINAL;
+
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ app_mngr::WindowID window_id() const FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief CheckWindowId checks if provided window_id exists and allowed to be
+ * deleted
+ * @param app pointer to application owns affected window
+ * @return true if window_id is valid, otherwise returns false
+ */
+ bool CheckWindowId(app_mngr::ApplicationSharedPtr app) const;
+
+ /**
+ * @brief DeleteWindow deletes data related to a request window id
+ * @param app pointer to applications owns affected window
+ */
+ void DeleteWindow(app_mngr::ApplicationSharedPtr app) const;
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteWindowRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_response.h
new file mode 100644
index 0000000000..279541724a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_response.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteWindow response command class
+ **/
+class DeleteWindowResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ DeleteWindowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ ~DeleteWindowResponse() FINAL;
+
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteWindowResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_WINDOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
index f24ce422f2..b3e04f7796 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
@@ -76,7 +76,7 @@ class PutFileRequest : public app_mngr::commands::CommandRequestImpl {
mobile_apis::FileType::eType file_type_;
bool is_persistent_file_;
- void SendOnPutFileNotification();
+ void SendOnPutFileNotification(bool is_system_file);
DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
index 8a80db9cdf..c55dcb65fc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
@@ -126,7 +126,7 @@ class RegisterAppInterfaceRequest
*
* @param app application with changed HMI status
* @param resumption If true, resumption-related parameters will be sent to
- *the HMI
+ * the HMI
* @param need_restore_vr If resumption is true, whether or not VR commands
*should be resumed
**/
@@ -207,17 +207,31 @@ class RegisterAppInterfaceRequest
void SendSubscribeCustomButtonNotification();
/**
- * @brief IsApplicationSwitched checks whether application is switched from
- * another transport. If application id is found, but not in reconnection
+ * @brief IsApplicationSwitched checks whether application is switched
+ * from another transport. If application id is found, but not in reconnection
* list, returns 'already registered' code. Otherwise - proceed with
* switching.
* @return True if application is detected as switched, otherwise false.
*/
bool IsApplicationSwitched();
+ /**
+ * @brief Information about given Connection Key.
+ * @param key Unique key used by other components as session identifier
+ * @param device_id device identifier.
+ * @param mac_address uniq address
+ * @return false in case of error or true in case of success
+ */
+ bool GetDataOnSessionKey(
+ const uint32_t key,
+ connection_handler::DeviceHandle* device_id = nullptr,
+ std::string* mac_address = nullptr) const;
+
private:
std::string response_info_;
mobile_apis::Result::eType result_code_;
+ connection_handler::DeviceHandle device_handle_;
+ std::string device_id_;
policy::PolicyHandlerInterface& GetPolicyHandler();
DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
index e84bf6e5e6..7e67428fb0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
@@ -149,6 +149,8 @@ class SetGlobalPropertiesRequest
std::string ui_response_info_;
std::string tts_response_info_;
+ bool is_menu_layout_available_ = true;
+
DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_request.h
new file mode 100644
index 0000000000..c9691a808f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_request.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowAppMenuRequest command class
+ **/
+class ShowAppMenuRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ShowAppMenuRequest class constructor
+ **/
+ ShowAppMenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ShowAppMenuRequest class destructor
+ **/
+ ~ShowAppMenuRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowAppMenuRequest);
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_response.h
new file mode 100644
index 0000000000..1e357e8a11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowAppMenuResponse command class
+ **/
+class ShowAppMenuResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ShowAppMenuResponse class constructor
+ **/
+ ShowAppMenuResponse(const app_mngr::commands::MessageSharedPtr& messasge,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ShowAppMenuResponse class destructor
+ **/
+ ~ShowAppMenuResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowAppMenuResponse);
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_APP_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
index 586004b783..26612609a4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
@@ -90,8 +90,33 @@ class ShowRequest : public app_mngr::commands::CommandRequestImpl {
int32_t field_index,
smart_objects::SmartObject& msg_params);
+ /**
+ * @brief Handle the template configuration information from the
+ * incoming mobile json message format for specified application
+ * @param app - application for which configuration should be checked
+ * @return True if template config can be successfully applied otherwise -
+ * false
+ */
+ bool CheckTemplateConfigurationForApp(application_manager::Application& app);
+
+ /**
+ * @brief Applies the template configuration which was set up beforehand
+ * @param result - result code on which template application is dependent
+ * @param app - application for which configuration should be applied
+ */
+ void ApplyTemplateConfigurationForApp(mobile_apis::Result::eType result,
+ application_manager::Application& app);
+
mobile_apis::Result::eType core_result_code_;
std::string core_response_info_;
+ app_mngr::WindowID current_window_id_;
+ smart_objects::SmartObject template_config_;
+ bool layout_change_required_;
+
+ // dcs - abbreviation of Day Color Scheme
+ bool dcs_change_required_;
+ // ncd - abbreviation of Night Color Scheme
+ bool ncs_change_required_;
DISALLOW_COPY_AND_ASSIGN(ShowRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
index 7d482709cb..288410e342 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
@@ -67,5 +67,5 @@ class SDLRPCPlugin : public plugins::RPCPlugin {
} // namespace sdl_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
-
+extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data);
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc
new file mode 100644
index 0000000000..b021faefd8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationCloseApplicationRequest::
+ BasicCommunicationCloseApplicationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BasicCommunicationCloseApplicationRequest::
+ ~BasicCommunicationCloseApplicationRequest() {}
+
+void BasicCommunicationCloseApplicationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc
new file mode 100644
index 0000000000..2e56271cf2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc
@@ -0,0 +1,65 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationCloseApplicationResponse::
+ BasicCommunicationCloseApplicationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BasicCommunicationCloseApplicationResponse::
+ ~BasicCommunicationCloseApplicationResponse() {}
+
+void BasicCommunicationCloseApplicationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_CloseApplication);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
index 37dca47793..1a104c0fa1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
@@ -161,6 +161,15 @@ void OnBCSystemCapabilityUpdatedNotification::Run() {
[strings::app_services_capabilities] = app_service_caps;
break;
}
+ case mobile_apis::SystemCapabilityType::DISPLAYS: {
+ if (!hmi_capabilities_.system_display_capabilities()) {
+ LOG4CXX_INFO(logger_, "system_display_capabilities are not available");
+ return;
+ }
+ msg_params[strings::system_capability][strings::display_capabilities] =
+ *hmi_capabilities_.system_display_capabilities();
+ break;
+ }
default:
return;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc
new file mode 100644
index 0000000000..6077425c07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h"
+
+#include "application_manager/display_capabilities_builder.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnBCSystemCapabilityUpdatedNotificationFromHMI::
+ OnBCSystemCapabilityUpdatedNotificationFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnBCSystemCapabilityUpdatedNotificationFromHMI::
+ ~OnBCSystemCapabilityUpdatedNotificationFromHMI() {}
+
+OnBCSystemCapabilityUpdatedNotificationFromHMI::
+ ProcessSystemDisplayCapabilitiesResult
+ OnBCSystemCapabilityUpdatedNotificationFromHMI::
+ ProcessSystemDisplayCapabilities(
+ const smart_objects::SmartObject& display_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_, "Updating general display capabilities");
+ hmi_capabilities_.set_system_display_capabilities(display_capabilities);
+ return ProcessSystemDisplayCapabilitiesResult::SUCCESS;
+ }
+
+ const auto app_id =
+ (*message_)[strings::msg_params][strings::app_id].asUInt();
+ auto app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with app_id " << app_id << " is not registered");
+ return ProcessSystemDisplayCapabilitiesResult::FAIL;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Updating display capabilities for app " << app_id);
+ app->set_display_capabilities(display_capabilities);
+
+ // Remove app_id from notification to mobile
+ (*message_)[strings::params][strings::connection_key] =
+ (*message_)[strings::msg_params][strings::app_id];
+ (*message_)[strings::msg_params].erase(strings::app_id);
+ if (app->is_resuming() && app->is_app_data_resumption_allowed()) {
+ LOG4CXX_DEBUG(logger_, "Application is resuming");
+ app->display_capabilities_builder().UpdateDisplayCapabilities(
+ display_capabilities);
+ return ProcessSystemDisplayCapabilitiesResult::CAPABILITIES_CACHED;
+ }
+
+ return ProcessSystemDisplayCapabilitiesResult::SUCCESS;
+}
+
+void OnBCSystemCapabilityUpdatedNotificationFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(
+ mobile_apis::FunctionID::OnSystemCapabilityUpdatedID);
+
+ const auto& system_capability =
+ (*message_)[strings::msg_params][strings::system_capability];
+ if (mobile_apis::SystemCapabilityType::DISPLAYS ==
+ system_capability[strings::system_capability_type].asInt() &&
+ system_capability.keyExists(strings::display_capabilities)) {
+ const auto result = ProcessSystemDisplayCapabilities(
+ system_capability[strings::display_capabilities]);
+ if (ProcessSystemDisplayCapabilitiesResult::FAIL == result) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to process display capabilities. Notification will "
+ "be ignored");
+ return;
+ } else if (ProcessSystemDisplayCapabilitiesResult::CAPABILITIES_CACHED ==
+ result) {
+ LOG4CXX_TRACE(logger_, "Capabilities are being cached for resuming app");
+ return;
+ }
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
index 2f3ee60a16..a29b9721e9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
@@ -59,12 +59,39 @@ struct OnDriverDistractionProcessor {
void operator()(ApplicationSharedPtr application) {
if (application) {
- (*on_driver_distraction_so_)[strings::params][strings::connection_key] =
- application->app_id();
+ // Create modifiable copy of base message
+ smart_objects::SmartObject message = *on_driver_distraction_so_;
+ message[strings::params][strings::connection_key] = application->app_id();
const RPCParams params;
policy::CheckPermissionResult result;
application_manager_.GetPolicyHandler().CheckPermissions(
- application, stringified_function_id_, params, result);
+ application,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ stringified_function_id_,
+ params,
+ result);
+ auto& msg_params = message[strings::msg_params];
+ const bool is_lock_screen_dismissal_exists = msg_params.keyExists(
+ mobile_notification::lock_screen_dismissal_enabled);
+
+ if (is_lock_screen_dismissal_exists &&
+ msg_params[mobile_notification::lock_screen_dismissal_enabled]
+ .asBool()) {
+ const auto language =
+ MessageHelper::MobileLanguageToString(application->ui_language());
+
+ const auto warning_message =
+ application_manager_.GetPolicyHandler()
+ .LockScreenDismissalWarningMessage(language);
+ // Only allow lock screen dismissal if a warning message is available
+ if (warning_message && !warning_message->empty()) {
+ msg_params[mobile_notification::lock_screen_dismissal_warning] =
+ *warning_message;
+ } else {
+ msg_params[mobile_notification::lock_screen_dismissal_enabled] =
+ false;
+ }
+ }
if (result.hmi_level_permitted != policy::kRpcAllowed) {
MobileMessageQueue messages;
application->SwapMobileMessageQueue(messages);
@@ -72,15 +99,19 @@ struct OnDriverDistractionProcessor {
std::remove_if(
messages.begin(),
messages.end(),
- [this](smart_objects::SmartObjectSPtr message) {
+ [](smart_objects::SmartObjectSPtr message) {
return (*message)[strings::params][strings::function_id]
- .asString() == stringified_function_id_;
+ .asUInt() ==
+ mobile_api::FunctionID::OnDriverDistractionID;
}),
messages.end());
- application->PushMobileMessage(on_driver_distraction_so_);
+ application->SwapMobileMessageQueue(messages);
+ application->PushMobileMessage(
+ std::make_shared<smart_objects::SmartObject>(message));
return;
}
- command_.SendNotificationToMobile(on_driver_distraction_so_);
+ command_.SendNotificationToMobile(
+ std::make_shared<smart_objects::SmartObject>(message));
}
}
@@ -108,14 +139,12 @@ OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
void OnDriverDistractionNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_DriverDistractionState::eType state =
+ const auto state =
static_cast<hmi_apis::Common_DriverDistractionState::eType>(
(*message_)[strings::msg_params][hmi_notification::state].asInt());
application_manager_.set_driver_distraction_state(state);
- smart_objects::SmartObjectSPtr on_driver_distraction =
- std::make_shared<smart_objects::SmartObject>();
-
+ auto on_driver_distraction = std::make_shared<smart_objects::SmartObject>();
if (!on_driver_distraction) {
LOG4CXX_ERROR(logger_, "NULL pointer");
return;
@@ -127,6 +156,17 @@ void OnDriverDistractionNotification::Run() {
(*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
state;
+ const auto lock_screen_dismissal =
+ application_manager_.GetPolicyHandler().LockScreenDismissalEnabledState();
+
+ if (lock_screen_dismissal &&
+ hmi_apis::Common_DriverDistractionState::DD_ON == state) {
+ (*on_driver_distraction)
+ [strings::msg_params]
+ [mobile_notification::lock_screen_dismissal_enabled] =
+ *lock_screen_dismissal;
+ }
+
const ApplicationSet applications =
application_manager_.applications().GetData();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
index 11647e2140..3eec6c5d1a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
@@ -119,12 +119,7 @@ void OnExitApplicationNotification::Run() {
}
}
- application_manager_.state_controller().SetRegularState(
- app_impl,
- HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- VideoStreamingState::NOT_STREAMABLE,
- false);
+ application_manager_.state_controller().ExitDefaultWindow(app_impl);
}
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
index 38b87f23d3..bf52492ae1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
@@ -62,13 +62,27 @@ void OnSystemContextNotification::Run() {
(*message_)[strings::msg_params][hmi_notification::system_context]
.asInt());
+ WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ window_id = (*message_)[strings::msg_params][strings::window_id].asInt();
+ }
+
ApplicationSharedPtr app;
- if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
+ if (helpers::
+ Compare<mobile_api::SystemContext::eType, helpers::EQ, helpers::ONE>(
+ system_context,
+ mobile_api::SystemContext::SYSCTXT_VRSESSION,
+ mobile_api::SystemContext::SYSCTXT_MENU,
+ mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED)) {
app = application_manager_.active_application();
- } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
+ }
+
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id ||
+ helpers::Compare<mobile_api::SystemContext::eType,
+ helpers::EQ,
+ helpers::ONE>(system_context,
+ mobile_api::SystemContext::SYSCTXT_ALERT,
+ mobile_api::SystemContext::SYSCTXT_MAIN)) {
if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
app = application_manager_.application(
(*message_)[strings::msg_params][strings::app_id].asUInt());
@@ -76,8 +90,8 @@ void OnSystemContextNotification::Run() {
}
if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) {
- application_manager_.state_controller().SetRegularState(app,
- system_context);
+ application_manager_.state_controller().SetRegularState(
+ app, window_id, system_context);
} else {
LOG4CXX_ERROR(logger_, "Application does not exist");
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
index 7680b74426..19b4047b1b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
@@ -72,7 +72,10 @@ void OnVRCommandNotification::Run() {
ApplicationSharedPtr app = application_manager_.application(app_id);
if (app) {
application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, true);
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::HMILevel::HMI_FULL,
+ true);
} else {
LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
index 55c6eb8881..c308af9b92 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
@@ -83,7 +83,10 @@ void OnVRLanguageChangeNotification::Run() {
if (static_cast<int32_t>(app->language()) !=
(*message_)[strings::msg_params][strings::language].asInt()) {
application_manager_.state_controller().SetRegularState(
- app, mobile_api::HMILevel::HMI_NONE, false);
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::HMILevel::HMI_NONE,
+ false);
rpc_service_.ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc
new file mode 100644
index 0000000000..c186077b1e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UICancelInteractionRequest::UICancelInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UICancelInteractionRequest::~UICancelInteractionRequest() {}
+
+void UICancelInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc
new file mode 100644
index 0000000000..2d5db4eecb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UICancelInteractionResponse::UICancelInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UICancelInteractionResponse::~UICancelInteractionResponse() {}
+
+void UICancelInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_CancelInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc
new file mode 100644
index 0000000000..b354009e3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_create_window_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UICreateWindowRequest::UICreateWindowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UICreateWindowRequest::~UICreateWindowRequest() {}
+
+void UICreateWindowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc
new file mode 100644
index 0000000000..c3a323818d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_create_window_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UICreateWindowResponse::UICreateWindowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UICreateWindowResponse::~UICreateWindowResponse() {}
+
+void UICreateWindowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_CreateWindow);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc
new file mode 100644
index 0000000000..7933574d92
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteWindowRequest::UIDeleteWindowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteWindowRequest::~UIDeleteWindowRequest() {}
+
+void UIDeleteWindowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc
new file mode 100644
index 0000000000..ba703e18ae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteWindowResponse::UIDeleteWindowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteWindowResponse::~UIDeleteWindowResponse() {}
+
+void UIDeleteWindowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteWindow);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
index 909e3bae47..a3eb9244bd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
@@ -73,9 +73,17 @@ void UIGetCapabilitiesResponse::Run() {
msg_params[hmi_response::soft_button_capabilities]);
}
- if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
+ // use newer parameter "audioPassThruCapabilitiesList" when available
+ if (msg_params.keyExists(strings::audio_pass_thru_capabilities_list)) {
hmi_capabilities.set_audio_pass_thru_capabilities(
- msg_params[strings::audio_pass_thru_capabilities]);
+ msg_params[strings::audio_pass_thru_capabilities_list]);
+ } else if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
+ smart_objects::SmartObject audio_pass_thru_capabilities_list(
+ smart_objects::SmartType_Array);
+ audio_pass_thru_capabilities_list[0] =
+ msg_params[strings::audio_pass_thru_capabilities];
+ hmi_capabilities.set_audio_pass_thru_capabilities(
+ audio_pass_thru_capabilities_list);
}
if (msg_params.keyExists(strings::hmi_capabilities)) {
@@ -113,6 +121,12 @@ void UIGetCapabilitiesResponse::Run() {
msg_params[strings::system_capabilities]
[strings::video_streaming_capability]);
}
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::display_capabilities)) {
+ hmi_capabilities.set_system_display_capabilities(
+ msg_params[strings::system_capabilities]
+ [strings::display_capabilities]);
+ }
}
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc
new file mode 100644
index 0000000000..c2c8566e82
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+UIShowAppMenuRequest::UIShowAppMenuRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowAppMenuRequest::~UIShowAppMenuRequest() {}
+
+void UIShowAppMenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc
new file mode 100644
index 0000000000..14bbc79e03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+UIShowAppMenuResponse::UIShowAppMenuResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowAppMenuResponse::~UIShowAppMenuResponse() {}
+
+void UIShowAppMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(hmi_apis::FunctionID::UI_ShowAppMenu);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
index fbfcd4d38a..d5ec8b8bb3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -109,6 +109,18 @@ void AddSubMenuRequest::Run() {
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (received_msg_params.keyExists(strings::menu_layout)) {
+ auto menu_layout = static_cast<mobile_apis::MenuLayout::eType>(
+ received_msg_params[strings::menu_layout].asUInt());
+ if (application_manager_.hmi_capabilities().menu_layout_supported(
+ menu_layout)) {
+ msg_params[strings::menu_layout] =
+ received_msg_params[strings::menu_layout];
+ } else {
+ is_menu_layout_available_ = false;
+ }
+ }
+
msg_params[strings::menu_id] = received_msg_params[strings::menu_id];
if (received_msg_params.keyExists(strings::position)) {
msg_params[strings::menu_params][strings::position] =
@@ -152,11 +164,22 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
application->AddSubMenu(
(*message_)[strings::msg_params][strings::menu_id].asInt(),
(*message_)[strings::msg_params]);
+ response_info =
+ "The MenuLayout specified is unsupported, the "
+ "default MenuLayout will be used." +
+ response_info;
+ SendResponse(result,
+ is_menu_layout_available_
+ ? MessageHelper::HMIToMobileResult(result_code)
+ : mobile_apis::Result::WARNINGS,
+ is_menu_layout_available_ ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ } else {
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
}
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
break;
}
default: {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
index 7173aaf2d0..7a0fd79b08 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
@@ -251,7 +251,8 @@ bool AlertRequest::Validate(uint32_t app_id) {
return false;
}
- if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
+ if (mobile_apis::HMILevel::HMI_BACKGROUND ==
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW) &&
app->AreCommandLimitsExceeded(
static_cast<mobile_apis::FunctionID::eType>(function_id()),
application_manager::TLimitSource::POLICY_TABLE)) {
@@ -321,6 +322,11 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
msg_params[hmi_request::alert_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
int32_t index = 0;
if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
@@ -350,6 +356,23 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
MessageHelper::SubscribeApplicationToSoftButton(
(*message_)[strings::msg_params], app, function_id());
}
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_icon)) {
+ auto verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::alert_icon],
+ app,
+ application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+
+ msg_params[strings::alert_icon] =
+ (*message_)[strings::msg_params][strings::alert_icon];
+ }
+
// app_id
msg_params[strings::app_id] = app_id;
msg_params[strings::duration] = default_timeout_;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc
new file mode 100644
index 0000000000..82e0703da1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc
@@ -0,0 +1,117 @@
+
+/*
+Copyright (c) 2019, Ford Motor Company, Livio
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution.
+
+Neither the name of the the copyright holders nor the names of their
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CancelInteractionRequest::CancelInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CancelInteractionRequest::~CancelInteractionRequest() {}
+
+void CancelInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto function_id = static_cast<mobile_apis::FunctionID::eType>(
+ (*message_)[strings::msg_params][strings::func_id].asInt());
+
+ if (helpers::
+ Compare<mobile_apis::FunctionID::eType, helpers::NEQ, helpers::ALL>(
+ function_id,
+ mobile_apis::FunctionID::PerformInteractionID,
+ mobile_apis::FunctionID::AlertID,
+ mobile_apis::FunctionID::ScrollableMessageID,
+ mobile_apis::FunctionID::SliderID)) {
+ LOG4CXX_ERROR(logger_, "Bad function ID" << function_id);
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::func_id] = function_id;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_CancelInteraction, &msg_params, true);
+}
+
+void CancelInteractionRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (event.id() != hmi_apis::FunctionID::UI_CancelInteraction) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ auto message = event.smart_object();
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_UI);
+
+ auto msg_params = message[strings::msg_params];
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc
new file mode 100644
index 0000000000..af73e72a6f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CancelInteractionResponse::CancelInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CancelInteractionResponse::~CancelInteractionResponse() {}
+
+void CancelInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin \ No newline at end of file
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
index ef81babdd6..8940ea3f59 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
@@ -49,7 +49,7 @@ struct IsSameNickname {
}
private:
- const custom_str::CustomString& app_id_;
+ const custom_str::CustomString app_id_;
};
} // namespace
@@ -160,7 +160,7 @@ void ChangeRegistrationRequest::Run() {
return;
}
- if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
+ if (mobile_apis::Result::SUCCESS != CheckCoincidence(app->device())) {
SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
return;
}
@@ -578,36 +578,46 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
return false;
}
-mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
+mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence(
+ const connection_handler::DeviceHandle& device_id) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
- ApplicationSet accessor = application_manager_.applications().GetData();
+ auto compare_tts_name = [](const smart_objects::SmartObject& obj_1,
+ const smart_objects::SmartObject& obj_2) {
+ return obj_1[application_manager::strings::text]
+ .asCustomString()
+ .CompareIgnoreCase(
+ obj_2[application_manager::strings::text].asCustomString());
+ };
+
+ const auto& accessor = application_manager_.applications().GetData();
custom_str::CustomString app_name;
- uint32_t app_id = connection_key();
+ const uint32_t app_id = connection_key();
if (msg_params.keyExists(strings::app_name)) {
app_name = msg_params[strings::app_name].asCustomString();
}
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it; ++it) {
- if (app_id == (*it)->app_id()) {
+ for (const auto& app : accessor) {
+ if (app->device() != device_id) {
+ continue;
+ }
+
+ if (app->app_id() == app_id) {
continue;
}
- const custom_str::CustomString& cur_name = (*it)->name();
+ const auto& cur_name = app->name();
if (msg_params.keyExists(strings::app_name)) {
if (app_name.CompareIgnoreCase(cur_name)) {
LOG4CXX_ERROR(logger_, "Application name is known already.");
return mobile_apis::Result::DUPLICATE_NAME;
}
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
+ const auto vr = app->vr_synonyms();
+ if (vr) {
+ const auto curr_vr = vr->asArray();
CoincidencePredicateVR v(app_name);
if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
@@ -617,18 +627,37 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
}
}
- // vr check
+ // VR check
if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
+ const auto new_vr = msg_params[strings::vr_synonyms].asArray();
CoincidencePredicateVR v(cur_name);
if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
return mobile_apis::Result::DUPLICATE_NAME;
}
- } // end vr check
- } // application for end
+ } // End vr check
+
+ // TTS check
+ if (msg_params.keyExists(strings::tts_name) && app->tts_name()) {
+ const auto tts_array = msg_params[strings::tts_name].asArray();
+ const auto tts_curr = app->tts_name()->asArray();
+ const auto& it_tts = std::find_first_of(tts_array->begin(),
+ tts_array->end(),
+ tts_curr->begin(),
+ tts_curr->end(),
+ compare_tts_name);
+ if (it_tts != tts_array->end()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "TTS name: "
+ << (*it_tts)[strings::text].asCustomString().AsMBString()
+ << " is known already");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // End tts check
+
+ } // Application for end
return mobile_apis::Result::SUCCESS;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
new file mode 100644
index 0000000000..275f1d82a6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
@@ -0,0 +1,119 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/close_application_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CloseApplicationRequest::CloseApplicationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CloseApplicationRequest::~CloseApplicationRequest() {}
+
+void CloseApplicationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::app_id] = connection_key();
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_CloseApplication,
+ &msg_params,
+ true);
+}
+
+void CloseApplicationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ auto msg_params = message[strings::msg_params];
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ if (success) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ auto on_app_exit = [app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationExit, app);
+ };
+
+ application_manager_.GetPluginManager().ForEachPlugin(on_app_exit);
+ application_manager_.state_controller().SetRegularState(
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false);
+ }
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc
new file mode 100644
index 0000000000..934804e1b1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/close_application_response.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CloseApplicationResponse::CloseApplicationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CloseApplicationResponse::~CloseApplicationResponse() {}
+
+void CloseApplicationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc
new file mode 100644
index 0000000000..21b54b4e9f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc
@@ -0,0 +1,370 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/create_window_request.h"
+
+#include <algorithm>
+
+#include "application_manager/application_impl.h"
+#include "application_manager/application_state.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+using app_mngr::ApplicationSharedPtr;
+
+namespace commands {
+
+CreateWindowRequest::CreateWindowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CreateWindowRequest::~CreateWindowRequest() {}
+
+bool CreateWindowRequest::CheckWindowName(
+ app_mngr::ApplicationSharedPtr app,
+ const app_mngr::WindowID window_id,
+ const std::string& window_name) const {
+ if (mobile_apis::PredefinedWindows::PRIMARY_WIDGET == window_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Window name check is ignored for the primary widgets");
+ return true;
+ }
+
+ const bool names_are_equal = window_name == app->name().c_str();
+ if (names_are_equal &&
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id) {
+ LOG4CXX_ERROR(logger_,
+ "Regular widget can't have the same name as application: "
+ << window_name);
+ return false;
+ }
+
+ const WindowNames window_names = app->GetWindowNames();
+ return !helpers::in_range(window_names, window_name);
+}
+
+void CreateWindowRequest::ApplyWindowInitialState(
+ ApplicationSharedPtr app) const {
+ const mobile_apis::WindowType::eType window_type =
+ static_cast<mobile_apis::WindowType::eType>(
+ (*message_)[strings::msg_params][strings::window_type].asInt());
+
+ // State should be initialized with INVALID_ENUM value to let state controller
+ // trigger OnHmiStatus notifiation sending
+ HmiStatePtr initial_state = application_manager_.CreateRegularState(
+ app,
+ window_type,
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
+ mobile_api::SystemContext::INVALID_ENUM);
+
+ const WindowID window_id =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ const std::string window_name =
+ (*message_)[strings::msg_params][strings::window_name].asString();
+
+ smart_objects::SmartObject window_info(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::associated_service_type)) {
+ window_info[strings::associated_service_type] =
+ (*message_)[strings::msg_params][strings::associated_service_type];
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::duplicate_updates_from_window_id)) {
+ window_info[strings::duplicate_updates_from_window_id] =
+ (*message_)[strings::msg_params]
+ [strings::duplicate_updates_from_window_id];
+ }
+
+ window_info[strings::window_name] = window_name;
+
+ app->SetWindowInfo(window_id, window_info);
+
+ app->SetInitialState(window_id, window_name, initial_state);
+
+ // Default HMI level for all windows except the main one is always NONE
+ application_manager_.state_controller().OnAppWindowAdded(
+ app, window_id, window_type, mobile_apis::HMILevel::HMI_NONE);
+}
+
+app_mngr::WindowID CreateWindowRequest::window_id() const {
+ return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
+void CreateWindowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const auto application = application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const auto window_id =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ if (application->WindowIdExists(window_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Window with id #" << window_id << " does already exist");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ const auto window_type =
+ (*message_)[strings::msg_params][strings::window_type].asInt();
+
+ if (mobile_apis::WindowType::eType::MAIN == window_type) {
+ LOG4CXX_ERROR(logger_, "MAIN application window already exists");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::duplicate_updates_from_window_id)) {
+ const auto duplicate_updates_from_window_id =
+ (*message_)[strings::msg_params]
+ [strings::duplicate_updates_from_window_id]
+ .asInt();
+ if (!application->WindowIdExists(duplicate_updates_from_window_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Window with id #" << duplicate_updates_from_window_id
+ << " does not exist");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ const std::string window_name =
+ (*message_)[strings::msg_params][strings::window_name].asString();
+ if (!CheckWindowName(application, window_id, window_name)) {
+ LOG4CXX_ERROR(logger_,
+ "Window name \"" << window_name
+ << "\" is disallowed for window #"
+ << window_id);
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ if (!ValidateWindowCreation(application, window_id)) {
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_CreateWindow, &msg_params, true);
+}
+
+void CreateWindowRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (hmi_apis::FunctionID::UI_CreateWindow != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ auto application = application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ LOG4CXX_INFO(logger_, "Received CreateWindow event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ const smart_objects::SmartObject& response_message = event.smart_object();
+ const auto result_code = CommandRequestImpl::GetMobileResultCode(
+ static_cast<hmi_apis::Common_Result::eType>(
+ response_message[strings::params][hmi_response::code].asInt()));
+
+ const bool is_success = IsMobileResultSuccess(result_code);
+ std::string response_info;
+ GetInfo(response_message, response_info);
+
+ if (!is_success) {
+ LOG4CXX_ERROR(logger_, "CreateWindow request has failed on HMI side");
+ SendResponse(is_success,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str());
+ return;
+ }
+
+ ApplyWindowInitialState(application);
+
+ SendResponse(is_success,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str());
+}
+
+bool CreateWindowRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool CreateWindowRequest::IsWindowForAssociatedServiceCreated(
+ app_mngr::ApplicationSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const auto window_optional_params_map =
+ app->window_optional_params_map().GetData();
+
+ if (!(*message_)[strings::msg_params].keyExists(
+ strings::associated_service_type)) {
+ return false;
+ }
+
+ const auto associated_service_type =
+ (*message_)[strings::msg_params][strings::associated_service_type]
+ .asString();
+
+ const auto find_res = std::find_if(
+ window_optional_params_map.begin(),
+ window_optional_params_map.end(),
+ [&associated_service_type](
+ const std::pair<WindowID, smart_objects::SmartObjectSPtr>& element) {
+ LOG4CXX_DEBUG(logger_,
+ "Searching for " << associated_service_type
+ << " in window info for id "
+ << element.first);
+ if (element.second->keyExists(strings::associated_service_type) &&
+ associated_service_type ==
+ (*element.second)[strings::associated_service_type]
+ .asString()) {
+ return true;
+ }
+
+ return false;
+ });
+
+ return find_res != window_optional_params_map.end();
+}
+
+bool CreateWindowRequest::DoesExceedMaxAllowedWindows(
+ app_mngr::ApplicationSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto get_current_number_of_windows =
+ [&app](const mobile_apis::WindowType::eType window_type) -> size_t {
+ switch (window_type) {
+ case mobile_apis::WindowType::MAIN: {
+ return 1u;
+ }
+ case mobile_apis::WindowType::WIDGET: {
+ return app->window_optional_params_map().GetData().size();
+ }
+
+ default: {
+ LOG4CXX_WARN(logger_, "Unknown window type");
+ return 0u;
+ }
+ }
+ };
+
+ const auto window_type = static_cast<mobile_apis::WindowType::eType>(
+ (*message_)[strings::msg_params][strings::window_type].asInt());
+
+ const auto display_capabilities = app->display_capabilities();
+
+ if (!display_capabilities) {
+ LOG4CXX_WARN(logger_, "Application has no capabilities");
+ return false;
+ }
+
+ MessageHelper::PrintSmartObject(*display_capabilities);
+
+ const auto windowTypeSupported =
+ (*display_capabilities)[0][strings::window_type_supported].asArray();
+
+ DCHECK(windowTypeSupported);
+
+ const auto find_res = std::find_if(
+ windowTypeSupported->begin(),
+ windowTypeSupported->end(),
+ [&window_type](const smart_objects::SmartObject& element) {
+ if (window_type == static_cast<mobile_apis::WindowType::eType>(
+ element[strings::window_type].asInt())) {
+ return true;
+ }
+
+ return false;
+ });
+
+ DCHECK(find_res != windowTypeSupported->end());
+
+ if (get_current_number_of_windows(window_type) + 1 >
+ (*find_res)[strings::maximum_number_of_windows].asUInt()) {
+ return true;
+ }
+
+ return false;
+}
+
+bool CreateWindowRequest::ValidateWindowCreation(
+ app_mngr::ApplicationSharedPtr app, const WindowID window_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (DoesExceedMaxAllowedWindows(app)) {
+ std::string info("Maximum allowed amount of windows is exceeded");
+ LOG4CXX_WARN(logger_, info);
+ SendResponse(false, mobile_apis::Result::REJECTED, info.c_str());
+ return false;
+ }
+
+ if (IsWindowForAssociatedServiceCreated(app)) {
+ std::string info(
+ "Window for this associated service type is already created");
+ LOG4CXX_WARN(logger_, info);
+ SendResponse(false, mobile_apis::Result::REJECTED, info.c_str());
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc
new file mode 100644
index 0000000000..0d9bbc2815
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/create_window_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+CreateWindowResponse::CreateWindowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CreateWindowResponse::~CreateWindowResponse() {}
+
+void CreateWindowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
index b2c9a3377f..46af8353b7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
@@ -68,7 +68,9 @@ void DeleteFileRequest::Run() {
return;
}
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ if ((mobile_api::HMILevel::HMI_NONE ==
+ application->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) &&
(application_manager_.get_settings().delete_file_in_none() <=
application->delete_file_in_none_count())) {
// If application is in the HMI_NONE level the quantity of allowed
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc
new file mode 100644
index 0000000000..7f253e25fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc
@@ -0,0 +1,162 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_window_request.h"
+
+#include <algorithm>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteWindowRequest::DeleteWindowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteWindowRequest::~DeleteWindowRequest() {}
+
+bool DeleteWindowRequest::CheckWindowId(
+ app_mngr::ApplicationSharedPtr app) const {
+ const WindowID window_id =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id) {
+ LOG4CXX_ERROR(logger_, "Main application window can't be deleted");
+ return false;
+ }
+
+ if (!app->WindowIdExists(window_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Window with id #" << window_id << " does not exist");
+ return false;
+ }
+
+ return true;
+}
+
+app_mngr::WindowID DeleteWindowRequest::window_id() const {
+ return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
+void DeleteWindowRequest::DeleteWindow(
+ app_mngr::ApplicationSharedPtr app) const {
+ const WindowID window_id =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ app->RemoveWindowInfo(window_id);
+ app->RemoveHMIState(window_id, HmiState::StateID::STATE_ID_REGULAR);
+ app->remove_window_capability(window_id);
+}
+
+void DeleteWindowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!CheckWindowId(application)) {
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteWindow, &msg_params, true);
+}
+
+void DeleteWindowRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (hmi_apis::FunctionID::UI_DeleteWindow != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ LOG4CXX_INFO(logger_, "Received DeleteWindow event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ const smart_objects::SmartObject& response_message = event.smart_object();
+ const auto result_code = CommandRequestImpl::GetMobileResultCode(
+ static_cast<hmi_apis::Common_Result::eType>(
+ response_message[strings::params][hmi_response::code].asInt()));
+
+ const bool is_success = IsMobileResultSuccess(result_code);
+ std::string response_info;
+ GetInfo(response_message, response_info);
+
+ if (!is_success) {
+ LOG4CXX_ERROR(logger_, "DeleteWindow request has failed on HMI side");
+ SendResponse(is_success,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str());
+ return;
+ }
+
+ DeleteWindow(application);
+
+ SendResponse(is_success,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str());
+}
+
+bool DeleteWindowRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc
new file mode 100644
index 0000000000..f9ac9a46d6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_window_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteWindowResponse::DeleteWindowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteWindowResponse::~DeleteWindowResponse() {}
+
+void DeleteWindowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
index 0655da27c0..dfc48ce2d5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
@@ -152,27 +152,54 @@ void GetSystemCapabilityRequest::Run() {
all_services);
break;
}
+ case mobile_apis::SystemCapabilityType::DISPLAYS: {
+ auto capabilities = hmi_capabilities.system_display_capabilities();
+ if (app->display_capabilities()) {
+ capabilities = app->display_capabilities();
+ }
+
+ if (!capabilities) {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ LOG4CXX_INFO(logger_, "system_display_capabilities are not available");
+ return;
+ }
+
+ response_params[strings::system_capability]
+ [strings::display_capabilities] = *capabilities;
+ break;
+ }
default: // Return unsupported resource
SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
return;
}
- if ((*message_)[app_mngr::strings::msg_params].keyExists(
- strings::subscribe)) {
- auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
- if ((*message_)[app_mngr::strings::msg_params][strings::subscribe]
- .asBool() == true) {
- LOG4CXX_DEBUG(logger_,
- "Subscribe to system capability: " << response_type);
- ext.SubscribeTo(response_type);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Unsubscribe from system capability: " << response_type);
- ext.UnsubscribeFrom(response_type);
+ const char* info = nullptr;
+ // Ignore subscription/unsubscription for DISPLAYS type
+ if (mobile_apis::SystemCapabilityType::DISPLAYS != response_type) {
+ if ((*message_)[app_mngr::strings::msg_params].keyExists(
+ strings::subscribe)) {
+ auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
+ if ((*message_)[app_mngr::strings::msg_params][strings::subscribe]
+ .asBool() == true) {
+ LOG4CXX_DEBUG(logger_,
+ "Subscribe to system capability: " << response_type);
+ ext.SubscribeTo(response_type);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Unsubscribe from system capability: " << response_type);
+ ext.UnsubscribeFrom(response_type);
+ }
+ }
+ } else {
+ if ((*message_)[app_mngr::strings::msg_params].keyExists(
+ strings::subscribe)) {
+ info =
+ "Subscribe parameter is ignored. Auto Subscription/Unsubscription is "
+ "used for DISPLAY capability type.";
}
}
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ SendResponse(true, mobile_apis::Result::SUCCESS, info, &response_params);
}
void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
index 46a39513d5..b8714b4784 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
@@ -70,7 +70,9 @@ void ListFilesRequest::Run() {
return;
}
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ if ((mobile_api::HMILevel::HMI_NONE ==
+ application->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) &&
(application_manager_.get_settings().list_files_in_none() <=
application->list_files_in_none_count())) {
// If application is in the HMI_NONE level the quantity of allowed
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
index f0368a742d..0bf9b40cb6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
@@ -102,8 +102,11 @@ void OnButtonEventNotification::Run() {
return;
}
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ const auto window_id = app->GetSoftButtonWindowID(custom_btn_id);
+ (*message_)[strings::msg_params][strings::window_id] = window_id;
+ const auto window_hmi_level = app->hmi_level(window_id);
+ if ((mobile_api::HMILevel::HMI_FULL != window_hmi_level) &&
+ (mobile_api::HMILevel::HMI_LIMITED != window_hmi_level)) {
LOG4CXX_WARN(logger_,
"CUSTOM_BUTTON OnButtonEvent notification is allowed only "
<< "in FULL or LIMITED hmi level");
@@ -127,8 +130,11 @@ void OnButtonEventNotification::Run() {
}
// Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ const mobile_apis::HMILevel::eType app_hmi_level =
+ subscribed_app->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
+ if ((mobile_api::HMILevel::HMI_FULL != app_hmi_level) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app_hmi_level)) {
LOG4CXX_WARN(logger_,
"OnButtonEvent notification is allowed only"
<< "in FULL or LIMITED hmi level");
@@ -179,6 +185,11 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][strings::custom_button_id];
}
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ (*on_btn_event)[strings::msg_params][strings::window_id] =
+ (*message_)[strings::msg_params][strings::window_id];
+ }
+
message_ = on_btn_event;
SendNotification();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
index 7c77e29298..8c22844865 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
@@ -104,8 +104,12 @@ void OnButtonPressNotification::Run() {
}
// Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ const auto window_id = app->GetSoftButtonWindowID(custom_btn_id);
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
+ (*message_)[strings::msg_params][strings::window_id] = window_id;
+ const auto window_hmi_level = app->hmi_level(window_id);
+ if ((mobile_api::HMILevel::HMI_FULL != window_hmi_level) &&
+ (mobile_api::HMILevel::HMI_LIMITED != window_hmi_level)) {
LOG4CXX_WARN(logger_,
"CUSTOM_BUTTON OnButtonPress notification is allowed only "
<< "in FULL or LIMITED hmi level");
@@ -129,8 +133,11 @@ void OnButtonPressNotification::Run() {
}
// Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ const mobile_apis::HMILevel::eType app_hmi_level =
+ subscribed_app->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
+ if ((mobile_api::HMILevel::HMI_FULL != app_hmi_level) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app_hmi_level)) {
LOG4CXX_WARN(logger_,
"OnButtonPress notification is allowed only"
<< "in FULL or LIMITED hmi level");
@@ -187,6 +194,11 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][strings::custom_button_id];
}
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ (*on_btn_press)[strings::msg_params][strings::window_id] =
+ (*message_)[strings::msg_params][strings::window_id];
+ }
+
message_ = on_btn_press;
SendNotification();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
index 8ec8a86554..1c0609e17d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
@@ -76,7 +76,8 @@ void OnKeyBoardInputNotification::Run() {
break;
}
- if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level()) {
+ if (mobile_apis::HMILevel::eType::HMI_FULL ==
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) {
LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
app_to_notify = app;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
index 515279c5f9..cc6ab7b65b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
@@ -2,6 +2,7 @@
#include "application_manager/app_service_manager.h"
#include "application_manager/application_manager.h"
+#include "application_manager/display_capabilities_builder.h"
#include "application_manager/helpers/application_helper.h"
#include "application_manager/message_helper.h"
#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
@@ -31,7 +32,7 @@ void OnSystemCapabilityUpdatedNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- mobile_apis::SystemCapabilityType::eType system_capability_type =
+ const auto system_capability_type =
static_cast<mobile_apis::SystemCapabilityType::eType>(
msg_params[strings::system_capability]
[strings::system_capability_type]
@@ -127,8 +128,21 @@ void OnSystemCapabilityUpdatedNotification::Run() {
[strings::app_services_capabilities] = app_service_caps;
break;
}
- default:
+
+ case mobile_apis::SystemCapabilityType::DISPLAYS: {
+ // Display capabilities content will be populated in the code after the
+ // switch so just breaking here
+ break;
+ }
+
+ default: {
+ LOG4CXX_ERROR(logger_,
+ "Unknown system capability type: "
+ << msg_params[strings::system_capability]
+ [strings::system_capability_type]
+ .asInt());
return;
+ }
}
const char* capability_type_string;
@@ -136,11 +150,34 @@ void OnSystemCapabilityUpdatedNotification::Run() {
mobile_apis::SystemCapabilityType::eType>::
EnumToCString(system_capability_type, &capability_type_string);
+ const auto initial_connection_key =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+
auto subscribed_to_capability_predicate =
- [&system_capability_type](const ApplicationSharedPtr app) {
+ [&system_capability_type,
+ &initial_connection_key](const ApplicationSharedPtr app) {
DCHECK_OR_RETURN(app, false);
auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
- return ext.IsSubscribedTo(system_capability_type);
+ if (!ext.IsSubscribedTo(system_capability_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "App " << app->app_id()
+ << " is not subscribed to this capability type");
+ return false;
+ }
+
+ if (mobile_apis::SystemCapabilityType::DISPLAYS ==
+ system_capability_type &&
+ initial_connection_key > 0) {
+ LOG4CXX_DEBUG(logger_,
+ "Display capabilities notification for app "
+ << initial_connection_key << " only");
+ return app->app_id() == initial_connection_key;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "App " << app->app_id()
+ << " is subscribed to specified capability type");
+ return true;
};
const std::vector<ApplicationSharedPtr>& applications = FindAllApps(
@@ -167,6 +204,40 @@ void OnSystemCapabilityUpdatedNotification::Run() {
ext.UnsubscribeFrom(system_capability_type);
continue;
}
+
+ if (mobile_apis::SystemCapabilityType::DISPLAYS == system_capability_type) {
+ LOG4CXX_DEBUG(logger_, "Using common display capabilities");
+ auto capabilities = hmi_capabilities_.system_display_capabilities();
+ if (app->is_resuming() && app->is_app_data_resumption_allowed()) {
+ LOG4CXX_DEBUG(logger_,
+ "Application "
+ << app->app_id()
+ << " is resuming. Providing cached capabilities");
+ auto display_caps =
+ app->display_capabilities_builder().display_capabilities();
+ capabilities = display_caps;
+ } else if (app->display_capabilities()) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << app->app_id()
+ << " has specific display capabilities");
+ const WindowID window_id =
+ msg_params[strings::system_capability]
+ [strings::display_capabilities][0]
+ [strings::window_capabilities][0][strings::window_id]
+ .asInt();
+ capabilities = app->display_capabilities(window_id);
+ }
+
+ if (!capabilities) {
+ LOG4CXX_WARN(logger_,
+ "No available display capabilities for sending. Skipping");
+ continue;
+ }
+
+ msg_params[strings::system_capability][strings::display_capabilities] =
+ *capabilities;
+ }
+
LOG4CXX_INFO(logger_,
"Sending OnSystemCapabilityUpdated " << capability_type_string
<< " application id "
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index a85dec10bb..fc99bb323c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -86,8 +86,8 @@ void OnSystemRequestNotification::Run() {
static_cast<rpc::policy_table_interface_base::RequestType>(
request_type));
- if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(),
- request_type)) {
+ if (!policy_handler.IsRequestTypeAllowed(
+ app->device(), app->policy_app_id(), request_type)) {
LOG4CXX_WARN(logger_,
"Request type " << stringified_request_type
<< " is not allowed by policies");
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
index ccbdab15c9..0a8420b6a3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
@@ -67,7 +67,8 @@ void OnTBTClientStateNotification::Run() {
std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
for (; applications.end() != it; ++it) {
ApplicationSharedPtr app = *it;
- if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ if (mobile_apis::HMILevel::eType::HMI_NONE !=
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) {
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotification();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
index 8f8e4dbf6f..0481542565 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -87,7 +87,8 @@ void PerformAudioPassThruRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ if (mobile_api::HMILevel::HMI_NONE ==
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) {
LOG4CXX_ERROR(logger_, "application isn't activated");
SendResponse(false, mobile_apis::Result::REJECTED);
return;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
index 6b2f3cbcc5..cc109afcf0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
@@ -449,6 +449,11 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest(
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
mobile_apis::InteractionMode::eType mode =
static_cast<mobile_apis::InteractionMode::eType>(
(*message_)[strings::msg_params][strings::interaction_mode].asInt());
@@ -532,6 +537,11 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
smart_objects::SmartObject& choice_list =
(*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
index 41558c08f0..e25215fb48 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
@@ -94,7 +94,9 @@ void PutFileRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
+ if (mobile_api::HMILevel::HMI_NONE ==
+ application->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW) &&
application_manager_.get_settings().put_file_in_none() <=
application->put_file_in_none_count()) {
// If application is in the HMI_NONE level the quantity of allowed
@@ -284,9 +286,7 @@ void PutFileRequest::Run() {
}
SendResponse(true, save_result, "File was downloaded", &response_params);
- if (is_system_file) {
- SendOnPutFileNotification();
- }
+ SendOnPutFileNotification(is_system_file);
break;
}
default:
@@ -297,7 +297,7 @@ void PutFileRequest::Run() {
}
}
-void PutFileRequest::SendOnPutFileNotification() {
+void PutFileRequest::SendOnPutFileNotification(bool is_system_file) {
LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
smart_objects::SmartObjectSPtr notification =
std::make_shared<smart_objects::SmartObject>(
@@ -316,6 +316,7 @@ void PutFileRequest::SendOnPutFileNotification() {
message[strings::msg_params][strings::length] = length_;
message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
message[strings::msg_params][strings::file_type] = file_type_;
+ message[strings::msg_params][strings::is_system_file] = is_system_file;
rpc_service_.ManageHMICommand(notification);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
index 597df26d0a..b39e50b222 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -158,13 +158,14 @@ class SmartArrayValueExtractor {
};
struct IsSameNickname {
- IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
+ IsSameNickname(const custom_str::CustomString app_name)
+ : app_name_(app_name) {}
bool operator()(const policy::StringArray::value_type& nickname) const {
- return app_id_.CompareIgnoreCase(nickname.c_str());
+ return app_name_.CompareIgnoreCase(nickname.c_str());
}
private:
- const custom_str::CustomString& app_id_;
+ const custom_str::CustomString app_name_;
};
} // namespace
@@ -184,13 +185,14 @@ RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
rpc_service,
hmi_capabilities,
policy_handler)
- , result_code_(mobile_apis::Result::INVALID_ENUM) {}
+ , result_code_(mobile_apis::Result::INVALID_ENUM)
+ , device_handle_(0) {}
RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
bool RegisterAppInterfaceRequest::Init() {
LOG4CXX_AUTO_TRACE(logger_);
- return true;
+ return GetDataOnSessionKey(connection_key(), &device_handle_, &device_id_);
}
void RegisterAppInterfaceRequest::Run() {
@@ -224,20 +226,25 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
+ LOG4CXX_DEBUG(
+ logger_,
+ "device_handle: " << device_handle_ << " device_id: " << device_id_);
+
if (IsApplicationSwitched()) {
return;
}
+ // Cache the original app ID (for legacy behavior)
+ const auto policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+
ApplicationSharedPtr application =
- application_manager_.application(connection_key());
+ application_manager_.application(device_id_, policy_app_id);
if (application) {
SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
return;
}
- // cache the original app ID (for legacy behavior)
- const std::string policy_app_id =
- application_manager_.GetCorrectMobileIDFromMessage(message_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -576,6 +583,13 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params,
}
if (hmi_capabilities.display_capabilities()->keyExists(
+ strings::menu_layouts_available)) {
+ display_caps[strings::menu_layouts_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ strings::menu_layouts_available);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
hmi_response::media_clock_formats)) {
display_caps[hmi_response::media_clock_formats] =
hmi_capabilities.display_capabilities()->getElement(
@@ -613,15 +627,9 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params,
}
if (hmi_capabilities.audio_pass_thru_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[strings::audio_pass_thru_capabilities] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- } else {
- response_params[strings::audio_pass_thru_capabilities][0] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- }
+ // hmi_capabilities json contains array and HMI response object
+ response_params[strings::audio_pass_thru_capabilities] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
}
response_params[strings::hmi_capabilities] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -821,6 +829,16 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
application->mac_address());
}
+ // If app is in resuming state
+ // DisplayCapabilitiesBuilder has to collect all the information
+ // from incoming HMI notifications and send only one notification
+ // to mobile app, even if hash does not match, which means that app data
+ // will not be resumed, notification should be sent for default window as
+ // it will be resumed in any case
+ if (resumption) {
+ resumer.StartWaitingForDisplayCapabilitiesUpdate(application);
+ }
+
AppHmiTypes hmi_types;
if ((*message_)[strings::msg_params].keyExists(strings::app_hmi_type)) {
smart_objects::SmartArray* hmi_types_ptr =
@@ -835,14 +853,15 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
}
}
policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication(
- application->policy_app_id(), hmi_types);
+ application->mac_address(), application->policy_app_id(), hmi_types);
response_params[strings::icon_resumed] =
file_system::FileExists(application->app_icon_path());
SendResponse(true, result_code, add_info.c_str(), &response_params);
if (msg_params.keyExists(strings::app_hmi_type)) {
- GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
+ GetPolicyHandler().SetDefaultHmiTypes(application->device(),
+ application->policy_app_id(),
&(msg_params[strings::app_hmi_type]));
}
@@ -856,12 +875,14 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
// Start PTU after successfull registration
// Sends OnPermissionChange notification to mobile right after RAI response
// and HMI level set-up
- GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
-
- if (result_code != mobile_apis::Result::RESUME_FAILED) {
- resumer.StartResumption(application, hash_id);
- } else {
- resumer.StartResumptionOnlyHMILevel(application);
+ GetPolicyHandler().OnAppRegisteredOnMobile(application->mac_address(),
+ application->policy_app_id());
+ if (resumption) {
+ if (result_code != mobile_apis::Result::RESUME_FAILED) {
+ resumer.StartResumption(application, hash_id);
+ } else {
+ resumer.StartResumptionOnlyHMILevel(application);
+ }
}
// By default app subscribed to CUSTOM_BUTTON
@@ -961,48 +982,72 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence(
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
- ApplicationSet accessor = application_manager_.applications().GetData();
+ auto compare_tts_name = [](const smart_objects::SmartObject& obj_1,
+ const smart_objects::SmartObject& obj_2) {
+ return obj_1[application_manager::strings::text]
+ .asCustomString()
+ .CompareIgnoreCase(
+ obj_2[application_manager::strings::text].asCustomString());
+ };
- ApplicationSetConstIt it = accessor.begin();
- const custom_str::CustomString& app_name =
- msg_params[strings::app_name].asCustomString();
+ const auto& accessor = application_manager_.applications().GetData();
+ const auto& app_name = msg_params[strings::app_name].asCustomString();
- for (; accessor.end() != it; ++it) {
- // name check
- const custom_str::CustomString& cur_name = (*it)->name();
+ for (const auto& app : accessor) {
+ if (app->device() != device_handle_) {
+ continue;
+ }
+ // Name check
+ const auto& cur_name = app->name();
if (app_name.CompareIgnoreCase(cur_name)) {
LOG4CXX_ERROR(logger_, "Application name is known already.");
- out_duplicate_apps.push_back(*it);
+ out_duplicate_apps.push_back(app);
continue;
}
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
+ const auto vr = app->vr_synonyms();
+ if (vr) {
+ const auto curr_vr = vr->asArray();
CoincidencePredicateVR v(app_name);
if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
LOG4CXX_ERROR(logger_, "Application name is known already.");
- out_duplicate_apps.push_back(*it);
+ out_duplicate_apps.push_back(app);
continue;
}
}
- // vr check
+ // VR check
if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
+ const auto new_vr = msg_params[strings::vr_synonyms].asArray();
CoincidencePredicateVR v(cur_name);
if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- out_duplicate_apps.push_back(*it);
+ out_duplicate_apps.push_back(app);
continue;
}
- } // end vr check
+ } // End vr check
+
+ // TTS check
+ if (msg_params.keyExists(strings::tts_name) && app->tts_name()) {
+ const auto tts_array = msg_params[strings::tts_name].asArray();
+ const auto tts_curr = app->tts_name()->asArray();
+ const auto& it_tts = std::find_first_of(tts_array->begin(),
+ tts_array->end(),
+ tts_curr->begin(),
+ tts_curr->end(),
+ compare_tts_name);
+ if (it_tts != tts_array->end()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "TTS name: "
+ << (*it_tts)[strings::text].asCustomString().AsMBString()
+ << " is known already");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // End tts check
- } // application for end
+ } // Application for end
if (!out_duplicate_apps.empty()) {
return mobile_apis::Result::DUPLICATE_NAME;
@@ -1131,14 +1176,19 @@ bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
const custom_string::CustomString mobile_app_id(
application_manager_.GetCorrectMobileIDFromMessage(message_));
- const ApplicationSet& applications =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = applications.begin();
- ApplicationSetConstIt it_end = applications.end();
-
- for (; it != it_end; ++it) {
- if (mobile_app_id.CompareIgnoreCase((*it)->policy_app_id().c_str())) {
+ const auto& applications = application_manager_.applications().GetData();
+
+ for (const auto& app : applications) {
+ if (mobile_app_id.CompareIgnoreCase(app->policy_app_id().c_str())) {
+ if (app->device() != device_handle_) {
+ LOG4CXX_DEBUG(logger_,
+ "These policy_app_id equal, but applications have "
+ "different device id"
+ << " mobile_app_id: " << mobile_app_id.c_str()
+ << " device_handle: " << device_handle_
+ << " device_handle: " << app->device());
+ continue;
+ }
return true;
}
}
@@ -1308,13 +1358,12 @@ void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
using namespace smart_objects;
- using namespace hmi_apis;
-
SmartObject msg_params = SmartObject(SmartType_Map);
msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = Common_ButtonName::CUSTOM_BUTTON;
+ msg_params[strings::name] = hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+ CreateHMINotification(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ msg_params);
}
bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
@@ -1323,7 +1372,7 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
- auto app = application_manager_.application_by_policy_id(policy_app_id);
+ auto app = application_manager_.application(device_id_, policy_app_id);
if (!app) {
LOG4CXX_DEBUG(
@@ -1334,12 +1383,13 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
LOG4CXX_DEBUG(logger_,
"Application with policy id " << policy_app_id << " is found.");
- if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
+ if (!application_manager_.IsAppInReconnectMode(device_handle_,
+ policy_app_id)) {
LOG4CXX_DEBUG(
logger_,
"Policy id " << policy_app_id << " is not found in reconnection list.");
SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
- return false;
+ return true;
}
LOG4CXX_DEBUG(logger_, "Application is found in reconnection list.");
@@ -1358,13 +1408,61 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
application_manager_.ProcessReconnection(app, connection_key());
SendRegisterAppInterfaceResponseToMobile(app_type);
- application_manager_.SendHMIStatusNotification(app);
+ MessageHelper::SendHMIStatusNotification(
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ application_manager_);
application_manager_.OnApplicationSwitched(app);
return true;
}
+bool RegisterAppInterfaceRequest::GetDataOnSessionKey(
+ const uint32_t key,
+ connection_handler::DeviceHandle* device_id,
+ std::string* mac_address) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((nullptr == mac_address) && (nullptr == device_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Can't get data on session key because device id and mac "
+ "address are empty.");
+ return false;
+ }
+
+ connection_handler::DeviceHandle device_handle = 0;
+ auto& connect_handler = application_manager_.connection_handler();
+
+ auto result = connect_handler.GetDataOnSessionKey(
+ connection_key(), nullptr, nullptr, &device_handle);
+
+ if (result) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Failed to get device info for connection key: " << connection_key());
+ return false;
+ }
+
+ if (mac_address) {
+ result = connect_handler.get_session_observer().GetDataOnDeviceID(
+ device_handle, nullptr, nullptr, mac_address, nullptr);
+ }
+
+ if (result) {
+ LOG4CXX_DEBUG(logger_,
+ "Failed get unique address info for connection key: "
+ << connection_key());
+ return false;
+ }
+
+ if (device_id) {
+ *device_id = device_handle;
+ }
+
+ return true;
+}
+
policy::PolicyHandlerInterface&
RegisterAppInterfaceRequest::GetPolicyHandler() {
return policy_handler_;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
index 39363bbad1..ffd8a7dc81 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
@@ -161,7 +161,8 @@ void ResetGlobalPropertiesRequest::Run() {
key_board_properties[hmi_request::limited_character_list] =
limited_character_list;*/
- key_board_properties[hmi_request::auto_complete_text] = "";
+ key_board_properties[hmi_request::auto_complete_list] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
msg_params[hmi_request::keyboard_properties] = key_board_properties;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
index c1d02c96d3..5bef1d56fc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
@@ -112,6 +112,11 @@ void ScrollableMessageRequest::Run() {
msg_params[strings::app_id] = app->app_id();
msg_params[strings::timeout] = default_timeout_;
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
msg_params[strings::soft_buttons] =
(*message_)[strings::msg_params][strings::soft_buttons];
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
index 2a09a72af2..5ba1076084 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
@@ -75,8 +75,8 @@ void SetDisplayLayoutRequest::Run() {
new_layout = msg_params[strings::display_layout].asString();
}
- if (new_layout != old_layout &&
- !new_layout.empty()) { // Template switched, allow any color change
+ if (new_layout != old_layout && !new_layout.empty()) {
+ // Template switched, hence allow any color change
LOG4CXX_DEBUG(logger_,
"SetDisplayLayoutRequest New Layout: " << new_layout);
app->set_display_layout(new_layout);
@@ -85,22 +85,20 @@ void SetDisplayLayoutRequest::Run() {
// Template layout is the same as previous layout
// Reject message if colors are set
if (msg_params.keyExists(strings::day_color_scheme) &&
- app->day_color_scheme() != NULL &&
- !(msg_params[strings::day_color_scheme] ==
- *(app->day_color_scheme()))) {
- // Color scheme param exists and has been previously set, do not allow
- // color change
+ app->day_color_scheme().getType() != smart_objects::SmartType_Null &&
+ msg_params[strings::day_color_scheme] != app->day_color_scheme()) {
+ // Color scheme param exists and has been previously set,
+ // hence do not allow color change
LOG4CXX_DEBUG(logger_, "Reject Day Color Scheme Change");
SendResponse(false, mobile_apis::Result::REJECTED);
return;
}
if (msg_params.keyExists(strings::night_color_scheme) &&
- app->night_color_scheme() != NULL &&
- !(msg_params[strings::night_color_scheme] ==
- *(app->night_color_scheme()))) {
- // Color scheme param exists and has been previously set, do not allow
- // color change
+ app->night_color_scheme().getType() != smart_objects::SmartType_Null &&
+ msg_params[strings::night_color_scheme] != app->night_color_scheme()) {
+ // Color scheme param exists and has been previously set,
+ // hence do not allow color change
LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change");
SendResponse(false, mobile_apis::Result::REJECTED);
return;
@@ -127,6 +125,14 @@ void SetDisplayLayoutRequest::Run() {
void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetDisplayLayout: {
@@ -143,7 +149,7 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
if (response_success) {
HMICapabilities& hmi_capabilities = hmi_capabilities_;
- // in case templates_available is empty copy from hmi capabilities
+ // In case templates_available is empty copy from hmi capabilities
if (msg_params.keyExists(hmi_response::display_capabilities)) {
if (0 == msg_params[hmi_response::display_capabilities]
[hmi_response::templates_available]
@@ -154,10 +160,21 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
hmi_response::templates_available);
}
}
+ const Version& app_version = app->version();
+ if (app_version.max_supported_api_version >= APIVersion::kAPIV6) {
+ // In case of successful response warn user that this RPC is
+ // deprecated from 6.0 and higher API versions
+ result_code = hmi_apis::Common_Result::WARNINGS;
+ info =
+ "The RPC is deprecated and will be removed in a future version. "
+ "The requested display layout is set to the main window. Please "
+ "use `Show.templateConfiguration` instead.";
+ }
}
+
SendResponse(response_success,
MessageHelper::HMIToMobileResult(result_code),
- info.empty() ? NULL : info.c_str(),
+ info.empty() ? nullptr : info.c_str(),
&msg_params);
break;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
index bbfc61d463..4a73740ccf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
@@ -68,8 +68,7 @@ SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
void SetGlobalPropertiesRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -90,11 +89,9 @@ void SetGlobalPropertiesRequest::Run() {
mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
+ if (msg_params.keyExists(strings::menu_icon)) {
verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::menu_icon],
- app,
- application_manager_);
+ msg_params[strings::menu_icon], app, application_manager_);
if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
@@ -103,18 +100,29 @@ void SetGlobalPropertiesRequest::Run() {
}
}
// Check for image file(s) in vrHelpItem
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (msg_params.keyExists(strings::vr_help)) {
if (mobile_apis::Result::INVALID_DATA ==
MessageHelper::VerifyImageVrHelpItems(
- (*message_)[strings::msg_params][strings::vr_help],
- app,
- application_manager_)) {
+ msg_params[strings::vr_help], app, application_manager_)) {
LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
SendResponse(false, mobile_apis::Result::INVALID_DATA);
return;
}
}
+ if (msg_params.keyExists(strings::keyboard_properties)) {
+ if (!msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_list) &&
+ msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_text)) {
+ LOG4CXX_ERROR(logger_, "Replacing deprecated autoCompleteText property");
+ msg_params[strings::keyboard_properties][strings::auto_complete_list][0] =
+ msg_params[strings::keyboard_properties][strings::auto_complete_text]
+ .asString();
+ }
+ msg_params[strings::keyboard_properties].erase(strings::auto_complete_text);
+ }
+
if (IsWhiteSpaceExist()) {
LOG4CXX_ERROR(logger_, "White spaces found");
SendResponse(false, mobile_apis::Result::INVALID_DATA);
@@ -138,6 +146,20 @@ void SetGlobalPropertiesRequest::Run() {
return;
}
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (msg_params.keyExists(strings::menu_layout)) {
+ auto menu_layout = static_cast<mobile_apis::MenuLayout::eType>(
+ msg_params[strings::menu_layout].asUInt());
+ if (application_manager_.hmi_capabilities().menu_layout_supported(
+ menu_layout)) {
+ params[strings::menu_layout] = msg_params[strings::menu_layout];
+ } else {
+ is_menu_layout_available_ = false;
+ }
+ }
+
/* Need to set flags before sending request to HMI
* for correct processing this flags in method on_event */
if (is_help_prompt_present || is_timeout_prompt_present) {
@@ -154,9 +176,6 @@ void SetGlobalPropertiesRequest::Run() {
return;
}
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
PrepareUIRequestVRHelpData(app, msg_params, params);
PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
@@ -169,9 +188,6 @@ void SetGlobalPropertiesRequest::Run() {
LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
// Preparing data
@@ -186,14 +202,13 @@ void SetGlobalPropertiesRequest::Run() {
// check TTS params
if (is_help_prompt_present || is_timeout_prompt_present) {
LOG4CXX_DEBUG(logger_, "TTS params presents");
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
+ auto tts_params = smart_objects::SmartObject(smart_objects::SmartType_Map);
std::vector<std::string> invalid_params;
if (is_help_prompt_present) {
smart_objects::SmartObject& help_prompt =
(*message_)[strings::msg_params][strings::help_prompt];
- mobile_apis::Result::eType verification_result =
+ verification_result =
MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
@@ -203,16 +218,15 @@ void SetGlobalPropertiesRequest::Run() {
invalid_params.push_back("help_prompt");
} else {
app->set_help_prompt(help_prompt);
- params[strings::help_prompt] = (*app->help_prompt());
+ tts_params[strings::help_prompt] = (*app->help_prompt());
}
}
if (is_timeout_prompt_present) {
smart_objects::SmartObject& timeout_prompt =
(*message_)[strings::msg_params][strings::timeout_prompt];
- mobile_apis::Result::eType verification_result =
- MessageHelper::VerifyTtsFiles(
- timeout_prompt, app, application_manager_);
+ verification_result = MessageHelper::VerifyTtsFiles(
+ timeout_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
LOG4CXX_ERROR(
@@ -221,7 +235,7 @@ void SetGlobalPropertiesRequest::Run() {
invalid_params.push_back("timeout_prompt");
} else {
app->set_timeout_prompt(timeout_prompt);
- params[strings::timeout_prompt] = (*app->timeout_prompt());
+ tts_params[strings::timeout_prompt] = (*app->timeout_prompt());
}
}
@@ -239,11 +253,18 @@ void SetGlobalPropertiesRequest::Run() {
return;
}
- params[strings::app_id] = app->app_id();
- SendTTSRequest(params, true);
+ tts_params[strings::app_id] = app->app_id();
+ SendTTSRequest(tts_params, true);
auto& help_prompt_manager = app->help_prompt_manager();
- help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
+ help_prompt_manager.OnSetGlobalPropertiesReceived(tts_params, false);
+ } else if (!is_ui_send_) {
+ std::string response_info = "There are no parameters present in request.";
+ if (!is_menu_layout_available_) {
+ response_info += " The MenuLayout specified is unsupported.";
+ }
+ SendResponse(
+ false, mobile_apis::Result::INVALID_DATA, response_info.c_str());
}
}
@@ -317,10 +338,21 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
std::string response_info;
const bool result = PrepareResponseParameters(result_code, response_info);
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
+ if (result && !is_menu_layout_available_) {
+ response_info =
+ "The MenuLayout specified is unsupported, the "
+ "default MenuLayout will be used." +
+ response_info;
+ SendResponse(result,
+ mobile_apis::Result::WARNINGS,
+ response_info.c_str(),
+ &(message[strings::msg_params]));
+ } else {
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ }
}
bool SetGlobalPropertiesRequest::Init() {
@@ -435,7 +467,8 @@ bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
params.keyExists(strings::vr_help) ||
params.keyExists(strings::menu_title) ||
params.keyExists(strings::menu_icon) ||
- params.keyExists(strings::keyboard_properties);
+ params.keyExists(strings::keyboard_properties) ||
+ params.keyExists(strings::menu_layout);
}
bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
@@ -549,16 +582,21 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
}
if (msg_params[strings::keyboard_properties].keyExists(
- strings::auto_complete_text)) {
- str =
- msg_params[strings::keyboard_properties][strings::auto_complete_text]
- .asCharArray();
+ strings::auto_complete_list)) {
+ const smart_objects::SmartArray* acl_array =
+ msg_params[strings::keyboard_properties][strings::auto_complete_list]
+ .asArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "auto_complete_text syntax check failed");
- return true;
+ smart_objects::SmartArray::const_iterator it = acl_array->begin();
+
+ for (; it != acl_array->end(); ++it) {
+ str = it->asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "auto_complete_list syntax check failed");
+ return true;
+ }
}
}
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc
new file mode 100644
index 0000000000..36278168dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_app_menu_request.h"
+
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+ShowAppMenuRequest::ShowAppMenuRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ShowAppMenuRequest::~ShowAppMenuRequest() {}
+
+void ShowAppMenuRequest::Run() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Application with id " << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_apis::HMILevel::HMI_FULL !=
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW) ||
+ helpers::Compare<mobile_apis::SystemContext::eType,
+ helpers::NEQ,
+ helpers::ALL>(
+ app->system_context(mobile_apis::PredefinedWindows::DEFAULT_WINDOW),
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ mobile_apis::SystemContext::SYSCTXT_MENU)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Application with id " << connection_key() << " is not activated.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ auto msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+
+ const auto& received_msg_params = (*message_)[strings::msg_params];
+ if (received_msg_params.keyExists(strings::menu_id)) {
+ const int32_t menu_id = received_msg_params[strings::menu_id].asInt();
+ if (!app->FindSubMenu(menu_id)) {
+ LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+ msg_params[strings::menu_id] = menu_id;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_ShowAppMenu, &msg_params, true);
+}
+
+void ShowAppMenuRequest::on_event(const app_mngr::event_engine::Event& event) {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_ShowAppMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ const auto result_code = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with id " << connection_key()
+ << " is not registered.");
+ return;
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &message[strings::msg_params]);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event: " << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc
new file mode 100644
index 0000000000..2b952ea9ac
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_app_menu_response.h"
+
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+ShowAppMenuResponse::ShowAppMenuResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ShowAppMenuResponse::~ShowAppMenuResponse() {}
+
+void ShowAppMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
index 2bf1a81261..84d11f8e09 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
@@ -55,7 +55,12 @@ ShowRequest::ShowRequest(
rpc_service,
hmi_capabilities,
policy_handler)
- , core_result_code_(mobile_apis::Result::INVALID_ENUM) {}
+ , core_result_code_(mobile_apis::Result::INVALID_ENUM)
+ , current_window_id_(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)
+ , template_config_(smart_objects::SmartType::SmartType_Null)
+ , layout_change_required_(false)
+ , dcs_change_required_(false)
+ , ncs_change_required_(false) {}
ShowRequest::~ShowRequest() {}
@@ -94,6 +99,137 @@ void ShowRequest::HandleMetadata(const char* field_id,
}
}
+bool ShowRequest::CheckTemplateConfigurationForApp(
+ application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ current_window_id_ =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ }
+
+ const auto set_window_layout = [&app, this]() -> bool {
+ const auto new_template_layout =
+ template_config_[strings::template_layout].asString();
+ const auto old_template_layout = app.window_layout(current_window_id_);
+ LOG4CXX_DEBUG(logger_, "New layout: " << new_template_layout);
+ LOG4CXX_DEBUG(logger_, "Old layout: " << old_template_layout);
+
+ const bool layouts_equal = (new_template_layout == old_template_layout);
+
+ if (!new_template_layout.empty() && !layouts_equal) {
+ // Template switched, hence allow any color change
+ LOG4CXX_DEBUG(logger_,
+ "Show Request: Setting new Layout: " << new_template_layout
+ << " for window ID: "
+ << current_window_id_);
+ layout_change_required_ = true;
+ return true;
+ }
+ LOG4CXX_DEBUG(logger_, "Show Request: No Layout Change");
+ return false;
+ };
+
+ const auto set_day_color_scheme = [&app, this]() -> bool {
+ if (!template_config_.keyExists(strings::day_color_scheme)) {
+ return false;
+ }
+ if (app.day_color_scheme(current_window_id_).getType() !=
+ smart_objects::SmartType_Null &&
+ template_config_[strings::day_color_scheme] !=
+ app.day_color_scheme(current_window_id_)) {
+ // Color scheme param exists and has been previously set,
+ // hence do not allow color change
+ LOG4CXX_DEBUG(logger_, "Day Color Scheme change is rejected");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "Day Color Scheme change is allowed");
+ dcs_change_required_ = true;
+
+ return true;
+ };
+
+ const auto set_night_color_scheme = [&app, this]() -> bool {
+ if (!template_config_.keyExists(strings::night_color_scheme)) {
+ return false;
+ }
+ if (app.night_color_scheme(current_window_id_).getType() !=
+ smart_objects::SmartType_Null &&
+ template_config_[strings::night_color_scheme] !=
+ app.night_color_scheme(current_window_id_)) {
+ // Color scheme param exists and has been previously set,
+ // hence do not allow color change
+ LOG4CXX_DEBUG(logger_, "Night Color Scheme change is rejected");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "Night Color Scheme Change is allowed");
+ ncs_change_required_ = true;
+
+ return true;
+ };
+
+ const bool set_layout_result = set_window_layout();
+
+ if (set_layout_result) {
+ set_day_color_scheme();
+ set_night_color_scheme();
+ return true;
+ }
+
+ if (!template_config_.keyExists(strings::night_color_scheme) &&
+ !template_config_.keyExists(strings::day_color_scheme)) {
+ // In case current layout was not changed and day and night color
+ // schemes are absent in mobile message SDL has to forward message
+ // to HMI with the only layout even it was not changed
+ return true;
+ }
+
+ const bool set_schemes_result =
+ (set_day_color_scheme() && set_night_color_scheme());
+
+ return set_schemes_result;
+}
+
+void ShowRequest::ApplyTemplateConfigurationForApp(
+ mobile_apis::Result::eType result, application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS)) {
+ if (layout_change_required_) {
+ const std::string new_layout =
+ template_config_[strings::template_layout].asString();
+ LOG4CXX_DEBUG(logger_, "New layout : " << new_layout << " is applied");
+ app.set_window_layout(current_window_id_, new_layout);
+
+ if (template_config_.keyExists(strings::day_color_scheme)) {
+ app.set_day_color_scheme(current_window_id_,
+ template_config_[strings::day_color_scheme]);
+ }
+
+ if (template_config_.keyExists(strings::night_color_scheme)) {
+ app.set_night_color_scheme(
+ current_window_id_, template_config_[strings::night_color_scheme]);
+ }
+
+ return;
+ }
+
+ if (dcs_change_required_) {
+ LOG4CXX_DEBUG(logger_, "New day color scheme is applied");
+ app.set_day_color_scheme(current_window_id_,
+ template_config_[strings::day_color_scheme]);
+ }
+
+ if (ncs_change_required_) {
+ LOG4CXX_DEBUG(logger_, "New night color scheme is applied");
+ app.set_night_color_scheme(current_window_id_,
+ template_config_[strings::night_color_scheme]);
+ }
+ }
+}
+
void ShowRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -218,6 +354,14 @@ void ShowRequest::Run() {
HandleMetadata(strings::main_field_4, main_field_4_index, msg_params);
}
+ if ((*message_)[strings::msg_params].keyExists(strings::template_title)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::templateTitle);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::template_title];
+ ++index;
+ }
+
if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
@@ -264,7 +408,7 @@ void ShowRequest::Run() {
app->UnsubscribeFromSoftButtons(function_id());
} else {
MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
+ (*message_)[strings::msg_params], app, function_id(), window_id());
}
}
@@ -273,6 +417,33 @@ void ShowRequest::Run() {
(*message_)[strings::msg_params][strings::custom_presets];
}
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ const auto window_id =
+ (*message_)[strings::msg_params][strings::window_id].asInt();
+ if (!app->WindowIdExists(window_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Window with id #" << window_id << " does not exist");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+ msg_params[strings::window_id] = window_id;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::template_configuration)) {
+ template_config_ =
+ (*message_)[strings::msg_params][strings::template_configuration];
+ const bool result = CheckTemplateConfigurationForApp(*app);
+ if (!result) {
+ const char* info(
+ "Color schemes can not be changed without a new template set");
+ SendResponse(false, mobile_apis::Result::REJECTED, info);
+ return;
+ }
+ msg_params[strings::template_configuration] =
+ (*message_)[strings::msg_params][strings::template_configuration];
+ }
+
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
@@ -286,6 +457,13 @@ void ShowRequest::on_event(const event_engine::Event& event) {
using namespace helpers;
const smart_objects::SmartObject& message = event.smart_object();
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
switch (event.id()) {
case hmi_apis::FunctionID::UI_Show: {
@@ -305,6 +483,9 @@ void ShowRequest::on_event(const event_engine::Event& event) {
}
mobile_apis::Result::eType converted_result_code =
MessageHelper::HMIToMobileResult(result_code);
+
+ ApplyTemplateConfigurationForApp(converted_result_code, *app);
+
if (mobile_apis::Result::SUCCESS == converted_result_code &&
mobile_apis::Result::INVALID_ENUM != core_result_code_) {
converted_result_code = core_result_code_;
@@ -355,6 +536,14 @@ bool ShowRequest::CheckStringsOfShowRequest() {
return false;
}
}
+ if ((*message_)[strings::msg_params].keyExists(strings::template_title)) {
+ str =
+ (*message_)[strings::msg_params][strings::template_title].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid templateTitle syntax check failed");
+ return false;
+ }
+ }
if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
index d80e73ccbf..dd7b426b40 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
@@ -116,6 +116,11 @@ void SliderRequest::Run() {
msg_params[strings::timeout] = default_timeout_;
}
+ if ((*message_)[strings::msg_params].keyExists(strings::cancel_id)) {
+ msg_params[strings::cancel_id] =
+ (*message_)[strings::msg_params][strings::cancel_id].asInt();
+ }
+
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
index 0d3158d841..1acb2a7438 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
@@ -126,6 +126,26 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed(
(mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
return false;
}
+
+ if (!app->is_navi() &&
+ ((mobile_apis::ButtonName::NAV_CENTER_LOCATION == btn_id) ||
+ (mobile_apis::ButtonName::NAV_ZOOM_IN == btn_id) ||
+ (mobile_apis::ButtonName::NAV_ZOOM_OUT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_UP == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_UP_RIGHT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_RIGHT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_DOWN_RIGHT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_DOWN == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_DOWN_LEFT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_LEFT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_PAN_UP_LEFT == btn_id) ||
+ (mobile_apis::ButtonName::NAV_TILT_TOGGLE == btn_id) ||
+ (mobile_apis::ButtonName::NAV_ROTATE_CLOCKWISE == btn_id) ||
+ (mobile_apis::ButtonName::NAV_ROTATE_COUNTERCLOCKWISE == btn_id) ||
+ (mobile_apis::ButtonName::NAV_HEADING_TOGGLE == btn_id))) {
+ return false;
+ }
+
return true;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
index e70433f29b..9be5a270f5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
@@ -470,8 +470,8 @@ void SystemRequest::Run() {
static_cast<rpc::policy_table_interface_base::RequestType>(
request_type));
- if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
- request_type)) {
+ if (!policy_handler.IsRequestTypeAllowed(
+ application->device(), application->policy_app_id(), request_type)) {
LOG4CXX_ERROR(logger_,
"RequestType " << stringified_request_type
<< " is DISALLOWED by policies");
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
index 0734e1935d..27768e8a31 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -99,10 +99,14 @@
#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_create_window_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_create_window_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_window_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_window_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
@@ -158,6 +162,8 @@
#endif // EXTERNAL_PROPRIETARY_MODE
#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h"
#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
@@ -230,10 +236,14 @@
#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_cancel_interaction_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h"
#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h"
#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h"
@@ -243,6 +253,7 @@
#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -317,6 +328,13 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::ActivateAppRequest>()
: factory.GetCreator<commands::ActivateAppResponse>();
}
+ case hmi_apis::FunctionID::BasicCommunication_CloseApplication: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::BasicCommunicationCloseApplicationRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationCloseApplicationResponse>();
+ }
#ifdef EXTERNAL_PROPRIETARY_MODE
case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
return hmi_apis::messageType::request == message_type
@@ -385,6 +403,11 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UIAddCommandRequest>()
: factory.GetCreator<commands::UIAddCommandResponse>();
}
+ case hmi_apis::FunctionID::UI_CancelInteraction: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UICancelInteractionRequest>()
+ : factory.GetCreator<commands::UICancelInteractionResponse>();
+ }
case hmi_apis::FunctionID::UI_DeleteCommand: {
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::UIDeleteCommandRequest>()
@@ -400,6 +423,16 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UIDeleteSubmenuRequest>()
: factory.GetCreator<commands::UIDeleteSubmenuResponse>();
}
+ case hmi_apis::FunctionID::UI_ShowAppMenu: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIShowAppMenuRequest>()
+ : factory.GetCreator<commands::UIShowAppMenuResponse>();
+ }
+ case hmi_apis::FunctionID::UI_DeleteWindow: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIDeleteWindowRequest>()
+ : factory.GetCreator<commands::UIDeleteWindowResponse>();
+ }
case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::UISetMediaClockTimerRequest>()
@@ -448,6 +481,11 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UIChangeRegistrationRequest>()
: factory.GetCreator<commands::UIChangeRegistratioResponse>();
}
+ case hmi_apis::FunctionID::UI_CreateWindow: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UICreateWindowRequest>()
+ : factory.GetCreator<commands::UICreateWindowResponse>();
+ }
case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::UIPerformAudioPassThruRequest>()
@@ -852,8 +890,13 @@ CommandCreator& HMICommandFactory::get_creator_factory(
: factory.GetCreator<commands::BCGetFilePathResponse>();
}
case hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated: {
- return factory
- .GetCreator<commands::OnBCSystemCapabilityUpdatedNotification>();
+ return (application_manager::commands::Command::CommandSource::
+ SOURCE_HMI == source)
+ ? factory.GetCreator<
+ commands::
+ OnBCSystemCapabilityUpdatedNotificationFromHMI>()
+ : factory.GetCreator<
+ commands::OnBCSystemCapabilityUpdatedNotification>();
}
default: { return factory.GetCreator<InvalidCommand>(); }
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
index 1a1d4f725c..c6f4b64636 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
@@ -40,10 +40,16 @@
#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
+#include "sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h"
+#include "sdl_rpc_plugin/commands/mobile/cancel_interaction_response.h"
#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "sdl_rpc_plugin/commands/mobile/close_application_request.h"
+#include "sdl_rpc_plugin/commands/mobile/close_application_response.h"
#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/create_window_request.h"
+#include "sdl_rpc_plugin/commands/mobile/create_window_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
@@ -52,6 +58,8 @@
#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_window_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_window_response.h"
#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
@@ -110,6 +118,8 @@
#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/mobile/show_app_menu_request.h"
+#include "sdl_rpc_plugin/commands/mobile/show_app_menu_response.h"
#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h"
#include "sdl_rpc_plugin/commands/mobile/show_request.h"
@@ -170,6 +180,11 @@ CommandCreator& MobileCommandFactory::get_command_creator(
? factory.GetCreator<commands::AddCommandRequest>()
: factory.GetCreator<commands::AddCommandResponse>();
}
+ case mobile_apis::FunctionID::CreateWindowID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::CreateWindowRequest>()
+ : factory.GetCreator<commands::CreateWindowResponse>();
+ }
case mobile_apis::FunctionID::DeleteCommandID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<commands::DeleteCommandRequest>()
@@ -185,6 +200,16 @@ CommandCreator& MobileCommandFactory::get_command_creator(
? factory.GetCreator<commands::DeleteSubMenuRequest>()
: factory.GetCreator<commands::DeleteSubMenuResponse>();
}
+ case mobile_apis::FunctionID::ShowAppMenuID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ShowAppMenuRequest>()
+ : factory.GetCreator<commands::ShowAppMenuResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteWindowID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteWindowRequest>()
+ : factory.GetCreator<commands::DeleteWindowResponse>();
+ }
case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<
@@ -212,6 +237,11 @@ CommandCreator& MobileCommandFactory::get_command_creator(
? factory.GetCreator<commands::PerformAudioPassThruRequest>()
: factory.GetCreator<commands::PerformAudioPassThruResponse>();
}
+ case mobile_apis::FunctionID::CancelInteractionID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::CancelInteractionRequest>()
+ : factory.GetCreator<commands::CancelInteractionResponse>();
+ }
case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<
@@ -356,6 +386,11 @@ CommandCreator& MobileCommandFactory::get_command_creator(
: factory
.GetCreator<commands::GetCloudAppPropertiesResponse>();
}
+ case mobile_apis::FunctionID::CloseApplicationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::CloseApplicationRequest>()
+ : factory.GetCreator<commands::CloseApplicationResponse>();
+ }
case mobile_apis::FunctionID::GenericResponseID: {
using app_mngr::commands::Command;
return factory.GetCreator<commands::GenericResponse>();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
index b261b20c24..43462bfaf1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
@@ -70,8 +70,14 @@ void SDLRPCPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) {
if (plugins::ApplicationEvent::kApplicationRegistered == event) {
- application->AddExtension(
- std::make_shared<SystemCapabilityAppExtension>(*this, *application));
+ auto sys_cap_ext_ptr =
+ std::make_shared<SystemCapabilityAppExtension>(*this, *application);
+ application->AddExtension(sys_cap_ext_ptr);
+ // Processing automatic subscription to SystemCapabilities for DISPLAY type
+ const auto capability_type =
+ mobile_apis::SystemCapabilityType::eType::DISPLAYS;
+ LOG4CXX_DEBUG(logger_, "Subscription to DISPLAYS capability is enabled");
+ sys_cap_ext_ptr->SubscribeTo(capability_type);
} else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
ClearSubscriptions(application);
}
@@ -84,6 +90,13 @@ void SDLRPCPlugin::ClearSubscriptions(app_mngr::ApplicationSharedPtr app) {
} // namespace sdl_rpc_plugin
-extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+extern "C" __attribute__((visibility("default")))
+application_manager::plugin_manager::RPCPlugin*
+Create() {
return new sdl_rpc_plugin::SDLRPCPlugin();
}
+
+extern "C" __attribute__((visibility("default"))) void Delete(
+ application_manager::plugin_manager::RPCPlugin* data) {
+ delete data;
+} \ No newline at end of file
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
index 1a206c2cce..b21ab9dca8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
@@ -23,15 +23,8 @@ file(GLOB SOURCES
)
set(LIBRARIES
+ sdl_rpc_plugin_static
gmock
- Utils
- SmartObjects
- HMI_API
- MOBILE_API
- connectionHandler
- sdl_rpc_plugin
- jsoncpp
- Policy
)
create_cotired_test("sdl_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
index 8f2feed877..26f7a63872 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
@@ -148,6 +148,11 @@ typedef NiceMock<
#define NAVI true
#define NOT_NAVI false
+namespace {
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
ACTION_P(GetEventId, event_id) {
*event_id = arg0.id();
}
@@ -155,8 +160,8 @@ ACTION_P(GetArg, arg) {
*arg = arg0;
}
-ACTION_P(GetArg3, result) {
- arg3 = *result;
+ACTION_P(GetArg4, result) {
+ arg4 = *result;
}
ACTION_P2(GetConnectIdPermissionConsent, connect_id, consent) {
@@ -192,6 +197,14 @@ const int32_t kMobileProtocolType_ = 0;
const int32_t kProtocolVersion_ = 3;
const uint32_t kCorrelationId_ = 1939u;
const uint32_t kAppId_ = 2014u;
+const std::string kDefaultLanguage = "en-us";
+const mobile_apis::Language::eType kMobileLanguage =
+ mobile_apis::Language::EN_US;
+
+// LSDW - lock screen dismissal warning
+const std::string kLockScreenDismissalWarningMessage_en =
+ "Swipe down to dismiss, acknowledging that you are not the driver";
+const uint32_t kConnectionKey = 2u;
} // namespace
class HMICommandsNotificationsTest
@@ -240,6 +253,9 @@ class HMICommandsNotificationsTest
.WillByDefault(ReturnRef(mock_event_dispatcher_));
ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_));
ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
+ ON_CALL(app_mngr_, application(kConnectionKey)).WillByDefault(Return(app_));
+ ON_CALL(mock_message_helper_, MobileLanguageToString(kMobileLanguage))
+ .WillByDefault(Return(kDefaultLanguage));
}
am::ApplicationSharedPtr ConfigureApp(NiceMock<MockApplication>** app_mock,
@@ -259,6 +275,8 @@ class HMICommandsNotificationsTest
.WillByDefault(Return(vc));
ON_CALL(**app_mock, IsAudioApplication())
.WillByDefault(Return(media || navi || vc));
+ ON_CALL(**app_mock, ui_language())
+ .WillByDefault(ReturnRef(kMobileLanguage));
return app;
}
#if defined(OS_POSIX)
@@ -1090,6 +1108,7 @@ TEST_F(HMICommandsNotificationsTest,
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
SetRegularState(app_,
+ kDefaultWindowId,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
mobile_apis::VideoStreamingState::NOT_STREAMABLE,
@@ -1114,12 +1133,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(app_,
- mobile_apis::HMILevel::HMI_NONE,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE,
- mobile_apis::VideoStreamingState::NOT_STREAMABLE,
- false));
+ EXPECT_CALL(mock_state_controller_, ExitDefaultWindow(app_));
command->Run();
}
@@ -1137,7 +1151,8 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
- SetRegularState(_, mobile_apis::HMILevel::HMI_FULL, true));
+ SetRegularState(
+ _, kDefaultWindowId, mobile_apis::HMILevel::HMI_FULL, true));
EXPECT_CALL(app_mngr_, get_settings())
.WillOnce(ReturnRef(app_mngr_settings_));
@@ -1338,8 +1353,10 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(app_, mobile_apis::HMILevel::HMI_NONE, false));
+ EXPECT_CALL(
+ mock_state_controller_,
+ SetRegularState(
+ app_, kDefaultWindowId, mobile_apis::HMILevel::HMI_NONE, false));
EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
kAppId_,
@@ -1416,7 +1433,8 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_, kDefaultWindowId, *it));
command->Run();
}
}
@@ -1465,7 +1483,8 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_, kDefaultWindowId, *it));
command->Run();
}
}
@@ -1793,11 +1812,26 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ typedef boost::optional<bool> OptionalBool;
+
+ ON_CALL(mock_policy_handler_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(true)));
+ std::string required_language = "en-us";
+ ON_CALL(mock_policy_handler_,
+ LockScreenDismissalWarningMessage(required_language))
+ .WillByDefault(Return(
+ boost::optional<std::string>(kLockScreenDismissalWarningMessage_en)));
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(applications_));
+
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(*app_ptr_, app_id()).Times(0);
command->Run();
@@ -1805,16 +1839,28 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
TEST_F(HMICommandsNotificationsTest,
OnDriverDistractionNotificationInvalidApp) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
ApplicationSharedPtr invalid_app;
application_set_.insert(invalid_app);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ typedef boost::optional<bool> OptionalBool;
+ ON_CALL(mock_policy_handler_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(true)));
+ std::string required_language = "en-us";
+ ON_CALL(mock_policy_handler_,
+ LockScreenDismissalWarningMessage(required_language))
+ .WillByDefault(Return(
+ boost::optional<std::string>(kLockScreenDismissalWarningMessage_en)));
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(applications_));
+
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(*app_ptr_, app_id()).Times(0);
command->Run();
@@ -1825,21 +1871,33 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::mobile_notification::state] = state;
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
application_set_.insert(app_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ typedef boost::optional<bool> OptionalBool;
+ ON_CALL(mock_policy_handler_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(true)));
+ std::string required_language = "en-us";
+ ON_CALL(mock_policy_handler_,
+ LockScreenDismissalWarningMessage(required_language))
+ .WillByDefault(Return(
+ boost::optional<std::string>(kLockScreenDismissalWarningMessage_en)));
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(applications_));
+
policy::CheckPermissionResult result;
result.hmi_level_permitted = policy::kRpcAllowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
- EXPECT_CALL(mock_policy_handler_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
+ EXPECT_CALL(mock_policy_handler_, CheckPermissions(_, _, _, _, _))
+ .WillOnce(GetArg4(&result));
+
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL))
.WillOnce(GetMessage(message));
- EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
command->Run();
EXPECT_EQ(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc
new file mode 100644
index 0000000000..f3ed480180
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/on_bc_system_capability_updated_notification_from_hmi.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_bc_system_capability_updated_notification_from_hmi {
+
+using sdl_rpc_plugin::commands::OnBCSystemCapabilityUpdatedNotificationFromHMI;
+using ::testing::_;
+using ::testing::Return;
+
+typedef std::shared_ptr<OnBCSystemCapabilityUpdatedNotificationFromHMI>
+ OnBCSystemCapabilityUpdatedNotificationFromHMIPtr;
+
+namespace strings = application_manager::strings;
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+MATCHER(CheckMessageToMobile, "") {
+ const auto function_id = mobile_apis::FunctionID::OnSystemCapabilityUpdatedID;
+
+ const bool is_function_id_matched =
+ function_id == static_cast<am::mobile_api::FunctionID::eType>(
+ (*arg)[strings::params][strings::function_id].asInt());
+ const bool app_id_exist =
+ (*arg)[strings::msg_params].keyExists(strings::app_id);
+ bool is_connection_key_correct = true;
+ if ((*arg)[strings::msg_params].keyExists(strings::connection_key)) {
+ is_connection_key_correct =
+ (*arg)[strings::params][strings::connection_key] == kAppId;
+ }
+ return is_function_id_matched && !app_id_exist && is_connection_key_correct;
+}
+
+MATCHER_P(CheckDisplayCapabilitiesNotChanged, display_capability, "") {
+ return display_capability == arg;
+}
+
+class OnBCSystemCapabilityUpdatedNotificationFromHMITest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ OnBCSystemCapabilityUpdatedNotificationFromHMITest()
+ : message_(CreateMessage())
+ , display_capability_(
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [strings::display_capabilities]) {
+ command_ =
+ CreateCommand<OnBCSystemCapabilityUpdatedNotificationFromHMI>(message_);
+ mock_app_ = CreateMockApp();
+ }
+
+ OnBCSystemCapabilityUpdatedNotificationFromHMIPtr command_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ const SmartObject display_capability_;
+};
+
+TEST_F(
+ OnBCSystemCapabilityUpdatedNotificationFromHMITest,
+ Run_AppIdNotPresentedInMessage_SetSystemDisplayCapabilitiesToHMICapabilities_SendMessageToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_system_display_capabilities(
+ CheckDisplayCapabilitiesNotChanged(display_capability_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(),
+ ::application_manager::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(OnBCSystemCapabilityUpdatedNotificationFromHMITest,
+ Run_AppNotRegisteredWithPresentedAppIdInMessage_MessageNotSendToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+ (*message_)[strings::msg_params][strings::app_id] = kAppId;
+ ApplicationSharedPtr app; // Empty application shared pointer
+
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(app));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(
+ OnBCSystemCapabilityUpdatedNotificationFromHMITest,
+ Run_AppRegisteredWithPresentedAppIdInMessage_SetDisplayCapabilitiesToApp_SendMessageToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+ (*message_)[strings::msg_params][strings::app_id] = kAppId;
+
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_,
+ set_display_capabilities(
+ CheckDisplayCapabilitiesNotChanged(display_capability_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(),
+ ::application_manager::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+} // namespace on_bc_system_capability_updated_notification_from_hmi
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc
new file mode 100644
index 0000000000..cb8894749f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/on_bc_system_capability_updated_notification.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_bc_system_capability_updated_notification {
+
+using sdl_rpc_plugin::commands::OnBCSystemCapabilityUpdatedNotification;
+using ::testing::_;
+using ::testing::Return;
+
+typedef std::shared_ptr<OnBCSystemCapabilityUpdatedNotification>
+ OnBCSystemCapabilityUpdatedNotificationPtr;
+
+namespace strings = application_manager::strings;
+namespace {
+const uint32_t kConnectionKey = 1u;
+}
+
+MATCHER_P(CheckDisplayCapabilities, display_capabilities, "") {
+ return display_capabilities ==
+ (*arg)[strings::msg_params][strings::system_capability]
+ [strings::display_capabilities];
+}
+
+class OnBCSystemCapabilityUpdatedNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ command_ = CreateCommand<OnBCSystemCapabilityUpdatedNotification>(message_);
+ mock_app_ = CreateMockApp();
+ }
+
+ OnBCSystemCapabilityUpdatedNotificationPtr command_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+};
+
+TEST_F(OnBCSystemCapabilityUpdatedNotificationTest,
+ SystemDisplayCapabilities_SUCCESS) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ smart_objects::SmartObjectSPtr system_display_capabilities =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
+
+ EXPECT_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .Times(2)
+ .WillRepeatedly(Return(system_display_capabilities));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToHMI(CheckDisplayCapabilities(*system_display_capabilities)));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(OnBCSystemCapabilityUpdatedNotificationTest,
+ SystemDisplayCapabilities_DATA_NOT_AVAILABLE) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+ EXPECT_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillOnce(Return(nullptr));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+} // namespace on_bc_system_capability_updated_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
index 802ad01d0b..fe6ba7c4e3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -52,22 +52,65 @@ namespace hmi_commands_test {
namespace on_driver_distraction_notification {
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Eq;
+using ::testing::NiceMock;
using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::SetArgumentPointee;
+
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification;
using namespace am::commands;
+using test::components::commands_test::MobileResultCodeIs;
+
+namespace {
+const std::string kDefaultLanguage = "en-us";
+const mobile_apis::Language::eType kMobileLanguage =
+ mobile_apis::Language::EN_US;
-typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr;
+// LSDW - lock screen dismissal warning
+const std::string kLockScreenDismissalWarningMessage_en =
+ "Swipe down to dismiss, acknowledging that you are not the driver";
+const uint32_t kConnectionKey = 2u;
+} // namespace
class HMIOnDriverDistractionNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
HMIOnDriverDistractionNotificationTest()
- : app_set_lock_(std::make_shared<sync_primitives::Lock>()) {}
+ : mock_app_(CreateMockApp())
+ , app_set_lock_(std::make_shared<sync_primitives::Lock>())
+ , accessor(app_set_, app_set_lock_) {
+ app_set_.insert(mock_app_);
+ InitMocksRelations();
+ }
+
+ typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr;
+ typedef boost::optional<bool> OptionalBool;
+
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_app_, ui_language())
+ .WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(mock_message_helper_, MobileLanguageToString(kMobileLanguage))
+ .WillByDefault(Return(kDefaultLanguage));
+ }
+
+ MockAppPtr mock_app_;
std::shared_ptr<sync_primitives::Lock> app_set_lock_;
- policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+ am::ApplicationSet app_set_;
+ DataAccessor<am::ApplicationSet> accessor;
+ NiceMock<policy_test::MockPolicyHandlerInterface>
+ mock_policy_handler_interface_;
+
+ void InitMocksRelations() {
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_interface_));
+ }
};
MATCHER_P2(CheckNotificationParams, function_id, state, "") {
@@ -83,75 +126,237 @@ MATCHER_P2(CheckNotificationParams, function_id, state, "") {
return is_function_id_matched && is_state_matched;
}
-ACTION_P(GetArg3, result) {
- arg3 = *result;
+ACTION_P(GetArg4, result) {
+ arg4 = *result;
}
-TEST_F(HMIOnDriverDistractionNotificationTest, Run_PushMobileMessage_SUCCESS) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
+ACTION_P(SetMessage, lockScreenDismissalWarning) {
+ smart_objects::SmartObject& notification = arg0;
+
+ notification[application_manager::strings::msg_params]
+ [application_manager::mobile_notification::
+ lock_screen_dismissal_warning] = lockScreenDismissalWarning;
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SUCCESS) {
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
(*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*commands_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
NotificationPtr command(
CreateCommand<OnDriverDistractionNotification>(commands_msg));
EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
- MockAppPtr mock_app = CreateMockApp();
- am::ApplicationSet app_set;
- app_set.insert(mock_app);
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(true)));
+
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalWarningMessage(_))
+ .WillByDefault(Return(kLockScreenDismissalWarningMessage_en));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _, _))
+ .WillOnce(GetArg4(&result));
+
+ MessageSharedPtr message_to_mobile(
+ CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mobile), Return(true)));
+ command->Run();
+
+ ASSERT_TRUE((*message_to_mobile)[am::strings::msg_params].keyExists(
+ am::mobile_notification::lock_screen_dismissal_warning));
+
+ auto LSDW_message =
+ (*message_to_mobile)
+ [am::strings::msg_params]
+ [am::mobile_notification::lock_screen_dismissal_warning]
+ .asString();
+
+ EXPECT_EQ(kLockScreenDismissalWarningMessage_en, LSDW_message);
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_PushMobileMessage_If_DisallowedByPolicy) {
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*commands_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(boost::optional<bool>(true)));
+
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalWarningMessage(_))
+ .WillByDefault(Return(kLockScreenDismissalWarningMessage_en));
- DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
policy::CheckPermissionResult result;
result.hmi_level_permitted = policy::kRpcDisallowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_interface_));
- EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(3);
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _, _))
+ .WillOnce(GetArg4(&result));
- EXPECT_CALL(*mock_app,
+ MessageSharedPtr pushed_message(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(*mock_app_,
PushMobileMessage(CheckNotificationParams(
- am::mobile_api::FunctionID::OnDriverDistractionID, state)));
+ am::mobile_api::FunctionID::OnDriverDistractionID, state)))
+ .WillOnce(SaveArg<0>(&pushed_message));
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
command->Run();
+
+ ASSERT_TRUE((*pushed_message)[am::strings::msg_params].keyExists(
+ am::mobile_notification::lock_screen_dismissal_warning));
+
+ auto lock_screen_dismissal_warning_message =
+ (*pushed_message)[am::strings::msg_params]
+ [am::mobile_notification::lock_screen_dismissal_warning]
+ .asString();
+
+ EXPECT_EQ(kLockScreenDismissalWarningMessage_en,
+ lock_screen_dismissal_warning_message);
}
TEST_F(HMIOnDriverDistractionNotificationTest,
- Run_SendNotificationToMobile_SUCCESS) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
+ Run_SendNotificationIfLockScreenDismissalMissed) {
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
(*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
NotificationPtr command(
CreateCommand<OnDriverDistractionNotification>(commands_msg));
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(boost::optional<bool>()));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ ON_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _, _))
+ .WillByDefault(GetArg4(&result));
+
+ MessageSharedPtr command_result;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ command->Run();
+
+ auto& msg_params =
+ (*command_result)[application_manager::strings::msg_params];
+ EXPECT_FALSE(msg_params.keyExists(
+ application_manager::mobile_notification::lock_screen_dismissal_enabled));
+ EXPECT_FALSE(msg_params.keyExists(
+ application_manager::mobile_notification::lock_screen_dismissal_warning));
+}
+
+// LSDW - lock screen dimissal
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_LSDWMessageIsAbsent_SUCCESS) {
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*commands_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
- MockAppPtr mock_app = CreateMockApp();
- am::ApplicationSet app_set;
- app_set.insert(mock_app);
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(false)));
- DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ // LockScreenDismissalWarning won't be added to message if value of
+ // LockScreenDismissalEnabledState is false
+ std::string required_language = "en-us";
+ EXPECT_CALL(mock_policy_handler_interface_,
+ LockScreenDismissalWarningMessage(required_language))
+ .Times(0);
policy::CheckPermissionResult result;
result.hmi_level_permitted = policy::kRpcAllowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_interface_));
- EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
+ MessageSharedPtr message_to_mobile(
+ CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(2);
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _, _))
+ .WillOnce(GetArg4(&result));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
CheckNotificationParams(
am::mobile_api::FunctionID::OnDriverDistractionID, state),
- Command::CommandSource::SOURCE_SDL));
-
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mobile), Return(true)));
command->Run();
+
+ EXPECT_FALSE((*message_to_mobile)[am::strings::msg_params].keyExists(
+ am::mobile_notification::lock_screen_dismissal_warning));
}
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SpecifiedLanguageIsAbsent_SUCCESS) {
+ const auto state = hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+ (*commands_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalEnabledState())
+ .WillByDefault(Return(OptionalBool(true)));
+
+ ON_CALL(mock_policy_handler_interface_, LockScreenDismissalWarningMessage(_))
+ .WillByDefault(Return(kLockScreenDismissalWarningMessage_en));
+
+ // In case when specified language is absent in policy table, will added
+ // message on default language (en-us)
+ const mobile_apis::Language::eType mobile_language =
+ mobile_apis::Language::FR_FR;
+ std::string required_language = "FR-FR";
+ ON_CALL(*mock_app_, ui_language()).WillByDefault(ReturnRef(mobile_language));
+ ON_CALL(mock_message_helper_, MobileLanguageToString(mobile_language))
+ .WillByDefault(Return(required_language));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _, _))
+ .WillOnce(GetArg4(&result));
+
+ MessageSharedPtr message_to_mobile(
+ CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mobile), Return(true)));
+ command->Run();
+
+ ASSERT_TRUE((*message_to_mobile)[am::strings::msg_params].keyExists(
+ am::mobile_notification::lock_screen_dismissal_warning));
+
+ auto lock_screen_dismissal_warning_message =
+ (*message_to_mobile)
+ [am::strings::msg_params]
+ [am::mobile_notification::lock_screen_dismissal_warning]
+ .asString();
+
+ EXPECT_EQ(kLockScreenDismissalWarningMessage_en,
+ lock_screen_dismissal_warning_message);
+}
} // namespace on_driver_distraction_notification
} // namespace hmi_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
index d6df3e61ee..67c36dce9c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -139,6 +139,7 @@ TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
radio_control_capability["hdChannelAvailable"] = true;
radio_control_capability["rdsDataAvailable"] = true;
radio_control_capability["availableHDsAvailable"] = true;
+ radio_control_capability["availableHdChannelsAvailable"] = true;
radio_control_capability["stateAvailable"] = true;
radio_control_capability["signalStrengthAvailable"] = true;
radio_control_capability["signalChangeThresholdAvailable"] = true;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
index 3fd3a39dca..4683fc62c7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -145,7 +145,7 @@ TEST_F(UIGetCapabilitiesResponseTest, SetHmiZone_SUCCESS) {
TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
(*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
ResponseFromHMIPtr command(
CreateCommand<UIGetCapabilitiesResponse>(command_msg));
@@ -153,9 +153,40 @@ TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
smart_objects::SmartObject audio_pass_thru_capabilities_so =
(*command_msg)[strings::msg_params]
[strings::audio_pass_thru_capabilities];
+
+ // hmi_capabilities will receive a list of capabilities, the first element
+ // being audio_pass_thru_capabilities_so
+ smart_objects::SmartObject audio_pass_thru_capabilities_list_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ audio_pass_thru_capabilities_list_so[0] = audio_pass_thru_capabilities_so;
EXPECT_CALL(
mock_hmi_capabilities_,
- set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
+ set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_list_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThruList_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ // if both audioPassThruCapabilities and audioPassThruCapabilitiesList are
+ // supplied, audioPassThruCapabilitiesList should be used
+ smart_objects::SmartObject audio_pass_thru_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject audio_pass_thru_capabilities_list_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
+ audio_pass_thru_capabilities_so;
+ (*command_msg)[strings::msg_params]
+ [strings::audio_pass_thru_capabilities_list] =
+ audio_pass_thru_capabilities_list_so;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(
+ mock_hmi_capabilities_,
+ set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_list_so));
command->Run();
}
@@ -279,7 +310,7 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
video_streaming_capability[strings::preferred_resolution]
[strings::resolution_width] = 800;
video_streaming_capability[strings::preferred_resolution]
- [strings::resolution_height] = 350;
+ [strings::resolution_height] = 354;
video_streaming_capability[strings::max_bitrate] = 10000;
@@ -297,6 +328,12 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
video_streaming_capability[strings::haptic_spatial_data_supported] = true;
+ video_streaming_capability[strings::diagonal_screen_size] = 7.47;
+
+ video_streaming_capability[strings::pixel_per_inch] = 117.f;
+
+ video_streaming_capability[strings::scale] = 1.f;
+
ResponseFromHMIPtr command(
CreateCommand<UIGetCapabilitiesResponse>(command_msg));
@@ -306,6 +343,25 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
command->Run();
}
+TEST_F(UIGetCapabilitiesResponseTest, SetSystemDisplayCapabilities_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ const auto& display_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::display_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_system_display_capabilities(display_capability_so));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
} // namespace ui_get_capabilities_response
} // namespace hmi_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
index 113c6d32a0..dc7731bfc8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
@@ -73,6 +73,8 @@ const uint32_t kDefaultTimeout = 1000u;
const uint32_t kCorrelationId = 2u;
const mobile_apis::FunctionID::eType kFunctionId =
mobile_apis::FunctionID::AlertID;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -138,9 +140,9 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
*mock_app_,
AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
.WillByDefault(Return(false));
- ON_CALL(*mock_app_, hmi_level())
+ ON_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- ON_CALL(*mock_app_, hmi_level())
+ ON_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
}
@@ -155,7 +157,8 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
}
void ExpectCallHmiLevel(const mobile_apis::HMILevel::eType level) {
- EXPECT_CALL(*mock_app_, hmi_level()).WillRepeatedly(Return(level));
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
+ .WillRepeatedly(Return(level));
}
void ExpectManageMobileCommandWithResultCode(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc
new file mode 100644
index 0000000000..02a6591a2d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc
@@ -0,0 +1,457 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory>
+#include <set>
+#include <string>
+
+#include "mobile/create_window_request.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_state_controller.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace create_window_request {
+
+namespace am = application_manager;
+using am::MockMessageHelper;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::CreateWindowRequest;
+using namespace mobile_apis::PredefinedWindows;
+using am::commands::Command;
+using application_manager::WindowID;
+using test::components::application_manager_test::MockStateController;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kConnectionKey = 2u;
+const int32_t kFunctionID = mobile_apis::FunctionID::CreateWindowID;
+const WindowID kTestWindowId = 12;
+const WindowID kDuplicateWindowID = 13;
+const char* const kWindowName = "WindowName";
+const utils::custom_string::CustomString kAppName("TestApp");
+} // namespace
+
+MATCHER_P2(CheckMessageToMobile, result_code, success, "") {
+ const bool is_success =
+ (*arg)[am::strings::msg_params][am::strings::success].asBool() == success;
+
+ const bool is_result_code_correct =
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ static_cast<int32_t>(result_code);
+ return is_success && is_result_code_correct;
+}
+
+class CreateWindowRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ CreateWindowRequestTest() {
+ mock_app_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ protected:
+ MessageSharedPtr CreateMsgParams() {
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ void SetupHelperApplyWindowInitialState(const MockAppPtr& app,
+ const MessageSharedPtr& msg) {
+ am::HmiStatePtr state(new am::HmiState(app, app_mngr_));
+ const auto window_type = static_cast<mobile_apis::WindowType::eType>(
+ (*msg)[am::strings::msg_params][am::strings::window_type].asInt());
+ const auto window_id = static_cast<mobile_apis::WindowType::eType>(
+ (*msg)[am::strings::msg_params][am::strings::window_id].asInt());
+ const auto window_name =
+ (*msg)[am::strings::msg_params][am::strings::window_name].asString();
+
+ state->set_window_type(window_type);
+ state->set_hmi_level(mobile_apis::HMILevel::INVALID_ENUM);
+ state->set_audio_streaming_state(
+ mobile_apis::AudioStreamingState::INVALID_ENUM);
+ state->set_video_streaming_state(
+ mobile_apis::VideoStreamingState::INVALID_ENUM);
+ state->set_system_context(mobile_apis::SystemContext::INVALID_ENUM);
+ ApplicationSharedPtr AppPtr = app;
+ ON_CALL(app_mngr_,
+ CreateRegularState(AppPtr,
+ window_type,
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
+ mobile_apis::SystemContext::INVALID_ENUM))
+ .WillByDefault(Return(state));
+ ON_CALL(*mock_app_, SetInitialState(kTestWindowId, window_name, state))
+ .WillByDefault(Return());
+ ON_CALL(app_mngr_, state_controller())
+ .WillByDefault(ReturnRef(mock_state_controller));
+ ON_CALL(
+ mock_state_controller,
+ OnAppWindowAdded(
+ AppPtr, window_id, window_type, mobile_apis::HMILevel::HMI_NONE))
+ .WillByDefault(Return());
+ }
+
+ void SetUp() OVERRIDE {
+ using namespace application_manager;
+ display_capabilities_ = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject window_type_supported(
+ smart_objects::SmartType_Array);
+
+ const uint32_t maximum_widgets_amount = 4;
+ smart_objects::SmartObject maximum_widgets(smart_objects::SmartType_Map);
+ maximum_widgets[strings::window_type] = mobile_apis::WindowType::WIDGET;
+ maximum_widgets[strings::maximum_number_of_windows] =
+ maximum_widgets_amount;
+
+ window_type_supported[window_type_supported.length()] = maximum_widgets;
+
+ (*display_capabilities_)[0][strings::window_type_supported] =
+ window_type_supported;
+
+ ON_CALL(*mock_app_, display_capabilities())
+ .WillByDefault(Return(display_capabilities_));
+
+ window_params_map_lock_ptr_ = std::make_shared<sync_primitives::Lock>();
+
+ DataAccessor<am::WindowParamsMap> window_params_map(
+ test_window_params_map_, window_params_map_lock_ptr_);
+ ON_CALL(*mock_app_, window_optional_params_map())
+ .WillByDefault(Return(window_params_map));
+ }
+
+ MockAppPtr mock_app_;
+ NiceMock<MockStateController> mock_state_controller;
+ std::shared_ptr<sync_primitives::Lock> window_params_map_lock_ptr_;
+ application_manager::WindowParamsMap test_window_params_map_;
+ smart_objects::SmartObjectSPtr display_capabilities_;
+};
+
+TEST_F(CreateWindowRequestTest, WindowID_ExpectDefaultWindowID) {
+ auto msg = CreateMsgParams();
+ const auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ command->window_id());
+}
+
+TEST_F(CreateWindowRequestTest,
+ Run_AppDoesNotExist_ExpectAppNotRegisteredResponseToMobile) {
+ const auto result_code = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(CreateWindowRequestTest,
+ Run_WindowIDAlreadyExist_ExpectInvalidIDResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_ID;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(true));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(CreateWindowRequestTest,
+ Run_CreateWindowForMAINWindowType_ExpectInvalidDataResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_DATA;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::eType::MAIN;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(
+ CreateWindowRequestTest,
+ Run_DuplicateUpdatesFromNotExistingWindowId_ExpectInvalidDataResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_DATA;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, WindowIdExists(kDuplicateWindowID))
+ .WillByDefault(Return(false));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params]
+ [am::strings::duplicate_updates_from_window_id] = kDuplicateWindowID;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(
+ CreateWindowRequestTest,
+ Run_DuplicateUpdatesFromExistingWindowId_ExpectUICreateWindowIsSentToHMI) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_CreateWindow),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, WindowIdExists(kDuplicateWindowID))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
+ ON_CALL(*mock_app_, GetWindowNames())
+ .WillByDefault(Return(std::vector<std::string>()));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params]
+ [am::strings::duplicate_updates_from_window_id] = kDuplicateWindowID;
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::WIDGET;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(CreateWindowRequestTest,
+ Run_WindowNameAppNameAreEqual_ExpectDuplicateNameResponseToMobile) {
+ const auto result_code = mobile_apis::Result::DUPLICATE_NAME;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params][am::strings::window_name] = kAppName;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(CreateWindowRequestTest,
+ Run_AllParametersCorrect_ExpectUICreateWindowIsSentToHMI) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_CreateWindow),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, WindowIdExists(kDuplicateWindowID))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
+
+ const std::vector<std::string> windowNames = {
+ "WindowName_1", "WindowName_2", "WindowName_3"};
+ ON_CALL(*mock_app_, GetWindowNames()).WillByDefault(Return(windowNames));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params][am::strings::window_name] = kWindowName;
+ (*msg)[am::strings::msg_params]
+ [am::strings::duplicate_updates_from_window_id] = kDuplicateWindowID;
+ (*msg)[am::strings::msg_params][am::strings::associated_service_type] =
+ "MEDIA";
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::WIDGET;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(
+ CreateWindowRequestTest,
+ CheckWindowName_AllParametersCorrectCreateWindowForPrimaryWidget_SendMessageToHMI) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_CreateWindow),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, WindowIdExists(kTestWindowId))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, WindowIdExists(kDuplicateWindowID))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] =
+ mobile_apis::PredefinedWindows::PRIMARY_WIDGET;
+ (*msg)[am::strings::msg_params][am::strings::window_name] = kWindowName;
+ (*msg)[am::strings::msg_params]
+ [am::strings::duplicate_updates_from_window_id] = kDuplicateWindowID;
+ (*msg)[am::strings::msg_params][am::strings::associated_service_type] =
+ "MEDIA";
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::WIDGET;
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(CreateWindowRequestTest,
+ OnEvent_InvalidFunctionId_MessageNotSendToMobile) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ command->on_event(event);
+}
+
+TEST_F(CreateWindowRequestTest,
+ OnEvent_AppDoesNotExist_ExpectAppNotRegisteredResponseToMobile) {
+ const auto result_code = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ Event event(hmi_apis::FunctionID::UI_CreateWindow);
+ command->on_event(event);
+}
+
+TEST_F(CreateWindowRequestTest,
+ OnEvent_RequestFailedOnHMISide_SendGenericErrorResponseToMobile) {
+ const auto result_code = mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ (*msg)[am::strings::msg_params][am::strings::window_name] = kWindowName;
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::eType::WIDGET;
+
+ SetupHelperApplyWindowInitialState(mock_app_, msg);
+
+ Event event(hmi_apis::FunctionID::UI_CreateWindow);
+ event.set_smart_object(*msg);
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->on_event(event);
+}
+
+TEST_F(CreateWindowRequestTest,
+ OnEvent_AllParametersCorrect_SendSuccessResponseToMobile) {
+ const auto result_code = mobile_apis::Result::SUCCESS;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, true),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(1);
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::strings::window_name] = kWindowName;
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+ (*msg)[am::strings::msg_params][am::strings::window_type] =
+ mobile_apis::WindowType::eType::WIDGET;
+
+ SetupHelperApplyWindowInitialState(mock_app_, msg);
+
+ Event event(hmi_apis::FunctionID::UI_CreateWindow);
+ event.set_smart_object(*msg);
+
+ auto command = CreateCommand<CreateWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->on_event(event);
+}
+
+} // namespace create_window_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
index 4081583099..cce53bb480 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
@@ -98,6 +98,8 @@ namespace {
const uint32_t kConnectionKey = 1u;
const uint32_t kCorrelationId = 10u;
const int32_t kMenuId = 5;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
class DeleteFileRequestTest
@@ -134,7 +136,7 @@ TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
EXPECT_CALL(app_mngr_, get_settings())
@@ -161,7 +163,7 @@ TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(app_mngr_, get_settings())
@@ -191,7 +193,7 @@ TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) {
(*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(app_mngr_, get_settings())
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc
new file mode 100644
index 0000000000..f951d5c2a7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory>
+#include <set>
+#include <string>
+
+#include "mobile/delete_window_request.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_state_controller.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_window_request {
+
+namespace am = application_manager;
+using am::MockMessageHelper;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::DeleteWindowRequest;
+using namespace mobile_apis::PredefinedWindows;
+using am::commands::Command;
+using application_manager::WindowID;
+using test::components::application_manager_test::MockStateController;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const int32_t kFunctionID = mobile_apis::FunctionID::DeleteWindowID;
+const WindowID kTestWindowId = 12;
+} // namespace
+
+MATCHER_P2(CheckMessageToMobile, result_code, success, "") {
+ const bool is_success =
+ (*arg)[am::strings::msg_params][am::strings::success].asBool() == success;
+
+ const bool is_result_code_correct =
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ static_cast<int32_t>(result_code);
+ return is_success && is_result_code_correct;
+}
+
+class DeleteWindowRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteWindowRequestTest() {
+ mock_app_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ protected:
+ MessageSharedPtr CreateMsgParams() {
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ MockAppPtr mock_app_;
+ NiceMock<MockStateController> mock_state_controller;
+};
+
+TEST_F(DeleteWindowRequestTest, WindowID_ExpectDefaultWindowID) {
+ auto msg = CreateMsgParams();
+ const auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ command->window_id());
+}
+
+TEST_F(DeleteWindowRequestTest,
+ Run_AppDoesNotExist_ExpectAppNotRegisteredResponseToMobile) {
+ const auto result_code = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(DeleteWindowRequestTest,
+ Run_WindowIDForMainApplicationWindow_ExpectInvalidIDResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_ID;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(DeleteWindowRequestTest,
+ Run_WindowIDNotExist_ExpectInvalidIDResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_ID;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ ON_CALL(*mock_app_, GetWindowIds()).WillByDefault(Return(am::WindowIds()));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(DeleteWindowRequestTest,
+ Run_AllParametersCorrect_ExpectUIDeleteWindowIsSentToHMI) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteWindow),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+
+ ON_CALL(*mock_app_, GetWindowIds())
+ .WillByDefault(Return(am::WindowIds(1, kTestWindowId)));
+ EXPECT_CALL(*mock_app_, WindowIdExists(kTestWindowId)).WillOnce(Return(true));
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(DeleteWindowRequestTest,
+ Run_AllParametersCorrectDeleteWindowForPrimaryWidget_SendMessageToHMI) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteWindow),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ const auto primary_widget_window_id =
+ mobile_apis::PredefinedWindows::PRIMARY_WIDGET;
+ ON_CALL(*mock_app_, GetWindowIds())
+ .WillByDefault(Return(am::WindowIds(1, primary_widget_window_id)));
+ EXPECT_CALL(*mock_app_, WindowIdExists(primary_widget_window_id))
+ .WillOnce(Return(true));
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] =
+ primary_widget_window_id;
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(DeleteWindowRequestTest,
+ OnEvent_InvalidFunctionId_MessageNotSendToMobile) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ command->on_event(event);
+}
+
+TEST_F(DeleteWindowRequestTest,
+ OnEvent_AppDoesNotExist_ExpectAppNotRegisteredResponseToMobile) {
+ const auto result_code = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ Event event(hmi_apis::FunctionID::UI_DeleteWindow);
+ command->on_event(event);
+}
+
+TEST_F(DeleteWindowRequestTest,
+ OnEvent_RequestFailedOnHMISide_SendGenericErrorResponseToMobile) {
+ const auto result_code = mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ Event event(hmi_apis::FunctionID::UI_DeleteWindow);
+ event.set_smart_object(*msg);
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->on_event(event);
+}
+
+TEST_F(DeleteWindowRequestTest,
+ OnEvent_AllParametersCorrect_SendSuccessResponseToMobile) {
+ const auto result_code = mobile_apis::Result::SUCCESS;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, true),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(1);
+ EXPECT_CALL(*mock_app_, RemoveHMIState(kTestWindowId, _)).Times(1);
+
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kTestWindowId;
+
+ Event event(hmi_apis::FunctionID::UI_DeleteWindow);
+ event.set_smart_object(*msg);
+
+ auto command = CreateCommand<DeleteWindowRequest>(msg);
+ EXPECT_TRUE(command->Init());
+ command->on_event(event);
+}
+
+} // namespace delete_window_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc
new file mode 100644
index 0000000000..74c61410e8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc
@@ -0,0 +1,124 @@
+/*
+ Copyright (c) 2019, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "mobile/get_system_capability_request.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_system_capability_request_test {
+
+using sdl_rpc_plugin::commands::GetSystemCapabilityRequest;
+using ::testing::_;
+using ::testing::Return;
+typedef std::shared_ptr<GetSystemCapabilityRequest>
+ GetSystemCapabilityRequestPtr;
+
+namespace strings = application_manager::strings;
+namespace {
+const uint32_t kConnectionKey = 1u;
+}
+
+class GetSystemCapabilityRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ command_ = CreateCommand<GetSystemCapabilityRequest>(message_);
+ mock_app_ = CreateMockApp();
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ GetSystemCapabilityRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(
+ GetSystemCapabilityRequestTest,
+ Run_GetSystemDisplayCapabilities_SendMessageToMobileWithSUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ smart_objects::SmartObjectSPtr system_display_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+
+ ON_CALL(*mock_app_, display_capabilities())
+ .WillByDefault(Return(system_display_capabilities));
+
+ ON_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillByDefault(Return(system_display_capabilities));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ Command::CommandSource::SOURCE_SDL));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(
+ GetSystemCapabilityRequestTest,
+ Run_GetSystemDisplayCapabilities_CapabilitiesNotExistSendMessageToMobileWithDATA_NOT_AVAILABLEResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ EXPECT_CALL(*mock_app_, display_capabilities()).WillOnce(Return(nullptr));
+
+ ON_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillByDefault(Return(nullptr));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DATA_NOT_AVAILABLE),
+ Command::CommandSource::SOURCE_SDL));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+} // namespace get_system_capability_request_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
index 8b6f6696b7..06ecc1116e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
@@ -60,6 +60,11 @@ namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::ListFilesRequest;
+namespace {
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
class ListFilesRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
@@ -86,7 +91,7 @@ TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, hmi_level())
+ ON_CALL(*app, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_NONE));
const uint32_t kListFilesInNoneAllowed = 1u;
@@ -121,7 +126,7 @@ TEST_F(ListFilesRequestTest, Run_SUCCESS) {
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, hmi_level())
+ ON_CALL(*app, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
ON_CALL(*app, increment_list_files_in_none_count()).WillByDefault(Return());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
index 1f514e09c5..c0305a15ca 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
@@ -65,6 +65,8 @@ namespace {
const uint32_t kAppId = 5u;
const uint32_t kCustomButtonId = 3u;
const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
template <class NotificationT,
@@ -217,7 +219,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- ON_CALL(*mock_app, hmi_level())
+ ON_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
@@ -264,7 +266,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
std::vector<ApplicationSharedPtr> subscribed_apps_list;
subscribed_apps_list.push_back(mock_app);
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
@@ -290,7 +292,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
std::vector<ApplicationSharedPtr> subscribed_apps_list;
subscribed_apps_list.push_back(mock_app);
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
@@ -316,7 +318,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
std::vector<ApplicationSharedPtr> subscribed_apps_list;
subscribed_apps_list.push_back(mock_app);
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
index 501b4d8631..b7b827bb4c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -48,6 +48,8 @@ namespace strings = application_manager::strings;
namespace {
const uint32_t kConnectionKey = 1u;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
using application_manager::ApplicationSet;
@@ -102,7 +104,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
EXPECT_CALL(*mock_app, perform_interaction_layout())
.WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
- EXPECT_CALL(*mock_app, hmi_level()).Times(0);
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId)).Times(0);
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
@@ -126,7 +128,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
EXPECT_CALL(*mock_app, is_perform_interaction_active())
.WillRepeatedly(Return(0));
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::eType::HMI_FULL));
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
@@ -151,7 +153,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
EXPECT_CALL(*mock_app, is_perform_interaction_active())
.WillRepeatedly(Return(0));
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc
new file mode 100644
index 0000000000..349ada66a2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "mobile/on_system_capability_updated_notification.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/display_capabilities_builder.h"
+#include "gtest/gtest.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_system_capability_updated_notification {
+
+using sdl_rpc_plugin::commands::mobile::OnSystemCapabilityUpdatedNotification;
+using ::testing::_;
+using ::testing::Return;
+
+typedef std::shared_ptr<OnSystemCapabilityUpdatedNotification>
+ OnSystemCapabilityUpdatedNotificationPtr;
+
+namespace strings = application_manager::strings;
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kAppId = 2u;
+} // namespace
+
+MATCHER_P(CheckDisplayCapabilities, display_capabilities, "") {
+ return *display_capabilities ==
+ (*arg)[strings::msg_params][strings::system_capability]
+ [strings::display_capabilities];
+}
+
+class OnSystemCapabilityUpdatedNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ command_ = CreateCommand<OnSystemCapabilityUpdatedNotification>(message_);
+ mock_app_ = CreateMockApp();
+ }
+
+ OnSystemCapabilityUpdatedNotificationPtr command_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+};
+
+TEST_F(
+ OnSystemCapabilityUpdatedNotificationTest,
+ Run_AppExistSubscribedToNotification_SystemDisplayCapabilitiesSendToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ smart_objects::SmartObjectSPtr system_display_capabilities =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
+
+ ON_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillByDefault(Return(system_display_capabilities));
+
+ sdl_rpc_plugin::SDLRPCPlugin sdl_rpc_plugin;
+
+ std::shared_ptr<sdl_rpc_plugin::SystemCapabilityAppExtension>
+ system_capability_app_extension(
+ std::make_shared<sdl_rpc_plugin::SystemCapabilityAppExtension>(
+ sdl_rpc_plugin, *mock_app_));
+ system_capability_app_extension->SubscribeTo(
+ mobile_apis::SystemCapabilityType::DISPLAYS);
+ application_manager::ApplicationSet apps({mock_app_});
+ std::shared_ptr<sync_primitives::Lock> apps_lock_(
+ std::make_shared<sync_primitives::Lock>());
+ DataAccessor<application_manager::ApplicationSet> apps_data(
+ DataAccessor<application_manager::ApplicationSet>(apps, apps_lock_));
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_data));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, display_capabilities()).WillByDefault(Return(nullptr));
+ ON_CALL(*mock_app_,
+ QueryInterface(sdl_rpc_plugin::SystemCapabilityAppExtension::
+ SystemCapabilityAppExtensionUID))
+ .WillByDefault(Return(system_capability_app_extension));
+ application_manager::DisplayCapabilitiesBuilder builder(*mock_app_);
+ ON_CALL(*mock_app_, display_capabilities_builder())
+ .WillByDefault(ReturnRef(builder));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(CheckDisplayCapabilities(system_display_capabilities),
+ false));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(
+ OnSystemCapabilityUpdatedNotificationTest,
+ Run_AppExistConnectionKeyNotEqualWithAppId_SystemDisplayCapabilitiesNotSendToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ smart_objects::SmartObjectSPtr system_display_capabilities =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
+
+ ON_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillByDefault(Return(system_display_capabilities));
+
+ sdl_rpc_plugin::SDLRPCPlugin sdl_rpc_plugin;
+
+ std::shared_ptr<sdl_rpc_plugin::SystemCapabilityAppExtension>
+ system_capability_app_extension(
+ std::make_shared<sdl_rpc_plugin::SystemCapabilityAppExtension>(
+ sdl_rpc_plugin, *mock_app_));
+ system_capability_app_extension->SubscribeTo(
+ mobile_apis::SystemCapabilityType::DISPLAYS);
+ application_manager::ApplicationSet apps({mock_app_});
+ std::shared_ptr<sync_primitives::Lock> apps_lock_(
+ std::make_shared<sync_primitives::Lock>());
+ DataAccessor<application_manager::ApplicationSet> apps_data(
+ DataAccessor<application_manager::ApplicationSet>(apps, apps_lock_));
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_data));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, display_capabilities()).WillByDefault(Return(nullptr));
+ ON_CALL(*mock_app_,
+ QueryInterface(sdl_rpc_plugin::SystemCapabilityAppExtension::
+ SystemCapabilityAppExtensionUID))
+ .WillByDefault(Return(system_capability_app_extension));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(
+ OnSystemCapabilityUpdatedNotificationTest,
+ Run_AppExistNotSubscribedToNotification_SystemDisplayCapabilitiesNotSendToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+
+ smart_objects::SmartObjectSPtr system_display_capabilities =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
+
+ ON_CALL(mock_hmi_capabilities_, system_display_capabilities())
+ .WillByDefault(Return(system_display_capabilities));
+
+ sdl_rpc_plugin::SDLRPCPlugin sdl_rpc_plugin;
+
+ std::shared_ptr<sdl_rpc_plugin::SystemCapabilityAppExtension>
+ system_capability_app_extension(
+ std::make_shared<sdl_rpc_plugin::SystemCapabilityAppExtension>(
+ sdl_rpc_plugin, *mock_app_));
+
+ application_manager::ApplicationSet apps({mock_app_});
+ std::shared_ptr<sync_primitives::Lock> apps_lock_(
+ std::make_shared<sync_primitives::Lock>());
+ DataAccessor<application_manager::ApplicationSet> apps_data(
+ DataAccessor<application_manager::ApplicationSet>(apps, apps_lock_));
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_data));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, display_capabilities()).WillByDefault(Return(nullptr));
+ ON_CALL(*mock_app_,
+ QueryInterface(sdl_rpc_plugin::SystemCapabilityAppExtension::
+ SystemCapabilityAppExtensionUID))
+ .WillByDefault(Return(system_capability_app_extension));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(
+ OnSystemCapabilityUpdatedNotificationTest,
+ Run_AppDataEmpty_SystemDisplayCapabilitiesUpdatedNotificationNotSendToMobile) {
+ (*message_)[am::strings::msg_params][strings::system_capability]
+ [am::strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DISPLAYS;
+ application_manager::ApplicationSet apps;
+ std::shared_ptr<sync_primitives::Lock> apps_lock_(
+ std::make_shared<sync_primitives::Lock>());
+ DataAccessor<application_manager::ApplicationSet> apps_data(
+ DataAccessor<application_manager::ApplicationSet>(apps, apps_lock_));
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_data));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+} // namespace on_system_capability_updated_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
index 69ed8fb311..ffa7203f1f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -62,6 +62,7 @@ using testing::SaveArg;
namespace {
const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "fake-app-id";
+const connection_handler::DeviceHandle kDeviceId = 1u;
} // namespace
class OnSystemRequestNotificationTest
@@ -73,6 +74,7 @@ class OnSystemRequestNotificationTest
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(*mock_app_, device()).WillByDefault(Return(kDeviceId));
}
protected:
@@ -90,12 +92,14 @@ TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
+ PreConditions();
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kPolicyAppId, request_type))
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, request_type))
.WillRepeatedly(Return(true));
#ifdef PROPRIETARY_MODE
@@ -130,10 +134,13 @@ TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
+ PreConditions();
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, request_type))
.WillOnce(Return(true));
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
@@ -167,7 +174,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(MockAppPtr()));
EXPECT_CALL(*mock_app_, policy_app_id()).Times(0);
- EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _)).Times(0);
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _, _)).Times(0);
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
@@ -187,10 +194,13 @@ TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
+ PreConditions();
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, request_type))
.WillOnce(Return(false));
EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
@@ -214,7 +224,7 @@ TEST_F(
PreConditions();
EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kPolicyAppId, request_type))
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, request_type))
.WillOnce(Return(true));
EXPECT_CALL(mock_policy_handler_,
IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
@@ -241,7 +251,7 @@ TEST_F(OnSystemRequestNotificationTest,
PreConditions();
EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kPolicyAppId, request_type))
+ IsRequestTypeAllowed(kDeviceId, kPolicyAppId, request_type))
.WillOnce(Return(true));
EXPECT_CALL(mock_policy_handler_,
IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
index f1e1a291d3..c43dea76e1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -60,6 +60,8 @@ typedef std::shared_ptr<OnTBTClientStateNotification> NotificationPtr;
namespace {
const uint32_t kAppId = 1u;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
class OnTBTClientStateNotificationTest
@@ -79,7 +81,7 @@ TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(*mock_app, app_id()).Times(0);
@@ -122,7 +124,7 @@ TEST_F(OnTBTClientStateNotificationTest,
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, hmi_level())
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
index b0df0e57d3..2915418d43 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -72,6 +72,8 @@ const std::string kCorrectDisplayText1 = "CorrectDisplayText1";
const std::string kCorrectDisplayText2 = "CorrectDisplayText2";
const std::string kFunctionId = "FunctionId";
const uint32_t kTimeoutForTTSSpeak = 1u;
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
class PerformAudioPassThruRequestTest
@@ -109,7 +111,7 @@ class PerformAudioPassThruRequestTest
msg_params_[field] = "prompt\\n";
}
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
CallRun caller(*command_sptr_);
@@ -206,7 +208,7 @@ TEST_F(PerformAudioPassThruRequestTest,
(*mobile_request)[am::strings::msg_params][am::strings::initial_prompt] =
initial_prompt;
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
std::shared_ptr<PerformAudioPassThruRequest> command =
CreateCommand<PerformAudioPassThruRequest>(mobile_request);
@@ -286,7 +288,7 @@ TEST_F(PerformAudioPassThruRequestTest,
}
TEST_F(PerformAudioPassThruRequestTest, Run_HmiLevelNone_Rejected) {
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
CallRun caller(*command_sptr_);
@@ -319,7 +321,7 @@ TEST_F(PerformAudioPassThruRequestTest,
// First we need to call SendSpeakRequest()
// to enable the "is_active_tts_speak" key
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
msg_params_[am::strings::initial_prompt][0][am::strings::text] =
@@ -407,7 +409,7 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(PerformAudioPassThruRequestTest,
Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteTrue) {
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
msg_params_[am::strings::initial_prompt][0][am::strings::text] =
@@ -481,7 +483,7 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(PerformAudioPassThruRequestTest,
Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteFalse) {
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
msg_params_[am::strings::initial_prompt][0][am::strings::text] =
@@ -536,7 +538,7 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(
PerformAudioPassThruRequestTest,
Run_InitPromptEmpty_PerformAndRecordStartNotificationsAndStartRecording) {
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
MessageSharedPtr start_record_result_msg;
@@ -766,7 +768,7 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
- EXPECT_CALL(*application_sptr_, hmi_level())
+ EXPECT_CALL(*application_sptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
msg_params_[am::strings::initial_prompt][0][am::strings::text] =
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
index e8e03484ed..8db533f446 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -78,6 +78,8 @@ const int64_t kZeroOffset = 0u;
const std::string kStorageFolder = "./storage";
const std::string kFolder = "folder";
const std::string kAppFolder = "app_folder";
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
class PutFileRequestTest
@@ -99,7 +101,7 @@ class PutFileRequestTest
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, hmi_level())
+ ON_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
}
@@ -179,7 +181,7 @@ TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
}
TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
const uint32_t settings_put_file_in_none = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
index 0e8374b75a..ac45e90d8e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
@@ -67,6 +67,8 @@ using ::testing::_;
using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::testing::SetArgPointee;
namespace am = ::application_manager;
@@ -75,12 +77,15 @@ using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest;
namespace {
const uint32_t kConnectionKey = 1u;
+const uint32_t kConnectionKey2 = 2u;
const hmi_apis::Common_Language::eType kHmiLanguage =
hmi_apis::Common_Language::EN_US;
const mobile_apis::Language::eType kMobileLanguage =
mobile_apis::Language::EN_US;
-const std::string kMacAddress = "test_mac_address";
-const std::string kAppId = "test_app_id";
+const std::string kMacAddress1 = "test_mac_address1";
+const std::string kMacAddress2 = "test_mac_address2";
+const std::string kAppId1 = "test_app1_id";
+const std::string kAppId2 = "test_app2_id";
const std::string kFullAppId = "test_app_id_long";
const std::string kDummyString = "test_string";
const std::vector<uint32_t> kDummyDiagModes;
@@ -94,6 +99,7 @@ class RegisterAppInterfaceRequestTest
: msg_(CreateMessage())
, command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
, app_name_("test_app_name_")
+ , app2_name_("test_app2_name_")
, lock_ptr_(std::make_shared<sync_primitives::Lock>())
, mock_application_helper_(
application_manager_test::MockApplicationHelper::
@@ -112,7 +118,7 @@ class RegisterAppInterfaceRequestTest
void InitBasicMessage() {
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId1;
(*msg_)[am::strings::msg_params][am::strings::full_app_id] = kFullAppId;
(*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
(*msg_)[am::strings::msg_params][am::strings::language_desired] =
@@ -130,11 +136,11 @@ class RegisterAppInterfaceRequestTest
MockAppPtr CreateBasicMockedApp() {
MockAppPtr mock_app = CreateMockApp();
ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(app_name_));
- ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress));
+ ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress1));
ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
- ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId1));
ON_CALL(*mock_app, msg_version())
.WillByDefault(ReturnRef(mock_semantic_version));
return mock_app;
@@ -154,7 +160,7 @@ class RegisterAppInterfaceRequestTest
void InitGetters() {
ON_CALL(app_mngr_, GetCorrectMobileIDFromMessage(msg_))
- .WillByDefault(Return(kAppId));
+ .WillByDefault(Return(kAppId1));
ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
ON_CALL(app_mngr_, resume_controller())
.WillByDefault(ReturnRef(mock_resume_crt_));
@@ -168,7 +174,7 @@ class RegisterAppInterfaceRequestTest
.WillByDefault(ReturnRef(kDummyString));
ON_CALL(app_mngr_settings_, supported_diag_modes())
.WillByDefault(ReturnRef(kDummyDiagModes));
- ON_CALL(mock_policy_handler_, GetAppRequestTypes(_))
+ ON_CALL(mock_policy_handler_, GetAppRequestTypes(_, _))
.WillByDefault(Return(std::vector<std::string>()));
ON_CALL(mock_policy_handler_, GetAppRequestTypeState(_))
.WillByDefault(Return(policy::RequestType::State::EMPTY));
@@ -180,7 +186,7 @@ class RegisterAppInterfaceRequestTest
.WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
ON_CALL(app_mngr_, GetDeviceTransportType(_))
.WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
- ON_CALL(app_mngr_, IsAppInReconnectMode(_)).WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAppInReconnectMode(_, _)).WillByDefault(Return(false));
ON_CALL(app_mngr_, application_by_policy_id(_))
.WillByDefault(Return(ApplicationSharedPtr()));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
@@ -201,7 +207,7 @@ class RegisterAppInterfaceRequestTest
void SetCommonExpectionsOnSwitchedApplication(
MockAppPtr mock_app, mobile_apis::Result::eType response_result_code) {
- EXPECT_CALL(mock_policy_handler_, AddApplication(_, _)).Times(0);
+ EXPECT_CALL(mock_policy_handler_, AddApplication(_, _, _)).Times(0);
EXPECT_CALL(
mock_rpc_service_,
@@ -250,6 +256,7 @@ class RegisterAppInterfaceRequestTest
std::shared_ptr<RegisterAppInterfaceRequest> command_;
const utils::custom_string::CustomString app_name_;
+ const utils::custom_string::CustomString app2_name_;
std::shared_ptr<sync_primitives::Lock> lock_ptr_;
am::ApplicationSet app_set_;
@@ -280,7 +287,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
InitBasicMessage();
- (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId1;
EXPECT_CALL(app_mngr_, IsStopping())
.WillOnce(Return(false))
.WillOnce(Return(true))
@@ -289,20 +296,30 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+ connection_handler::DeviceHandle handle = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(handle), Return(0)));
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(handle, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()))
- .WillRepeatedly(Return(mock_app));
+ EXPECT_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillRepeatedly(Return(ApplicationSharedPtr()));
ON_CALL(app_mngr_, applications())
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
- ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId1, _, _))
.WillByDefault(Return(true));
policy::StatusNotifier notify_upd_manager =
std::make_shared<utils::CallNothing>();
- ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ ON_CALL(mock_policy_handler_, AddApplication(kMacAddress1, kAppId1, _))
.WillByDefault(Return(notify_upd_manager));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
@@ -323,6 +340,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+ ASSERT_TRUE(command_->Init());
command_->Run();
}
@@ -360,10 +378,19 @@ TEST_F(RegisterAppInterfaceRequestTest,
EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+ connection_handler::DeviceHandle handle = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(handle), Return(0)));
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(_, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillRepeatedly(Return(ApplicationSharedPtr()));
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()))
- .WillRepeatedly(Return(mock_app));
+ .WillOnce(Return(mock_app));
MessageSharedPtr expected_message =
CreateMessage(smart_objects::SmartType_Map);
@@ -401,11 +428,11 @@ TEST_F(RegisterAppInterfaceRequestTest,
.WillByDefault(
Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
- ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId1, _, _))
.WillByDefault(Return(true));
policy::StatusNotifier notify_upd_manager =
std::make_shared<utils::CallNothing>();
- ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ ON_CALL(mock_policy_handler_, AddApplication(kMacAddress1, kAppId1, _))
.WillByDefault(Return(notify_upd_manager));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
@@ -444,7 +471,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
-
+ ASSERT_TRUE(command_->Init());
command_->Run();
}
@@ -456,10 +483,23 @@ TEST_F(RegisterAppInterfaceRequestTest,
(*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ app_set_.insert(mock_app);
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId1))
.WillRepeatedly(Return(mock_app));
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+ connection_handler::DeviceHandle device_id = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(device_id), Return(0)));
+
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(device_id, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
+ ON_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(app_mngr_, IsAppInReconnectMode(device_id, kAppId1))
+ .WillByDefault(Return(true));
EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
@@ -482,6 +522,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
SetCommonExpectionsOnSwitchedApplication(mock_app,
mobile_apis::Result::SUCCESS);
+ ASSERT_TRUE(command_->Init());
command_->Run();
}
@@ -492,11 +533,22 @@ TEST_F(RegisterAppInterfaceRequestTest,
const std::string request_hash_id = "abc123";
(*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+ connection_handler::DeviceHandle device_id = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(device_id), Return(0)));
+
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(device_id, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId1))
.WillRepeatedly(Return(mock_app));
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillOnce(Return(mock_app));
+ ON_CALL(app_mngr_, IsAppInReconnectMode(device_id, kAppId1))
+ .WillByDefault(Return(true));
EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
@@ -520,7 +572,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
SetCommonExpectionsOnSwitchedApplication(mock_app,
mobile_apis::Result::RESUME_FAILED);
-
+ ASSERT_TRUE(command_->Init());
command_->Run();
}
@@ -528,11 +580,23 @@ TEST_F(RegisterAppInterfaceRequestTest,
SwitchApplication_NoHash_ExpectCleanupResumeFailed) {
InitBasicMessage();
+ connection_handler::DeviceHandle device_id = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(device_id), Return(0)));
+
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(device_id, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId1))
.WillRepeatedly(Return(mock_app));
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(device_id, kAppId1))
+ .WillOnce(Return(true));
EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
@@ -550,6 +614,133 @@ TEST_F(RegisterAppInterfaceRequestTest,
SetCommonExpectionsOnSwitchedApplication(mock_app,
mobile_apis::Result::RESUME_FAILED);
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ RegisterApp_SameAppId_SameDeviceFailed) {
+ using namespace am;
+
+ InitBasicMessage();
+
+ MockAppPtr mock_app1 = CreateBasicMockedApp();
+
+ app_set_.insert(mock_app1);
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+
+ MockAppPtr mock_app2 = CreateBasicMockedApp();
+
+ connection_handler::DeviceHandle device_id = 1;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(device_id), Return(0)));
+
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(device_id, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress1), Return(0)));
+
+ EXPECT_CALL(app_mngr_, application(kMacAddress1, kAppId1))
+ .WillOnce(Return(mock_app1));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(
+ mobile_apis::Result::APPLICATION_REGISTERED_ALREADY),
+ am::commands::Command::SOURCE_SDL));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ RegisterApp_SameAppId_DifferentDevicesSuccess) {
+ MockAppPtr mock_app1 = CreateBasicMockedApp();
+ const connection_handler::DeviceHandle device_id1 = 1u;
+ ON_CALL(*mock_app1, device()).WillByDefault(Return(device_id1));
+ app_set_.insert(mock_app1);
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+
+ InitBasicMessage();
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey2;
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey2, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(kConnectionKey2, kAppId1))
+ .WillOnce(Return(false));
+
+ connection_handler::DeviceHandle device_id2 = 2u;
+ ON_CALL(mock_connection_handler_,
+ GetDataOnSessionKey(kConnectionKey2, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(device_id2), Return(0)));
+
+ ON_CALL(mock_session_observer_, GetDataOnDeviceID(device_id2, _, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3>(kMacAddress2), Return(0)));
+
+ MockAppPtr mock_app2 = CreateBasicMockedApp();
+
+ ON_CALL(*mock_app2, device()).WillByDefault(Return(device_id2));
+ ON_CALL(*mock_app2, mac_address()).WillByDefault(ReturnRef(kMacAddress2));
+ EXPECT_CALL(app_mngr_, application(kMacAddress2, kAppId1))
+ .WillRepeatedly(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey2))
+ .WillOnce(Return(mock_app2));
+
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId1, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ std::make_shared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(kMacAddress2, kAppId1, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app2));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration), _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration), _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration), _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+
+ ASSERT_TRUE(command_->Init());
command_->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
index cc2f042eac..cde15a2318 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
@@ -160,6 +160,7 @@ TEST_F(SetDisplayLayoutRequestTest,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ command->Init();
command->on_event(event);
ResultCommandExpectations(ui_command_result, "UI is not supported by system");
@@ -178,6 +179,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
am::commands::Command::CommandSource::SOURCE_SDL));
+ command->Init();
command->Run();
}
@@ -188,7 +190,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, display_layout()).WillOnce(ReturnRef(kLayout));
+ EXPECT_CALL(*mock_app, display_layout()).WillOnce(Return(kLayout));
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -204,20 +206,60 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
ManageHMICommand(CheckMshCorrId(kCorrelationKey), _))
.WillOnce(Return(true));
+ command->Init();
command->Run();
}
TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
- CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+
am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
- SmartObject msg(smart_objects::SmartType_Map);
- event.set_smart_object(msg);
+ event.set_smart_object(*msg);
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_AppVersion_v6_WARNING) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ MessageSharedPtr msg = CreateMessage();
+
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0;
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr dispaly_capabilities_msg = CreateMessage();
+ (*dispaly_capabilities_msg)[am::hmi_response::templates_available] =
+ "templates_available";
+
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillOnce(Return(dispaly_capabilities_msg.get()));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ::application_manager::Version app_version;
+ app_version.max_supported_api_version =
+ ::application_manager::APIVersion::kAPIV6;
+ EXPECT_CALL(*mock_app, version()).WillOnce(ReturnRef(app_version));
+
+ command->Init();
command->on_event(event);
}
-TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_AppVersion_v5_SUCCESS) {
am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
MessageSharedPtr msg = CreateMessage();
@@ -239,6 +281,15 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
am::commands::Command::CommandSource::SOURCE_SDL));
CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ::application_manager::Version app_version;
+ app_version.max_supported_api_version =
+ ::application_manager::APIVersion::kAPIV5;
+ EXPECT_CALL(*mock_app, version()).WillOnce(ReturnRef(app_version));
+
+ command->Init();
command->on_event(event);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
index ed0f52a521..b8cfdd4bfc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
@@ -31,6 +31,7 @@
*/
#include <stdint.h>
+#include <array>
#include <memory>
#include <set>
#include <string>
@@ -68,8 +69,28 @@ const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
const uint32_t kFunctionID = 3u;
+const std::string kCurrentTemplatelayout = "current_template_layout";
+const std::string kNewTemplateLayout = "new_template_layout";
+const app_mngr::WindowID kCurrentWindowID = 1;
+typedef std::array<int, 3> rgb_color_scheme;
+const rgb_color_scheme kCurrentDayColorRGB = {75, 75, 75};
+const rgb_color_scheme kCurrentNightColorRGB = {200, 200, 200};
+const rgb_color_scheme kNewDayColorRGB = {80, 80, 80};
+const rgb_color_scheme kNewNightColorRGB = {222, 222, 222};
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
} // namespace
+MATCHER_P2(CheckMessageToMobile, result_code, success, "") {
+ const bool is_success =
+ (*arg)[am::strings::msg_params][am::strings::success].asBool() == success;
+
+ const bool is_result_code_correct =
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ static_cast<int32_t>(result_code);
+ return is_success && is_result_code_correct;
+}
+
class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
ShowRequestTest() {
@@ -104,6 +125,101 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
return msg;
}
+ protected:
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, WindowIdExists(kCurrentWindowID))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, window_layout(kCurrentWindowID))
+ .WillByDefault(Return(kCurrentTemplatelayout));
+ }
+
+ smart_objects::SmartObject CreateColorScheme(
+ const rgb_color_scheme& rgb_color_scheme) {
+ using namespace application_manager;
+
+ smart_objects::SmartObject primary_color(smart_objects::SmartType_Map);
+ smart_objects::SmartObject secondary_color(smart_objects::SmartType_Map);
+ smart_objects::SmartObject background_color(smart_objects::SmartType_Map);
+
+ primary_color[strings::red] = rgb_color_scheme[0];
+ primary_color[strings::green] = rgb_color_scheme[1];
+ primary_color[strings::blue] = rgb_color_scheme[2];
+
+ secondary_color[strings::red] = rgb_color_scheme[0];
+ secondary_color[strings::green] = rgb_color_scheme[1];
+ secondary_color[strings::blue] = rgb_color_scheme[2];
+
+ background_color[strings::red] = rgb_color_scheme[0];
+ background_color[strings::green] = rgb_color_scheme[1];
+ background_color[strings::blue] = rgb_color_scheme[2];
+
+ smart_objects::SmartObject color_scheme(smart_objects::SmartType_Map);
+ color_scheme[strings::primary_color] = primary_color;
+ color_scheme[strings::secondary_color] = secondary_color;
+ color_scheme[strings::background_color] = background_color;
+
+ return color_scheme;
+ }
+
+ smart_objects::SmartObject CreateTemplateConfiguration(
+ const std::string& layout) {
+ using namespace application_manager;
+
+ smart_objects::SmartObject template_configuration(
+ smart_objects::SmartType_Map);
+
+ template_configuration[strings::template_layout] = layout;
+
+ template_configuration[strings::day_color_scheme] =
+ CreateColorScheme(kCurrentDayColorRGB);
+
+ template_configuration[strings::night_color_scheme] =
+ CreateColorScheme(kCurrentNightColorRGB);
+
+ return template_configuration;
+ }
+
+ MessageSharedPtr CreateMessageWithTemplateLayout(const std::string& layout) {
+ auto msg = CreateMsgParams();
+ (*msg)[app_mngr::strings::msg_params][app_mngr::strings::window_id] =
+ kCurrentWindowID;
+ (*msg)[am::strings::msg_params][am::strings::template_configuration] =
+ CreateTemplateConfiguration(layout);
+
+ return msg;
+ }
+
+ std::shared_ptr<ShowRequest> SetupHelperLayout(
+ const std::string& layout,
+ const rgb_color_scheme& day_colors,
+ const rgb_color_scheme& night_colors) {
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Show),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app_, WindowIdExists(kCurrentWindowID))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ const auto current_day_color_scheme = CreateColorScheme(day_colors);
+ ON_CALL(*mock_app_, day_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_day_color_scheme));
+ const auto current_night_color_scheme = CreateColorScheme(night_colors);
+ ON_CALL(*mock_app_, night_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_night_color_scheme));
+ ON_CALL(*mock_app_, window_layout(kCurrentWindowID))
+ .WillByDefault(Return(kCurrentTemplatelayout));
+
+ auto msg = CreateMessageWithTemplateLayout(layout);
+
+ auto command(CreateCommand<ShowRequest>(msg));
+ return command;
+ }
+
void TestSetupHelper(MessageSharedPtr msg,
hmi_apis::Common_TextFieldName::eType field_name,
const char* field) {
@@ -269,9 +385,9 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(
- mock_message_helper_,
- SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ creation_msg_params, _, kFunctionID, kDefaultWindowId));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
@@ -319,7 +435,8 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, _, kDefaultWindowId))
.Times(0);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
@@ -729,10 +846,14 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
hmi_apis::Common_Result::SUCCESS;
(*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
(*ev_msg)[am::strings::msg_params][am::strings::info] = "";
+ (*ev_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
Event event(hmi_apis::FunctionID::UI_Show);
event.set_smart_object(*ev_msg);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
MessageSharedPtr ui_command_result;
EXPECT_CALL(
mock_rpc_service_,
@@ -886,34 +1007,328 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
command->Run();
}
-TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
+TEST_F(ShowRequestTest,
+ Run_AppDoesNotExist_ExpectAppNotRegisteredResponseToMobile) {
+ const auto result_code = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+
+ auto msg = CreateMsgParams();
+ auto command = CreateCommand<ShowRequest>(msg);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
+ .WillOnce(Return(mock_app_));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ ASSERT_TRUE(command->Init());
command->Run();
}
-TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
+TEST_F(ShowRequestTest,
+ Run_WindowWithIDDoesNotExist_ExpectInvalidIDResponseToMobile) {
+ const auto result_code = mobile_apis::Result::INVALID_ID;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(CheckMessageToMobile(result_code, false),
+ Command::CommandSource::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ON_CALL(*mock_app_, WindowIdExists(kCurrentWindowID))
+ .WillByDefault(Return(false));
- std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ auto msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::window_id] = kCurrentWindowID;
+
+ auto command = CreateCommand<ShowRequest>(msg);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ShowRequestTest,
+ Run_NoLayoutChangeWithoutBothColorScheme_SendRequestToHMI_SUCCESS) {
+ auto msg = CreateMsgParams();
+ (*msg)[app_mngr::strings::msg_params][app_mngr::strings::window_id] =
+ kCurrentWindowID;
+ (*msg)[am::strings::msg_params][am::strings::template_configuration]
+ [am::strings::template_layout] = kCurrentTemplatelayout;
+
+ auto command(CreateCommand<ShowRequest>(msg));
+
+ auto message_to_hmi = CreateMessage();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_hmi), Return(true)));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ const auto template_layout =
+ (*message_to_hmi)[am::strings::msg_params]
+ [am::strings::template_configuration]
+ [am::strings::template_layout]
+ .asString();
+ EXPECT_EQ(kCurrentTemplatelayout, template_layout);
+}
+
+TEST_F(ShowRequestTest,
+ Run_NoLayoutChangeDayColorSchemesNotEqual_Response_REJECTED) {
+ auto msg = CreateMessageWithTemplateLayout(kCurrentTemplatelayout);
+
+ const auto current_day_color_scheme = CreateColorScheme(kNewDayColorRGB);
+
+ auto command(CreateCommand<ShowRequest>(msg));
+
+ ON_CALL(*mock_app_, day_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_day_color_scheme));
+
+ auto message_to_mobile = CreateMessage();
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mobile), Return(true)));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ const bool success =
+ (*message_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool();
+ EXPECT_FALSE(success);
+
+ const auto result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asUInt());
+
+ EXPECT_EQ(mobile_apis::Result::REJECTED, result_code);
+}
+
+TEST_F(ShowRequestTest,
+ Run_NoLayoutChangeNightColorSchemesNotEqual_Response_REJECTED) {
+ auto msg = CreateMessageWithTemplateLayout(kCurrentTemplatelayout);
+
+ const auto current_night_color_scheme = CreateColorScheme(kNewNightColorRGB);
+
+ auto command(CreateCommand<ShowRequest>(msg));
+
+ ON_CALL(*mock_app_, day_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_night_color_scheme));
+
+ auto message_to_mobile = CreateMessage();
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mobile), Return(true)));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ const bool success =
+ (*message_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool();
+ EXPECT_FALSE(success);
+ const auto result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asUInt());
+
+ EXPECT_EQ(mobile_apis::Result::REJECTED, result_code);
+}
+
+TEST_F(ShowRequestTest,
+ Run_LayoutNotChangeBothColorSchemeEqual_SendRequestToHMI_SUCCESS) {
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Show),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app_, WindowIdExists(kCurrentWindowID))
+ .WillOnce(Return(true));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ const auto current_day_color_scheme = CreateColorScheme(kCurrentDayColorRGB);
+ ON_CALL(*mock_app_, day_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_day_color_scheme));
+ const auto current_night_color_scheme =
+ CreateColorScheme(kCurrentNightColorRGB);
+ ON_CALL(*mock_app_, night_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_night_color_scheme));
+ ON_CALL(*mock_app_, window_layout(kCurrentWindowID))
+ .WillByDefault(Return(kCurrentTemplatelayout));
+
+ auto msg = CreateMessageWithTemplateLayout(kCurrentTemplatelayout);
+
+ auto command(CreateCommand<ShowRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ShowRequestTest,
+ Run_LayoutChangeBothColorSchemeNotEqual_SendRequestToHMI_SUCCESS) {
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Show),
+ Command::CommandSource::SOURCE_SDL_TO_HMI))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app_, WindowIdExists(kCurrentWindowID))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ const auto current_day_color_scheme = CreateColorScheme(kNewDayColorRGB);
+ ON_CALL(*mock_app_, day_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_day_color_scheme));
+ const auto current_night_color_scheme = CreateColorScheme(kNewNightColorRGB);
+ ON_CALL(*mock_app_, night_color_scheme(kCurrentWindowID))
+ .WillByDefault(Return(current_night_color_scheme));
+ ON_CALL(*mock_app_, window_layout(kCurrentWindowID))
+ .WillByDefault(Return(kCurrentTemplatelayout));
+
+ auto msg = CreateMessageWithTemplateLayout(kNewTemplateLayout);
+
+ auto command(CreateCommand<ShowRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_ExpectSetWindowLayoutOnly) {
+ // Precondition
+ auto command =
+ SetupHelperLayout(kNewTemplateLayout, kNewDayColorRGB, kNewNightColorRGB);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // Expectation
+ EXPECT_CALL(*mock_app_,
+ set_window_layout(kCurrentWindowID, kNewTemplateLayout));
+ EXPECT_CALL(*mock_app_, set_day_color_scheme(_, _));
+ EXPECT_CALL(*mock_app_, set_night_color_scheme(_, _));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(mobile_apis::Result::SUCCESS, true),
+ Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest,
+ OnEvent_SuccessResultCode_ExpectSetWindowLayoutAndSetDayColorScheme) {
+ // Precondition
+ auto command = SetupHelperLayout(
+ kNewTemplateLayout, kCurrentDayColorRGB, kNewNightColorRGB);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // Expectation
+ EXPECT_CALL(*mock_app_,
+ set_window_layout(kCurrentWindowID, kNewTemplateLayout));
+ EXPECT_CALL(*mock_app_,
+ set_day_color_scheme(kCurrentWindowID,
+ CreateColorScheme(kCurrentDayColorRGB)));
+ EXPECT_CALL(*mock_app_, set_night_color_scheme(_, _));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(mobile_apis::Result::SUCCESS, true),
+ Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest,
+ OnEvent_SuccessResultCode_ExpectSetWindowLayoutAndBothColorScheme) {
+ // Precondition
+ auto command = SetupHelperLayout(
+ kNewTemplateLayout, kCurrentDayColorRGB, kCurrentNightColorRGB);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // Expectation
+ EXPECT_CALL(*mock_app_,
+ set_window_layout(kCurrentWindowID, kNewTemplateLayout));
+ EXPECT_CALL(*mock_app_,
+ set_day_color_scheme(kCurrentWindowID,
+ CreateColorScheme(kCurrentDayColorRGB)));
+ EXPECT_CALL(*mock_app_,
+ set_night_color_scheme(kCurrentWindowID,
+ CreateColorScheme(kCurrentNightColorRGB)));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(mobile_apis::Result::SUCCESS, true),
+ Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest,
+ OnEvent_SuccessResultCode_ExpectBothColorSchemeWithoutSetWindowLayout) {
+ // Precondition
+ auto command = SetupHelperLayout(
+ kCurrentTemplatelayout, kCurrentDayColorRGB, kCurrentNightColorRGB);
+ ASSERT_TRUE(command->Init());
command->Run();
+ // Expectation
+ EXPECT_CALL(*mock_app_, set_window_layout(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_,
+ set_day_color_scheme(kCurrentWindowID,
+ CreateColorScheme(kCurrentDayColorRGB)));
+ EXPECT_CALL(*mock_app_,
+ set_night_color_scheme(kCurrentWindowID,
+ CreateColorScheme(kCurrentNightColorRGB)));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageToMobile(mobile_apis::Result::SUCCESS, true),
+ Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ auto msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
}
TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
@@ -931,7 +1346,7 @@ TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
event.set_smart_object(*msg);
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
-
+ ASSERT_TRUE(command->Init());
command->on_event(event);
}
@@ -957,6 +1372,10 @@ TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
MessageSharedPtr msg = CreateMessage();
(*msg)[am::strings::params][am::hmi_response::code] =
mobile_apis::Result::SUCCESS;
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
index 01f8f313b6..786f2b6bd1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
@@ -106,6 +106,23 @@ TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
.asInt()));
}
+TEST_F(SubscribeButtonRequestTest, Run_NavSubscriptionNotAllowed_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::NAV_CENTER_LOCATION;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_navi()).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
CommandPtr command(CreateCommand<SubscribeButtonRequest>());
@@ -203,6 +220,53 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
.asInt()));
}
+TEST_F(SubscribeButtonRequestTest, Run_NAV_SUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::NAV_CENTER_LOCATION;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_navi()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code]
+ .asInt()));
+}
+
TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
const mobile_apis::ButtonName::eType kButtonName =
mobile_apis::ButtonName::OK;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
index 7351cd67d3..211888d6be 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
@@ -74,6 +74,7 @@ const std::string kAppStorageFolder = "fake-storage";
const std::string kSystemFilesPath = "/fake/system/files";
const std::string kFileName = "Filename";
const uint32_t kHmiAppId = 3u;
+const connection_handler::DeviceHandle kDeviceId = 1u;
} // namespace
class SystemRequestTest
@@ -99,13 +100,15 @@ class SystemRequestTest
ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kAppPolicyId));
ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kAppFolderName));
ON_CALL(*mock_app_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+ ON_CALL(*mock_app_, device()).WillByDefault(Return(kDeviceId));
ON_CALL(app_mngr_settings_, system_files_path())
.WillByDefault(ReturnRef(kSystemFilesPath));
ON_CALL(app_mngr_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
- ON_CALL(mock_policy_handler_, IsRequestTypeAllowed(kAppPolicyId, _))
+ ON_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kDeviceId, kAppPolicyId, _))
.WillByDefault(Return(true));
}
@@ -146,9 +149,10 @@ TEST_F(SystemRequestTest,
PreConditions();
- EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kAppPolicyId,
- mobile_apis::RequestType::OEM_SPECIFIC))
+ EXPECT_CALL(
+ mock_policy_handler_,
+ IsRequestTypeAllowed(
+ kDeviceId, kAppPolicyId, mobile_apis::RequestType::OEM_SPECIFIC))
.WillOnce(Return(true));
EXPECT_CALL(mock_policy_handler_,
@@ -191,9 +195,10 @@ TEST_F(
PreConditions();
- EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kAppPolicyId,
- mobile_apis::RequestType::OEM_SPECIFIC))
+ EXPECT_CALL(
+ mock_policy_handler_,
+ IsRequestTypeAllowed(
+ kDeviceId, kAppPolicyId, mobile_apis::RequestType::OEM_SPECIFIC))
.WillOnce(Return(true));
EXPECT_CALL(mock_policy_handler_,
@@ -216,9 +221,10 @@ TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) {
PreConditions();
- EXPECT_CALL(mock_policy_handler_,
- IsRequestTypeAllowed(kAppPolicyId,
- mobile_apis::RequestType::OEM_SPECIFIC))
+ EXPECT_CALL(
+ mock_policy_handler_,
+ IsRequestTypeAllowed(
+ kDeviceId, kAppPolicyId, mobile_apis::RequestType::OEM_SPECIFIC))
.WillOnce(Return(false));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
@@ -241,9 +247,9 @@ TEST_F(SystemRequestTest, Run_RequestType_IconURL_Success) {
const std::vector<uint8_t> binary_data = {1u, 2u};
(*msg)[am::strings::params][am::strings::binary_data] = binary_data;
- EXPECT_CALL(
- mock_policy_handler_,
- IsRequestTypeAllowed(kAppPolicyId, mobile_apis::RequestType::ICON_URL))
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(
+ kDeviceId, kAppPolicyId, mobile_apis::RequestType::ICON_URL))
.WillOnce(Return(true));
EXPECT_CALL(app_mngr_settings_, app_icons_folder())
.WillOnce(ReturnRef(kAppStorageFolder));
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
index 0e556a6993..8c29cccfff 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
@@ -45,18 +45,25 @@ collect_sources(VEHICLE_INFO_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(LIBRARIES
HMI_API
MOBILE_API
+ MessageHelper
ApplicationManager
v4_protocol_v1_2_no_extra
SmartObjects
Utils
+ jsoncpp
+ connectionHandler
)
if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_library("vehicle_info_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${VEHICLE_INFO_PLUGIN_SOURCES})
-target_link_libraries("vehicle_info_plugin" ${LIBRARIES})
+add_library("vehicle_info_plugin_static" ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${VEHICLE_INFO_PLUGIN_SOURCES})
+target_link_libraries("vehicle_info_plugin_static" ${LIBRARIES})
+
+add_library(vehicle_info_plugin SHARED "src/vehicle_info_plugin.cc" )
+target_link_libraries(vehicle_info_plugin vehicle_info_plugin_static)
+
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
index d0e4926a65..7b0b0a59b8 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
@@ -78,5 +78,5 @@ class VehicleInfoPlugin : public plugins::RPCPlugin {
} // namespace vehicle_info_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
-
+extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data);
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
index 6ef76ad125..7d34bbbe37 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
@@ -72,7 +72,7 @@ void OnVehicleDataNotification::Run() {
for (; vehicle_data.end() != it; ++it) {
if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
- LOG4CXX_ERROR(logger_, "vehicle_data nanme" << it->first);
+ LOG4CXX_DEBUG(logger_, "vehicle_data name" << it->first);
auto vehicle_data_value =
(*message_)[strings::msg_params][it->first].asInt();
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
index 70210f704e..cc1c22a248 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
@@ -163,6 +163,13 @@ void VehicleInfoPlugin::DeleteSubscriptions(
}
} // namespace vehicle_info_plugin
-extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+extern "C" __attribute__((visibility("default")))
+application_manager::plugin_manager::RPCPlugin*
+Create() {
return new vehicle_info_plugin::VehicleInfoPlugin();
}
+
+extern "C" __attribute__((visibility("default"))) void Delete(
+ application_manager::plugin_manager::RPCPlugin* data) {
+ delete data;
+} \ No newline at end of file
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
index 3ea4a50a8a..92984b6ad5 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
@@ -51,14 +51,8 @@ file(GLOB SOURCES
)
set(LIBRARIES
- gmock
- Utils
- SmartObjects
- HMI_API
- MOBILE_API
- connectionHandler
- vehicle_info_plugin
- jsoncpp
+ gmock
+ vehicle_info_plugin_static
)
create_cotired_test("vi_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc
new file mode 100644
index 0000000000..fb14373bcf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "mobile/get_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_vehicle_data_response {
+
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetVehicleDataResponse;
+
+typedef std::shared_ptr<GetVehicleDataResponse> GetVehicleDataResponsePtr;
+
+class GetVehicleDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetVehicleDataResponseTest, GetVehicleDataResponse_SUCCESS) {
+ MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map));
+ GetVehicleDataResponsePtr command(
+ CreateCommand<GetVehicleDataResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+ command->Run();
+}
+
+} // namespace get_vehicle_data_response
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
index 7081746f28..8df00521de 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2019, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,9 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdint.h>
-#include <map>
-#include <vector>
+#include <strings.h>
#include "gtest/gtest.h"
#include "mobile/on_vehicle_data_notification.h"
@@ -45,6 +43,8 @@
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
namespace test {
namespace components {
@@ -62,49 +62,75 @@ using am::commands::MessageSharedPtr;
using vehicle_info_plugin::commands::OnVehicleDataNotification;
typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr;
+typedef std::shared_ptr<vehicle_info_plugin::VehicleInfoAppExtension>
+ VehicleInfoAppExtensionPtr;
+typedef DataAccessor<application_manager::ApplicationSet> ApplicationSetDA;
namespace {
const uint32_t kAppId = 1u;
+const utils::custom_string::CustomString kAppName("test_app");
} // namespace
class OnVehicleDataNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
- OnVehicleDataNotificationTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
+ OnVehicleDataNotificationTest() : mock_app_(CreateMockApp()) {}
- MessageSharedPtr command_msg_;
- NotificationPtr command_;
+ protected:
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
+
+ ON_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillByDefault(Return(false));
+ }
+ MockAppPtr mock_app_;
};
-MATCHER_P2(CheckMessageData, key, value, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- const bool kAreMsgParamsCorrect =
- (*arg)[am::strings::msg_params][key].asInt() == value;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect,
- kAreMsgParamsCorrect);
+TEST_F(OnVehicleDataNotificationTest, OnVehicleDataNotification_SUCCESS) {
+ MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map));
+ smart_objects::SmartObject gps_data;
+ gps_data[am::strings::longitude_degrees] = 1.0;
+ gps_data[am::strings::latitude_degrees] = 1.0;
+ gps_data[am::strings::shifted] = true;
+
+ (*message)[am::strings::msg_params][am::strings::gps] = gps_data;
+ (*message)[am::strings::msg_params][am::strings::speed] = 0;
+
+ NotificationPtr command(CreateCommand<OnVehicleDataNotification>(message));
+
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin;
+ VehicleInfoAppExtensionPtr vi_app_extention_ptr =
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin, *mock_app_);
+ vi_app_extention_ptr->subscribeToVehicleInfo(
+ mobile_apis::VehicleDataType::VEHICLEDATA_GPS);
+ vi_app_extention_ptr->subscribeToVehicleInfo(
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED);
+
+ EXPECT_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillOnce(Return(vi_app_extention_ptr));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ ApplicationSetDA apps_da(apps, apps_lock);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(apps_da));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS));
+ vehicle_data.insert(am::VehicleData::value_type(
+ am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+
+ command->Run();
}
} // namespace on_vehicle_data_notification
diff --git a/src/components/application_manager/src/app_service_manager.cc b/src/components/application_manager/src/app_service_manager.cc
index bab8147d9f..a85921a8cd 100644
--- a/src/components/application_manager/src/app_service_manager.cc
+++ b/src/components/application_manager/src/app_service_manager.cc
@@ -72,10 +72,44 @@ smart_objects::SmartObject AppServiceManager::PublishAppService(
std::string service_type = manifest[strings::service_type].asString();
- if (FindServiceByProvider(connection_key, service_type)) {
- LOG4CXX_WARN(logger_,
- "Service already exists for this provider, rejecting");
- return smart_objects::SmartObject();
+ AppService* found_service =
+ FindServiceByProvider(connection_key, service_type);
+ if (found_service) {
+ // Check if there is a different existing service with the same updated
+ // name.
+ if (manifest.keyExists(strings::service_name)) {
+ auto service_by_name =
+ FindServiceByName(manifest[strings::service_name].asString());
+ if (service_by_name) {
+ auto service_by_name_id =
+ service_by_name->record[strings::service_id].asString();
+ auto found_service_id =
+ found_service->record[strings::service_id].asString();
+ if (service_by_name_id != found_service_id) {
+ LOG4CXX_WARN(logger_,
+ "A service already exists with this name, rejecting");
+ return smart_objects::SmartObject();
+ }
+ }
+ }
+ LOG4CXX_WARN(logger_, "Service already exists for this provider, updating");
+ published_services_lock_.Acquire();
+ found_service->record[strings::service_manifest] = manifest;
+ found_service->record[strings::service_published] = true;
+ smart_objects::SmartObject updated_service_record = found_service->record;
+ published_services_lock_.Release();
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+
+ AppServiceUpdated(updated_service_record,
+ mobile_apis::ServiceUpdateReason::MANIFEST_UPDATE,
+ msg_params);
+
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+
+ return updated_service_record;
}
if (manifest.keyExists(strings::service_name) &&
@@ -131,10 +165,16 @@ smart_objects::SmartObject AppServiceManager::PublishAppService(
MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
- // Activate the new service if it is the default for its service type, or if
- // no service is active of its service type
+ // Activate the new service if it is the default for its service type, if
+ // no service is active of its service type, or it is a mobile app in full.
AppService* active_service = ActiveServiceForType(service_type);
- if (!active_service || app_service.default_service) {
+ ApplicationSharedPtr app = NULL;
+ if (mobile_service && connection_key) {
+ app = app_manager_.application(connection_key);
+ }
+
+ if (!active_service || app_service.default_service ||
+ (app && app->IsFullscreen())) {
ActivateAppService(service_id);
}
@@ -163,7 +203,9 @@ bool AppServiceManager::UnpublishAppService(const std::string service_id) {
// Activate embedded service, if available
auto embedded_service = EmbeddedServiceForType(
record[strings::service_manifest][strings::service_type].asString());
- if (embedded_service) {
+ if (embedded_service &&
+ (embedded_service->record[strings::service_id].asString() !=
+ service_id)) {
embedded_service->record[strings::service_active] = true;
AppServiceUpdated(embedded_service->record,
mobile_apis::ServiceUpdateReason::ACTIVATED,
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index 0636748977..f6b87d3a7e 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -173,19 +173,16 @@ InitialApplicationDataImpl::perform_interaction_layout() const {
}
DynamicApplicationDataImpl::DynamicApplicationDataImpl()
- : help_prompt_(NULL)
- , timeout_prompt_(NULL)
- , vr_help_title_(NULL)
- , vr_help_(NULL)
+ : help_prompt_(nullptr)
+ , timeout_prompt_(nullptr)
+ , vr_help_title_(nullptr)
+ , vr_help_(nullptr)
, tbt_state_(mobile_api::TBTState::INVALID_ENUM)
- , show_command_(NULL)
- , keyboard_props_(NULL)
- , menu_title_(NULL)
- , menu_icon_(NULL)
- , tbt_show_command_(NULL)
- , day_color_scheme_(NULL)
- , night_color_scheme_(NULL)
- , display_layout_("")
+ , show_command_(nullptr)
+ , keyboard_props_(nullptr)
+ , menu_title_(nullptr)
+ , menu_icon_(nullptr)
+ , tbt_show_command_(nullptr)
, commands_()
, commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, sub_menu_()
@@ -195,9 +192,12 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, performinteraction_choice_set_map_()
, performinteraction_choice_set_lock_ptr_(
std::make_shared<sync_primitives::RecursiveLock>())
+ , window_params_map_()
+ , window_params_map_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, is_perform_interaction_active_(false)
, is_reset_global_properties_active_(false)
- , perform_interaction_mode_(-1) {}
+ , perform_interaction_mode_(-1)
+ , display_capabilities_builder_(*this) {}
DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
if (help_prompt_) {
@@ -230,16 +230,6 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
tbt_show_command_ = NULL;
}
- if (day_color_scheme_) {
- delete day_color_scheme_;
- day_color_scheme_ = NULL;
- }
-
- if (night_color_scheme_) {
- delete night_color_scheme_;
- night_color_scheme_ = NULL;
- }
-
for (CommandsMap::iterator command_it = commands_.begin();
commands_.end() != command_it;
++command_it) {
@@ -265,6 +255,8 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
performinteraction_choice_set_map_[it->first].clear();
}
performinteraction_choice_set_map_.clear();
+
+ window_params_map_.clear();
}
const smart_objects::SmartObject* DynamicApplicationDataImpl::help_prompt()
@@ -316,18 +308,93 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon()
return menu_icon_;
}
-const smart_objects::SmartObject* DynamicApplicationDataImpl::day_color_scheme()
+smart_objects::SmartObject DynamicApplicationDataImpl::day_color_scheme()
const {
- return day_color_scheme_;
+ using namespace mobile_apis::PredefinedWindows;
+ auto default_window_it = window_templates_.find(DEFAULT_WINDOW);
+
+ if (window_templates_.end() != default_window_it) {
+ const smart_objects::SmartObject template_config =
+ default_window_it->second;
+ if (template_config.keyExists(strings::day_color_scheme)) {
+ return template_config[strings::day_color_scheme];
+ }
+ }
+
+ return smart_objects::SmartObject(smart_objects::SmartType::SmartType_Null);
}
-const smart_objects::SmartObject*
-DynamicApplicationDataImpl::night_color_scheme() const {
- return night_color_scheme_;
+smart_objects::SmartObject DynamicApplicationDataImpl::night_color_scheme()
+ const {
+ using namespace mobile_apis::PredefinedWindows;
+ auto default_window_it = window_templates_.find(DEFAULT_WINDOW);
+
+ if (window_templates_.end() != default_window_it) {
+ const smart_objects::SmartObject template_config =
+ default_window_it->second;
+ if (template_config.keyExists(strings::night_color_scheme)) {
+ return template_config[strings::night_color_scheme];
+ }
+ }
+
+ return smart_objects::SmartObject(smart_objects::SmartType::SmartType_Null);
+}
+
+std::string DynamicApplicationDataImpl::display_layout() const {
+ using namespace mobile_apis::PredefinedWindows;
+ auto default_window_it = window_templates_.find(DEFAULT_WINDOW);
+
+ if (window_templates_.end() != default_window_it) {
+ smart_objects::SmartObject template_config = default_window_it->second;
+ if (template_config.keyExists(strings::template_layout)) {
+ return template_config[strings::template_layout].asString();
+ }
+ }
+
+ return std::string();
}
-const std::string& DynamicApplicationDataImpl::display_layout() const {
- return display_layout_;
+smart_objects::SmartObjectSPtr
+DynamicApplicationDataImpl::display_capabilities() const {
+ return display_capabilities_;
+}
+
+smart_objects::SmartObjectSPtr DynamicApplicationDataImpl::display_capabilities(
+ const WindowID window_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto result_display_caps = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Array);
+ const auto window_caps =
+ (*display_capabilities_)[0][strings::window_capabilities].asArray();
+ if (!window_caps) {
+ LOG4CXX_WARN(logger_, "Current window capabilities are empty");
+ // SDL still needs to retreive display capabilities
+ return display_capabilities_;
+ }
+ auto find_res =
+ std::find_if(window_caps->begin(),
+ window_caps->end(),
+ [&window_id](const smart_objects::SmartObject& element) {
+ if (window_id == element[strings::window_id].asInt()) {
+ return true;
+ }
+
+ return false;
+ });
+
+ DCHECK(find_res != window_caps->end());
+ const auto disp_caps_keys = (*display_capabilities_)[0].enumerate();
+ for (const auto& key : disp_caps_keys) {
+ if (strings::window_capabilities == key) {
+ continue;
+ }
+ (*result_display_caps)[0][key] = (*display_capabilities_)[0][key];
+ }
+
+ (*result_display_caps)[0][strings::window_capabilities][0] = *find_res;
+
+ return result_display_caps;
}
void DynamicApplicationDataImpl::load_global_properties(
@@ -447,24 +514,176 @@ void DynamicApplicationDataImpl::set_menu_icon(
void DynamicApplicationDataImpl::set_day_color_scheme(
const smart_objects::SmartObject& color_scheme) {
- if (day_color_scheme_) {
- delete day_color_scheme_;
+ using namespace mobile_apis::PredefinedWindows;
+ DCHECK(color_scheme.getType() == smart_objects::SmartType_Map);
+ window_templates_[DEFAULT_WINDOW][strings::day_color_scheme] = color_scheme;
+}
+
+void DynamicApplicationDataImpl::set_night_color_scheme(
+ const smart_objects::SmartObject& color_scheme) {
+ using namespace mobile_apis::PredefinedWindows;
+ DCHECK(color_scheme.getType() == smart_objects::SmartType_Map);
+ window_templates_[DEFAULT_WINDOW][strings::night_color_scheme] = color_scheme;
+}
+
+void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis::PredefinedWindows;
+ smart_objects::SmartObject template_config(smart_objects::SmartType_Map);
+ template_config[strings::template_layout] = layout;
+ window_templates_[DEFAULT_WINDOW] = template_config;
+}
+
+void DynamicApplicationDataImpl::set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& incoming_window_capabilities =
+ display_capabilities[0][strings::window_capabilities];
+
+ smart_objects::SmartObject tmp_window_capabilities;
+ if (display_capabilities_) {
+ tmp_window_capabilities =
+ (*display_capabilities_)[0][strings::window_capabilities];
}
- day_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+ display_capabilities_.reset(
+ new smart_objects::SmartObject(display_capabilities));
+
+ auto has_window_id = [&tmp_window_capabilities](const WindowID window_id) {
+ const auto tmp_window_capabilities_arr = tmp_window_capabilities.asArray();
+ if (!tmp_window_capabilities_arr) {
+ return false;
+ }
+
+ const auto find_res = std::find_if(
+ tmp_window_capabilities_arr->begin(),
+ tmp_window_capabilities_arr->end(),
+ [&window_id](const smart_objects::SmartObject& element) {
+ LOG4CXX_DEBUG(logger_,
+ "Searching for "
+ << window_id << " with element window id "
+ << element[strings::window_id].asInt());
+ if ((!element.keyExists(strings::window_id)) && 0 == window_id) {
+ return true;
+ }
+ const auto current_window_id = element[strings::window_id].asInt();
+ if (window_id == current_window_id) {
+ return true;
+ }
+ return false;
+ });
+
+ return find_res != tmp_window_capabilities_arr->end();
+ };
+ for (uint32_t i = 0; i < incoming_window_capabilities.length(); ++i) {
+ const auto window_id =
+ incoming_window_capabilities[i][strings::window_id].asInt();
+ if (!has_window_id(window_id)) {
+ tmp_window_capabilities[tmp_window_capabilities.length()] =
+ incoming_window_capabilities[i];
+ }
+ }
+
+ (*display_capabilities_)[0][strings::window_capabilities] =
+ tmp_window_capabilities;
+}
+
+void DynamicApplicationDataImpl::remove_window_capability(
+ const WindowID window_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto window_capabilities =
+ (*display_capabilities_)[0][strings::window_capabilities].asArray();
+ DCHECK_OR_RETURN_VOID(window_capabilities);
+
+ for (auto it = window_capabilities->begin(); it != window_capabilities->end();
+ ++it) {
+ const auto cur_window_id = (*it).keyExists(strings::window_id)
+ ? (*it)[strings::window_id].asInt()
+ : 0;
+ if (window_id == cur_window_id) {
+ window_capabilities->erase(it);
+ return;
+ }
+ }
+
+ LOG4CXX_WARN(
+ logger_,
+ "No window id " << window_id << " found in display capabilities");
+}
+
+void DynamicApplicationDataImpl::set_window_layout(const WindowID window_id,
+ const std::string& layout) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject template_config(smart_objects::SmartType_Map);
+
+ template_config[strings::template_layout] = layout;
+ window_templates_[window_id] = template_config;
+}
+
+void DynamicApplicationDataImpl::set_day_color_scheme(
+ const WindowID window_id, const smart_objects::SmartObject& color_scheme) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(color_scheme.getType() == smart_objects::SmartType_Map);
+ window_templates_[window_id][strings::day_color_scheme] = color_scheme;
}
void DynamicApplicationDataImpl::set_night_color_scheme(
- const smart_objects::SmartObject& color_scheme) {
- if (night_color_scheme_) {
- delete night_color_scheme_;
+ const WindowID window_id, const smart_objects::SmartObject& color_scheme) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(color_scheme.getType() == smart_objects::SmartType_Map);
+ window_templates_[window_id][strings::night_color_scheme] = color_scheme;
+}
+
+std::string DynamicApplicationDataImpl::window_layout(
+ const WindowID window_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AppWindowsTemplates::const_iterator window_template_it =
+ window_templates_.find(window_id);
+
+ if (window_templates_.end() != window_template_it) {
+ const smart_objects::SmartObject template_config =
+ window_template_it->second;
+ if (template_config.keyExists(strings::template_layout)) {
+ return template_config[strings::template_layout].asString();
+ }
}
- night_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+ return std::string();
}
-void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) {
- display_layout_ = layout;
+smart_objects::SmartObject DynamicApplicationDataImpl::day_color_scheme(
+ const WindowID window_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AppWindowsTemplates::const_iterator window_template_it =
+ window_templates_.find(window_id);
+
+ if (window_templates_.end() != window_template_it) {
+ const smart_objects::SmartObject template_config =
+ window_template_it->second;
+ if (template_config.keyExists(strings::day_color_scheme)) {
+ return template_config[strings::day_color_scheme];
+ }
+ }
+
+ return smart_objects::SmartObject(smart_objects::SmartType::SmartType_Null);
+}
+
+smart_objects::SmartObject DynamicApplicationDataImpl::night_color_scheme(
+ const WindowID window_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AppWindowsTemplates::const_iterator window_template_it =
+ window_templates_.find(window_id);
+
+ if (window_templates_.end() != window_template_it) {
+ const smart_objects::SmartObject template_config =
+ window_template_it->second;
+ if (template_config.keyExists(strings::night_color_scheme)) {
+ return template_config[strings::night_color_scheme];
+ }
+ }
+
+ return smart_objects::SmartObject(smart_objects::SmartType::SmartType_Null);
}
void DynamicApplicationDataImpl::SetGlobalProperties(
@@ -555,6 +774,33 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
return false;
}
+DataAccessor<WindowParamsMap>
+DynamicApplicationDataImpl::window_optional_params_map() const {
+ return DataAccessor<WindowParamsMap>(window_params_map_,
+ window_params_map_lock_ptr_);
+}
+
+void DynamicApplicationDataImpl::SetWindowInfo(
+ const WindowID window_id, const smart_objects::SmartObject& window_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto it = window_params_map_.find(window_id);
+ if (window_params_map_.end() == it) {
+ window_params_map_[window_id] =
+ std::make_shared<smart_objects::SmartObject>(window_info);
+ }
+}
+
+DisplayCapabilitiesBuilder&
+DynamicApplicationDataImpl::display_capabilities_builder() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return display_capabilities_builder_;
+}
+
+void DynamicApplicationDataImpl::RemoveWindowInfo(const WindowID window_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ window_params_map_.erase(window_id);
+}
+
void DynamicApplicationDataImpl::AddChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 3b2f51f26c..bb505e2498 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -113,6 +113,7 @@ ApplicationImpl::ApplicationImpl(
, video_streaming_suspended_(true)
, audio_streaming_suspended_(true)
, is_app_allowed_(true)
+ , is_app_data_resumption_allowed_(false)
, has_been_activated_(false)
, tts_properties_in_none_(false)
, tts_properties_in_full_(false)
@@ -187,7 +188,8 @@ void ApplicationImpl::CloseActiveMessage() {
}
bool ApplicationImpl::IsFullscreen() const {
- return mobile_api::HMILevel::HMI_FULL == hmi_level();
+ return mobile_api::HMILevel::HMI_FULL ==
+ hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
}
bool ApplicationImpl::is_audio() const {
@@ -265,19 +267,21 @@ bool ApplicationImpl::IsVideoApplication() const {
return is_video_app;
}
-void ApplicationImpl::SetRegularState(HmiStatePtr state) {
+void ApplicationImpl::SetRegularState(const WindowID window_id,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
- state_.AddState(state);
+ state_.AddState(window_id, state);
}
-void ApplicationImpl::RemovePostponedState() {
+void ApplicationImpl::RemovePostponedState(const WindowID window_id) {
LOG4CXX_AUTO_TRACE(logger_);
- state_.RemoveState(HmiState::STATE_ID_POSTPONED);
+ state_.RemoveState(window_id, HmiState::STATE_ID_POSTPONED);
}
-void ApplicationImpl::SetPostponedState(HmiStatePtr state) {
+void ApplicationImpl::SetPostponedState(const WindowID window_id,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
- state_.AddState(state);
+ state_.AddState(window_id, state);
}
void ApplicationImpl::set_mobile_projection_enabled(bool option) {
@@ -297,22 +301,56 @@ struct StateIDComparator {
}
};
-void ApplicationImpl::AddHMIState(HmiStatePtr state) {
+void ApplicationImpl::AddHMIState(const WindowID window_id, HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
- state_.AddState(state);
+ state_.AddState(window_id, state);
}
-void ApplicationImpl::RemoveHMIState(HmiState::StateID state_id) {
+void ApplicationImpl::RemoveHMIState(const WindowID window_id,
+ HmiState::StateID state_id) {
LOG4CXX_AUTO_TRACE(logger_);
- state_.RemoveState(state_id);
+ state_.RemoveState(window_id, state_id);
}
-const HmiStatePtr ApplicationImpl::CurrentHmiState() const {
- return state_.GetState(HmiState::STATE_ID_CURRENT);
+const HmiStatePtr ApplicationImpl::CurrentHmiState(
+ const WindowID window_id) const {
+ return state_.GetState(window_id, HmiState::STATE_ID_CURRENT);
}
-const HmiStatePtr ApplicationImpl::RegularHmiState() const {
- return state_.GetState(HmiState::STATE_ID_REGULAR);
+const HmiStatePtr ApplicationImpl::RegularHmiState(
+ const WindowID window_id) const {
+ return state_.GetState(window_id, HmiState::STATE_ID_REGULAR);
+}
+
+WindowNames ApplicationImpl::GetWindowNames() const {
+ LOG4CXX_DEBUG(logger_,
+ "Collecting window names for application " << app_id());
+
+ WindowNames window_names;
+ std::string stringified_window_names;
+
+ sync_primitives::AutoLock auto_lock(window_params_map_lock_ptr_);
+ for (const auto& window_info_item : window_params_map_) {
+ const auto window_name =
+ (*window_info_item.second)[strings::window_name].asString();
+ window_names.push_back(window_name);
+ stringified_window_names +=
+ (stringified_window_names.empty() ? "" : ",") + window_name;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Existing window names: [" + stringified_window_names + "]");
+ return window_names;
+}
+
+WindowIds ApplicationImpl::GetWindowIds() const {
+ LOG4CXX_DEBUG(logger_, "Collecting window IDs for application " << app_id());
+ return state_.GetWindowIds();
+}
+
+bool ApplicationImpl::WindowIdExists(const WindowID window_id) const {
+ const WindowIds window_ids = GetWindowIds();
+ return helpers::in_range(window_ids, window_id);
}
bool ApplicationImpl::IsAllowedToChangeAudioSource() const {
@@ -322,8 +360,9 @@ bool ApplicationImpl::IsAllowedToChangeAudioSource() const {
return false;
}
-const HmiStatePtr ApplicationImpl::PostponedHmiState() const {
- return state_.GetState(HmiState::STATE_ID_POSTPONED);
+const HmiStatePtr ApplicationImpl::PostponedHmiState(
+ const WindowID window_id) const {
+ return state_.GetState(window_id, HmiState::STATE_ID_POSTPONED);
}
const smart_objects::SmartObject* ApplicationImpl::active_message() const {
@@ -354,9 +393,10 @@ bool ApplicationImpl::is_media_application() const {
return is_media_;
}
-const mobile_api::HMILevel::eType ApplicationImpl::hmi_level() const {
+const mobile_api::HMILevel::eType ApplicationImpl::hmi_level(
+ const WindowID window_id) const {
using namespace mobile_apis;
- const HmiStatePtr hmi_state = CurrentHmiState();
+ const HmiStatePtr hmi_state = CurrentHmiState(window_id);
return hmi_state ? hmi_state->hmi_level() : HMILevel::INVALID_ENUM;
}
@@ -380,9 +420,10 @@ const uint32_t ApplicationImpl::list_files_in_none_count() const {
return list_files_in_none_count_;
}
-const mobile_api::SystemContext::eType ApplicationImpl::system_context() const {
+const mobile_api::SystemContext::eType ApplicationImpl::system_context(
+ const WindowID window_id) const {
using namespace mobile_apis;
- const HmiStatePtr hmi_state = CurrentHmiState();
+ const HmiStatePtr hmi_state = CurrentHmiState(window_id);
return hmi_state ? hmi_state->system_context() : SystemContext::INVALID_ENUM;
;
}
@@ -680,6 +721,14 @@ void ApplicationImpl::set_app_allowed(const bool allowed) {
is_app_allowed_ = allowed;
}
+bool ApplicationImpl::is_app_data_resumption_allowed() const {
+ return is_app_data_resumption_allowed_;
+}
+
+void ApplicationImpl::set_app_data_resumption_allowance(const bool allowed) {
+ is_app_data_resumption_allowed_ = allowed;
+}
+
void ApplicationImpl::set_secondary_device(
connection_handler::DeviceHandle secondary_device) {
secondary_device_id_ = secondary_device;
@@ -930,8 +979,10 @@ bool ApplicationImpl::is_application_data_changed() const {
return is_application_data_changed_;
}
-void ApplicationImpl::SetInitialState(HmiStatePtr state) {
- state_.InitState(state);
+void ApplicationImpl::SetInitialState(const WindowID window_id,
+ const std::string& window_name,
+ HmiStatePtr state) {
+ state_.InitState(window_id, window_name, state);
}
void ApplicationImpl::set_is_application_data_changed(
@@ -1074,21 +1125,58 @@ void ApplicationImpl::SubscribeToSoftButtons(
cmd_softbuttonid_[cmd_id] = softbuttons_id;
}
} else {
- cmd_softbuttonid_[cmd_id] = softbuttons_id;
+ auto& soft_button_ids = cmd_softbuttonid_[cmd_id];
+ for (auto& softbutton_item : softbuttons_id) {
+ soft_button_ids.insert(softbutton_item);
+ }
}
}
+struct FindSoftButtonId {
+ uint32_t soft_button_id_;
+
+ FindSoftButtonId(const uint32_t soft_button_id)
+ : soft_button_id_(soft_button_id) {}
+
+ bool operator()(const std::pair<uint32_t, WindowID>& element) {
+ return soft_button_id_ == element.first;
+ }
+};
+
bool ApplicationImpl::IsSubscribedToSoftButton(const uint32_t softbutton_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
CommandSoftButtonID::iterator it = cmd_softbuttonid_.begin();
for (; it != cmd_softbuttonid_.end(); ++it) {
- if ((it->second).find(softbutton_id) != (it->second).end()) {
+ const auto& soft_button_ids = (*it).second;
+ FindSoftButtonId finder(softbutton_id);
+ const auto find_res =
+ std::find_if(soft_button_ids.begin(), soft_button_ids.end(), finder);
+ if ((soft_button_ids.end() != find_res)) {
return true;
}
}
return false;
}
+WindowID ApplicationImpl::GetSoftButtonWindowID(const uint32_t softbutton_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
+ CommandSoftButtonID::iterator it = cmd_softbuttonid_.begin();
+ for (; it != cmd_softbuttonid_.end(); ++it) {
+ const auto& soft_button_ids = (*it).second;
+ FindSoftButtonId finder(softbutton_id);
+ const auto find_res =
+ std::find_if(soft_button_ids.begin(), soft_button_ids.end(), finder);
+ if ((soft_button_ids.end() != find_res)) {
+ return find_res->second;
+ }
+ }
+
+ return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
CommandSoftButtonID::iterator it = cmd_softbuttonid_.find(cmd_id);
@@ -1098,8 +1186,9 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
}
void ApplicationImpl::set_system_context(
+ const WindowID window_id,
const mobile_api::SystemContext::eType& system_context) {
- const HmiStatePtr hmi_state = CurrentHmiState();
+ HmiStatePtr hmi_state = CurrentHmiState(window_id);
hmi_state->set_system_context(system_context);
}
@@ -1112,13 +1201,20 @@ void ApplicationImpl::set_audio_streaming_state(
" for non-media application to different from NOT_AUDIBLE");
return;
}
- CurrentHmiState()->set_audio_streaming_state(state);
+
+ // According to proposal SDL-0216 audio streaming state should
+ // be applied for all windows to keep consistency
+ HmiStates hmi_states = state_.GetStates(HmiState::STATE_ID_CURRENT);
+ for (const auto& hmi_state : hmi_states) {
+ hmi_state->set_audio_streaming_state(state);
+ }
}
void ApplicationImpl::set_hmi_level(
+ const WindowID window_id,
const mobile_api::HMILevel::eType& new_hmi_level) {
using namespace mobile_apis;
- const HMILevel::eType current_hmi_level = hmi_level();
+ const HMILevel::eType current_hmi_level = hmi_level(window_id);
if (HMILevel::HMI_NONE != current_hmi_level &&
HMILevel::HMI_NONE == new_hmi_level) {
put_file_in_none_count_ = 0;
@@ -1127,7 +1223,8 @@ void ApplicationImpl::set_hmi_level(
}
ApplicationSharedPtr app = application_manager_.application(app_id());
DCHECK_OR_RETURN_VOID(app)
- application_manager_.state_controller().SetRegularState(app, new_hmi_level);
+ application_manager_.state_controller().SetRegularState(
+ app, window_id, new_hmi_level);
LOG4CXX_INFO(logger_, "hmi_level = " << new_hmi_level);
usage_report_.RecordHmiStateChanged(new_hmi_level);
}
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 3a92009d4f..20a53b9780 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -121,17 +121,26 @@ bool device_id_comparator(const std::string& device_id,
}
/**
- * @brief policy_app_id_comparator is predicate to compare policy application
- * ids
- * @param policy_app_id Policy id of application
- * @param app Application pointer
- * @return True if policy id of application matches to policy id passed
+ * @brief PolicyAppIdComparator is struct predicate to compare policy
+ * application ids & device
+ * @param device_handle of application
+ * @param id of application
+ * @return True if policy id & device_handle of application matches to policy id
+ * & device_handle passed
*/
-bool policy_app_id_comparator(const std::string& policy_app_id,
- ApplicationSharedPtr app) {
- DCHECK_OR_RETURN(app, false);
- return app->policy_app_id() == policy_app_id;
-}
+struct PolicyAppIdComparator {
+ PolicyAppIdComparator(const connection_handler::DeviceHandle& device_handle,
+ const std::string& policy_app_id)
+ : device_handle_(device_handle), policy_app_id_(policy_app_id) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ return app && app->device() == device_handle_ &&
+ app->policy_app_id() == policy_app_id_;
+ }
+
+ private:
+ const connection_handler::DeviceHandle& device_handle_;
+ const std::string& policy_app_id_;
+};
uint32_t ApplicationManagerImpl::mobile_corelation_id_ = 0;
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
@@ -295,7 +304,9 @@ ApplicationSharedPtr ApplicationManagerImpl::active_application() const {
}
bool LimitedAppPredicate(const ApplicationSharedPtr app) {
- return app ? app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED : false;
+ return app ? app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_api::HMILevel::HMI_LIMITED
+ : false;
}
ApplicationSharedPtr ApplicationManagerImpl::get_limited_media_application()
@@ -306,7 +317,8 @@ ApplicationSharedPtr ApplicationManagerImpl::get_limited_media_application()
bool LimitedNaviAppPredicate(const ApplicationSharedPtr app) {
return app ? (app->is_navi() &&
- app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)
+ app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_api::HMILevel::HMI_LIMITED)
: false;
}
@@ -318,7 +330,8 @@ ApplicationSharedPtr ApplicationManagerImpl::get_limited_navi_application()
bool LimitedVoiceAppPredicate(const ApplicationSharedPtr app) {
return app ? (app->is_voice_communication_supported() &&
- app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)
+ app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_api::HMILevel::HMI_LIMITED)
: false;
}
@@ -340,7 +353,8 @@ ApplicationManagerImpl::applications_with_navi() {
bool LimitedMobileProjectionPredicate(const ApplicationSharedPtr app) {
return app ? (app->mobile_projection_enabled() &&
- app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)
+ app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_api::HMILevel::HMI_LIMITED)
: false;
}
@@ -565,12 +579,16 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
HmiStatePtr initial_state =
CreateRegularState(std::shared_ptr<Application>(application),
+ mobile_apis::WindowType::MAIN,
mobile_apis::HMILevel::INVALID_ENUM,
mobile_apis::AudioStreamingState::INVALID_ENUM,
mobile_apis::VideoStreamingState::INVALID_ENUM,
mobile_api::SystemContext::SYSCTXT_MAIN);
- application->SetInitialState(initial_state);
+ application->SetInitialState(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ std::string(), // should not be tracked for main window
+ initial_state);
application->set_folder_name(policy_app_id + "_" +
application->mac_address());
@@ -726,18 +744,15 @@ bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
LOG4CXX_DEBUG(logger_, "Activating application with id:" << app->app_id());
- // remove from resumption if app was activated by user
+ // Remove from resumption if app was activated by user
resume_controller().OnAppActivated(app);
+
// Activate any app services published by the app
GetAppServiceManager().OnAppActivated(app);
- const HMILevel::eType hmi_level = HMILevel::HMI_FULL;
- const AudioStreamingState::eType audio_state =
- app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
- : AudioStreamingState::NOT_AUDIBLE;
- const VideoStreamingState::eType video_state =
- app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
- : VideoStreamingState::NOT_STREAMABLE;
- state_ctrl_.SetRegularState(app, hmi_level, audio_state, video_state, false);
+
+ // Activate main window in state controller
+ state_ctrl_.ActivateDefaultWindow(app);
+
return true;
}
@@ -1305,11 +1320,13 @@ void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
HmiStatePtr ApplicationManagerImpl::CreateRegularState(
std::shared_ptr<Application> app,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::VideoStreamingState::eType video_state,
- mobile_apis::SystemContext::eType system_context) const {
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
+ const mobile_apis::SystemContext::eType system_context) const {
HmiStatePtr state(new HmiState(app, *this));
+ state->set_window_type(window_type);
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(audio_state);
state->set_video_streaming_state(video_state);
@@ -1631,7 +1648,8 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
if (GetPolicyHandler().PolicyEnabled()) {
const std::string policy_app_id = application->policy_app_id();
std::string default_hmi_string = "";
- if (GetPolicyHandler().GetDefaultHmi(policy_app_id, &default_hmi_string)) {
+ if (GetPolicyHandler().GetDefaultHmi(
+ application->mac_address(), policy_app_id, &default_hmi_string)) {
if ("BACKGROUND" == default_hmi_string) {
default_hmi = HMILevel::HMI_BACKGROUND;
} else if ("FULL" == default_hmi_string) {
@@ -1943,7 +1961,7 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
return;
}
- if (IsAppInReconnectMode(app->policy_app_id())) {
+ if (IsAppInReconnectMode(app->device(), app->policy_app_id())) {
LOG4CXX_DEBUG(logger_,
"Application is in reconnection list and won't be closed.");
return;
@@ -2490,8 +2508,24 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
}
const std::string policy_app_id(app_data[json::appId].asString());
- ApplicationSharedPtr registered_app =
- application_by_policy_id(policy_app_id);
+
+ connection_handler::DeviceHandle device_handle;
+ if (-1 == connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, nullptr, nullptr, &device_handle)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to create application: no connection info.");
+ continue;
+ }
+
+ std::string device_id;
+ if (-1 == connection_handler().get_session_observer().GetDataOnDeviceID(
+ device_handle, nullptr, nullptr, &device_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to create application: no connection info.");
+ continue;
+ }
+
+ ApplicationSharedPtr registered_app = application(device_id, policy_app_id);
if (registered_app) {
LOG4CXX_DEBUG(logger_,
"Application with the same id: "
@@ -2530,22 +2564,9 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
const std::string app_icon_dir(settings_.app_icons_folder());
const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
- connection_handler::DeviceHandle device_id = 0;
-
- if (-1 == connection_handler().get_session_observer().GetDataOnSessionKey(
- connection_key, NULL, NULL, &device_id)) {
- LOG4CXX_ERROR(logger_,
- "Failed to create application: no connection info.");
- continue;
- }
-
- std::string device_mac;
- connection_handler().get_session_observer().GetDataOnDeviceID(
- device_id, NULL, NULL, &device_mac, NULL);
-
const uint32_t hmi_app_id =
- resume_controller().IsApplicationSaved(policy_app_id, device_mac)
- ? resume_controller().GetHMIApplicationID(policy_app_id, device_mac)
+ resume_controller().IsApplicationSaved(policy_app_id, device_id)
+ ? resume_controller().GetHMIApplicationID(policy_app_id, device_id)
: GenerateNewHMIAppID();
// AppId = 0 because this is query_app(provided by hmi for download, but not
@@ -2553,8 +2574,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
ApplicationSharedPtr app(
new ApplicationImpl(0,
policy_app_id,
- device_mac,
device_id,
+ device_handle,
appName,
GetPolicyHandler().GetStatisticManager(),
*this));
@@ -3030,6 +3051,7 @@ void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) {
mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
const ApplicationSharedPtr app,
+ const WindowID window_id,
const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions) {
@@ -3042,7 +3064,8 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
DCHECK(app);
policy::CheckPermissionResult result;
- GetPolicyHandler().CheckPermissions(app, function_id, rpc_params, result);
+ GetPolicyHandler().CheckPermissions(
+ app, window_id, function_id, rpc_params, result);
if (NULL != params_permissions) {
params_permissions->allowed_params = result.list_of_allowed_params;
@@ -3050,7 +3073,9 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
params_permissions->undefined_params = result.list_of_undefined_params;
}
- if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE &&
+ // Record statistics for default window only
+ if (app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_apis::HMILevel::HMI_NONE &&
function_id != MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::UnregisterAppInterfaceID)) {
if (result.hmi_level_permitted != policy::kRpcAllowed) {
@@ -3061,7 +3086,8 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
#ifdef ENABLE_LOG
const std::string log_msg =
"Application: " + app->policy_app_id() + ", RPC: " + function_id +
- ", HMI status: " + MessageHelper::StringifiedHMILevel(app->hmi_level());
+ ", window_id: " + std::to_string(window_id) + ", HMI status: " +
+ MessageHelper::StringifiedHMILevel(app->hmi_level(window_id));
#endif // ENABLE_LOG
if (result.hmi_level_permitted != policy::kRpcAllowed) {
LOG4CXX_WARN(logger_, "Request is blocked by policies. " << log_msg);
@@ -3134,7 +3160,10 @@ bool ApplicationManagerImpl::HMILevelAllowsStreaming(
LOG4CXX_WARN(logger_, "An application is not registered.");
return false;
}
- return Compare<eType, EQ, ONE>(app->hmi_level(), HMI_FULL, HMI_LIMITED);
+ return Compare<eType, EQ, ONE>(
+ app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW),
+ HMI_FULL,
+ HMI_LIMITED);
}
bool ApplicationManagerImpl::CanAppStream(
@@ -3303,9 +3332,11 @@ void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) {
const std::string function_id = MessageHelper::StringifiedFunctionID(
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asUInt()));
+ const WindowID window_id = MessageHelper::ExtractWindowIdFromSmartObject(
+ (*message)[strings::msg_params]);
const RPCParams params;
const mobile_apis::Result::eType check_result =
- CheckPolicyPermissions(app, function_id, params);
+ CheckPolicyPermissions(app, window_id, function_id, params);
if (mobile_api::Result::SUCCESS == check_result) {
rpc_service_->ManageMobileCommand(message, commands::Command::SOURCE_SDL);
} else {
@@ -3360,39 +3391,6 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
}
}
-void ApplicationManagerImpl::SendHMIStatusNotification(
- const std::shared_ptr<Application> app) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(app);
- smart_objects::SmartObjectSPtr notification =
- std::make_shared<smart_objects::SmartObject>();
- smart_objects::SmartObject& message = *notification;
-
- message[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_api::FunctionID::OnHMIStatusID);
-
- message[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
- message[strings::params][strings::connection_key] =
- static_cast<int32_t>(app->app_id());
-
- message[strings::msg_params][strings::hmi_level] =
- static_cast<int32_t>(app->hmi_level());
-
- message[strings::msg_params][strings::audio_streaming_state] =
- static_cast<int32_t>(app->audio_streaming_state());
-
- message[strings::msg_params][strings::video_streaming_state] =
- static_cast<int32_t>(app->video_streaming_state());
-
- message[strings::msg_params][strings::system_context] =
- static_cast<int32_t>(app->system_context());
-
- rpc_service_->ManageMobileCommand(notification,
- commands::Command::SOURCE_SDL);
-}
-
void ApplicationManagerImpl::ClearTimerPool() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -3514,14 +3512,14 @@ bool ApplicationManagerImpl::IsApplicationForbidden(
}
bool ApplicationManagerImpl::IsAppInReconnectMode(
+ const connection_handler::DeviceHandle& device_id,
const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(reregister_wait_list_lock_);
return reregister_wait_list_.end() !=
std::find_if(reregister_wait_list_.begin(),
reregister_wait_list_.end(),
- std::bind1st(std::ptr_fun(&policy_app_id_comparator),
- policy_app_id));
+ PolicyAppIdComparator(device_id, policy_app_id));
}
policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
@@ -3823,13 +3821,18 @@ void ApplicationManagerImpl::OnUpdateHMIAppType(
if (flag_diffirence_app_hmi_type) {
(*it)->set_app_types(transform_app_hmi_types);
(*it)->ChangeSupportingAppHMIType();
- if ((*it)->hmi_level() == mobile_api::HMILevel::HMI_BACKGROUND) {
+ const mobile_apis::HMILevel::eType app_hmi_level =
+ (*it)->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
+ if (app_hmi_level == mobile_api::HMILevel::HMI_BACKGROUND) {
MessageHelper::SendUIChangeRegistrationRequestToHMI(*it, *this);
- } else if (((*it)->hmi_level() == mobile_api::HMILevel::HMI_FULL) ||
- ((*it)->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)) {
+ } else if ((app_hmi_level == mobile_api::HMILevel::HMI_FULL) ||
+ (app_hmi_level == mobile_api::HMILevel::HMI_LIMITED)) {
MessageHelper::SendUIChangeRegistrationRequestToHMI(*it, *this);
state_controller().SetRegularState(
- *it, mobile_apis::HMILevel::HMI_BACKGROUND, true);
+ *it,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::HMILevel::HMI_BACKGROUND,
+ true);
}
}
}
@@ -3846,10 +3849,10 @@ void ApplicationManagerImpl::EraseAppFromReconnectionList(
const auto policy_app_id = app->policy_app_id();
sync_primitives::AutoLock lock(reregister_wait_list_lock_);
- auto app_it = std::find_if(
- reregister_wait_list_.begin(),
- reregister_wait_list_.end(),
- std::bind1st(std::ptr_fun(&policy_app_id_comparator), policy_app_id));
+ auto app_it =
+ std::find_if(reregister_wait_list_.begin(),
+ reregister_wait_list_.end(),
+ PolicyAppIdComparator(app->device(), policy_app_id));
if (reregister_wait_list_.end() != app_it) {
reregister_wait_list_.erase(app_it);
}
@@ -3907,30 +3910,72 @@ void ApplicationManagerImpl::SendDriverDistractionState(
LOG4CXX_WARN(logger_, "DriverDistractionState is INVALID_ENUM");
return;
}
- smart_objects::SmartObjectSPtr on_driver_distraction =
- std::make_shared<smart_objects::SmartObject>();
- (*on_driver_distraction)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- (*on_driver_distraction)[strings::params][strings::function_id] =
- mobile_api::FunctionID::OnDriverDistractionID;
- (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
- driver_distraction_state();
- (*on_driver_distraction)[strings::params][strings::connection_key] =
- application->app_id();
+ auto create_notification = [application, this]() {
+ auto notification = std::make_shared<smart_objects::SmartObject>();
+ auto& msg_params = (*notification)[strings::msg_params];
+ auto& params = (*notification)[strings::params];
+
+ params[strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ params[strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnDriverDistractionID);
+ msg_params[mobile_notification::state] = driver_distraction_state();
+ const auto lock_screen_dismissal =
+ policy_handler_->LockScreenDismissalEnabledState();
+
+ if (lock_screen_dismissal &&
+ hmi_apis::Common_DriverDistractionState::DD_ON ==
+ driver_distraction_state()) {
+ bool dismissal_enabled = *lock_screen_dismissal;
+ if (dismissal_enabled) {
+ const auto language =
+ MessageHelper::MobileLanguageToString(application->ui_language());
+
+ const auto warning_message =
+ policy_handler_->LockScreenDismissalWarningMessage(language);
+ // Only allow lock screen dismissal if a warning message is available
+ if (warning_message && !warning_message->empty()) {
+ msg_params[mobile_notification::lock_screen_dismissal_warning] =
+ *warning_message;
+ } else {
+ dismissal_enabled = false;
+ }
+ }
+ msg_params[mobile_notification::lock_screen_dismissal_enabled] =
+ dismissal_enabled;
+ }
+
+ params[strings::connection_key] = application->app_id();
+ return notification;
+ };
- const std::string function_id = MessageHelper::StringifiedFunctionID(
- static_cast<mobile_apis::FunctionID::eType>(
- (*on_driver_distraction)[strings::params][strings::function_id]
- .asUInt()));
const RPCParams params;
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ mobile_api::FunctionID::OnDriverDistractionID);
const mobile_apis::Result::eType check_result =
- CheckPolicyPermissions(application, function_id, params);
+ CheckPolicyPermissions(application,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ function_id,
+ params);
if (mobile_api::Result::SUCCESS == check_result) {
- rpc_service_->ManageMobileCommand(on_driver_distraction,
+ rpc_service_->ManageMobileCommand(create_notification(),
commands::Command::SOURCE_SDL);
} else {
- application->PushMobileMessage(on_driver_distraction);
+ MobileMessageQueue messages;
+ application->SwapMobileMessageQueue(messages);
+ messages.erase(
+ std::remove_if(
+ messages.begin(),
+ messages.end(),
+ [](smart_objects::SmartObjectSPtr message) {
+ return (*message)[strings::params][strings::function_id]
+ .asUInt() ==
+ mobile_apis::FunctionID::OnDriverDistractionID;
+ }),
+ messages.end());
+ application->SwapMobileMessageQueue(messages);
+ application->PushMobileMessage(create_notification());
}
}
@@ -4203,16 +4248,11 @@ bool ApplicationManagerImpl::IsSOStructValid(
const smart_objects::SmartObject& display_capabilities) {
smart_objects::SmartObject display_capabilities_so = display_capabilities;
if (hmi_so_factory().AttachSchema(struct_id, display_capabilities_so)) {
- if (display_capabilities_so.isValid()) {
- return true;
- } else {
- return false;
- }
- } else {
- LOG4CXX_ERROR(logger_, "Could not find struct id: " << struct_id);
- return false;
+ return display_capabilities_so.isValid();
}
- return true;
+
+ LOG4CXX_ERROR(logger_, "Could not find struct id: " << struct_id);
+ return false;
}
#ifdef BUILD_TESTS
@@ -4295,9 +4335,10 @@ void ApplicationManagerImpl::ChangeAppsHMILevel(
LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id);
return;
}
- const mobile_apis::HMILevel::eType old_level = app->hmi_level();
+ const mobile_apis::HMILevel::eType old_level =
+ app->hmi_level(mobile_api::PredefinedWindows::DEFAULT_WINDOW);
if (old_level != level) {
- app->set_hmi_level(level);
+ app->set_hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW, level);
OnHMILevelChanged(app_id, old_level, level);
} else {
LOG4CXX_WARN(logger_, "Redundant changing HMI level: " << level);
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc
index 2b02e9b658..6ed784424a 100644
--- a/src/components/application_manager/src/application_state.cc
+++ b/src/components/application_manager/src/application_state.cc
@@ -31,7 +31,10 @@
*/
#include "application_manager/application_state.h"
+
#include <algorithm>
+#include <string>
+
#include "utils/logger.h"
#include "utils/macro.h"
@@ -53,193 +56,293 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
ApplicationState::ApplicationState() {}
-void ApplicationState::InitState(HmiStatePtr state) {
+void ApplicationState::InitState(const WindowID window_id,
+ const std::string& window_name,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- hmi_states_.clear();
- hmi_states_.push_back(state);
+ LOG4CXX_DEBUG(logger_,
+ "Initing state " << state << " for window " << window_id
+ << " with name " << window_name);
+ {
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& states = hmi_states_map_[window_id];
+ states.push_back(state);
+ }
}
-void ApplicationState::AddState(HmiStatePtr state) {
+void ApplicationState::AddState(const WindowID window_id, HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
switch (state->state_id()) {
case HmiState::StateID::STATE_ID_REGULAR:
- SetRegularState(state);
+ SetRegularState(window_id, state);
return;
case HmiState::StateID::STATE_ID_POSTPONED:
- SetPostponedState(state);
+ SetPostponedState(window_id, state);
return;
case HmiState::StateID::STATE_ID_CURRENT:
- LOG4CXX_ERROR(logger_, "State of type '" << state << "' can't be added.");
+ LOG4CXX_ERROR(logger_,
+ "State of type '" << state << "' can't be added for window "
+ << window_id);
return;
default:
- AddHMIState(state);
+ AddHMIState(window_id, state);
break;
}
return;
}
-void ApplicationState::RemoveState(HmiState::StateID state) {
+void ApplicationState::RemoveState(const WindowID window_id,
+ HmiState::StateID state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
switch (state) {
case HmiState::StateID::STATE_ID_CURRENT:
case HmiState::StateID::STATE_ID_REGULAR:
- LOG4CXX_ERROR(logger_,
- "State of type '" << state << "'can't be removed.");
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id) {
+ LOG4CXX_ERROR(logger_,
+ "State of type '" << state
+ << "' can't be removed for window "
+ << window_id);
+ return;
+ }
+
+ RemoveWindowHMIStates(window_id);
break;
case HmiState::StateID::STATE_ID_POSTPONED:
- RemovePostponedState();
+ RemovePostponedState(window_id);
break;
default:
- RemoveHMIState(state);
+ RemoveHMIState(window_id, state);
break;
}
}
-HmiStatePtr ApplicationState::GetState(HmiState::StateID state_id) const {
+HmiStatePtr ApplicationState::GetState(const WindowID window_id,
+ HmiState::StateID state_id) const {
switch (state_id) {
case HmiState::StateID::STATE_ID_REGULAR:
- LOG4CXX_DEBUG(logger_, "Getting regular state.");
- return RegularHmiState();
+ LOG4CXX_DEBUG(logger_, "Getting regular state for window " << window_id);
+ return RegularHmiState(window_id);
case HmiState::StateID::STATE_ID_POSTPONED:
- LOG4CXX_DEBUG(logger_, "Getting postponed state.");
- return PostponedHmiState();
+ LOG4CXX_DEBUG(logger_,
+ "Getting postponed state for window " << window_id);
+ return PostponedHmiState(window_id);
default:
- LOG4CXX_DEBUG(logger_, "Getting current state.");
- return CurrentHmiState();
+ LOG4CXX_DEBUG(logger_, "Getting current state for window " << window_id);
+ return CurrentHmiState(window_id);
+ }
+}
+
+HmiStates ApplicationState::GetStates(const HmiState::StateID state_id) const {
+ LOG4CXX_DEBUG(logger_, "Collecting all states of type " << state_id);
+
+ HmiStates hmi_states;
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ for (const auto& hmi_state_pair : hmi_states_map_) {
+ hmi_states.push_back(GetState(hmi_state_pair.first, state_id));
}
+
+ return hmi_states;
}
-void ApplicationState::AddHMIState(HmiStatePtr state) {
+WindowIds ApplicationState::GetWindowIds() const {
+ LOG4CXX_DEBUG(logger_, "Collecting available window ID's");
+
+ WindowIds window_ids;
+ std::string stringified_window_ids;
+
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ for (const auto& hmi_state_pair : hmi_states_map_) {
+ window_ids.push_back(hmi_state_pair.first);
+ stringified_window_ids += (stringified_window_ids.empty() ? "" : ", ") +
+ std::to_string(hmi_state_pair.first);
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Existing window IDs: [" + stringified_window_ids + "]");
+ return window_ids;
+}
+
+void ApplicationState::AddHMIState(const WindowID window_id,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- HmiStates::iterator it = std::find_if(hmi_states_.begin(),
- hmi_states_.end(),
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& hmi_states = hmi_states_map_[window_id];
+ HmiStates::iterator it = std::find_if(hmi_states.begin(),
+ hmi_states.end(),
StateIDComparator(state->state_id()));
- if (hmi_states_.end() != it) {
- LOG4CXX_WARN(
- logger_,
- "Hmi state with ID "
- << state->state_id()
- << "has been already applied to this application. Ignoring");
+ if (hmi_states.end() != it) {
+ LOG4CXX_WARN(logger_,
+ "Hmi state with ID " << state->state_id()
+ << "has been already applied for window "
+ << window_id
+ << " of this application. Ignoring");
return;
}
- hmi_states_.push_back(state);
+ hmi_states.push_back(state);
}
-void ApplicationState::RemoveHMIState(HmiState::StateID state_id) {
+void ApplicationState::RemoveHMIState(const WindowID window_id,
+ HmiState::StateID state_id) {
LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& hmi_states = hmi_states_map_[window_id];
HmiStates::iterator it = std::find_if(
- hmi_states_.begin(), hmi_states_.end(), StateIDComparator(state_id));
- if (it == hmi_states_.end()) {
- LOG4CXX_ERROR(logger_, "Unsuccesful remove HmiState: " << state_id);
+ hmi_states.begin(), hmi_states.end(), StateIDComparator(state_id));
+ if (hmi_states.end() == it) {
+ LOG4CXX_ERROR(logger_,
+ "Unsuccesful remove HmiState: " << state_id << " for window "
+ << window_id);
return;
}
// unable to remove regular state
- DCHECK_OR_RETURN_VOID(it != hmi_states_.begin());
+ DCHECK_OR_RETURN_VOID(hmi_states.begin() != it);
HmiStates::iterator next = it;
HmiStates::iterator prev = it;
next++;
prev--;
- if (next != hmi_states_.end()) {
+
+ if (next != hmi_states.end()) {
HmiStatePtr next_state = *next;
HmiStatePtr prev_state = *prev;
next_state->set_parent(prev_state);
}
- hmi_states_.erase(it);
+
+ hmi_states.erase(it);
}
-void ApplicationState::RemovePostponedState() {
+void ApplicationState::RemoveWindowHMIStates(const WindowID window_id) {
LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN_VOID(!hmi_states_.empty());
+ DCHECK_OR_RETURN_VOID(mobile_apis::PredefinedWindows::DEFAULT_WINDOW !=
+ window_id);
+
+ LOG4CXX_DEBUG(logger_,
+ "Removing HMI states for window with id #" << window_id);
+ {
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ hmi_states_map_.erase(window_id);
+ }
+}
+
+void ApplicationState::RemovePostponedState(const WindowID window_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& hmi_states = hmi_states_map_[window_id];
+ DCHECK_OR_RETURN_VOID(!hmi_states.empty());
StateIDComparator finder(HmiState::StateID::STATE_ID_POSTPONED);
HmiStates::iterator postponed_state =
- std::find_if(hmi_states_.begin(), hmi_states_.end(), finder);
+ std::find_if(hmi_states.begin(), hmi_states.end(), finder);
- if (hmi_states_.end() == postponed_state) {
- LOG4CXX_ERROR(logger_, "No postponed state is set for app.");
+ if (hmi_states.end() == postponed_state) {
+ LOG4CXX_ERROR(logger_,
+ "No postponed state is set for window " << window_id);
return;
}
- hmi_states_.erase(postponed_state);
+
+ hmi_states.erase(postponed_state);
}
-void ApplicationState::SetRegularState(HmiStatePtr state) {
+void ApplicationState::SetRegularState(const WindowID window_id,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() ==
HmiState::StateID::STATE_ID_REGULAR);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN_VOID(!hmi_states_.empty());
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& hmi_states = hmi_states_map_[window_id];
+ DCHECK_OR_RETURN_VOID(!hmi_states.empty());
- HmiStatePtr front_state = hmi_states_.front();
+ HmiStatePtr front_state = hmi_states.front();
HmiState::StateID front_state_id = front_state->state_id();
if (HmiState::StateID::STATE_ID_POSTPONED == front_state_id) {
// Drop postponed state
- hmi_states_.erase(hmi_states_.begin());
+ hmi_states.erase(hmi_states.begin());
}
// Drop regular state
- hmi_states_.erase(hmi_states_.begin());
+ hmi_states.erase(hmi_states.begin());
- if (!hmi_states_.empty()) {
- HmiStatePtr front_state = hmi_states_.front();
+ if (!hmi_states.empty()) {
+ HmiStatePtr front_state = hmi_states.front();
front_state->set_parent(state);
}
- hmi_states_.insert(hmi_states_.begin(), state);
+
+ // Insert new regular state
+ hmi_states.insert(hmi_states.begin(), state);
if (HmiState::StateID::STATE_ID_POSTPONED == front_state_id) {
- hmi_states_.insert(hmi_states_.begin(), front_state);
+ // Restore postponed state if it was before
+ hmi_states.insert(hmi_states.begin(), front_state);
}
}
-void ApplicationState::SetPostponedState(HmiStatePtr state) {
+void ApplicationState::SetPostponedState(const WindowID window_id,
+ HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() ==
HmiState::StateID::STATE_ID_POSTPONED);
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN_VOID(!hmi_states_.empty());
- HmiStatePtr front_state = hmi_states_.front();
+
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ HmiStates& hmi_states = hmi_states_map_[window_id];
+ DCHECK_OR_RETURN_VOID(!hmi_states.empty());
+ HmiStatePtr front_state = hmi_states.front();
if (front_state->state_id() == HmiState::StateID::STATE_ID_POSTPONED) {
- hmi_states_.erase(hmi_states_.begin());
+ hmi_states.erase(hmi_states.begin());
}
- hmi_states_.insert(hmi_states_.begin(), state);
+
+ hmi_states.insert(hmi_states.begin(), state);
}
-HmiStatePtr ApplicationState::CurrentHmiState() const {
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN(!hmi_states_.empty(), HmiStatePtr());
- HmiStatePtr back_state = hmi_states_.back();
+HmiStatePtr ApplicationState::CurrentHmiState(const WindowID window_id) const {
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ auto it_states = hmi_states_map_.find(window_id);
+ DCHECK_OR_RETURN(it_states != hmi_states_map_.end(), HmiStatePtr());
+
+ const HmiStates& hmi_states = it_states->second;
+ DCHECK_OR_RETURN(!hmi_states.empty(), HmiStatePtr());
+
+ HmiStatePtr back_state = hmi_states.back();
DCHECK_OR_RETURN(
back_state->state_id() != HmiState::StateID::STATE_ID_POSTPONED,
HmiStatePtr());
+
return back_state;
}
-HmiStatePtr ApplicationState::RegularHmiState() const {
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN(!hmi_states_.empty(), HmiStatePtr());
- HmiStates::const_iterator front_itr = hmi_states_.begin();
+HmiStatePtr ApplicationState::RegularHmiState(const WindowID window_id) const {
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ auto it_states = hmi_states_map_.find(window_id);
+ DCHECK_OR_RETURN(it_states != hmi_states_map_.end(), HmiStatePtr());
+
+ const HmiStates& hmi_states = it_states->second;
+ DCHECK_OR_RETURN(!hmi_states.empty(), HmiStatePtr());
+
+ HmiStates::const_iterator front_itr = hmi_states.begin();
if ((*front_itr)->state_id() == HmiState::StateID::STATE_ID_POSTPONED) {
++front_itr;
}
+
return *front_itr;
}
-HmiStatePtr ApplicationState::PostponedHmiState() const {
- sync_primitives::AutoLock auto_lock(hmi_states_lock_);
- DCHECK_OR_RETURN(!hmi_states_.empty(), HmiStatePtr());
- HmiStatePtr front_state = hmi_states_.front();
+HmiStatePtr ApplicationState::PostponedHmiState(
+ const WindowID window_id) const {
+ sync_primitives::AutoLock auto_lock(hmi_states_map_lock_);
+ auto it_states = hmi_states_map_.find(window_id);
+ DCHECK_OR_RETURN(it_states != hmi_states_map_.end(), HmiStatePtr());
+
+ const HmiStates& hmi_states = it_states->second;
+ DCHECK_OR_RETURN(!hmi_states.empty(), HmiStatePtr());
+
+ HmiStatePtr front_state = hmi_states.front();
return front_state->state_id() == HmiState::StateID::STATE_ID_POSTPONED
? front_state
: HmiStatePtr();
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 521a44890f..8875895cb7 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -96,6 +96,15 @@ int32_t CommandImpl::function_id() const {
return (*message_)[strings::params][strings::function_id].asInt();
}
+WindowID CommandImpl::window_id() const {
+ if ((*message_).keyExists(strings::msg_params)) {
+ if ((*message_)[strings::msg_params].keyExists(strings::window_id)) {
+ return (*message_)[strings::msg_params][strings::window_id].asInt();
+ }
+ }
+ return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
uint32_t CommandImpl::connection_key() const {
return (*message_)[strings::params][strings::connection_key].asUInt();
}
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index f67fde22a0..06e0220158 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -725,12 +725,17 @@ bool CommandRequestImpl::CheckAllowedParameters() {
}
mobile_apis::Result::eType check_result =
- application_manager_.CheckPolicyPermissions(
- app,
- MessageHelper::StringifiedFunctionID(
- static_cast<mobile_api::FunctionID::eType>(function_id())),
- params,
- &parameters_permissions_);
+ mobile_apis::Result::eType::INVALID_ID;
+ const auto current_window_id = window_id();
+ if (app->WindowIdExists(current_window_id)) {
+ check_result = application_manager_.CheckPolicyPermissions(
+ app,
+ current_window_id,
+ MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())),
+ params,
+ &parameters_permissions_);
+ }
// Check, if RPC is allowed by policy
if (mobile_apis::Result::SUCCESS != check_result) {
diff --git a/src/components/application_manager/src/display_capabilities_builder.cc b/src/components/application_manager/src/display_capabilities_builder.cc
new file mode 100644
index 0000000000..8234128280
--- /dev/null
+++ b/src/components/application_manager/src/display_capabilities_builder.cc
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/display_capabilities_builder.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "DisplayCapabilitiesBuilder")
+
+const WindowID kDefaultWindowID = 0;
+
+DisplayCapabilitiesBuilder::DisplayCapabilitiesBuilder(Application& application)
+ : owner_(application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void DisplayCapabilitiesBuilder::InitBuilder(
+ DisplayCapabilitiesBuilder::ResumeCallback resume_callback,
+ const smart_objects::SmartObject& windows_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(display_capabilities_lock_);
+ resume_callback_ = resume_callback;
+ window_ids_to_resume_.insert(kDefaultWindowID);
+ for (size_t i = 0; i < windows_info.length(); ++i) {
+ auto window_id = windows_info[i][strings::window_id].asInt();
+ LOG4CXX_DEBUG(logger_,
+ "Inserting " << window_id << " to waiting container");
+ window_ids_to_resume_.insert(window_id);
+ }
+}
+
+void DisplayCapabilitiesBuilder::UpdateDisplayCapabilities(
+ const smart_objects::SmartObject& incoming_display_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+ sync_primitives::AutoLock lock(display_capabilities_lock_);
+
+ if (!display_capabilities_) {
+ display_capabilities_ = std::make_shared<SmartObject>(SmartType_Array);
+ }
+
+ // As per v6.0, only single display is supported
+ auto cur_window_caps =
+ (*display_capabilities_)[0][strings::window_capabilities];
+
+ const auto& inc_window_caps =
+ incoming_display_capabilities[0][strings::window_capabilities];
+
+ for (size_t i = 0; i < inc_window_caps.length(); ++i) {
+ const WindowID window_id =
+ inc_window_caps[i].keyExists(strings::window_id)
+ ? inc_window_caps[i][strings::window_id].asInt()
+ : kDefaultWindowID;
+ if (window_ids_to_resume_.end() != window_ids_to_resume_.find(window_id)) {
+ cur_window_caps[cur_window_caps.length()] = inc_window_caps[i];
+ LOG4CXX_DEBUG(logger_, "Stop waiting for: " << window_id);
+ window_ids_to_resume_.erase(window_id);
+ }
+ }
+
+ *display_capabilities_ = incoming_display_capabilities;
+ (*display_capabilities_)[0][strings::window_capabilities] = cur_window_caps;
+
+ if (window_ids_to_resume_.empty()) {
+ LOG4CXX_TRACE(logger_, "Invoking resume callback");
+ resume_callback_(owner_, *display_capabilities_);
+ display_capabilities_.reset();
+ }
+} // namespace application_manager
+
+const smart_objects::SmartObjectSPtr
+DisplayCapabilitiesBuilder::display_capabilities() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return display_capabilities_;
+}
+
+void DisplayCapabilitiesBuilder::ResetDisplayCapabilities() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(display_capabilities_lock_);
+ display_capabilities_.reset();
+}
+
+void DisplayCapabilitiesBuilder::StopWaitingForWindow(
+ const WindowID window_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(display_capabilities_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "Window id " << window_id << " will be erased due to failure");
+ window_ids_to_resume_.erase(window_id);
+ if (window_ids_to_resume_.empty()) {
+ LOG4CXX_TRACE(logger_,
+ window_id << " was the last window pending resumption. "
+ "Invoking resume callback");
+ resume_callback_(owner_, *display_capabilities_);
+ display_capabilities_.reset();
+ }
+}
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index 0f5bc80d56..6b209ade0c 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -58,6 +58,7 @@ std::map<std::string, hmi_apis::Common_TextFieldName::eType>
text_fields_enum_name;
std::map<std::string, hmi_apis::Common_MediaClockFormat::eType>
media_clock_enum_name;
+std::map<std::string, hmi_apis::Common_MenuLayout::eType> menu_layout_enum;
std::map<std::string, hmi_apis::Common_ImageType::eType> image_type_enum;
std::map<std::string, hmi_apis::Common_SamplingRate::eType> sampling_rate_enum;
std::map<std::string, hmi_apis::Common_BitsPerSample::eType>
@@ -135,6 +136,46 @@ void InitCapabilities() {
hmi_apis::Common_ButtonName::CUSTOM_BUTTON));
button_enum_name.insert(std::make_pair(std::string("SEARCH"),
hmi_apis::Common_ButtonName::SEARCH));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_CENTER_LOCATION"),
+ hmi_apis::Common_ButtonName::NAV_CENTER_LOCATION));
+ button_enum_name.insert(std::make_pair(
+ std::string("NAV_ZOOM_IN"), hmi_apis::Common_ButtonName::NAV_ZOOM_IN));
+ button_enum_name.insert(std::make_pair(
+ std::string("NAV_ZOOM_OUT"), hmi_apis::Common_ButtonName::NAV_ZOOM_OUT));
+ button_enum_name.insert(std::make_pair(
+ std::string("NAV_PAN_UP"), hmi_apis::Common_ButtonName::NAV_PAN_UP));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_PAN_UP_RIGHT"),
+ hmi_apis::Common_ButtonName::NAV_PAN_UP_RIGHT));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_PAN_RIGHT"),
+ hmi_apis::Common_ButtonName::NAV_PAN_RIGHT));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_PAN_DOWN_RIGHT"),
+ hmi_apis::Common_ButtonName::NAV_PAN_DOWN_RIGHT));
+ button_enum_name.insert(std::make_pair(
+ std::string("NAV_PAN_DOWN"), hmi_apis::Common_ButtonName::NAV_PAN_DOWN));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_PAN_DOWN_LEFT"),
+ hmi_apis::Common_ButtonName::NAV_PAN_DOWN_LEFT));
+ button_enum_name.insert(std::make_pair(
+ std::string("NAV_PAN_LEFT"), hmi_apis::Common_ButtonName::NAV_PAN_LEFT));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_PAN_UP_LEFT"),
+ hmi_apis::Common_ButtonName::NAV_PAN_UP_LEFT));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_TILT_TOGGLE"),
+ hmi_apis::Common_ButtonName::NAV_TILT_TOGGLE));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_ROTATE_CLOCKWISE"),
+ hmi_apis::Common_ButtonName::NAV_ROTATE_CLOCKWISE));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_ROTATE_COUNTERCLOCKWISE"),
+ hmi_apis::Common_ButtonName::NAV_ROTATE_COUNTERCLOCKWISE));
+ button_enum_name.insert(
+ std::make_pair(std::string("NAV_HEADING_TOGGLE"),
+ hmi_apis::Common_ButtonName::NAV_HEADING_TOGGLE));
text_fields_enum_name.insert(std::make_pair(
std::string("mainField1"), hmi_apis::Common_TextFieldName::mainField1));
@@ -239,6 +280,11 @@ void InitCapabilities() {
std::make_pair(std::string("CLOCKTEXT4"),
hmi_apis::Common_MediaClockFormat::CLOCKTEXT4));
+ menu_layout_enum.insert(
+ std::make_pair(std::string("LIST"), hmi_apis::Common_MenuLayout::LIST));
+ menu_layout_enum.insert(
+ std::make_pair(std::string("TILES"), hmi_apis::Common_MenuLayout::TILES));
+
image_type_enum.insert(std::make_pair(std::string("STATIC"),
hmi_apis::Common_ImageType::STATIC));
image_type_enum.insert(std::make_pair(std::string("DYNAMIC"),
@@ -337,6 +383,8 @@ void InitCapabilities() {
std::make_pair(std::string("MFD5"), hmi_apis::Common_DisplayType::MFD5));
display_type_enum.insert(std::make_pair(
std::string("GEN3_8_INCH"), hmi_apis::Common_DisplayType::GEN3_8_INCH));
+ display_type_enum.insert(std::make_pair(
+ std::string("SDL_GENERIC"), hmi_apis::Common_DisplayType::SDL_GENERIC));
character_set_enum.insert(std::make_pair(
std::string("TYPE2SET"), hmi_apis::Common_CharacterSet::TYPE2SET));
@@ -568,6 +616,12 @@ void HMICapabilitiesImpl::set_display_capabilities(
}
}
+void HMICapabilitiesImpl::set_system_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) {
+ system_display_capabilities_.reset(
+ new smart_objects::SmartObject(display_capabilities));
+}
+
void HMICapabilitiesImpl::set_hmi_zone_capabilities(
const smart_objects::SmartObject& hmi_zone_capabilities) {
if (hmi_zone_capabilities_) {
@@ -758,6 +812,11 @@ const smart_objects::SmartObject* HMICapabilitiesImpl::display_capabilities()
return display_capabilities_;
}
+const smart_objects::SmartObjectSPtr
+HMICapabilitiesImpl::system_display_capabilities() const {
+ return system_display_capabilities_;
+}
+
const smart_objects::SmartObject* HMICapabilitiesImpl::hmi_zone_capabilities()
const {
return hmi_zone_capabilities_;
@@ -826,6 +885,26 @@ bool HMICapabilitiesImpl::rc_supported() const {
return is_rc_supported_;
}
+bool HMICapabilitiesImpl::menu_layout_supported(
+ mobile_apis::MenuLayout::eType layout) const {
+ if (!display_capabilities_ ||
+ !display_capabilities_->keyExists(strings::menu_layouts_available))
+ return false;
+
+ auto menu_layouts =
+ display_capabilities_->getElement(strings::menu_layouts_available);
+ if (menu_layouts.getType() == smart_objects::SmartType_Array) {
+ for (uint32_t i = 0; i < menu_layouts.length(); ++i) {
+ if (layout == static_cast<mobile_apis::MenuLayout::eType>(
+ menu_layouts.getElement(i).asUInt())) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability()
const {
return navigation_capability_;
@@ -1002,6 +1081,25 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
}
if (display_capabilities_so.keyExists(
+ strings::menu_layouts_available)) {
+ smart_objects::SmartObject menu_layouts_available_enum(
+ smart_objects::SmartType_Array);
+ auto menu_layouts_available_array =
+ display_capabilities_so[strings::menu_layouts_available];
+ for (uint32_t i = 0, j = 0; i < menu_layouts_available_array.length();
+ ++i) {
+ auto it = menu_layout_enum.find(
+ menu_layouts_available_array[i].asString());
+ if (it != menu_layout_enum.end()) {
+ menu_layouts_available_enum[j++] = it->second;
+ }
+ }
+ display_capabilities_so.erase(strings::menu_layouts_available);
+ display_capabilities_so[strings::menu_layouts_available] =
+ menu_layouts_available_enum;
+ }
+
+ if (display_capabilities_so.keyExists(
hmi_response::image_capabilities)) {
smart_objects::SmartObject& image_capabilities_array =
display_capabilities_so[hmi_response::image_capabilities];
@@ -1026,27 +1124,16 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(ui, "audioPassThruCapabilities")) {
Json::Value audio_capabilities =
ui.get("audioPassThruCapabilities", "");
- smart_objects::SmartObject audio_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- audio_capabilities_so =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if (check_existing_json_member(audio_capabilities, "samplingRate")) {
- audio_capabilities_so["samplingRate"] =
- sampling_rate_enum
- .find(audio_capabilities.get("samplingRate", "").asString())
- ->second;
- }
- if (check_existing_json_member(audio_capabilities, "bitsPerSample")) {
- audio_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum
- .find(audio_capabilities.get("bitsPerSample", "").asString())
- ->second;
- }
- if (check_existing_json_member(audio_capabilities, "audioType")) {
- audio_capabilities_so["audioType"] =
- audio_type_enum
- .find(audio_capabilities.get("audioType", "").asString())
- ->second;
+ smart_objects::SmartObject audio_capabilities_so(
+ smart_objects::SmartType_Array);
+ if (audio_capabilities.type() == Json::arrayValue) {
+ for (uint32_t i = 0; i < audio_capabilities.size(); i++) {
+ convert_audio_capability_to_obj(audio_capabilities[i],
+ audio_capabilities_so[i]);
+ }
+ } else if (audio_capabilities.type() == Json::objectValue) {
+ convert_audio_capability_to_obj(audio_capabilities,
+ audio_capabilities_so[0]);
}
set_audio_pass_thru_capabilities(audio_capabilities_so);
}
@@ -1055,26 +1142,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value pcm_capabilities = ui.get("pcmStreamCapabilities", "");
smart_objects::SmartObject pcm_capabilities_so =
smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (check_existing_json_member(pcm_capabilities, "samplingRate")) {
- pcm_capabilities_so["samplingRate"] =
- sampling_rate_enum
- .find(pcm_capabilities.get("samplingRate", "").asString())
- ->second;
- }
- if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) {
- pcm_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum
- .find(pcm_capabilities.get("bitsPerSample", "").asString())
- ->second;
- }
- if (check_existing_json_member(pcm_capabilities, "audioType")) {
- pcm_capabilities_so["audioType"] =
- audio_type_enum
- .find(pcm_capabilities.get("audioType", "").asString())
- ->second;
- }
-
+ convert_audio_capability_to_obj(pcm_capabilities, pcm_capabilities_so);
set_pcm_stream_capabilities(pcm_capabilities_so);
}
@@ -1331,6 +1399,27 @@ void HMICapabilitiesImpl::convert_json_languages_to_obj(
}
}
+void HMICapabilitiesImpl::convert_audio_capability_to_obj(
+ const Json::Value& capability,
+ smart_objects::SmartObject& output_so) const {
+ if (check_existing_json_member(capability, "samplingRate")) {
+ output_so[strings::sampling_rate] =
+ sampling_rate_enum.find(capability.get("samplingRate", "").asString())
+ ->second;
+ }
+ if (check_existing_json_member(capability, "bitsPerSample")) {
+ output_so[strings::bits_per_sample] =
+ bit_per_sample_enum
+ .find(capability.get("bitsPerSample", "").asString())
+ ->second;
+ }
+ if (check_existing_json_member(capability, "audioType")) {
+ output_so[strings::audio_type] =
+ audio_type_enum.find(capability.get("audioType", "").asString())
+ ->second;
+ }
+}
+
HMILanguageHandler& HMICapabilitiesImpl::get_hmi_language_handler() {
return hmi_language_handler_;
}
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 9aff403e09..f1f8660217 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -105,6 +105,8 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_GetFilePath] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_CloseApplication] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Started] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Stopped] = HmiInterfaces::HMI_INTERFACE_VR;
@@ -135,12 +137,16 @@ generate_function_to_interface_convert_map() {
convert_map[UI_DeleteCommand] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_AddSubMenu] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_DeleteSubMenu] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_ShowAppMenu] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_CreateWindow] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_DeleteWindow] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_PerformInteraction] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_SetMediaClockTimer] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_SetGlobalProperties] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_OnCommand] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_OnSystemContext] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_CancelInteraction] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_ChangeRegistration] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_OnLanguageChange] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_GetSupportedLanguages] = HmiInterfaces::HMI_INTERFACE_UI;
@@ -231,6 +237,8 @@ generate_function_to_interface_convert_map() {
convert_map[RC_OnRemoteControlSettings] = HmiInterfaces::HMI_INTERFACE_RC;
convert_map[AppService_PublishAppService] =
HmiInterfaces::HMI_INTERFACE_AppService;
+ convert_map[AppService_UnpublishAppService] =
+ HmiInterfaces::HMI_INTERFACE_AppService;
convert_map[AppService_GetAppServiceData] =
HmiInterfaces::HMI_INTERFACE_AppService;
convert_map[AppService_PerformAppServiceInteraction] =
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 77880eddc0..844d0254cf 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -48,6 +48,7 @@ HmiState::HmiState(std::shared_ptr<Application> app,
: hmi_app_id_(app->hmi_app_id())
, state_id_(state_id)
, app_mngr_(app_mngr)
+ , window_type_(mobile_apis::WindowType::INVALID_ENUM)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
, video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
@@ -60,6 +61,7 @@ HmiState::HmiState(std::shared_ptr<Application> app,
: hmi_app_id_(app->hmi_app_id())
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
+ , window_type_(mobile_apis::WindowType::INVALID_ENUM)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
, video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
@@ -96,6 +98,15 @@ bool HmiState::is_mobile_projection_app() const {
return app ? app->mobile_projection_enabled() : false;
}
+mobile_apis::WindowType::eType HmiState::window_type() const {
+ return window_type_;
+}
+
+void HmiState::set_window_type(
+ const mobile_apis::WindowType::eType window_type) {
+ window_type_ = window_type;
+}
+
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
const {
using namespace mobile_apis;
@@ -173,17 +184,25 @@ PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
+
+ if (WindowType::WIDGET == window_type()) {
+ return parent()->hmi_level();
+ }
+
if (Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
HMILevel::HMI_BACKGROUND,
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
+
if (is_navi_app() || is_mobile_projection_app()) {
return HMILevel::HMI_LIMITED;
}
+
if (!is_media_app()) {
return parent()->hmi_level();
}
+
return HMILevel::HMI_BACKGROUND;
}
@@ -198,6 +217,11 @@ DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
+
+ if (WindowType::WIDGET == window_type()) {
+ return parent()->hmi_level();
+ }
+
if (Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
HMILevel::HMI_BACKGROUND,
HMILevel::HMI_NONE)) {
@@ -215,14 +239,19 @@ AudioSource::AudioSource(std::shared_ptr<Application> app,
}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
+ using namespace mobile_apis;
+
+ if (WindowType::WIDGET == window_type()) {
+ return parent()->hmi_level();
+ }
+
// Checking for NONE is necessary to avoid issue during
// calculation of HMI level during setting default HMI level
- if (keep_context_ ||
- mobile_apis::HMILevel::HMI_NONE == parent()->hmi_level()) {
+ if (keep_context_ || HMILevel::HMI_NONE == parent()->hmi_level()) {
return parent()->hmi_level();
}
- return mobile_apis::HMILevel::HMI_BACKGROUND;
+ return HMILevel::HMI_BACKGROUND;
}
EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app,
@@ -232,11 +261,17 @@ EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
using namespace mobile_apis;
using namespace helpers;
+
+ if (WindowType::WIDGET == window_type()) {
+ return parent()->hmi_level();
+ }
+
if (Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
HMILevel::HMI_BACKGROUND,
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
+
return HMILevel::HMI_BACKGROUND;
}
@@ -278,7 +313,8 @@ std::ostream& operator<<(std::ostream& os, const HmiState& src) {
} else {
os << "(none)";
}
- os << ", hmi app id:" << src.hmi_app_id_ << ", state:" << src.state_id()
+ os << ", hmi app id:" << src.hmi_app_id_
+ << ", window_type:" << src.window_type_ << ", state:" << src.state_id()
<< ", hmi_level:" << src.hmi_level()
<< ", audio:" << src.audio_streaming_state()
<< ", video:" << src.video_streaming_state()
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 6530004499..3639953a3a 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -332,6 +332,15 @@ std::string MessageHelper::CommonLanguageToString(
return std::string();
}
+std::string MessageHelper::MobileLanguageToString(
+ mobile_apis::Language::eType language) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+ const char* str = 0;
+ EnumConversionHelper<mobile_apis::Language::eType>::EnumToCString(language,
+ &str);
+ return str ? str : std::string();
+}
+
smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
@@ -348,6 +357,33 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
return message;
}
+smart_objects::SmartObjectSPtr
+MessageHelper::CreateDisplayCapabilityUpdateToMobile(
+ const smart_objects::SmartObject& display_capabilities, Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto message = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+ (*message)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemCapabilityUpdatedID;
+ (*message)[strings::params][strings::connection_key] = app.app_id();
+ (*message)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ (*message)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+
+ smart_objects::SmartObject system_capability(smart_objects::SmartType_Map);
+ system_capability[strings::system_capability_type] =
+ static_cast<int32_t>(mobile_apis::SystemCapabilityType::DISPLAYS);
+ system_capability[strings::display_capabilities] = display_capabilities;
+ (*message)[strings::msg_params][strings::system_capability] =
+ system_capability;
+
+ return message;
+}
+
void MessageHelper::BroadcastCapabilityUpdate(
smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -369,7 +405,8 @@ void MessageHelper::BroadcastCapabilityUpdate(
hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated;
smart_objects::SmartObjectSPtr hmi_notification =
std::make_shared<smart_objects::SmartObject>(message);
- app_mngr.GetRPCService().ManageHMICommand(hmi_notification);
+ app_mngr.GetRPCService().ManageHMICommand(
+ hmi_notification, commands::Command::CommandSource::SOURCE_SDL_TO_HMI);
}
smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
@@ -623,15 +660,16 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
msg_params = *MessageHelper::CreateAppVrHelp(application);
msg_params[hmi_request::menu_title] = "";
- smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject keyboard_properties =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- key_board_properties[strings::language] =
+ keyboard_properties[strings::language] =
static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
- key_board_properties[hmi_request::keyboard_layout] =
+ keyboard_properties[hmi_request::keyboard_layout] =
static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
- key_board_properties[hmi_request::auto_complete_text] = "";
- msg_params[hmi_request::keyboard_properties] = key_board_properties;
+ keyboard_properties[hmi_request::auto_complete_list] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[hmi_request::keyboard_properties] = keyboard_properties;
msg_params[strings::app_id] = application->app_id();
@@ -761,7 +799,8 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
}
void MessageHelper::SendHMIStatusNotification(
- const Application& application_impl,
+ ApplicationSharedPtr application,
+ const WindowID window_id,
ApplicationManager& application_manager) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr notification =
@@ -779,16 +818,21 @@ void MessageHelper::SendHMIStatusNotification(
static_cast<int32_t>(application_manager::MessageType::kNotification);
message[strings::params][strings::connection_key] =
- static_cast<int32_t>(application_impl.app_id());
+ static_cast<int32_t>(application->app_id());
+
+ message[strings::msg_params][strings::window_id] = window_id;
message[strings::msg_params][strings::hmi_level] =
- static_cast<int32_t>(application_impl.hmi_level());
+ static_cast<int32_t>(application->hmi_level(window_id));
message[strings::msg_params][strings::audio_streaming_state] =
- static_cast<int32_t>(application_impl.audio_streaming_state());
+ static_cast<int32_t>(application->audio_streaming_state());
+
+ message[strings::msg_params][strings::video_streaming_state] =
+ static_cast<int32_t>(application->video_streaming_state());
message[strings::msg_params][strings::system_context] =
- static_cast<int32_t>(application_impl.system_context());
+ static_cast<int32_t>(application->system_context(window_id));
application_manager.GetRPCService().ManageMobileCommand(
notification, commands::Command::SOURCE_SDL);
@@ -1547,6 +1591,67 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
return vr_command;
}
+smart_objects::SmartObjectSPtr MessageHelper::CreateUICreateWindowRequestToHMI(
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& window_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto ui_request = CreateMessageForHMI(hmi_apis::messageType::request,
+ app_mngr.GetNextHMICorrelationID());
+
+ (*ui_request)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::UI_CreateWindow);
+
+ (*ui_request)[strings::correlation_id] =
+ (*ui_request)[strings::params][strings::correlation_id];
+ (*ui_request)[strings::function_id] =
+ (*ui_request)[strings::params][strings::function_id];
+
+ smart_objects::SmartObject msg_params(
+ smart_objects::SmartObject(smart_objects::SmartType_Map));
+
+ msg_params[strings::window_id] = window_info[strings::window_id].asInt();
+ msg_params[strings::window_type] = window_info[strings::window_type].asInt();
+ msg_params[strings::window_name] =
+ window_info[strings::window_name].asString();
+
+ if (window_info.keyExists(strings::associated_service_type)) {
+ msg_params[strings::associated_service_type] =
+ window_info[strings::associated_service_type].asString();
+ }
+ if (window_info.keyExists(strings::duplicate_updates_from_window_id)) {
+ msg_params[strings::duplicate_updates_from_window_id] =
+ window_info[strings::duplicate_updates_from_window_id].asInt();
+ }
+
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ (*ui_request)[strings::msg_params] = msg_params;
+
+ return ui_request;
+}
+
+smart_objects::SmartObjectList MessageHelper::CreateUICreateWindowRequestsToHMI(
+ application_manager::ApplicationSharedPtr application,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& windows_info) {
+ smart_objects::SmartObjectList requests;
+ DCHECK_OR_RETURN(application, requests);
+
+ for (size_t i = 0; i < windows_info.length(); ++i) {
+ const auto& info = windows_info[i];
+
+ const auto ui_request =
+ CreateUICreateWindowRequestToHMI(application, app_mngr, info);
+
+ DCHECK_OR_RETURN(ui_request, requests);
+
+ requests.push_back(ui_request);
+ }
+
+ return requests;
+}
+
bool MessageHelper::CreateDeviceInfo(
connection_handler::DeviceHandle device_handle,
const protocol_handler::SessionObserver& session_observer,
@@ -1599,8 +1704,8 @@ bool MessageHelper::CreateHMIApplicationStruct(
const smart_objects::SmartObject* app_types = app->app_types();
const smart_objects::SmartObject* ngn_media_screen_name =
app->ngn_media_screen_name();
- const smart_objects::SmartObject* day_color_scheme = app->day_color_scheme();
- const smart_objects::SmartObject* night_color_scheme =
+ const smart_objects::SmartObject day_color_scheme = app->day_color_scheme();
+ const smart_objects::SmartObject night_color_scheme =
app->night_color_scheme();
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -1638,7 +1743,8 @@ bool MessageHelper::CreateHMIApplicationStruct(
const policy::RequestType::State app_request_types_state =
policy_handler.GetAppRequestTypeState(policy_app_id);
if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
- const auto request_types = policy_handler.GetAppRequestTypes(policy_app_id);
+ const auto request_types =
+ policy_handler.GetAppRequestTypes(app->device(), policy_app_id);
message[strings::request_type] =
SmartObject(smart_objects::SmartType_Array);
smart_objects::SmartObject& request_types_array =
@@ -1675,12 +1781,12 @@ bool MessageHelper::CreateHMIApplicationStruct(
SmartObject(smart_objects::SmartType_Array);
}
- if (day_color_scheme) {
- message[strings::day_color_scheme] = *day_color_scheme;
+ if (day_color_scheme.getType() == smart_objects::SmartType_Map) {
+ message[strings::day_color_scheme] = day_color_scheme;
}
- if (night_color_scheme) {
- message[strings::night_color_scheme] = *night_color_scheme;
+ if (night_color_scheme.getType() == smart_objects::SmartType_Map) {
+ message[strings::night_color_scheme] = night_color_scheme;
}
message[strings::device_info] =
@@ -1789,12 +1895,16 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+ if (hmi_apis::Common_HMILevel::NONE == level) {
+ LOG4CXX_WARN(logger_,
+ "BC.ActivateApp cannot be used to deactivate an application");
+ return NULL;
+ }
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
@@ -1831,6 +1941,23 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
return message;
}
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+
+ const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_CloseApplication;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::msg_params][strings::app_id] = app->app_id();
+
+ return message;
+}
+
void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id);
@@ -2979,17 +3106,32 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
void MessageHelper::SubscribeApplicationToSoftButton(
smart_objects::SmartObject& message_params,
ApplicationSharedPtr app,
- int32_t function_id) {
+ int32_t function_id,
+ const WindowID window_id) {
SoftButtonID softbuttons_id;
smart_objects::SmartObject& soft_buttons =
message_params[strings::soft_buttons];
unsigned int length = soft_buttons.length();
for (unsigned int i = 0; i < length; ++i) {
- softbuttons_id.insert(soft_buttons[i][strings::soft_button_id].asUInt());
+ const auto button_id = std::make_pair(
+ soft_buttons[i][strings::soft_button_id].asUInt(), window_id);
+ softbuttons_id.insert(button_id);
}
app->SubscribeToSoftButtons(function_id, softbuttons_id);
}
+void MessageHelper::SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SubscribeApplicationToSoftButton(
+ message_params,
+ app,
+ function_id,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
+}
+
bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
#ifdef DEBUG
Json::Value tmp;
@@ -3000,4 +3142,14 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
return true;
}
+WindowID MessageHelper::ExtractWindowIdFromSmartObject(
+ const smart_objects::SmartObject& s_map) {
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ if (s_map.keyExists(strings::window_id)) {
+ return s_map[strings::window_id].asInt();
+ }
+ }
+ return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
index ad313c638f..2248711037 100644
--- a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
+++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
@@ -29,10 +29,23 @@ bool IsLibraryFile(const std::string& file_path) {
return true;
}
-RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
+template <typename T>
+T GetFuncFromLib(void* dl_handle, const std::string& function_name) {
+ T exported_func =
+ reinterpret_cast<T>(dlsym(dl_handle, function_name.c_str()));
+ char* error_string = dlerror();
+ if (nullptr != error_string) {
+ LOG4CXX_ERROR(logger_, "Failed to export symbols : " << error_string);
+ return nullptr;
+ }
+ return exported_func;
+}
+
+RPCPluginManagerImpl::RPCPluginPtr RPCPluginManagerImpl::LoadPlugin(
+ const std::string& full_plugin_path) const {
if (!IsLibraryFile(full_plugin_path)) {
LOG4CXX_DEBUG(logger_, "Skip loading " << full_plugin_path);
- return RPCPluginPtr();
+ return RPCPluginPtr(nullptr, [](RPCPlugin*) {});
}
void* plugin_dll = dlopen(full_plugin_path.c_str(), RTLD_LAZY);
@@ -40,21 +53,33 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
LOG4CXX_ERROR(
logger_,
"Failed to open dll " << full_plugin_path << " : " << dlerror());
- return RPCPluginPtr();
+ return RPCPluginPtr(nullptr, [](RPCPlugin*) {});
}
typedef RPCPlugin* (*Create)();
- Create create_plugin = reinterpret_cast<Create>(dlsym(plugin_dll, "Create"));
- char* error_string = dlerror();
- if (nullptr != error_string) {
- LOG4CXX_ERROR(logger_,
- "Failed to export dll's " << full_plugin_path
- << " symbols : " << error_string);
+ Create create_plugin = GetFuncFromLib<Create>(plugin_dll, "Create");
+ if (!create_plugin) {
+ LOG4CXX_ERROR(logger_, "No Create function in " << full_plugin_path);
+ dlclose(plugin_dll);
+ return RPCPluginPtr(nullptr, [](RPCPlugin*) {});
+ }
+
+ typedef void (*Delete)(RPCPlugin*);
+ Delete delete_plugin = GetFuncFromLib<Delete>(plugin_dll, "Delete");
+ if (!delete_plugin) {
+ LOG4CXX_ERROR(logger_, "No Delete function in " << full_plugin_path);
dlclose(plugin_dll);
- return RPCPluginPtr();
+ return RPCPluginPtr(nullptr, [](RPCPlugin*) {});
}
+
+ auto plugin_destroyer = [delete_plugin, plugin_dll](RPCPlugin* plugin) {
+ LOG4CXX_DEBUG(logger_, "Delete plugin " << plugin->PluginName());
+ delete_plugin(plugin);
+ dlclose(plugin_dll);
+ return RPCPluginPtr(nullptr, [](RPCPlugin*) {});
+ };
RPCPlugin* plugin = create_plugin();
- return RPCPluginPtr(plugin);
+ return RPCPluginPtr(plugin, plugin_destroyer);
}
uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) {
@@ -82,7 +107,8 @@ uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) {
return loaded_plugins_.size();
}
-std::vector<RPCPluginPtr>& RPCPluginManagerImpl::GetPlugins() {
+std::vector<RPCPluginManagerImpl::RPCPluginPtr>&
+RPCPluginManagerImpl::GetPlugins() {
return loaded_plugins_;
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index d94a364c8c..ab07151b69 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -126,7 +126,10 @@ struct HMILevelPredicate
: level_(level) {}
bool operator()(const ApplicationSharedPtr app) const {
- return level_ == app->hmi_level() ? true : false;
+ return level_ == app->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW)
+ ? true
+ : false;
}
private:
@@ -165,6 +168,7 @@ struct DeactivateApplication {
if (device_id_ == app->device()) {
state_ctrl_.SetRegularState(
app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
mobile_apis::VideoStreamingState::NOT_STREAMABLE,
@@ -177,41 +181,6 @@ struct DeactivateApplication {
StateController& state_ctrl_;
};
-struct SDLAllowedNotification {
- SDLAllowedNotification(const connection_handler::DeviceHandle& device_id,
- PolicyManager* policy_manager,
- StateController& state_controller)
- : device_id_(device_id)
- , policy_manager_(policy_manager)
- , state_controller_(state_controller) {}
-
- void operator()(const ApplicationSharedPtr& app) {
- DCHECK_OR_RETURN_VOID(policy_manager_);
- if (device_id_ == app->device()) {
- std::string hmi_level = "NONE";
- mobile_apis::HMILevel::eType default_mobile_hmi;
- policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
- if ("BACKGROUND" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
- } else if ("FULL" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
- } else if ("LIMITED" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
- } else if ("NONE" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
- } else {
- return;
- }
- state_controller_.SetRegularState(app, default_mobile_hmi, true);
- }
- }
-
- private:
- connection_handler::DeviceHandle device_id_;
- PolicyManager* policy_manager_;
- StateController& state_controller_;
-};
-
/**
* @brief Gets from system list of currently registered applications and
* create collection of links device-to-application
@@ -505,21 +474,25 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
continue;
}
- policy_manager_->ReactOnUserDevConsentForApp(policy_app_id, is_allowed);
+ policy_manager_->ReactOnUserDevConsentForApp(
+ device_handle, policy_app_id, is_allowed);
- policy_manager_->SendNotificationOnPermissionsUpdated(policy_app_id);
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id,
+ policy_app_id);
}
}
}
void PolicyHandler::SendOnAppPermissionsChanged(
- const AppPermissions& permissions, const std::string& policy_app_id) const {
+ const AppPermissions& permissions,
+ const std::string& device_id,
+ const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
logger_,
"PolicyHandler::SendOnAppPermissionsChanged for " << policy_app_id);
ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(policy_app_id);
+ application_manager_.application(device_id, policy_app_id);
if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id);
return;
@@ -553,10 +526,11 @@ struct SmartObjectToInt {
};
StatusNotifier PolicyHandler::AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>());
- return policy_manager_->AddApplication(application_id, hmi_types);
+ return policy_manager_->AddApplication(device_id, application_id, hmi_types);
}
void PolicyHandler::AddDevice(const std::string& device_id,
@@ -608,13 +582,9 @@ void PolicyHandler::OnAppPermissionConsentInternal(
#endif
}
} else if (!app_to_device_link_.empty()) {
- sync_primitives::AutoLock lock(app_to_device_link_lock_);
- std::map<std::string, std::string>::const_iterator it =
- app_to_device_link_.begin();
- for (; app_to_device_link_.end() != it; ++it) {
- ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(it->second);
-
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+ for (const auto& app : accessor) {
// If list of apps sent to HMI for user consents is not the same as
// current,
// permissions should be set only for coincident to registered apps
@@ -625,19 +595,26 @@ void PolicyHandler::OnAppPermissionConsentInternal(
continue;
}
+ if (!app->IsRegistered()) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << app->policy_app_id()
+ << " is not marked as registered.");
+ continue;
+ }
+
DeviceParams device_params = GetDeviceParams(
app->device(),
application_manager_.connection_handler().get_session_observer());
- if (device_params.device_mac_address != it->first) {
+ if (device_params.device_mac_address != app->mac_address()) {
LOG4CXX_WARN(logger_,
"Device_id of application is changed."
"Permissions setting skipped.");
continue;
}
- out_permissions.policy_app_id = it->second;
- out_permissions.device_id = it->first;
+ out_permissions.policy_app_id = app->policy_app_id();
+ out_permissions.device_id = app->mac_address();
#ifdef EXTERNAL_PROPRIETARY_MODE
policy_manager_->SetUserConsentForApp(out_permissions, mode);
#else
@@ -861,6 +838,15 @@ void PolicyHandler::OnDeviceSwitching(const std::string& device_id_from,
policy_manager_->OnDeviceSwitching(device_id_from, device_id_to);
}
+void PolicyHandler::OnLockScreenDismissalStateChanged() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto accessor = application_manager_.applications();
+ const auto apps = accessor.GetData();
+ for (auto& app : apps) {
+ application_manager_.SendDriverDistractionState(app);
+ }
+}
+
void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
@@ -878,10 +864,15 @@ void PolicyHandler::OnUpdateStatusChanged(const std::string& status) {
}
std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) {
LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(policy_app_id);
+ DeviceParams device_params = GetDeviceParams(
+ device_handle,
+ application_manager_.connection_handler().get_session_observer());
+
+ ApplicationSharedPtr app = application_manager_.application(
+ device_params.device_mac_address, policy_app_id);
if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
@@ -889,11 +880,8 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
<< policy_app_id
<< "' "
"not found within registered applications.");
- return "";
+ return std::string();
}
- DeviceParams device_params = GetDeviceParams(
- app->device(),
- application_manager_.connection_handler().get_session_observer());
return device_params.device_mac_address;
}
@@ -951,14 +939,14 @@ void PolicyHandler::OnVehicleDataUpdated(
}
void PolicyHandler::OnPendingPermissionChange(
- const std::string& policy_app_id) {
+ const std::string& device_id, const std::string& policy_app_id) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
logger_,
"PolicyHandler::OnPendingPermissionChange for " << policy_app_id);
POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(policy_app_id);
+ application_manager_.application(device_id, policy_app_id);
if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"No app found for " << policy_app_id << " policy app id.");
@@ -966,7 +954,7 @@ void PolicyHandler::OnPendingPermissionChange(
}
AppPermissions permissions =
- policy_manager_->GetAppPermissionsChanges(policy_app_id);
+ policy_manager_->GetAppPermissionsChanges(device_id, policy_app_id);
const uint32_t app_id = app->app_id();
@@ -975,6 +963,7 @@ void PolicyHandler::OnPendingPermissionChange(
app_id, permissions, application_manager_);
application_manager_.state_controller().SetRegularState(
app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
mobile_apis::VideoStreamingState::NOT_STREAMABLE,
@@ -983,7 +972,8 @@ void PolicyHandler::OnPendingPermissionChange(
return;
}
- mobile_apis::HMILevel::eType app_hmi_level = app->hmi_level();
+ mobile_apis::HMILevel::eType app_hmi_level =
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
switch (app_hmi_level) {
case mobile_apis::HMILevel::eType::HMI_FULL:
@@ -1125,7 +1115,8 @@ struct SDLAlowedNotification {
if (app->device() == device_id_) {
std::string hmi_level;
mobile_apis::HMILevel::eType default_mobile_hmi;
- policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
+ policy_manager_->GetDefaultHmi(
+ app->mac_address(), app->policy_app_id(), &hmi_level);
if ("BACKGROUND" == hmi_level) {
default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
} else if ("FULL" == hmi_level) {
@@ -1137,7 +1128,11 @@ struct SDLAlowedNotification {
} else {
return;
}
- state_controller_.SetRegularState(app, default_mobile_hmi, true);
+ state_controller_.SetRegularState(
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ default_mobile_hmi,
+ true);
}
}
@@ -1246,7 +1241,12 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
: VideoStreamingState::NOT_STREAMABLE;
application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, audio_state, video_state, true);
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::HMILevel::HMI_FULL,
+ audio_state,
+ video_state,
+ true);
last_activated_app_id_ = 0;
} else {
DeactivateApplication deactivate_notification(
@@ -1282,7 +1282,8 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key,
permissions.isSDLAllowed = true;
}
} else {
- permissions = policy_manager_->GetAppPermissionsChanges(policy_app_id);
+ permissions = policy_manager_->GetAppPermissionsChanges(app->mac_address(),
+ policy_app_id);
#ifdef EXTERNAL_PROPRIETARY_MODE
UsageStatistics& usage = app->usage_report();
@@ -1353,24 +1354,26 @@ void PolicyHandler::PTExchangeAtUserRequest(uint32_t correlation_id) {
update_status, correlation_id, application_manager_);
}
-void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
+void PolicyHandler::OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions,
const HMILevel& default_hmi) {
LOG4CXX_AUTO_TRACE(logger_);
- OnPermissionsUpdated(policy_app_id, permissions);
+ OnPermissionsUpdated(device_id, policy_app_id, permissions);
ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(policy_app_id);
+ application_manager_.application(device_id, policy_app_id);
if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
- "Connection_key not found for application_id:" << policy_app_id);
+ "Connection_key not found for application_id: " << policy_app_id);
return;
}
// The application currently not running (i.e. in NONE) should change HMI
// level to default
- mobile_apis::HMILevel::eType current_hmi_level = app->hmi_level();
+ mobile_apis::HMILevel::eType current_hmi_level =
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
mobile_apis::HMILevel::eType hmi_level =
MessageHelper::StringToHMILevel(default_hmi);
@@ -1393,10 +1396,16 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
if (hmi_level == mobile_apis::HMILevel::HMI_FULL) {
application_manager_.state_controller().SetRegularState(
- app, hmi_level, true);
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ hmi_level,
+ true);
} else {
application_manager_.state_controller().SetRegularState(
- app, hmi_level, false);
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ hmi_level,
+ false);
}
break;
}
@@ -1409,15 +1418,16 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
}
}
-void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
+void PolicyHandler::OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(policy_app_id);
+ application_manager_.application(device_id, policy_app_id);
if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
- "Connection_key not found for application_id:" << policy_app_id);
+ "Connection_key not found for application_id: " << policy_app_id);
return;
}
@@ -1425,7 +1435,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
app->app_id(), permissions, application_manager_);
LOG4CXX_DEBUG(logger_,
- "Notification sent for application_id:"
+ "Notification sent for application_id: "
<< policy_app_id << " and connection_key "
<< app->app_id());
}
@@ -1508,12 +1518,13 @@ bool PolicyHandler::GetPriority(const std::string& policy_app_id,
void PolicyHandler::CheckPermissions(
const application_manager::ApplicationSharedPtr app,
+ const application_manager::WindowID window_id,
const PTString& rpc,
const RPCParams& rpc_params,
CheckPermissionResult& result) {
POLICY_LIB_CHECK_VOID();
const std::string hmi_level =
- MessageHelper::StringifiedHMILevel(app->hmi_level());
+ MessageHelper::StringifiedHMILevel(app->hmi_level(window_id));
if (hmi_level.empty()) {
LOG4CXX_WARN(logger_,
"HMI level for " << app->policy_app_id() << " is invalid, rpc "
@@ -1527,13 +1538,8 @@ void PolicyHandler::CheckPermissions(
"Checking permissions for " << app->policy_app_id() << " in "
<< hmi_level << " on device "
<< device_id << " rpc " << rpc);
-#ifdef EXTERNAL_PROPRIETARY_MODE
- policy_manager_->CheckPermissions(
- app->policy_app_id(), hmi_level, rpc, rpc_params, result);
-#else // EXTERNAL_PROPRIETARY_MODE
policy_manager_->CheckPermissions(
device_id, app->policy_app_id(), hmi_level, rpc, rpc_params, result);
-#endif // EXTERNAL_PROPRIETARY_MODE
}
uint32_t PolicyHandler::GetNotificationsNumber(
@@ -1548,10 +1554,11 @@ DeviceConsent PolicyHandler::GetUserConsentForDevice(
return policy_manager_->GetUserConsentForDevice(device_id);
}
-bool PolicyHandler::GetDefaultHmi(const std::string& policy_app_id,
+bool PolicyHandler::GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const {
POLICY_LIB_CHECK(false);
- return policy_manager_->GetDefaultHmi(policy_app_id, default_hmi);
+ return policy_manager_->GetDefaultHmi(device_id, policy_app_id, default_hmi);
}
bool PolicyHandler::GetInitialAppData(const std::string& application_id,
@@ -1609,6 +1616,19 @@ void PolicyHandler::OnSystemReady() {
policy_manager_->OnSystemReady();
}
+const boost::optional<bool> PolicyHandler::LockScreenDismissalEnabledState()
+ const {
+ POLICY_LIB_CHECK(boost::optional<bool>());
+ return policy_manager_->LockScreenDismissalEnabledState();
+}
+
+const boost::optional<std::string>
+PolicyHandler::LockScreenDismissalWarningMessage(
+ const std::string& language) const {
+ POLICY_LIB_CHECK(boost::optional<std::string>());
+ return policy_manager_->LockScreenDismissalWarningMessage(language);
+}
+
void PolicyHandler::PTUpdatedAt(Counters counter, int value) {
POLICY_LIB_CHECK_VOID();
policy_manager_->PTUpdatedAt(counter, value);
@@ -1675,7 +1695,7 @@ custom_str::CustomString PolicyHandler::GetAppName(
if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
- "Connection_key not found for application_id:" << policy_app_id);
+ "Connection_key not found for application_id: " << policy_app_id);
return custom_str::CustomString("");
}
return app->name();
@@ -2091,9 +2111,10 @@ void PolicyHandler::OnAppsSearchCompleted(const bool trigger_ptu) {
policy_manager_->OnAppsSearchCompleted(trigger_ptu);
}
-void PolicyHandler::OnAppRegisteredOnMobile(const std::string& application_id) {
+void PolicyHandler::OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) {
POLICY_LIB_CHECK_VOID();
- policy_manager_->OnAppRegisteredOnMobile(application_id);
+ policy_manager_->OnAppRegisteredOnMobile(device_id, application_id);
}
RequestType::State PolicyHandler::GetAppRequestTypeState(
@@ -2109,12 +2130,13 @@ RequestSubType::State PolicyHandler::GetAppRequestSubTypeState(
}
bool PolicyHandler::IsRequestTypeAllowed(
+ const transport_manager::DeviceHandle& device_id,
const std::string& policy_app_id,
mobile_apis::RequestType::eType type) const {
POLICY_LIB_CHECK(false);
using namespace mobile_apis;
- std::string stringified_type = RequestTypeToString(type);
+ const std::string stringified_type = RequestTypeToString(type);
if (stringified_type.empty()) {
LOG4CXX_ERROR(logger_, "Unknown request type.");
return false;
@@ -2137,7 +2159,11 @@ bool PolicyHandler::IsRequestTypeAllowed(
case RequestType::State::AVAILABLE: {
// If any of request types is available for current application - get them
const auto request_types =
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->GetAppRequestTypes(device_id, policy_app_id);
+#else
policy_manager_->GetAppRequestTypes(policy_app_id);
+#endif
return helpers::in_range(request_types, stringified_type);
}
default:
@@ -2183,9 +2209,14 @@ bool PolicyHandler::IsRequestSubTypeAllowed(
}
const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const {
POLICY_LIB_CHECK(std::vector<std::string>());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ return policy_manager_->GetAppRequestTypes(device_handle, policy_app_id);
+#else
return policy_manager_->GetAppRequestTypes(policy_app_id);
+#endif
}
const std::vector<std::string> PolicyHandler::GetAppRequestSubTypes(
@@ -2238,15 +2269,31 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx,
const ApplicationSharedPtr app =
application_manager_.application_by_policy_id(app_data.app_id);
- const bool is_registered = (app && (app->IsRegistered()));
- const bool is_default = (app_data.app_id == policy::kDefaultId);
- const bool is_empty_urls = app_urls.empty();
+ if (policy::kDefaultId == app_data.app_id) {
+ return true;
+ }
+
+ if (app_urls.empty()) {
+ return false;
+ }
+
+ const auto devices_ids = GetDevicesIds(app_data.app_id);
+ LOG4CXX_TRACE(logger_,
+ "Count devices: " << devices_ids.size()
+ << " for app_id: " << app_data.app_id);
+ for (const auto& device_id : devices_ids) {
+ ApplicationSharedPtr app =
+ application_manager_.application(device_id, app_data.app_id);
+ if (app && (app->IsRegistered())) {
+ return true;
+ }
+ }
- return ((is_registered && !is_empty_urls) || is_default);
+ return false;
}
std::vector<std::string> PolicyHandler::GetDevicesIds(
- const std::string& policy_app_id) {
+ const std::string& policy_app_id) const {
return application_manager_.devices(policy_app_id);
}
@@ -2254,7 +2301,8 @@ void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app,
mobile_apis::HMILevel::eType level) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ if (app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW) ==
+ mobile_apis::HMILevel::HMI_NONE) {
// If default is FULL, send request to HMI. Notification to mobile will be
// sent on response receiving.
if (mobile_apis::HMILevel::HMI_FULL == level) {
@@ -2266,7 +2314,10 @@ void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app,
// Set application hmi level
application_manager_.ChangeAppsHMILevel(app->app_id(), level);
// If hmi Level is full, it will be seted after ActivateApp response
- MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+ MessageHelper::SendHMIStatusNotification(
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ application_manager_);
}
}
}
@@ -2309,7 +2360,10 @@ void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id,
<< app->app_id() << " to default hmi level " << level);
// Set application hmi level
application_manager_.ChangeAppsHMILevel(app->app_id(), level);
- MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+ MessageHelper::SendHMIStatusNotification(
+ app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ application_manager_);
}
bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id,
@@ -2320,6 +2374,7 @@ bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id,
}
void PolicyHandler::SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& application_id,
const smart_objects::SmartObject* app_types) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2332,7 +2387,7 @@ void PolicyHandler::SetDefaultHmiTypes(
std::back_inserter(hmi_types),
SmartObjectToInt());
}
- policy_manager_->SetDefaultHmiTypes(application_id, hmi_types);
+ policy_manager_->SetDefaultHmiTypes(device_handle, application_id, hmi_types);
}
bool PolicyHandler::CheckHMIType(const std::string& application_id,
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index fff1aefed3..957075150f 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -30,6 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/resumption/resume_ctrl_impl.h"
+#include "application_manager/display_capabilities_builder.h"
#include <algorithm>
#include <fstream>
@@ -159,7 +160,13 @@ void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
}
void ResumeCtrlImpl::on_event(const event_engine::Event& event) {
- LOG4CXX_DEBUG(logger_, "Event received" << event.id());
+ LOG4CXX_DEBUG(logger_, "Event received: " << event.id());
+
+ if (hmi_apis::FunctionID::UI_CreateWindow == event.id()) {
+ LOG4CXX_INFO(logger_, "Received UI_CreateWindow event");
+ const auto& response_message = event.smart_object();
+ RestoreWidgetsHMIState(response_message);
+ }
}
bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
@@ -208,7 +215,12 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
<< saved_hmi_level);
}
- return SetAppHMIState(application, saved_hmi_level, true);
+ const bool app_hmi_state_is_set =
+ SetAppHMIState(application, saved_hmi_level, true);
+ if (app_hmi_state_is_set &&
+ application->is_app_data_resumption_allowed()) {
+ RestoreAppWidgets(application, saved_app);
+ }
} else {
result = false;
LOG4CXX_ERROR(logger_, "saved app data corrupted");
@@ -219,6 +231,89 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
return result;
}
+void ResumeCtrlImpl::RestoreWidgetsHMIState(
+ const smart_objects::SmartObject& response_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto correlation_id =
+ response_message[strings::params][strings::correlation_id].asInt();
+ const auto& request = requests_msg_.find(correlation_id);
+ if (requests_msg_.end() == request) {
+ LOG4CXX_ERROR(logger_,
+ "Request UI_CreateWindow for correlation id: "
+ << correlation_id << " not found");
+ return;
+ }
+
+ const auto& msg_params = (*request->second)[strings::msg_params];
+ const auto hmi_app_id = msg_params[strings::app_id].asInt();
+ auto application = application_manager_.application_by_hmi_app(hmi_app_id);
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "Application is not registered by hmi id: " << hmi_app_id);
+ requests_msg_.erase(request);
+ return;
+ }
+ const WindowID window_id = msg_params[strings::window_id].asInt();
+
+ const auto result_code = static_cast<hmi_apis::Common_Result::eType>(
+ response_message[strings::params][hmi_response::code].asInt());
+ if (hmi_apis::Common_Result::SUCCESS != result_code) {
+ LOG4CXX_ERROR(logger_,
+ "UI_CreateWindow for correlation id: "
+ << correlation_id
+ << " failed with code: " << result_code);
+ requests_msg_.erase(request);
+ auto& builder = application->display_capabilities_builder();
+ builder.StopWaitingForWindow(window_id);
+ return;
+ }
+
+ smart_objects::SmartObject window_info(smart_objects::SmartType_Map);
+ auto fill_optional_param = [&window_info,
+ &msg_params](const std::string& key) {
+ if (msg_params.keyExists(key)) {
+ window_info[key] = msg_params[key].asString();
+ }
+ };
+ fill_optional_param(strings::associated_service_type);
+ fill_optional_param(strings::duplicate_updates_from_window_id);
+
+ const auto window_name = msg_params[strings::window_name].asString();
+ window_info[strings::window_name] = window_name;
+ application->SetWindowInfo(window_id, window_info);
+
+ const auto window_type = static_cast<mobile_apis::WindowType::eType>(
+ msg_params[strings::window_type].asInt());
+ // State should be initialized with INVALID_ENUM value to let state controller
+ // trigger OnHmiStatus notifiation sending
+ auto initial_state = application_manager_.CreateRegularState(
+ application,
+ window_type,
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
+ mobile_api::SystemContext::INVALID_ENUM);
+ application->SetInitialState(window_id, window_name, initial_state);
+
+ // Default HMI level for all windows except the main one is always NONE
+ application_manager_.state_controller().OnAppWindowAdded(
+ application, window_id, window_type, mobile_apis::HMILevel::HMI_NONE);
+
+ requests_msg_.erase(request);
+}
+
+void ResumeCtrlImpl::ProcessSystemCapabilityUpdated(
+ Application& app, const smart_objects::SmartObject& display_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto notification = MessageHelper::CreateDisplayCapabilityUpdateToMobile(
+ display_capabilities, app);
+
+ application_manager_.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::SOURCE_SDL);
+ app.set_is_resuming(false);
+}
+
bool ResumeCtrlImpl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(application, false);
@@ -252,7 +347,9 @@ void ResumeCtrlImpl::ApplicationResumptiOnTimer() {
LOG4CXX_ERROR(logger_, "Invalid app_id = " << *it);
continue;
}
- StartAppHmiStateResumption(app);
+ if (!StartAppHmiStateResumption(app)) {
+ app->set_is_resuming(false);
+ }
}
is_resumption_active_ = false;
waiting_for_timer_.clear();
@@ -292,14 +389,36 @@ bool ResumeCtrlImpl::SetAppHMIState(
return false;
}
application->set_is_resuming(true);
- application_manager_.state_controller().SetRegularState(application,
- hmi_level);
+ application_manager_.state_controller().SetRegularState(
+ application, mobile_apis::PredefinedWindows::DEFAULT_WINDOW, hmi_level);
LOG4CXX_INFO(logger_,
"Application with policy id " << application->policy_app_id()
<< " got HMI level " << hmi_level);
return true;
}
+void ResumeCtrlImpl::RestoreAppWidgets(
+ application_manager::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app) {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(application);
+ if (!saved_app.keyExists(strings::windows_info)) {
+ LOG4CXX_ERROR(logger_, "windows_info section does not exist");
+ return;
+ }
+ const auto& windows_info = saved_app[strings::windows_info];
+ auto request_list = MessageHelper::CreateUICreateWindowRequestsToHMI(
+ application, application_manager_, windows_info);
+
+ requests_msg_.clear();
+ for (auto& request : request_list) {
+ requests_msg_.insert(std::make_pair(
+ (*request)[strings::params][strings::correlation_id].asInt(), request));
+ }
+ ProcessHMIRequests(request_list);
+}
+
bool ResumeCtrlImpl::IsHMIApplicationIdExist(uint32_t hmi_app_id) {
LOG4CXX_DEBUG(logger_, "hmi_app_id :" << hmi_app_id);
return resumption_storage_->IsHMIApplicationIdExist(hmi_app_id);
@@ -473,18 +592,18 @@ void ResumeCtrlImpl::RetryResumption(const uint32_t app_id) {
AddToResumptionTimerQueue(app_id);
}
-void ResumeCtrlImpl::StartAppHmiStateResumption(
+bool ResumeCtrlImpl::StartAppHmiStateResumption(
ApplicationSharedPtr application) {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(application);
+ DCHECK_OR_RETURN(application, false);
smart_objects::SmartObject saved_app;
const std::string& device_mac = application->mac_address();
const bool result = resumption_storage_->GetSavedApplication(
application->policy_app_id(), device_mac, saved_app);
if (!result) {
LOG4CXX_ERROR(logger_, "Application was not saved");
- return;
+ return false;
}
const bool is_hmi_level_applicable_to_resume =
@@ -492,7 +611,7 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
if (!is_hmi_level_applicable_to_resume) {
LOG4CXX_DEBUG(logger_, "No applicable HMI level found for resuming");
- return;
+ return false;
}
const bool is_resume_allowed_by_low_voltage =
@@ -507,18 +626,20 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
if (restore_hmi_level_allowed) {
LOG4CXX_INFO(logger_,
"Resume application " << application->policy_app_id());
- RestoreAppHMIState(application);
+ bool result = RestoreAppHMIState(application);
if (mobile_apis::HMILevel::eType::INVALID_ENUM !=
application->deferred_resumption_hmi_level()) {
// the application has not been fully resumed
- return;
+ return false;
}
RemoveApplicationFromSaved(application);
+ return result;
} else {
LOG4CXX_INFO(
logger_,
"Do not need to resume application " << application->policy_app_id());
}
+ return true;
}
void ResumeCtrlImpl::ResetLaunchTime() {
@@ -561,9 +682,14 @@ bool ResumeCtrlImpl::CheckApplicationHash(ApplicationSharedPtr application,
"app_id : " << application->app_id() << " hash : " << hash);
smart_objects::SmartObject saved_app;
const std::string& device_mac = application->mac_address();
- bool result = resumption_storage_->GetSavedApplication(
+ const bool get_app_result = resumption_storage_->GetSavedApplication(
application->policy_app_id(), device_mac, saved_app);
- return result ? saved_app[strings::hash_id].asString() == hash : false;
+ const bool check_result =
+ get_app_result ? saved_app[strings::hash_id].asString() == hash : false;
+ if (check_result) {
+ application->set_app_data_resumption_allowance(true);
+ }
+ return check_result;
}
void ResumeCtrlImpl::SaveDataOnTimer() {
@@ -628,6 +754,28 @@ bool ResumeCtrlImpl::RestoreApplicationData(ApplicationSharedPtr application) {
return result;
}
+void ResumeCtrlImpl::StartWaitingForDisplayCapabilitiesUpdate(
+ app_mngr::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject saved_app(smart_objects::SmartType_Map);
+ resumption_storage_->GetSavedApplication(
+ application->policy_app_id(), application->mac_address(), saved_app);
+ auto resume_callback =
+ [this](Application& app,
+ const smart_objects::SmartObject& display_capabilities) -> void {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessSystemCapabilityUpdated(app, display_capabilities);
+ };
+ auto& builder = application->display_capabilities_builder();
+
+ smart_objects::SmartObject windows_info(smart_objects::SmartType_Null);
+ if (saved_app.keyExists(strings::windows_info)) {
+ windows_info = saved_app[strings::windows_info];
+ }
+ builder.InitBuilder(resume_callback, windows_info);
+ application->set_is_resuming(true);
+}
+
void ResumeCtrlImpl::AddFiles(ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1006,7 +1154,8 @@ bool ResumeCtrlImpl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
(*request)[strings::correlation_id].asInt();
subscribe_on_event(function_id, hmi_correlation_id);
}
- if (!application_manager_.GetRPCService().ManageHMICommand(request)) {
+ if (!application_manager_.GetRPCService().ManageHMICommand(
+ request, commands::Command::SOURCE_SDL_TO_HMI)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
return false;
}
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index b4d39eccc1..9046fe35ad 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -198,6 +198,52 @@ smart_objects::SmartObject ResumptionData::GetApplicationFiles(
return files;
}
+smart_objects::SmartObject ResumptionData::GetApplicationWidgetsInfo(
+ app_mngr::ApplicationConstSharedPtr application) const {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject windows_info =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ DCHECK_OR_RETURN(application, windows_info);
+ const auto window_ids = application->GetWindowIds();
+ const auto& window_optional_params_map =
+ application->window_optional_params_map().GetData();
+ for (const auto& window_id : window_ids) {
+ const HmiStatePtr hmi_state = application->CurrentHmiState(window_id);
+ if (mobile_apis::WindowType::WIDGET != hmi_state->window_type()) {
+ continue;
+ }
+ auto info = CreateWindowInfoSO(
+ window_id, hmi_state->window_type(), window_optional_params_map);
+
+ windows_info[windows_info.length()] = info;
+ }
+ return windows_info;
+}
+
+smart_objects::SmartObject ResumptionData::CreateWindowInfoSO(
+ const app_mngr::WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const app_mngr::WindowParamsMap& window_optional_params_map) const {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto window_info = smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ window_info[strings::window_id] = window_id;
+ window_info[strings::window_type] = window_type;
+
+ const auto& it_info = window_optional_params_map.find(window_id);
+ if (window_optional_params_map.end() != it_info) {
+ const auto keys = it_info->second->enumerate();
+
+ for (const auto& key : keys) {
+ window_info[key] = (*it_info->second)[key];
+ }
+ }
+
+ return window_info;
+}
+
smart_objects::SmartObject ResumptionData::PointerToSmartObj(
const smart_objects::SmartObject* ptr) const {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 02b7098414..9188a47bf9 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -2731,7 +2731,8 @@ bool ResumptionDataDB::UpdateApplicationData(
utils::dbms::SQLQuery query(db());
const int64_t time_stamp = static_cast<int64_t>(time(NULL));
- const mobile_apis::HMILevel::eType hmi_level = application->hmi_level();
+ const mobile_apis::HMILevel::eType hmi_level =
+ application->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
if (!query.Prepare(kUpdateApplicationData)) {
LOG4CXX_WARN(logger_,
@@ -2843,7 +2844,8 @@ ApplicationParams::ApplicationParams(app_mngr::ApplicationSharedPtr application)
m_grammar_id = application->get_grammar_id();
m_connection_key = application->app_id();
m_hmi_app_id = application->hmi_app_id();
- m_hmi_level = application->hmi_level();
+ m_hmi_level =
+ application->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
m_is_media_application = application->IsAudioApplication();
app_ptr = application;
}
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index 591166c687..5da47d31ce 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -64,7 +64,8 @@ void ResumptionDataJson::SaveApplication(
const uint32_t grammar_id = application->get_grammar_id();
const uint32_t time_stamp = (uint32_t)time(NULL);
const std::string device_mac = application->mac_address();
- const mobile_apis::HMILevel::eType hmi_level = application->hmi_level();
+ const mobile_apis::HMILevel::eType hmi_level =
+ application->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
const bool is_subscribed_for_way_points =
application_manager_.IsAppSubscribedForWayPoints(application);
@@ -99,6 +100,9 @@ void ResumptionDataJson::SaveApplication(
formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationFiles(application), tmp);
json_app[strings::application_files] = tmp;
+ formatters::CFormatterJsonBase::objToJsonValue(
+ GetApplicationWidgetsInfo(application), tmp);
+ json_app[strings::windows_info] = tmp;
json_app[strings::time_stamp] = time_stamp;
json_app[strings::subscribed_for_way_points] = is_subscribed_for_way_points;
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index 3fceaf573c..49877ce3ef 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -159,10 +159,6 @@ void RPCHandlerImpl::ProcessMessageFromHMI(
smart_objects::SmartObjectSPtr smart_object =
std::make_shared<smart_objects::SmartObject>();
bool allow_unknown_parameters = false;
- if (!smart_object) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
smart_objects::SmartObject converted_result;
formatters::FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
@@ -198,6 +194,7 @@ void RPCHandlerImpl::ProcessMessageFromHMI(
LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
}
}
+
void RPCHandlerImpl::Handle(const impl::MessageFromMobile message) {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/src/rpc_passing_handler.cc b/src/components/application_manager/src/rpc_passing_handler.cc
index feb3bccc1f..8d63e9489f 100644
--- a/src/components/application_manager/src/rpc_passing_handler.cc
+++ b/src/components/application_manager/src/rpc_passing_handler.cc
@@ -108,9 +108,11 @@ bool RPCPassingHandler::ExtractRPCParams(
}
CommandParametersPermissions parameters_permissions;
+ const WindowID window_id =
+ MessageHelper::ExtractWindowIdFromSmartObject(s_map);
mobile_apis::Result::eType check_result = app_manager_.CheckPolicyPermissions(
- app, function_id_str, params, &parameters_permissions);
+ app, window_id, function_id_str, params, &parameters_permissions);
// Check if RPC is allowed by policy (since we are allowing unknown params,
// check should pass if only undefined parameters exist)
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index b5cae1c126..c7d1bde288 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -82,7 +82,8 @@ bool RPCServiceImpl::ManageMobileCommand(
(*message)[strings::params][strings::connection_key].asUInt());
auto app_ptr = app_manager_.application(connection_key);
- if (app_ptr && app_manager_.IsAppInReconnectMode(app_ptr->policy_app_id())) {
+ if (app_ptr && app_manager_.IsAppInReconnectMode(app_ptr->device(),
+ app_ptr->policy_app_id())) {
commands_holder_.Suspend(
app_ptr, CommandHolder::CommandType::kMobileCommand, message);
return true;
@@ -176,7 +177,8 @@ bool RPCServiceImpl::ManageMobileCommand(
mobile_apis::HMILevel::eType app_hmi_level =
mobile_apis::HMILevel::INVALID_ENUM;
if (app) {
- app_hmi_level = app->hmi_level();
+ app_hmi_level =
+ app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
}
// commands will be launched from request_ctrl
@@ -296,7 +298,8 @@ bool RPCServiceImpl::ManageHMICommand(const commands::MessageSharedPtr message,
(*message)[strings::msg_params][strings::app_id].asUInt();
auto app = app_manager_.application(static_cast<uint32_t>(connection_key));
- if (app && app_manager_.IsAppInReconnectMode(app->policy_app_id())) {
+ if (app && app_manager_.IsAppInReconnectMode(app->device(),
+ app->policy_app_id())) {
commands_holder_.Suspend(
app, CommandHolder::CommandType::kHmiCommand, message);
return true;
@@ -464,9 +467,12 @@ void RPCServiceImpl::SendMessageToMobile(
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asUInt());
+
RPCParams params;
const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
+ const WindowID window_id =
+ MessageHelper::ExtractWindowIdFromSmartObject(s_map);
if (smart_objects::SmartType_Map == s_map.getType()) {
smart_objects::SmartMap::iterator iter = s_map.map_begin();
smart_objects::SmartMap::iterator iter_end = s_map.map_end();
@@ -481,7 +487,8 @@ void RPCServiceImpl::SendMessageToMobile(
const std::string string_functionID =
MessageHelper::StringifiedFunctionID(function_id);
const mobile_apis::Result::eType check_result =
- app_manager_.CheckPolicyPermissions(app, string_functionID, params);
+ app_manager_.CheckPolicyPermissions(
+ app, window_id, string_functionID, params);
if (mobile_apis::Result::SUCCESS != check_result) {
LOG4CXX_WARN(logger_,
"Function \"" << string_functionID << "\" (#" << function_id
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 872103929f..e9adf796af 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -20,6 +20,7 @@ const char* info = "info";
const char* app_id = "appID";
const char* full_app_id = "fullAppID";
const char* bundle_id = "appBundleID";
+const char* window_id = "windowID";
const char* app_info = "appInfo";
const char* app_launch = "app_launch";
const char* app_launch_list = "app_launch_list";
@@ -59,6 +60,7 @@ const char* main_field_1 = "mainField1";
const char* main_field_2 = "mainField2";
const char* main_field_3 = "mainField3";
const char* main_field_4 = "mainField4";
+const char* template_title = "templateTitle";
const char* metadata_tags = "metadataTags";
const char* eta = "eta";
const char* time_to_destination = "timeToDestination";
@@ -81,6 +83,8 @@ const char* num_ticks = "numTicks";
const char* slider_footer = "sliderFooter";
const char* menu_id = "menuID";
const char* menu_name = "menuName";
+const char* menu_layout = "menuLayout";
+const char* menu_layouts_available = "menuLayoutsAvailable";
const char* interaction_choice_set_id = "interactionChoiceSetID";
const char* interaction_choice_set_id_list = "interactionChoiceSetIDList";
const char* choice_set = "choiceSet";
@@ -96,7 +100,10 @@ const char* initial_prompt = "initialPrompt";
const char* initial_text = "initialText";
const char* duration = "duration";
const char* progress_indicator = "progressIndicator";
+const char* func_id = "functionID";
+const char* cancel_id = "cancelID";
const char* alert_type = "alertType";
+const char* alert_icon = "alertIcon";
const char* play_tone = "playTone";
const char* soft_buttons = "softButtons";
const char* soft_button_id = "softButtonID";
@@ -133,9 +140,17 @@ const char* activate_app_hmi_level = "level";
const char* audio_streaming_state = "audioStreamingState";
const char* video_streaming_state = "videoStreamingState";
const char* system_context = "systemContext";
+const char* window_name = "windowName";
+const char* window_type = "type";
+const char* window_type_supported = "windowTypeSupported";
+const char* maximum_number_of_windows = "maximumNumberOfWindows";
+const char* window_capabilities = "windowCapabilities";
+const char* associated_service_type = "associatedServiceType";
+const char* duplicate_updates_from_window_id = "duplicateUpdatesFromWindowID";
const char* speech_capabilities = "speechCapabilities";
const char* vr_capabilities = "vrCapabilities";
const char* audio_pass_thru_capabilities = "audioPassThruCapabilities";
+const char* audio_pass_thru_capabilities_list = "audioPassThruCapabilitiesList";
const char* pcm_stream_capabilities = "pcmStreamCapabilities";
const char* audio_pass_thru_icon = "audioPassThruIcon";
const char* way_points = "wayPoints";
@@ -156,6 +171,8 @@ const char* red = "red";
const char* green = "green";
const char* blue = "blue";
const char* display_layout = "displayLayout";
+const char* template_configuration = "templateConfiguration";
+const char* template_layout = "template";
const char* icon_resumed = "iconResumed";
const char* nicknames = "nicknames";
const char* enabled = "enabled";
@@ -165,6 +182,7 @@ const char* hybrid_app_preference = "hybridAppPreference";
const char* is_cloud_application = "isCloudApplication";
const char* cloud_connection_status = "cloudConnectionStatus";
const char* endpoint = "endpoint";
+const char* display_capabilities = "displayCapabilities";
// PutFile
const char* sync_file_name = "syncFileName";
@@ -183,6 +201,7 @@ const char* is_template = "isTemplate";
const char* image = "image";
const char* type = "type";
const char* system_file = "systemFile";
+const char* is_system_file = "isSystemFile";
const char* offset = "offset";
const char* length = "length";
const char* secondary_image = "secondaryImage";
@@ -221,6 +240,7 @@ const char* key_press_mode = "keypressMode";
// duplicate names from hmi_request
const char* limited_character_list = "limitedCharacterList";
const char* auto_complete_text = "autoCompleteText";
+const char* auto_complete_list = "autoCompleteList";
const char* navigation_text = "navigationText";
// vehicle info
@@ -311,6 +331,10 @@ const char* activate = "activate";
const char* set_as_default = "setAsDefault";
const char* origin_app = "originApp";
+// sis data
+const char* station_short_name = "stationShortName";
+const char* station_location = "stationLocation";
+
// resuming
const char* application_commands = "applicationCommands";
const char* application_submenus = "applicationSubMenus";
@@ -339,8 +363,12 @@ const char* time_stamp = "timeStamp";
const char* manual_text_entry = "manualTextEntry";
const char* image_type_supported = "imageTypeSupported";
const char* unexpected_disconnect = "unexpectedDisconnect";
+
+const char* shifted = "shifted";
+const char* altitude = "altitude";
const char* longitude_degrees = "longitudeDegrees";
const char* latitude_degrees = "latitudeDegrees";
+
const char* address = "address";
const char* country_name = "countryName";
const char* country_code = "countryCode";
@@ -363,13 +391,14 @@ const char* delivery_mode = "deliveryMode";
const char* audio_streaming_indicator = "audioStreamingIndicator";
+const char* windows_info = "windowsInfo";
+
const char* const keyboard_properties_supported = "keyboardPropertiesSupported";
const char* const language_supported = "languageSupported";
const char* const keyboard_layout_supported = "keyboardLayoutSupported";
const char* const keypress_mode_supported = "keypressModeSupported";
const char* const limited_characters_list_supported =
"limitedCharactersListSupported";
-const char* const auto_complete_text_supported = "autoCompleteTextSupported";
const char* const send_location_enabled = "sendLocationEnabled";
const char* const get_way_points_enabled = "getWayPointsEnabled";
const char* const entity_type = "entityType";
@@ -390,6 +419,9 @@ const char* const resolution_height = "resolutionHeight";
const char* const max_bitrate = "maxBitrate";
const char* const supported_formats = "supportedFormats";
const char* const haptic_spatial_data_supported = "hapticSpatialDataSupported";
+const char* const diagonal_screen_size = "diagonalScreenSize";
+const char* const pixel_per_inch = "pixelPerInch";
+const char* const scale = "scale";
const char* const haptic_rect_data = "hapticRectData";
const char* const rect = "rect";
const char* const x = "x";
@@ -432,6 +464,8 @@ namespace mobile_notification {
const char* state = "state";
const char* syncp_timeout = "Timeout";
const char* syncp_url = "URL";
+const char* lock_screen_dismissal_enabled = "lockScreenDismissalEnabled";
+const char* lock_screen_dismissal_warning = "lockScreenDismissalWarning";
} // namespace mobile_notification
namespace hmi_levels {
@@ -476,7 +510,7 @@ const char* keyboard_properties = "keyboardProperties";
const char* method_name = "methodName";
const char* keyboard_layout = "keyboardLayout";
const char* limited_character_list = "limitedCharacterList";
-const char* auto_complete_text = "autoCompleteText";
+const char* auto_complete_list = "autoCompleteList";
const char* file = "file";
const char* file_name = "fileName";
const char* retry = "retry";
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index c791f58047..8368597370 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -67,14 +67,16 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr state,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(HmiState::STATE_ID_REGULAR == state->state_id());
- LOG4CXX_DEBUG(logger_, "Set regular state " << *state);
+ LOG4CXX_DEBUG(logger_,
+ "Set window #" << window_id << " regular state " << *state);
if (state->hmi_level() == mobile_apis::HMILevel::INVALID_ENUM ||
state->audio_streaming_state() ==
@@ -93,37 +95,44 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr resolved_state = ResolveHmiState(app, state);
if (!resolved_state) {
state->set_state_id(HmiState::STATE_ID_POSTPONED);
- app->SetPostponedState(state);
+ app->SetPostponedState(window_id, state);
return;
}
+
LOG4CXX_DEBUG(logger_, "Resolved state: " << *resolved_state);
const hmi_apis::Common_HMILevel::eType hmi_level =
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- if (send_activate_app) {
- const int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
- if (-1 != corr_id) {
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- corr_id);
- waiting_for_activate_[app->app_id()] = resolved_state;
+ if (request_hmi_state_change) {
+ const int64_t result = RequestHMIStateChange(app, hmi_level, true);
+ if (-1 != result) {
+ const uint32_t corr_id = static_cast<uint32_t>(result);
+ subscribe_on_event(
+ hmi_apis::Common_HMILevel::NONE == hmi_level
+ ? hmi_apis::FunctionID::BasicCommunication_CloseApplication
+ : hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ corr_id);
+ waiting_for_response_[app->app_id()] = resolved_state;
+ app_mngr_.set_application_id(corr_id, app->hmi_app_id());
return;
}
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp");
return;
}
- ApplyRegularState(app, resolved_state);
+ ApplyRegularState(app, window_id, resolved_state);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr prev_regular = app->RegularHmiState();
+ HmiStatePtr prev_regular = app->RegularHmiState(window_id);
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
@@ -132,16 +141,22 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_regular->system_context());
- SetRegularState(app, hmi_state, send_activate_app);
+ hmi_state->set_window_type(prev_regular->window_type());
+ SetRegularState(app, window_id, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
+
+ HmiStatePtr prev_regular = app->RegularHmiState(window_id);
+ DCHECK_OR_RETURN_VOID(prev_regular);
+
const HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
@@ -150,33 +165,43 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
- SetRegularState(app, hmi_state, send_activate_app);
+ hmi_state->set_window_type(prev_regular->window_type());
+ SetRegularState(app, window_id, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
+
+ HmiStatePtr prev_regular = app->RegularHmiState(window_id);
+ DCHECK_OR_RETURN_VOID(prev_regular);
+
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
+
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(system_context);
- SetRegularState(app, hmi_state, send_activate_app);
+ hmi_state->set_window_type(prev_regular->window_type());
+ SetRegularState(app, window_id, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
- ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) {
+ ApplicationSharedPtr app,
+ const WindowID window_id,
+ const mobile_apis::HMILevel::eType hmi_level) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr prev_state = app->RegularHmiState();
+ HmiStatePtr prev_state = app->RegularHmiState(window_id);
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
@@ -186,15 +211,16 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_system_context(prev_state
? prev_state->system_context()
: mobile_apis::SystemContext::SYSCTXT_MAIN);
- SetRegularState(app, hmi_state);
+ SetRegularState(app, window_id, hmi_state);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::SystemContext::eType system_context) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr prev_regular = app->RegularHmiState();
+ HmiStatePtr prev_regular = app->RegularHmiState(window_id);
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
@@ -205,16 +231,18 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_video_streaming_state(
CalcVideoState(app, prev_regular->hmi_level()));
hmi_state->set_system_context(system_context);
- SetRegularState(app, hmi_state, false);
+ hmi_state->set_window_type(prev_regular->window_type());
+ SetRegularState(app, window_id, hmi_state, false);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr prev_state = app->RegularHmiState();
+ HmiStatePtr prev_state = app->RegularHmiState(window_id);
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
@@ -223,18 +251,23 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_state->system_context());
- SetRegularState(app, hmi_state, false);
+ hmi_state->set_window_type(prev_state->window_type());
+ SetRegularState(app, window_id, hmi_state, false);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
- if (mobile_apis::HMILevel::HMI_FULL == state->hmi_level()) {
- SetRegularState(app, state, true);
+
+ // SDL should send BC.ActivateApp for main window during resumption
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id &&
+ mobile_apis::HMILevel::HMI_FULL == state->hmi_level()) {
+ SetRegularState(app, window_id, state, true);
} else {
- SetRegularState(app, state, false);
+ SetRegularState(app, window_id, state, false);
}
}
@@ -295,7 +328,8 @@ void StateControllerImpl::HmiLevelConflictResolver::operator()(
return;
}
- const HmiStatePtr state_to_resolve = app_to_resolve->RegularHmiState();
+ const HmiStatePtr state_to_resolve =
+ app_to_resolve->RegularHmiState(window_id_);
DCHECK_OR_RETURN_VOID(state_to_resolve);
// If applied HMI state is FULL:
@@ -379,22 +413,23 @@ void StateControllerImpl::HmiLevelConflictResolver::operator()(
std::make_tuple(
result_hmi_level, result_audio_state, result_video_state)) {
LOG4CXX_DEBUG(logger_,
- "Application "
- << app_to_resolve->app_id() << " will change state to: "
- << "HMI level " << to_resolve_hmi_level << " --> "
- << result_hmi_level << ", audio "
- << state_to_resolve->audio_streaming_state() << " --> "
- << result_audio_state << ", video "
- << state_to_resolve->video_streaming_state() << " --> "
- << result_video_state);
+ "Application " << app_to_resolve->app_id() << " window "
+ << window_id_ << " will change state to: "
+ << "HMI level " << to_resolve_hmi_level
+ << " --> " << result_hmi_level << ", audio "
+ << state_to_resolve->audio_streaming_state()
+ << " --> " << result_audio_state << ", video "
+ << state_to_resolve->video_streaming_state()
+ << " --> " << result_video_state);
state_ctrl_->SetupRegularHmiState(app_to_resolve,
+ window_id_,
result_hmi_level,
result_audio_state,
result_video_state);
} else {
LOG4CXX_DEBUG(logger_,
- "Application " << app_to_resolve->app_id()
- << " will NOT change HMI level");
+ "Application " << app_to_resolve->app_id() << " window "
+ << window_id_ << " will NOT change HMI level");
}
}
@@ -408,6 +443,7 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN(available_state, HmiStatePtr());
available_state->set_hmi_level(state->hmi_level());
+ available_state->set_window_type(state->window_type());
available_state->set_audio_streaming_state(state->audio_streaming_state());
available_state->set_video_streaming_state(state->video_streaming_state());
available_state->set_system_context(state->system_context());
@@ -565,12 +601,14 @@ bool StateControllerImpl::IsStateAvailableForResumption(
}
void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr state) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
- LOG4CXX_DEBUG(logger_, "Setup regular state: " << *state);
- HmiStatePtr curr_state = app->CurrentHmiState();
+ LOG4CXX_DEBUG(logger_,
+ "Setup window #" << window_id << " regular state: " << *state);
+ HmiStatePtr curr_state = app->CurrentHmiState(window_id);
HmiStatePtr old_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(old_state);
@@ -578,28 +616,30 @@ void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
old_state->set_audio_streaming_state(curr_state->audio_streaming_state());
old_state->set_video_streaming_state(curr_state->video_streaming_state());
old_state->set_system_context(curr_state->system_context());
- app->SetRegularState(state);
+ old_state->set_window_type(curr_state->window_type());
+ app->SetRegularState(window_id, state);
- if (HMILevel::HMI_LIMITED == state->hmi_level() && app->is_resuming()) {
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id &&
+ HMILevel::HMI_LIMITED == state->hmi_level() && app->is_resuming()) {
LOG4CXX_DEBUG(logger_,
"Resuming to LIMITED level. "
<< "Send OnResumeAudioSource notification");
MessageHelper::SendOnResumeAudioSourceToHMI(app->app_id(), app_mngr_);
}
- app->set_is_resuming(false);
- HmiStatePtr new_state = app->CurrentHmiState();
- OnStateChanged(app, old_state, new_state);
+ HmiStatePtr new_state = app->CurrentHmiState(window_id);
+ OnStateChanged(app, window_id, old_state, new_state);
}
void StateControllerImpl::SetupRegularHmiState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr prev_state = app->RegularHmiState();
+ HmiStatePtr prev_state = app->RegularHmiState(window_id);
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr new_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
@@ -608,22 +648,64 @@ void StateControllerImpl::SetupRegularHmiState(
new_state->set_audio_streaming_state(audio_state);
new_state->set_video_streaming_state(video_state);
new_state->set_system_context(prev_state->system_context());
- SetupRegularHmiState(app, new_state);
+ new_state->set_window_type(prev_state->window_type());
+ SetupRegularHmiState(app, window_id, new_state);
}
void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
LOG4CXX_DEBUG(logger_,
- "Applying to app " << app->app_id() << " state " << *state);
- SetupRegularHmiState(app, state);
+ "Applying to app " << app->app_id() << " window #" << window_id
+ << " state " << *state);
+ SetupRegularHmiState(app, window_id, state);
+
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id) {
+ LOG4CXX_DEBUG(logger_, "No need to resolve conflicts for a widget");
+ return;
+ }
+
LOG4CXX_DEBUG(logger_,
"Resolving HMI level conflicts for app " << app->app_id());
- ForEachApplication(HmiLevelConflictResolver(app, state, this));
+ ForEachApplication(HmiLevelConflictResolver(app, window_id, state, this));
}
+
+void StateControllerImpl::UpdateAppWindowsStreamingState(
+ ApplicationSharedPtr app, HmiStatePtr state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto window_ids = app->GetWindowIds();
+ for (auto window_id : window_ids) {
+ HmiStatePtr window_hmi_state = app->RegularHmiState(window_id);
+ LOG4CXX_DEBUG(
+ logger_, "State: " << *state << " window state: " << *window_hmi_state);
+ if (window_hmi_state->audio_streaming_state() !=
+ state->audio_streaming_state() ||
+ window_hmi_state->video_streaming_state() !=
+ state->video_streaming_state()) {
+ LOG4CXX_DEBUG(logger_,
+ "Updating streaming state for window #" << window_id);
+
+ HmiStatePtr new_window_state =
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(new_window_state);
+ new_window_state->set_hmi_level(window_hmi_state->hmi_level());
+ new_window_state->set_audio_streaming_state(
+ state->audio_streaming_state());
+ new_window_state->set_video_streaming_state(
+ state->video_streaming_state());
+ new_window_state->set_system_context(window_hmi_state->system_context());
+ new_window_state->set_window_type(window_hmi_state->window_type());
+ app->SetRegularState(window_id, new_window_state);
+
+ MessageHelper::SendHMIStatusNotification(app, window_id, app_mngr_);
+ }
+ }
+}
+
void StateControllerImpl::on_event(const event_engine::MobileEvent& event) {}
void StateControllerImpl::on_event(const event_engine::Event& event) {
@@ -636,8 +718,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
const SmartObject& message = event.smart_object();
const FunctionID::eType id = static_cast<FunctionID::eType>(event.id());
switch (id) {
- case FunctionID::BasicCommunication_ActivateApp: {
- OnActivateAppResponse(message);
+ case FunctionID::BasicCommunication_ActivateApp:
+ case FunctionID::BasicCommunication_CloseApplication: {
+ OnHMIResponse(message);
break;
}
case FunctionID::BasicCommunication_OnAppActivated: {
@@ -725,26 +808,82 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
}
}
+void StateControllerImpl::ActivateDefaultWindow(ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+
+ const WindowID window_id = PredefinedWindows::DEFAULT_WINDOW;
+ const HMILevel::eType hmi_level = HMILevel::HMI_FULL;
+ const AudioStreamingState::eType audio_state =
+ app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+ const VideoStreamingState::eType video_state =
+ app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
+ : VideoStreamingState::NOT_STREAMABLE;
+
+ SetRegularState(app, window_id, hmi_level, audio_state, video_state, false);
+
+ // After main window activation, streaming state should be updated for another
+ // windows of the app
+ HmiStatePtr new_state =
+ app->RegularHmiState(PredefinedWindows::DEFAULT_WINDOW);
+ UpdateAppWindowsStreamingState(app, new_state);
+}
+
+void StateControllerImpl::ExitDefaultWindow(ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+
+ const WindowID window_id = PredefinedWindows::DEFAULT_WINDOW;
+ const HMILevel::eType hmi_level = HMILevel::HMI_NONE;
+ const AudioStreamingState::eType audio_state =
+ AudioStreamingState::NOT_AUDIBLE;
+ const VideoStreamingState::eType video_state =
+ VideoStreamingState::NOT_STREAMABLE;
+
+ SetRegularState(app, window_id, hmi_level, audio_state, video_state, false);
+
+ // After main window exiting, streaming state should be updated for another
+ // windows of the app
+ HmiStatePtr new_state =
+ app->RegularHmiState(PredefinedWindows::DEFAULT_WINDOW);
+ UpdateAppWindowsStreamingState(app, new_state);
+}
+
void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr old_state,
HmiStatePtr new_state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(old_state);
DCHECK_OR_RETURN_VOID(new_state);
- LOG4CXX_DEBUG(logger_, "Old state: " << *old_state);
- LOG4CXX_DEBUG(logger_, "New state: " << *new_state);
- if (IsStateChanged(*old_state, *new_state)) {
- app_mngr_.SendHMIStatusNotification(app);
- if (new_state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
- app->ResetDataInNone();
- }
- app_mngr_.OnHMILevelChanged(
- app->app_id(), old_state->hmi_level(), new_state->hmi_level());
- app->usage_report().RecordHmiStateChanged(new_state->hmi_level());
- } else {
- LOG4CXX_ERROR(logger_, "State has NOT been changed.");
+ LOG4CXX_DEBUG(logger_,
+ "Window #" << window_id << " old state: " << *old_state);
+ LOG4CXX_DEBUG(logger_,
+ "Window #" << window_id << " new state: " << *new_state);
+
+ if (!IsStateChanged(*old_state, *new_state)) {
+ LOG4CXX_DEBUG(logger_, "State has NOT been changed.");
+ return;
+ }
+
+ MessageHelper::SendHMIStatusNotification(app, window_id, app_mngr_);
+
+ if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id) {
+ LOG4CXX_DEBUG(logger_,
+ "State was changed not for a main application window. No "
+ "additional actions required");
+ return;
+ }
+
+ if (new_state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ app->ResetDataInNone();
}
+
+ app_mngr_.OnHMILevelChanged(
+ app->app_id(), old_state->hmi_level(), new_state->hmi_level());
+ app->usage_report().RecordHmiStateChanged(new_state->hmi_level());
}
bool StateControllerImpl::IsTempStateActive(HmiState::StateID id) const {
@@ -755,6 +894,20 @@ bool StateControllerImpl::IsTempStateActive(HmiState::StateID id) const {
void StateControllerImpl::OnApplicationRegistered(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // After app registration HMI level should be set for DEFAUL_WINDOW only
+ OnAppWindowAdded(app,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ mobile_apis::WindowType::MAIN,
+ default_level);
+}
+
+void StateControllerImpl::OnAppWindowAdded(
+ ApplicationSharedPtr app,
+ const WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType default_level) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
@@ -768,9 +921,10 @@ void StateControllerImpl::OnApplicationRegistered(
DCHECK_OR_RETURN_VOID(new_state);
DCHECK_OR_RETURN_VOID(new_state->state_id() !=
HmiState::STATE_ID_REGULAR);
- HmiStatePtr old_hmi_state = app->CurrentHmiState();
+ HmiStatePtr old_hmi_state = app->CurrentHmiState(window_id);
new_state->set_parent(old_hmi_state);
- app->AddHMIState(new_state);
+ new_state->set_window_type(old_hmi_state->window_type());
+ app->AddHMIState(window_id, new_state);
}
}
@@ -781,50 +935,57 @@ void StateControllerImpl::OnApplicationRegistered(
default_state->set_audio_streaming_state(CalcAudioState(app, default_level));
default_state->set_video_streaming_state(CalcVideoState(app, default_level));
default_state->set_system_context(SystemContext::SYSCTXT_MAIN);
+ default_state->set_window_type(window_type);
- HmiStatePtr initial_state = app->RegularHmiState();
+ HmiStatePtr initial_state = app->RegularHmiState(window_id);
- app->SetRegularState(default_state);
+ app->SetRegularState(window_id, default_state);
- HmiStatePtr new_state = app->CurrentHmiState();
+ HmiStatePtr new_state = app->CurrentHmiState(window_id);
- OnStateChanged(app, initial_state, new_state);
+ OnStateChanged(app, window_id, initial_state, new_state);
}
-int64_t StateControllerImpl::SendBCActivateApp(
+int64_t StateControllerImpl::RequestHMIStateChange(
ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr bc_activate_app_request =
- MessageHelper::GetBCActivateAppRequestToHMI(
- app,
- app_mngr_.connection_handler().get_session_observer(),
- app_mngr_.GetPolicyHandler(),
- level,
- send_policy_priority,
- app_mngr_);
- if (!bc_activate_app_request) {
- LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest");
+ smart_objects::SmartObjectSPtr request = NULL;
+ if (hmi_apis::Common_HMILevel::NONE == level) {
+ request = MessageHelper::GetBCCloseApplicationRequestToHMI(app, app_mngr_);
+ } else {
+ request = MessageHelper::GetBCActivateAppRequestToHMI(
+ app,
+ app_mngr_.GetPolicyHandler(),
+ level,
+ send_policy_priority,
+ app_mngr_);
+ }
+ if (!request) {
+ LOG4CXX_ERROR(logger_, "Unable to create request");
return -1;
}
- if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) {
- LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest");
+ if (!app_mngr_.GetRPCService().ManageHMICommand(request)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
return -1;
}
- const int64_t corr_id =
- (*bc_activate_app_request)[strings::params][strings::correlation_id]
- .asInt();
- return corr_id;
+ const uint32_t corr_id =
+ (*request)[strings::params][strings::correlation_id].asUInt();
+ return static_cast<int64_t>(corr_id);
}
void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
- HmiStatePtr state = app->PostponedHmiState();
- if (state) {
- app->RemovePostponedState();
- state->set_state_id(HmiState::STATE_ID_REGULAR);
- SetRegularState(app, state);
+ const WindowIds window_ids = app->GetWindowIds();
+
+ for (const auto& window_id : window_ids) {
+ HmiStatePtr state = app->PostponedHmiState(window_id);
+ if (state) {
+ app->RemovePostponedState(window_id);
+ state->set_state_id(HmiState::STATE_ID_REGULAR);
+ SetRegularState(app, window_id, state);
+ }
}
}
@@ -852,16 +1013,19 @@ void StateControllerImpl::TempStateStopped(HmiState::StateID ID) {
std::mem_fun(&StateControllerImpl::ApplyPostponedStateForApp), this));
}
-void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
+void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app,
+ const WindowID window_id) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- const HmiStatePtr regular = app->RegularHmiState();
+ const HmiStatePtr regular = app->RegularHmiState(window_id);
DCHECK_OR_RETURN_VOID(regular);
HmiStatePtr new_regular = std::make_shared<HmiState>(*regular);
- LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'");
+ LOG4CXX_DEBUG(logger_,
+ "Window #" << window_id << " current HMI level: '"
+ << app->hmi_level(window_id) << "'");
const bool is_audio_app = app->IsAudioApplication();
const bool is_video_app = app->IsVideoApplication();
@@ -887,23 +1051,25 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
new_regular->set_video_streaming_state(VideoStreamingState::NOT_STREAMABLE);
}
- SetRegularState(app, new_regular, false);
+ SetRegularState(app, window_id, new_regular, false);
}
-void StateControllerImpl::OnActivateAppResponse(
+void StateControllerImpl::OnHMIResponse(
const smart_objects::SmartObject& message) {
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- const int32_t correlation_id =
- message[strings::params][strings::correlation_id].asInt();
+ const uint32_t correlation_id =
+ message[strings::params][strings::correlation_id].asUInt();
const uint32_t hmi_app_id = app_mngr_.application_id(correlation_id);
ApplicationSharedPtr application =
app_mngr_.application_by_hmi_app(hmi_app_id);
if (application && hmi_apis::Common_Result::SUCCESS == code) {
- HmiStatePtr pending_state = waiting_for_activate_[application->app_id()];
+ HmiStatePtr pending_state = waiting_for_response_[application->app_id()];
DCHECK_OR_RETURN_VOID(pending_state);
- ApplyRegularState(application, pending_state);
+ ApplyRegularState(application,
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ pending_state);
}
}
@@ -919,7 +1085,33 @@ void StateControllerImpl::OnAppActivated(
return;
}
- SetRegularState(app, HMILevel::HMI_FULL, true);
+ WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+ if (message[strings::msg_params].keyExists(strings::window_id)) {
+ window_id = message[strings::msg_params][strings::window_id].asInt();
+ }
+
+ const auto window_ids = app->GetWindowIds();
+ if (!helpers::in_range(window_ids, window_id)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Application " << app_id << " does not contain window #" << window_id);
+ return;
+ }
+
+ if (PredefinedWindows::DEFAULT_WINDOW != window_id) {
+ const auto window_hmi_level = app->hmi_level(window_id);
+ const HMILevel::eType new_hmi_level = HMILevel::HMI_NONE == window_hmi_level
+ ? HMILevel::HMI_BACKGROUND
+ : HMILevel::HMI_FULL;
+ const AudioStreamingState::eType audio_state = app->audio_streaming_state();
+ const VideoStreamingState::eType video_state = app->video_streaming_state();
+
+ SetRegularState(
+ app, window_id, new_hmi_level, audio_state, video_state, false);
+ return;
+ }
+
+ SetRegularState(app, window_id, HMILevel::HMI_FULL, true);
}
void StateControllerImpl::OnAppDeactivated(
@@ -934,13 +1126,39 @@ void StateControllerImpl::OnAppDeactivated(
return;
}
- if (HMILevel::HMI_FULL != app->hmi_level()) {
+ WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+ if (message[strings::msg_params].keyExists(strings::window_id)) {
+ window_id = message[strings::msg_params][strings::window_id].asInt();
+ }
+
+ const auto window_ids = app->GetWindowIds();
+ if (!helpers::in_range(window_ids, window_id)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Application " << app_id << " does not contain window #" << window_id);
+ return;
+ }
+
+ const auto window_hmi_level = app->hmi_level(window_id);
+ if (PredefinedWindows::DEFAULT_WINDOW != window_id) {
+ const HMILevel::eType new_hmi_level = HMILevel::HMI_FULL == window_hmi_level
+ ? HMILevel::HMI_BACKGROUND
+ : HMILevel::HMI_NONE;
+ const AudioStreamingState::eType audio_state = app->audio_streaming_state();
+ const VideoStreamingState::eType video_state = app->video_streaming_state();
+
+ SetRegularState(
+ app, window_id, new_hmi_level, audio_state, video_state, false);
+ return;
+ }
+
+ if (HMILevel::HMI_FULL != window_hmi_level) {
return;
}
// TODO(AOleynik): Need to delete DeactivateReason and modify OnAppDeactivated
// when HMI will support that, otherwise won't be testable
- DeactivateApp(app);
+ DeactivateApp(app, window_id);
}
void StateControllerImpl::OnVideoStreamingStarted(
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index ccec05a795..5b7aa80f20 100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -88,7 +88,7 @@ set (RequestController_SOURCES
set(LIBRARIES
Utils
ApplicationManager
- sdl_rpc_plugin
+ sdl_rpc_plugin_static
jsoncpp
Policy
connectionHandler
@@ -154,6 +154,7 @@ set(ResumptionData_SOURCES
file(COPY hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY hmi_capabilities_sc1.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY hmi_capabilities_sc2.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY hmi_capabilities_old_apt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
diff --git a/src/components/application_manager/test/app_service_manager_test.cc b/src/components/application_manager/test/app_service_manager_test.cc
index 0f2b4469a2..daabdeedf4 100644
--- a/src/components/application_manager/test/app_service_manager_test.cc
+++ b/src/components/application_manager/test/app_service_manager_test.cc
@@ -60,6 +60,7 @@ const std::string kServiceType = "MEDIA";
const std::string kServiceName = "service_name";
const std::string kServiceId = "service_id";
const std::string kPolicyAppId = "p_app_id";
+const std::string kPolicyAppId2 = "p_app_id2";
const uint32_t kConnectionKey = 43629;
const uint32_t kHMIConnectionKey = 0;
@@ -83,6 +84,7 @@ class AppServiceManagerTest : public testing::Test {
public:
AppServiceManagerTest()
: mock_app_ptr_(new MockApplication)
+ , mock_app_ptr2_(new MockApplication)
, app_service_manager_(mock_app_manager_, mock_last_state_)
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock()) {
@@ -101,10 +103,15 @@ class AppServiceManagerTest : public testing::Test {
.WillByDefault(ReturnRef(mock_settings_));
ON_CALL(*mock_app_ptr_, policy_app_id())
.WillByDefault(Return(kPolicyAppId));
+ ON_CALL(*mock_app_ptr2_, policy_app_id())
+ .WillByDefault(Return(kPolicyAppId2));
ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(dict_));
auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr2 = std::static_pointer_cast<am::Application>(mock_app_ptr2_);
ON_CALL(mock_app_manager_, application(kConnectionKey))
.WillByDefault(Return(app_ptr));
+ ON_CALL(mock_app_manager_, application(kConnectionKey + 1))
+ .WillByDefault(Return(app_ptr2));
}
protected:
@@ -192,6 +199,7 @@ class AppServiceManagerTest : public testing::Test {
Json::Value dict_;
std::vector<std::string> embedded_services_;
std::shared_ptr<MockApplication> mock_app_ptr_;
+ std::shared_ptr<MockApplication> mock_app_ptr2_;
MockApplicationManager mock_app_manager_;
resumption_test::MockLastState mock_last_state_;
MockApplicationManagerSettings mock_settings_;
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 46d35bdbef..7b45d387f7 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -69,7 +69,14 @@ using ::testing::Return;
using ::testing::ReturnRef;
using usage_statistics_test::MockStatisticsManager;
-typedef void (ApplicationImpl::*AddSet)(HmiStatePtr args);
+typedef void (ApplicationImpl::*AddSet)(const WindowID window_id,
+ HmiStatePtr args);
+
+namespace {
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+const std::string kDefaultWindowName = "DefaultName";
+} // namespace
class ApplicationImplTest : public ::testing::Test {
protected:
@@ -106,7 +113,8 @@ class ApplicationImplTest : public ::testing::Test {
mock_application_manager_));
HmiStatePtr initial_state = CreateTestHmiState();
- app_impl->SetInitialState(initial_state);
+ app_impl->SetInitialState(
+ kDefaultWindowId, kDefaultWindowName, initial_state);
}
virtual void TearDown() OVERRIDE {
@@ -159,12 +167,12 @@ HmiStatePtr ApplicationImplTest::TestAddHmiState(HMILevel::eType hmi_lvl,
test_lvl = hmi_lvl;
state_id = id_state;
HmiStatePtr state = CreateTestHmiState();
- ((app_impl.get())->*hmi_action)(state);
+ ((app_impl.get())->*hmi_action)(kDefaultWindowId, state);
return state;
}
void ApplicationImplTest::CheckCurrentHMIState() {
- HmiStatePtr current_state = app_impl->CurrentHmiState();
+ HmiStatePtr current_state = app_impl->CurrentHmiState(kDefaultWindowId);
EXPECT_EQ(test_lvl, current_state->hmi_level());
EXPECT_EQ(state_id, current_state->state_id());
}
@@ -207,7 +215,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetRegularState) {
HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
- HmiStatePtr current_state = app_impl->RegularHmiState();
+ HmiStatePtr current_state = app_impl->RegularHmiState(kDefaultWindowId);
EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
EXPECT_EQ(HmiState::STATE_ID_REGULAR, current_state->state_id());
EXPECT_EQ(app_id, app_impl->app_id());
@@ -228,8 +236,8 @@ TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
CheckCurrentHMIState();
// Remove last state
- app_impl->RemoveHMIState(state3->state_id());
- HmiStatePtr current_state = app_impl->CurrentHmiState();
+ app_impl->RemoveHMIState(kDefaultWindowId, state3->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState(kDefaultWindowId);
EXPECT_EQ(state2, current_state);
EXPECT_EQ(HMILevel::HMI_NONE, current_state->hmi_level());
EXPECT_EQ(HmiState::STATE_ID_VIDEO_STREAMING, current_state->state_id());
@@ -249,8 +257,8 @@ TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
CheckCurrentHMIState();
// Remove not last state
- app_impl->RemoveHMIState(state2->state_id());
- HmiStatePtr current_state = app_impl->CurrentHmiState();
+ app_impl->RemoveHMIState(kDefaultWindowId, state2->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState(kDefaultWindowId);
EXPECT_EQ(state3, current_state);
// HMI level is equal to parent hmi_level
EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
@@ -272,8 +280,8 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
CheckCurrentHMIState();
// Remove first added state
- app_impl->RemoveHMIState(state1->state_id());
- HmiStatePtr current_state = app_impl->CurrentHmiState();
+ app_impl->RemoveHMIState(kDefaultWindowId, state1->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState(kDefaultWindowId);
EXPECT_EQ(state3, current_state);
// Last state does not have a parent
EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level());
@@ -295,8 +303,8 @@ TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) {
CheckCurrentHMIState();
// Remove first state
- app_impl->RemoveHMIState(state1->state_id());
- HmiStatePtr current_state = app_impl->CurrentHmiState();
+ app_impl->RemoveHMIState(kDefaultWindowId, state1->state_id());
+ HmiStatePtr current_state = app_impl->CurrentHmiState(kDefaultWindowId);
EXPECT_EQ(state3, current_state);
// Last state has a parent
EXPECT_EQ(HMILevel::HMI_FULL, current_state->hmi_level());
@@ -311,12 +319,12 @@ TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) {
&ApplicationImpl::SetPostponedState);
// Check that state was setted correctly
- HmiStatePtr state2 = app_impl->PostponedHmiState();
+ HmiStatePtr state2 = app_impl->PostponedHmiState(kDefaultWindowId);
EXPECT_EQ(state1, state2);
// Check that state was correctly removed
- app_impl->RemovePostponedState();
- state2 = app_impl->PostponedHmiState();
+ app_impl->RemovePostponedState(kDefaultWindowId);
+ state2 = app_impl->PostponedHmiState(kDefaultWindowId);
EXPECT_EQ(nullptr, state2);
}
@@ -327,9 +335,9 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
HmiState::STATE_ID_REGULAR,
&ApplicationImpl::SetRegularState);
- EXPECT_EQ(test_lvl, app_impl->hmi_level());
+ EXPECT_EQ(test_lvl, app_impl->hmi_level(kDefaultWindowId));
EXPECT_EQ(audiostate, app_impl->audio_streaming_state());
- EXPECT_EQ(syst_context, app_impl->system_context());
+ EXPECT_EQ(syst_context, app_impl->system_context(kDefaultWindowId));
audiostate = AudioStreamingState::AUDIBLE;
syst_context = SystemContext::SYSCTXT_MENU;
@@ -337,9 +345,9 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
- EXPECT_EQ(test_lvl, app_impl->hmi_level());
+ EXPECT_EQ(test_lvl, app_impl->hmi_level(kDefaultWindowId));
EXPECT_EQ(audiostate, app_impl->audio_streaming_state());
- EXPECT_EQ(syst_context, app_impl->system_context());
+ EXPECT_EQ(syst_context, app_impl->system_context(kDefaultWindowId));
}
TEST_F(ApplicationImplTest, IsAudioApplication) {
@@ -565,7 +573,9 @@ TEST_F(ApplicationImplTest, SubscribeToSoftButton_UnsubscribeFromSoftButton) {
SoftButtonID test_button;
for (uint i = 0; i < btn_count; i++) {
- test_button.insert(i);
+ test_button.insert(std::make_pair(
+ i,
+ static_cast<WindowID>(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)));
}
app_impl->SubscribeToSoftButtons(FunctionID::ScrollableMessageID,
test_button);
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index 804959e1db..1f0b705f41 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -102,6 +102,8 @@ connection_handler::DeviceHandle kDeviceId = 12345u;
const std::string kAppId = "someID";
const uint32_t kConnectionKey = 1232u;
const std::string kAppName = "appName";
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
// Cloud application params
@@ -145,8 +147,10 @@ class ApplicationManagerImplTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
CreateAppManager();
- ON_CALL(mock_session_observer_, GetDataOnSessionKey(_, _, _, _))
- .WillByDefault(DoAll(SetArgPointee<3u>(kDeviceId), Return(0)));
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_ptr_, device()).WillByDefault(Return(kDeviceId));
+ ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, &kDeviceId))
+ .WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0)));
ON_CALL(mock_connection_handler_, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer_));
app_manager_impl_->SetMockRPCService(mock_rpc_service_);
@@ -384,7 +388,7 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) {
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -415,7 +419,7 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
// is_navi() is false
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -446,7 +450,7 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
// HMI level is not FULL nor LIMITED
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
bool result = false;
@@ -476,7 +480,7 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
bool result = false;
@@ -560,7 +564,7 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -634,7 +638,7 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -669,7 +673,7 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) {
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -699,7 +703,7 @@ TEST_F(ApplicationManagerImplTest,
const int32_t session_key = 123;
EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ EXPECT_CALL(*mock_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
bool result = false;
@@ -820,6 +824,9 @@ TEST_F(ApplicationManagerImplTest,
std::shared_ptr<MockApplication> switching_app_ptr =
std::make_shared<MockApplication>();
+ ON_CALL(*switching_app_ptr, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*switching_app_ptr, device()).WillByDefault(Return(kDeviceId));
+
const std::string switching_device_id = "switching";
const std::string switching_device_id_hash =
encryption::MakeHash(switching_device_id);
@@ -832,12 +839,11 @@ TEST_F(ApplicationManagerImplTest,
.WillRepeatedly(Return(policy_app_id_switch));
const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
- EXPECT_CALL(*switching_app_ptr, hmi_level())
+ EXPECT_CALL(*switching_app_ptr, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(hmi_level_switching_app));
std::shared_ptr<MockApplication> nonswitching_app_ptr =
std::make_shared<MockApplication>();
-
const std::string nonswitching_device_id = "nonswitching";
const std::string nonswitching_device_id_hash =
encryption::MakeHash(nonswitching_device_id);
@@ -850,7 +856,7 @@ TEST_F(ApplicationManagerImplTest,
.WillRepeatedly(Return(policy_app_id_nonswitch));
const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
- EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(hmi_level_nonswitching_app));
// Act
@@ -868,15 +874,18 @@ TEST_F(ApplicationManagerImplTest,
.WillOnce(Return(smart_objects::SmartObjectSPtr()));
app_manager_impl_->OnDeviceSwitchingStart(switching_device,
non_switching_device);
- EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
- EXPECT_FALSE(
- app_manager_impl_->IsAppInReconnectMode(policy_app_id_nonswitch));
+ EXPECT_TRUE(
+ app_manager_impl_->IsAppInReconnectMode(kDeviceId, policy_app_id_switch));
+ EXPECT_FALSE(app_manager_impl_->IsAppInReconnectMode(
+ kDeviceId, policy_app_id_nonswitch));
}
TEST_F(ApplicationManagerImplTest,
OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) {
std::shared_ptr<MockApplication> switching_app_ptr =
std::make_shared<MockApplication>();
+ ON_CALL(*switching_app_ptr, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*switching_app_ptr, device()).WillByDefault(Return(kDeviceId));
plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
new plugin_manager::MockRPCPluginManager;
@@ -896,7 +905,7 @@ TEST_F(ApplicationManagerImplTest,
.WillRepeatedly(Return(policy_app_id_switch));
const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
- EXPECT_CALL(*switching_app_ptr, hmi_level())
+ EXPECT_CALL(*switching_app_ptr, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(hmi_level_switching_app));
std::shared_ptr<MockApplication> nonswitching_app_ptr =
@@ -913,8 +922,12 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*nonswitching_app_ptr, policy_app_id())
.WillRepeatedly(Return(policy_app_id_nonswitch));
+ ON_CALL(*nonswitching_app_ptr, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+
const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
- EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(hmi_level_nonswitching_app));
// Act
@@ -933,7 +946,8 @@ TEST_F(ApplicationManagerImplTest,
app_manager_impl_->OnDeviceSwitchingStart(switching_device,
non_switching_device);
- EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
+ EXPECT_TRUE(
+ app_manager_impl_->IsAppInReconnectMode(kDeviceId, policy_app_id_switch));
app_manager_impl_->OnDeviceSwitchingFinish(switching_device_id);
EXPECT_FALSE(
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index 5ebcdd29c7..22d111f926 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -50,6 +50,11 @@ using namespace mobile_apis;
typedef HmiState::StateID StateID;
namespace {
+
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+const std::string kDefaultWindowName = "DefaultName";
+
std::vector<StateID> GenerateCurrentStates() {
std::vector<StateID> states;
states.push_back(StateID::STATE_ID_PHONE_CALL);
@@ -87,8 +92,8 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
- EXPECT_EQ(state, app_state.GetState(current_id));
+ app_state.AddState(kDefaultWindowId, state);
+ EXPECT_EQ(state, app_state.GetState(kDefaultWindowId, current_id));
}
}
@@ -99,16 +104,16 @@ TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
- HmiStatePtr curr_state = app_state.GetState(current_id);
+ HmiStatePtr curr_state = app_state.GetState(kDefaultWindowId, current_id);
ASSERT_EQ(*new_state, curr_state->state_id());
}
new_state = added_states_.end() - 1;
while (new_state != added_states_.begin()) {
- app_state.RemoveState(*new_state);
- HmiStatePtr curr_state = app_state.GetState(current_id);
+ app_state.RemoveState(kDefaultWindowId, *new_state);
+ HmiStatePtr curr_state = app_state.GetState(kDefaultWindowId, current_id);
--new_state;
EXPECT_EQ(*new_state, curr_state->state_id());
}
@@ -122,19 +127,20 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
}
// Postponed state wasn't added
- HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
+ HmiStatePtr get_postponed_id =
+ app_state.GetState(kDefaultWindowId, postponed_id);
EXPECT_EQ(nullptr, get_postponed_id);
// Add posponed state
HmiStatePtr state = std::make_shared<HmiState>(
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Postponed state exists
- get_postponed_id = app_state.GetState(postponed_id);
+ get_postponed_id = app_state.GetState(kDefaultWindowId, postponed_id);
EXPECT_EQ(state, get_postponed_id);
}
@@ -146,7 +152,7 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
app_mngr_,
*new_state);
state->set_hmi_level(HMILevel::HMI_FULL);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
++new_state;
// Add some other
for (; new_state != added_states_.end(); ++new_state) {
@@ -154,13 +160,14 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
state->set_hmi_level(HMILevel::HMI_LIMITED);
}
// Regular state will be the first added state
new_state = added_states_.begin();
- HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ HmiStatePtr reg_state =
+ app_state.GetState(kDefaultWindowId, StateID::STATE_ID_REGULAR);
EXPECT_EQ(*new_state, reg_state->state_id());
EXPECT_EQ(HMILevel::HMI_FULL, reg_state->hmi_level());
}
@@ -171,7 +178,7 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
++new_state;
// Add postponed state
@@ -179,10 +186,10 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Make sure that the state was added
- HmiStatePtr post_state = app_state.GetState(postponed_id);
+ HmiStatePtr post_state = app_state.GetState(kDefaultWindowId, postponed_id);
ASSERT_EQ(state, post_state);
for (; new_state != added_states_.end(); ++new_state) {
@@ -190,19 +197,20 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
}
// Regular state will be the first added state
new_state = added_states_.begin();
- HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ HmiStatePtr reg_state =
+ app_state.GetState(kDefaultWindowId, StateID::STATE_ID_REGULAR);
ASSERT_EQ(*new_state, reg_state->state_id());
- app_state.RemoveState(*new_state);
+ app_state.RemoveState(kDefaultWindowId, *new_state);
++new_state;
// Now regular state is the next state except postponed
- reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ reg_state = app_state.GetState(kDefaultWindowId, StateID::STATE_ID_REGULAR);
EXPECT_EQ(*new_state, reg_state->state_id());
}
@@ -213,14 +221,14 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
first_state);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Add postponed state
state = std::make_shared<HmiState>(
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Add new postponed state
std::shared_ptr<MockApplication> mock_app_2(new MockApplication);
@@ -228,21 +236,22 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Add regular state
state = std::make_shared<HmiState>(
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
StateID::STATE_ID_REGULAR);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Postponed state is the first
- HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_POSTPONED);
+ HmiStatePtr reg_state =
+ app_state.GetState(kDefaultWindowId, StateID::STATE_ID_POSTPONED);
ASSERT_EQ(postponed_id, reg_state->state_id());
// Regular state is the second one
- reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ reg_state = app_state.GetState(kDefaultWindowId, StateID::STATE_ID_REGULAR);
EXPECT_EQ(StateID::STATE_ID_REGULAR, reg_state->state_id());
}
@@ -253,12 +262,14 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) {
app_mngr_,
init_state);
- app_state.InitState(state);
+ app_state.InitState(kDefaultWindowId, kDefaultWindowName, state);
- HmiStatePtr reg_state = app_state.GetState(StateID::STATE_ID_REGULAR);
+ HmiStatePtr reg_state =
+ app_state.GetState(kDefaultWindowId, StateID::STATE_ID_REGULAR);
EXPECT_EQ(state, reg_state);
- HmiStatePtr curr_state = app_state.GetState(StateID::STATE_ID_CURRENT);
+ HmiStatePtr curr_state =
+ app_state.GetState(kDefaultWindowId, StateID::STATE_ID_CURRENT);
EXPECT_EQ(state, curr_state);
}
@@ -271,23 +282,24 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
init_state);
state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
- app_state.InitState(state);
+ app_state.InitState(kDefaultWindowId, kDefaultWindowName, state);
// Add postponed state
state = std::make_shared<HmiState>(
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
- app_state.AddState(state);
+ app_state.AddState(kDefaultWindowId, state);
// Make sure that state was added
- HmiStatePtr get_postponed_state = app_state.GetState(postponed_id);
+ HmiStatePtr get_postponed_state =
+ app_state.GetState(kDefaultWindowId, postponed_id);
ASSERT_EQ(state, get_postponed_state);
// Remove postponed state
- app_state.RemoveState(postponed_id);
+ app_state.RemoveState(kDefaultWindowId, postponed_id);
- get_postponed_state = app_state.GetState(postponed_id);
+ get_postponed_state = app_state.GetState(kDefaultWindowId, postponed_id);
EXPECT_EQ(nullptr, get_postponed_state);
}
@@ -298,13 +310,13 @@ TEST_F(ApplicationStateTest,
static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
reg_state);
- app_state.InitState(state);
+ app_state.InitState(kDefaultWindowId, kDefaultWindowName, state);
// Try deleting regular state
- app_state.RemoveState(reg_state);
+ app_state.RemoveState(kDefaultWindowId, reg_state);
// Get regular state
- HmiStatePtr get_reg_state = app_state.GetState(reg_state);
+ HmiStatePtr get_reg_state = app_state.GetState(kDefaultWindowId, reg_state);
EXPECT_EQ(state, get_reg_state);
}
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index 556f3a5032..ec7f454c47 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -58,7 +58,7 @@ set(LIBRARIES
connectionHandler
ApplicationManager
jsoncpp
- Policy
+ PolicyStatic
Resumption
)
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index cf26c19249..27e21efd8d 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -154,6 +154,13 @@ class CommandRequestImplTest
typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
typedef std::shared_ptr<UCommandRequestImpl> CommandPtr;
+TEST_F(CommandRequestImplTest, WindowID_ExpectDefaultWindowID) {
+ auto msg = CreateMessage();
+ const auto command = CreateCommand<UCommandRequestImpl>(msg);
+ EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ command->window_id());
+}
+
TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>();
@@ -366,6 +373,12 @@ TEST_F(CommandRequestImplTest,
TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, GetWindowIds())
+ .WillByDefault(Return(
+ am::WindowIds(1, mobile_apis::PredefinedWindows::DEFAULT_WINDOW)));
+ ON_CALL(*mock_app,
+ WindowIdExists(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
+ .WillByDefault(Return(true));
MessageSharedPtr message = CreateMessage();
(*message)[strings::msg_params] =
@@ -373,7 +386,7 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
.WillOnce(Return(kMobResultSuccess));
EXPECT_TRUE(command->CheckPermissions());
@@ -383,6 +396,12 @@ TEST_F(CommandRequestImplTest,
CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) {
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, GetWindowIds())
+ .WillByDefault(Return(
+ am::WindowIds(1, mobile_apis::PredefinedWindows::DEFAULT_WINDOW)));
+ ON_CALL(*mock_app,
+ WindowIdExists(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
+ .WillByDefault(Return(true));
MessageSharedPtr message = CreateMessage();
(*message)[strings::msg_params] =
@@ -394,7 +413,7 @@ TEST_F(CommandRequestImplTest,
.Times(1)
.WillRepeatedly(Return(kConnectionKey));
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
.WillOnce(Return(mobile_apis::Result::INVALID_ENUM));
EXPECT_CALL(mock_message_helper_, CreateBlockedByPoliciesResponse(_, _, _, _))
@@ -405,7 +424,7 @@ TEST_F(CommandRequestImplTest,
}
ACTION_P(GetArg3, output) {
- *output = arg2;
+ *output = arg3;
}
TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
@@ -417,9 +436,14 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
MockAppPtr app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, GetWindowIds())
+ .WillByDefault(Return(
+ am::WindowIds(1, mobile_apis::PredefinedWindows::DEFAULT_WINDOW)));
+ ON_CALL(*app, WindowIdExists(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
+ .WillByDefault(Return(true));
RPCParams params;
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
.WillOnce(DoAll(GetArg3(&params), Return(kMobResultSuccess)));
EXPECT_TRUE(command->CheckPermissions());
diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc
index dc6635b049..502c1bdbbf 100644
--- a/src/components/application_manager/test/help_prompt_manager_test.cc
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -65,6 +65,9 @@ const std::string kDirectoryName = "./test_storage";
const uint8_t expected_tread_pool_size = 2u;
const uint8_t stop_streaming_timeout = 1u;
const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+const std::string kDefaultWindowName = "DefaultName";
} // namespace
using namespace application_manager;
@@ -244,7 +247,8 @@ void HelpPromptManagerTest::CreateApplication(
app_mngr_,
mock_help_prompt_manager));
HmiStatePtr initial_state = CreateTestHmiState();
- app_impl_->SetInitialState(initial_state);
+ app_impl_->SetInitialState(
+ kDefaultWindowId, kDefaultWindowName, initial_state);
}
TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) {
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index ca67d81d8c..afa5fa6056 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -355,11 +355,11 @@
"STATIC"
]
},
- "audioPassThruCapabilities": {
+ "audioPassThruCapabilities": [{
"samplingRate": "44KHZ",
"bitsPerSample": "RATE_8_BIT",
"audioType": "PCM"
- },
+ }],
"pcmStreamCapabilities": {
"samplingRate": "16KHZ",
"bitsPerSample": "RATE_16_BIT",
diff --git a/src/components/application_manager/test/hmi_capabilities_old_apt.json b/src/components/application_manager/test/hmi_capabilities_old_apt.json
new file mode 100644
index 0000000000..5a5af37e2f
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_old_apt.json
@@ -0,0 +1,9 @@
+{
+ "UI": {
+ "audioPassThruCapabilities": {
+ "samplingRate": "22KHZ",
+ "bitsPerSample": "RATE_16_BIT",
+ "audioType": "PCM"
+ }
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index e883e7bddb..3d47c717e1 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -336,15 +336,18 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Check audio pass thru
const smart_objects::SmartObject audio_pass_thru_capabilities_so =
*(hmi_capabilities_test->audio_pass_thru_capabilities());
+ EXPECT_EQ(smart_objects::SmartType_Array,
+ audio_pass_thru_capabilities_so.getType());
+ EXPECT_EQ(1u, audio_pass_thru_capabilities_so.length());
EXPECT_EQ(hmi_apis::Common_SamplingRate::RATE_44KHZ,
static_cast<hmi_apis::Common_SamplingRate::eType>(
- audio_pass_thru_capabilities_so["samplingRate"].asInt()));
+ audio_pass_thru_capabilities_so[0]["samplingRate"].asInt()));
EXPECT_EQ(hmi_apis::Common_BitsPerSample::RATE_8_BIT,
static_cast<hmi_apis::Common_BitsPerSample::eType>(
- audio_pass_thru_capabilities_so["bitsPerSample"].asInt()));
+ audio_pass_thru_capabilities_so[0]["bitsPerSample"].asInt()));
EXPECT_EQ(hmi_apis::Common_AudioType::PCM,
static_cast<hmi_apis::Common_AudioType::eType>(
- audio_pass_thru_capabilities_so["audioType"].asInt()));
+ audio_pass_thru_capabilities_so[0]["audioType"].asInt()));
// Check hmi zone capabilities
const smart_objects::SmartObject hmi_zone_capabilities_so =
@@ -569,6 +572,57 @@ TEST_F(HMICapabilitiesTest,
EXPECT_FALSE(navigation_capability_so["getWayPointsEnabled"].asBool());
}
+TEST_F(HMICapabilitiesTest,
+ LoadCapabilitiesFromFileAndVerifyOldAudioPassThruCapabilities) {
+ MockApplicationManager mock_app_mngr;
+ event_engine_test::MockEventDispatcher mock_dispatcher;
+ MockApplicationManagerSettings mock_application_manager_settings;
+
+ const std::string hmi_capabilities_file = "hmi_capabilities_old_apt.json";
+
+ EXPECT_CALL(mock_app_mngr, event_dispatcher())
+ .WillOnce(ReturnRef(mock_dispatcher));
+ EXPECT_CALL(mock_app_mngr, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings));
+ EXPECT_CALL(mock_application_manager_settings, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(mock_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings, launch_hmi())
+ .WillOnce(Return(false));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CommonLanguageFromString(_))
+ .WillRepeatedly(Invoke(TestCommonLanguageFromString));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
+ hmi_capabilities->Init(&last_state_);
+
+ // with old audio pass thru format, the object is an array containing a single
+ // object
+ smart_objects::SmartObject audio_pass_thru_capabilities_so =
+ *(hmi_capabilities->audio_pass_thru_capabilities());
+ EXPECT_EQ(smart_objects::SmartType_Array,
+ audio_pass_thru_capabilities_so.getType());
+ EXPECT_EQ(1u, audio_pass_thru_capabilities_so.length());
+ EXPECT_TRUE(audio_pass_thru_capabilities_so[0].keyExists("samplingRate"));
+ EXPECT_EQ(hmi_apis::Common_SamplingRate::RATE_22KHZ,
+ static_cast<hmi_apis::Common_SamplingRate::eType>(
+ audio_pass_thru_capabilities_so[0]["samplingRate"].asInt()));
+ EXPECT_TRUE(audio_pass_thru_capabilities_so[0].keyExists("bitsPerSample"));
+ EXPECT_EQ(hmi_apis::Common_BitsPerSample::RATE_16_BIT,
+ static_cast<hmi_apis::Common_BitsPerSample::eType>(
+ audio_pass_thru_capabilities_so[0]["bitsPerSample"].asInt()));
+ EXPECT_TRUE(audio_pass_thru_capabilities_so[0].keyExists("audioType"));
+ EXPECT_EQ(hmi_apis::Common_AudioType::PCM,
+ static_cast<hmi_apis::Common_AudioType::eType>(
+ audio_pass_thru_capabilities_so[0]["audioType"].asInt()));
+}
+
TEST_F(HMICapabilitiesTest, VerifyImageType) {
const int32_t image_type = 1;
smart_objects::SmartObject sm_obj;
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 74d09661c7..29e1c1cf9f 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -34,6 +34,8 @@
#include <string>
#include "application_manager/app_extension.h"
#include "application_manager/application.h"
+#include "application_manager/display_capabilities_builder.h"
+#include "application_manager/hmi_state.h"
#include "application_manager/usage_statistics.h"
#include "gmock/gmock.h"
#include "smart_objects/smart_object.h"
@@ -56,6 +58,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(is_application_data_changed, bool());
MOCK_METHOD1(set_is_application_data_changed,
void(bool state_application_data));
+ MOCK_CONST_METHOD0(is_app_data_resumption_allowed, bool());
+ MOCK_METHOD1(set_app_data_resumption_allowance, void(bool allowed));
MOCK_METHOD0(CloseActiveMessage, void());
MOCK_CONST_METHOD0(IsFullscreen, bool());
MOCK_METHOD0(ChangeSupportingAppHMIType, void());
@@ -97,11 +101,15 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
MOCK_CONST_METHOD0(folder_name, const std::string());
MOCK_CONST_METHOD0(is_media_application, bool());
- MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType());
+ MOCK_CONST_METHOD1(hmi_level,
+ const mobile_apis::HMILevel::eType(
+ const application_manager::WindowID window_id));
MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
+ MOCK_CONST_METHOD1(system_context,
+ const mobile_apis::SystemContext::eType(
+ const application_manager::WindowID window_id));
MOCK_CONST_METHOD0(audio_streaming_state,
const mobile_apis::AudioStreamingState::eType());
MOCK_CONST_METHOD0(video_streaming_state,
@@ -109,11 +117,20 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(app_icon_path, const std::string&());
MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
MOCK_CONST_METHOD0(secondary_device, connection_handler::DeviceHandle());
- MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD1(CurrentHmiState,
+ const application_manager::HmiStatePtr(
+ const application_manager::WindowID window_id));
+ MOCK_CONST_METHOD1(RegularHmiState,
+ const application_manager::HmiStatePtr(
+ const application_manager::WindowID window_id));
+ MOCK_CONST_METHOD0(GetWindowIds, application_manager::WindowIds());
+ MOCK_CONST_METHOD0(GetWindowNames, application_manager::WindowNames());
+ MOCK_CONST_METHOD1(WindowIdExists,
+ bool(const application_manager::WindowID window_id));
MOCK_CONST_METHOD0(IsAllowedToChangeAudioSource, bool());
- MOCK_CONST_METHOD0(PostponedHmiState,
- const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD1(PostponedHmiState,
+ const application_manager::HmiStatePtr(
+ const application_manager::WindowID window_id));
MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
MOCK_METHOD0(tts_properties_in_none, bool());
MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
@@ -167,14 +184,24 @@ class MockApplication : public ::application_manager::Application {
::application_manager::HelpPromptManager&());
MOCK_CONST_METHOD0(help_prompt_manager,
const ::application_manager::HelpPromptManager&());
- MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(SetPostponedState,
- void(::application_manager::HmiStatePtr state));
- MOCK_METHOD0(RemovePostponedState, void());
- MOCK_METHOD1(AddHMIState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(RemoveHMIState,
- void(::application_manager::HmiState::StateID state_id));
+ MOCK_METHOD3(SetInitialState,
+ void(const application_manager::WindowID window_id,
+ const std::string& window_name,
+ application_manager::HmiStatePtr state));
+ MOCK_METHOD2(SetRegularState,
+ void(const application_manager::WindowID window_id,
+ application_manager::HmiStatePtr state));
+ MOCK_METHOD2(SetPostponedState,
+ void(const application_manager::WindowID window_id,
+ ::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(RemovePostponedState,
+ void(const application_manager::WindowID window_id));
+ MOCK_METHOD2(AddHMIState,
+ void(const application_manager::WindowID window_id,
+ application_manager::HmiStatePtr state));
+ MOCK_METHOD2(RemoveHMIState,
+ void(const application_manager::WindowID window_id,
+ ::application_manager::HmiState::StateID state_id));
MOCK_METHOD2(SubscribeToSoftButtons,
void(int32_t cmd_id,
const ::application_manager::SoftButtonID& softbuttons_id));
@@ -220,9 +247,35 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(day_color_scheme, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(night_color_scheme, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(display_layout, const std::string&());
+ MOCK_CONST_METHOD0(day_color_scheme, smart_objects::SmartObject());
+ MOCK_CONST_METHOD0(night_color_scheme, smart_objects::SmartObject());
+ MOCK_CONST_METHOD0(display_layout, std::string());
+ MOCK_CONST_METHOD0(display_capabilities, smart_objects::SmartObjectSPtr());
+ MOCK_CONST_METHOD1(display_capabilities,
+ smart_objects::SmartObjectSPtr(
+ const application_manager::WindowID window_id));
+
+ MOCK_METHOD2(set_window_layout,
+ void(const application_manager::WindowID window_id,
+ const std::string& layout));
+ MOCK_METHOD2(set_day_color_scheme,
+ void(const application_manager::WindowID window_id,
+ const smart_objects::SmartObject& color_scheme));
+ MOCK_METHOD2(set_night_color_scheme,
+ void(const application_manager::WindowID window_id,
+ const smart_objects::SmartObject& color_scheme));
+ MOCK_CONST_METHOD1(
+ window_layout,
+ std::string(const application_manager::WindowID window_id));
+ MOCK_CONST_METHOD1(day_color_scheme,
+ smart_objects::SmartObject(
+ const application_manager::WindowID window_id));
+ MOCK_CONST_METHOD1(night_color_scheme,
+ smart_objects::SmartObject(
+ const application_manager::WindowID window_id));
+ MOCK_METHOD1(set_display_capabilities,
+ void(const smart_objects::SmartObject& display_capabilities));
+
MOCK_METHOD1(load_global_properties,
void(const smart_objects::SmartObject& so));
MOCK_METHOD1(set_help_prompt,
@@ -316,9 +369,10 @@ class MockApplication : public ::application_manager::Application {
SwapMobileMessageQueue,
void(::application_manager::MobileMessageQueue& mobile_messages));
- MOCK_METHOD1(
+ MOCK_METHOD2(
set_system_context,
- void(const application_manager::mobile_api::SystemContext::eType&));
+ void(const application_manager::WindowID window_id,
+ const application_manager::mobile_api::SystemContext::eType&));
MOCK_METHOD1(
set_audio_streaming_state,
void(const application_manager::mobile_api::AudioStreamingState::eType&
@@ -329,9 +383,10 @@ class MockApplication : public ::application_manager::Application {
bool(smart_objects::SmartObject module));
MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
bool(smart_objects::SmartObject module));
- MOCK_METHOD1(
+ MOCK_METHOD2(
set_hmi_level,
- void(const application_manager::mobile_api::HMILevel::eType& hmi_level));
+ void(const application_manager::WindowID window_id,
+ const application_manager::mobile_api::HMILevel::eType& hmi_level));
MOCK_METHOD1(QueryInterface,
application_manager::AppExtensionPtr(
application_manager::AppExtensionUID uid));
@@ -357,6 +412,19 @@ class MockApplication : public ::application_manager::Application {
void(const mobile_apis::HybridAppPreference::eType&
hybrid_app_preference));
MOCK_METHOD1(set_cloud_app_certificate, void(const std::string& certificate));
+ MOCK_METHOD2(SetWindowInfo,
+ void(const ::application_manager::WindowID windowID,
+ const smart_objects::SmartObject& window_info));
+ MOCK_METHOD1(RemoveWindowInfo,
+ void((const ::application_manager::WindowID window_id)));
+ MOCK_CONST_METHOD0(window_optional_params_map,
+ DataAccessor< ::application_manager::WindowParamsMap>());
+ MOCK_METHOD0(display_capabilities_builder,
+ application_manager::DisplayCapabilitiesBuilder&());
+ MOCK_METHOD1(GetSoftButtonWindowID,
+ application_manager::WindowID(const uint32_t button_id));
+ MOCK_METHOD1(remove_window_capability,
+ void(const application_manager::WindowID window_id));
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
index 468bdbe5eb..6ca987c1b2 100644
--- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
@@ -103,6 +103,11 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_METHOD1(set_display_capabilities,
void(const smart_objects::SmartObject& display_capabilities));
+ MOCK_CONST_METHOD0(system_display_capabilities,
+ const smart_objects::SmartObjectSPtr());
+ MOCK_METHOD1(set_system_display_capabilities,
+ void(const smart_objects::SmartObject& display_capabilities));
+
MOCK_CONST_METHOD0(hmi_zone_capabilities,
const smart_objects::SmartObject*());
MOCK_METHOD1(set_hmi_zone_capabilities,
@@ -163,6 +168,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(rc_supported, bool());
MOCK_METHOD1(set_rc_supported, void(const bool supported));
+ MOCK_CONST_METHOD1(menu_layout_supported,
+ bool(mobile_apis::MenuLayout::eType layout));
+
MOCK_CONST_METHOD0(navigation_capability,
const smart_objects::SmartObject*());
MOCK_METHOD1(set_navigation_capability,
@@ -198,6 +206,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD2(convert_json_languages_to_obj,
void(const Json::Value& json_languages,
smart_objects::SmartObject& languages));
+ MOCK_CONST_METHOD2(convert_audio_capability_to_obj,
+ void(const Json::Value& capability,
+ smart_objects::SmartObject& output_so));
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index ec13137abe..6cbe46f9ec 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
+#include "application_manager/hmi_capabilities.h"
#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "gmock/gmock.h"
@@ -128,8 +129,9 @@ class MockMessageHelper {
MOCK_METHOD2(CreateMessageForHMI,
smart_objects::SmartObjectSPtr(hmi_apis::messageType::eType,
const uint32_t));
- MOCK_METHOD2(SendHMIStatusNotification,
- void(const Application& application_impl,
+ MOCK_METHOD3(SendHMIStatusNotification,
+ void(ApplicationSharedPtr application,
+ const WindowID window_id,
ApplicationManager& application_manager));
MOCK_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
@@ -168,6 +170,8 @@ class MockMessageHelper {
hmi_apis::Common_LightName::eType(const std::string& lightName));
MOCK_METHOD1(CommonLanguageToString,
std::string(hmi_apis::Common_Language::eType));
+ MOCK_METHOD1(MobileLanguageToString,
+ std::string(mobile_apis::Language::eType));
MOCK_METHOD2(CreateModuleInfoSO,
smart_objects::SmartObjectSPtr(uint32_t function_id,
ApplicationManager& app_mngr));
@@ -201,14 +205,16 @@ class MockMessageHelper {
MessageHelper::ChoiceSetVRCommandsStatus(
const smart_objects::SmartObject&));
- MOCK_METHOD6(GetBCActivateAppRequestToHMI,
+ MOCK_METHOD5(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr));
+ MOCK_METHOD2(GetBCCloseApplicationRequestToHMI,
+ smart_objects::SmartObjectSPtr(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
@@ -219,6 +225,11 @@ class MockMessageHelper {
ApplicationConstSharedPtr app,
const policy::PolicyHandlerInterface& policy_handler,
ApplicationManager& app_mngr));
+ MOCK_METHOD4(SubscribeApplicationToSoftButton,
+ void(smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id,
+ const application_manager::WindowID window_id));
MOCK_METHOD3(SubscribeApplicationToSoftButton,
void(smart_objects::SmartObject& message_params,
ApplicationSharedPtr app,
@@ -278,6 +289,10 @@ class MockMessageHelper {
MOCK_METHOD1(PrintSmartObject,
bool(const smart_objects::SmartObject& object));
+
+ MOCK_METHOD1(ExtractWindowIdFromSmartObject,
+ WindowID(const smart_objects::SmartObject& s_map));
+
MOCK_METHOD3(SendTTSGlobalProperties,
void(ApplicationSharedPtr app,
const bool default_help_prompt,
@@ -316,6 +331,15 @@ class MockMessageHelper {
MOCK_METHOD2(BroadcastCapabilityUpdate,
void(smart_objects::SmartObject& msg_params,
ApplicationManager& app_mngr));
+ MOCK_METHOD3(CreateUICreateWindowRequestsToHMI,
+ smart_objects::SmartObjectList(
+ ApplicationSharedPtr application,
+ ApplicationManager& app_manager,
+ const smart_objects::SmartObject& windows_info));
+ MOCK_METHOD2(
+ CreateDisplayCapabilityUpdateToMobile,
+ smart_objects::SmartObjectSPtr(const smart_objects::SmartObject&,
+ application_manager::Application&));
static MockMessageHelper* message_helper_mock();
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_request.h b/src/components/application_manager/test/include/application_manager/mock_request.h
index dfc6691ef4..77b5bb7c38 100644
--- a/src/components/application_manager/test/include/application_manager/mock_request.h
+++ b/src/components/application_manager/test/include/application_manager/mock_request.h
@@ -55,6 +55,7 @@ class MockRequest : public application_manager::commands::Command {
MOCK_METHOD0(CleanUp, bool());
MOCK_CONST_METHOD0(default_timeout, uint32_t());
MOCK_CONST_METHOD0(function_id, int32_t());
+ MOCK_CONST_METHOD0(window_id, application_manager::WindowID());
MOCK_METHOD0(onTimeOut, void());
MOCK_METHOD0(AllowedToTerminate, bool());
MOCK_METHOD1(SetAllowedToTerminate, void(bool is_allowed));
diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
index 4fd3b7fc5a..56c2ae3cd4 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
@@ -94,13 +94,23 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD1(SetupDefaultHMILevel,
bool(application_manager::ApplicationSharedPtr application));
MOCK_METHOD1(StartAppHmiStateResumption,
- void(application_manager::ApplicationSharedPtr application));
+ bool(application_manager::ApplicationSharedPtr application));
MOCK_METHOD3(SetAppHMIState,
bool(application_manager::ApplicationSharedPtr application,
const mobile_apis::HMILevel::eType hmi_level,
bool check_policy));
MOCK_CONST_METHOD0(LaunchTime, time_t());
+ MOCK_METHOD2(RestoreAppWidgets,
+ void(app_mngr::ApplicationSharedPtr application,
+ const smart_objects::SmartObject& saved_app));
+
+ MOCK_METHOD1(RestoreWidgetsHMIState,
+ void(const smart_objects::SmartObject& response_message));
+
+ MOCK_METHOD1(StartWaitingForDisplayCapabilitiesUpdate,
+ void(application_manager::ApplicationSharedPtr application));
+
#ifdef BUILD_TESTS
MOCK_METHOD1(set_resumption_storage,
void(std::shared_ptr<resumption::ResumptionData> mock_storage));
diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index cab3c23253..e313427547 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -74,7 +74,9 @@ class ResumptionDataTest : public ::testing::Test {
, comlock_ptr_(std::make_shared<sync_primitives::Lock>())
, setlock_ptr_(std::make_shared<sync_primitives::Lock>())
, btnlock_ptr_(std::make_shared<sync_primitives::Lock>())
- , ivilock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+ , ivilock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , window_params_map_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {
+ }
// Check structure in saved application
void CheckSavedApp(sm::SmartObject& saved_data);
// Set data for resumption
@@ -114,6 +116,9 @@ class ResumptionDataTest : public ::testing::Test {
void SetHelpAndTimeoutPrompt();
void SetVRHelpTitle();
void SetSubscriptions();
+ void SetWindowsInfo();
+ void SetDefaultCurrentHmiState();
+ void SetDefaultWindowIds();
void CheckCommands(sm::SmartObject& res_list);
void CheckGlobalProporties(sm::SmartObject& res_list);
@@ -129,6 +134,7 @@ class ResumptionDataTest : public ::testing::Test {
ns_smart_device_link::ns_smart_objects::SmartObject& res_list);
void CheckVRTitle(sm::SmartObject& res_list);
void CheckSubscriptions(sm::SmartObject& res_list);
+ void CheckWindowsInfo(sm::SmartObject& res_list);
const size_t kCountOfCommands_;
const size_t kCountOfChoice_;
@@ -145,11 +151,14 @@ class ResumptionDataTest : public ::testing::Test {
am::ButtonSubscriptions btn_subscr;
+ am::WindowParamsMap test_window_params_map_;
+
std::shared_ptr<sync_primitives::Lock> sublock_ptr_;
std::shared_ptr<sync_primitives::Lock> comlock_ptr_;
std::shared_ptr<sync_primitives::Lock> setlock_ptr_;
std::shared_ptr<sync_primitives::Lock> btnlock_ptr_;
std::shared_ptr<sync_primitives::Lock> ivilock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> window_params_map_lock_ptr_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_application_manager_;
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index 99031849f6..31b175cbf0 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -40,7 +40,7 @@ set(LIBRARIES
ApplicationManager
MessageHelper
jsoncpp
- Policy
+ PolicyStatic
connectionHandler
MediaManager
Resumption
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index d0fbe696cd..a174d74d5d 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -1084,6 +1084,27 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
EXPECT_EQ(480, msg_params[strings::config][strings::height].asInt());
}
+TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_SUCCESS) {
+ const WindowID window_id = 145;
+ smart_objects::SmartObject message(smart_objects::SmartType_Map);
+ message[strings::msg_params][strings::window_id] = window_id;
+ EXPECT_EQ(window_id,
+ MessageHelper::ExtractWindowIdFromSmartObject(
+ message[strings::msg_params]));
+}
+
+TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_FromEmptyMessage) {
+ smart_objects::SmartObject message(smart_objects::SmartType_Map);
+ EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ MessageHelper::ExtractWindowIdFromSmartObject(message));
+}
+
+TEST_F(MessageHelperTest, ExtractWindowIdFromSmartObject_FromWrongType) {
+ smart_objects::SmartObject message(smart_objects::SmartType_Array);
+ EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ MessageHelper::ExtractWindowIdFromSmartObject(message));
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 0629619397..cccadc5a9d 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -258,10 +258,11 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
}
void MessageHelper::SendHMIStatusNotification(
- const Application& application_impl,
+ ApplicationSharedPtr application,
+ const WindowID window_id,
ApplicationManager& application_manager) {
MockMessageHelper::message_helper_mock()->SendHMIStatusNotification(
- application_impl, application_manager);
+ application, window_id, application_manager);
}
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
@@ -366,20 +367,25 @@ std::string MessageHelper::CommonLanguageToString(
return MockMessageHelper::message_helper_mock()->CommonLanguageToString(lang);
}
+std::string MessageHelper::MobileLanguageToString(
+ mobile_apis::Language::eType lang) {
+ return MockMessageHelper::message_helper_mock()->MobileLanguageToString(lang);
+}
+
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->GetBCActivateAppRequestToHMI(
- app,
- session_observer,
- policy_handler,
- level,
- send_policy_priority,
- app_mngr);
+ app, policy_handler, level, send_policy_priority, app_mngr);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->GetBCCloseApplicationRequestToHMI(app, app_mngr);
}
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
@@ -403,6 +409,16 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
void MessageHelper::SubscribeApplicationToSoftButton(
smart_objects::SmartObject& message_params,
ApplicationSharedPtr app,
+ int32_t function_id,
+ const WindowID window_id) {
+ return MockMessageHelper::message_helper_mock()
+ ->SubscribeApplicationToSoftButton(
+ message_params, app, function_id, window_id);
+}
+
+void MessageHelper::SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
int32_t function_id) {
return MockMessageHelper::message_helper_mock()
->SubscribeApplicationToSoftButton(message_params, app, function_id);
@@ -523,6 +539,12 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
return MockMessageHelper::message_helper_mock()->PrintSmartObject(object);
}
+WindowID MessageHelper::ExtractWindowIdFromSmartObject(
+ const smart_objects::SmartObject& s_map) {
+ return MockMessageHelper::message_helper_mock()
+ ->ExtractWindowIdFromSmartObject(s_map);
+}
+
void MessageHelper::SendSetAppIcon(const uint32_t app_id,
const std::string& icon_path,
ApplicationManager& application_manager) {
@@ -589,4 +611,19 @@ void MessageHelper::BroadcastCapabilityUpdate(
MockMessageHelper::message_helper_mock()->BroadcastCapabilityUpdate(
msg_params, app_mngr);
}
+
+smart_objects::SmartObjectList MessageHelper::CreateUICreateWindowRequestsToHMI(
+ application_manager::ApplicationSharedPtr application,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& windows_info) {
+ return MockMessageHelper::message_helper_mock()
+ ->CreateUICreateWindowRequestsToHMI(application, app_mngr, windows_info);
+}
+
+smart_objects::SmartObjectSPtr
+MessageHelper::CreateDisplayCapabilityUpdateToMobile(
+ const smart_objects::SmartObject& system_capabilities, Application& app) {
+ return MockMessageHelper::message_helper_mock()
+ ->CreateDisplayCapabilityUpdateToMobile(system_capabilities, app);
+}
} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 458b065cdd..6af4c4f018 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -91,6 +91,8 @@ using ::testing::SetArgReferee;
typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
const std::string kDummyData = "some_data";
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
class PolicyHandlerTest : public ::testing::Test {
public:
@@ -233,10 +235,10 @@ class PolicyHandlerTest : public ::testing::Test {
void TestOnPermissionsUpdated(const std::string& default_hmi_level,
const mobile_apis::HMILevel::eType hmi_level) {
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(default_hmi_level))
@@ -247,7 +249,7 @@ class PolicyHandlerTest : public ::testing::Test {
Permissions permissions;
policy_handler_.OnPermissionsUpdated(
- kPolicyAppId_, permissions, default_hmi_level);
+ kDeviceId, kPolicyAppId_, permissions, default_hmi_level);
}
void CreateFunctionalGroupPermission(
@@ -494,31 +496,31 @@ TEST_F(PolicyHandlerTest, UnloadPolicyLibrary_method_ExpectLibraryUnloaded) {
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) {
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
EXPECT_CALL(mock_message_helper_,
SendOnPermissionsChangeNotification(kAppId1_, _, _));
// Act
Permissions perms;
- policy_handler_.OnPermissionsUpdated(kPolicyAppId_, perms);
+ policy_handler_.OnPermissionsUpdated(kDeviceId, kPolicyAppId_, perms);
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
std::shared_ptr<application_manager_test::MockApplication> invalid_app;
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_,
SendOnPermissionsChangeNotification(_, _, _))
.Times(0);
Permissions permissions;
- policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions);
+ policy_handler_.OnPermissionsUpdated(kDeviceId, kPolicyAppId_, permissions);
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
std::shared_ptr<application_manager_test::MockApplication> invalid_app;
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.WillOnce(Return(mock_app_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
@@ -526,7 +528,8 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
SendOnPermissionsChangeNotification(kAppId1_, _, _));
Permissions permissions;
- policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions, "HMI_FULL");
+ policy_handler_.OnPermissionsUpdated(
+ kDeviceId, kPolicyAppId_, permissions, "HMI_FULL");
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_HmiLevelInvalidEnum_UNSUCCESS) {
@@ -544,25 +547,26 @@ TEST_F(PolicyHandlerTest,
const std::string new_kHmiLevel_string = "HMI_FULL";
mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(mock_message_helper_,
SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
- EXPECT_CALL(mock_state_controller, SetRegularState(_, new_hmi_level, true));
+ EXPECT_CALL(mock_state_controller,
+ SetRegularState(_, kDefaultWindowId, new_hmi_level, true));
// Act
Permissions perms;
policy_handler_.OnPermissionsUpdated(
- kPolicyAppId_, perms, new_kHmiLevel_string);
+ kDeviceId, kPolicyAppId_, perms, new_kHmiLevel_string);
}
TEST_F(PolicyHandlerTest,
@@ -572,25 +576,26 @@ TEST_F(PolicyHandlerTest,
mobile_apis::HMILevel::eType new_hmi_level =
mobile_apis::HMILevel::HMI_LIMITED;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(mock_message_helper_,
SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
- EXPECT_CALL(mock_state_controller, SetRegularState(_, new_hmi_level, false));
+ EXPECT_CALL(mock_state_controller,
+ SetRegularState(_, kDefaultWindowId, new_hmi_level, false));
// Act
Permissions perms;
policy_handler_.OnPermissionsUpdated(
- kPolicyAppId_, perms, new_kHmiLevel_string);
+ kDeviceId, kPolicyAppId_, perms, new_kHmiLevel_string);
}
TEST_F(PolicyHandlerTest,
@@ -599,14 +604,14 @@ TEST_F(PolicyHandlerTest,
std::string new_kHmiLevel_string = "HMI_FULL";
mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId, kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
EXPECT_CALL(mock_message_helper_,
SendOnPermissionsChangeNotification(kAppId1_, _, _));
@@ -615,7 +620,7 @@ TEST_F(PolicyHandlerTest,
// Act
Permissions perms;
policy_handler_.OnPermissionsUpdated(
- kPolicyAppId_, perms, new_kHmiLevel_string);
+ kDeviceId, kPolicyAppId_, perms, new_kHmiLevel_string);
}
TEST_F(PolicyHandlerTest, GetPriority) {
@@ -636,25 +641,20 @@ TEST_F(PolicyHandlerTest, CheckPermissions) {
const uint32_t device = 3;
const mobile_apis::HMILevel::eType hmi_level =
mobile_apis::HMILevel::HMI_NONE;
- EXPECT_CALL(*mock_app_, hmi_level()).WillOnce(Return(hmi_level));
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
+ .WillOnce(Return(hmi_level));
EXPECT_CALL(*mock_app_, device()).WillOnce(Return(device));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
-#ifdef EXTERNAL_PROPRIETARY_MODE
- EXPECT_CALL(
- *mock_policy_manager_,
- CheckPermissions(kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, _));
-
-#else // EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(*mock_policy_manager_,
CheckPermissions(
kDeviceId, kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, _));
-#endif // EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(mock_message_helper_, StringifiedHMILevel(hmi_level))
.WillOnce(Return(kHmiLevel_));
EXPECT_CALL(mock_message_helper_, GetDeviceMacAddressForHandle(device, _))
.WillOnce(Return(kDeviceId));
// Act
- policy_handler_.CheckPermissions(mock_app_, kRpc_, kRpc_params, result);
+ policy_handler_.CheckPermissions(
+ mock_app_, kDefaultWindowId, kRpc_, kRpc_params, result);
}
TEST_F(PolicyHandlerTest, GetNotificationsNumber) {
@@ -681,9 +681,9 @@ TEST_F(PolicyHandlerTest, GetDefaultHmi) {
EnablePolicyAndPolicyManagerMock();
// Check expectations
EXPECT_CALL(*mock_policy_manager_,
- GetDefaultHmi(kPolicyAppId_, &default_hmi_));
+ GetDefaultHmi(kDeviceId_, kPolicyAppId_, &default_hmi_));
// Act
- policy_handler_.GetDefaultHmi(kPolicyAppId_, &default_hmi_);
+ policy_handler_.GetDefaultHmi(kDeviceId_, kPolicyAppId_, &default_hmi_);
}
TEST_F(PolicyHandlerTest, GetInitialAppData) {
@@ -882,12 +882,14 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
#endif // EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(*application1, policy_app_id()).WillOnce(Return(kPolicyAppId_));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kMacAddr_, kPolicyAppId_))
.WillOnce(Return(permissions));
ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _));
ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*application1, mac_address()).WillByDefault(ReturnRef(kMacAddr_));
// Act
policy_handler_.OnActivateApp(connection_key, correlation_id);
}
@@ -936,12 +938,14 @@ TEST_F(PolicyHandlerTest, OnActivateApp_AppIsRevoked_AppNotActivated) {
// Check expectations
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDefaultId, kPolicyAppId_))
.WillOnce(Return(permissions));
ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*mock_app_, mac_address()).WillByDefault(ReturnRef(kDefaultId));
// Act
policy_handler_.OnActivateApp(kConnectionKey_, kCorrelationKey_);
}
@@ -963,10 +967,10 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
std::shared_ptr<application_manager_test::MockApplication> application =
std::make_shared<application_manager_test::MockApplication>();
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
- .WillOnce(Return(application));
+ EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(application));
EXPECT_CALL(*application, app_id()).WillRepeatedly(Return(kAppId1_));
- EXPECT_CALL(*application, hmi_level()).WillRepeatedly(Return(hmi_level));
+ EXPECT_CALL(*application, hmi_level(kDefaultWindowId))
+ .WillRepeatedly(Return(hmi_level));
}
TEST_F(PolicyHandlerTest,
@@ -980,13 +984,13 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _))
.Times(0);
-
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInLimitedConsentNeeded) {
@@ -998,12 +1002,13 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInLimitedConsentNeeded) {
// Check expectations
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
@@ -1020,17 +1025,19 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(mock_state_controller,
SetRegularState(_,
+ kDefaultWindowId,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
mobile_apis::VideoStreamingState::NOT_STREAMABLE,
true));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInBackgroundAndRevoked) {
@@ -1044,12 +1051,13 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInBackgroundAndRevoked) {
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest,
@@ -1066,7 +1074,8 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(mock_message_helper_,
@@ -1083,7 +1092,7 @@ TEST_F(PolicyHandlerTest,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest,
@@ -1096,13 +1105,14 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest,
@@ -1121,7 +1131,8 @@ TEST_F(PolicyHandlerTest,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _))
.Times(0);
- EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ GetAppPermissionsChanges(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(permissions));
EXPECT_CALL(mock_message_helper_,
@@ -1138,7 +1149,7 @@ TEST_F(PolicyHandlerTest,
RemovePendingPermissionChanges(kPolicyAppId_));
// Act
- policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+ policy_handler_.OnPendingPermissionChange(kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, PTExchangeAtUserRequest) {
@@ -1234,7 +1245,7 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
// Check expectations
std::shared_ptr<application_manager_test::MockApplication> application =
std::make_shared<application_manager_test::MockApplication>();
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(application));
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
@@ -1251,10 +1262,11 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
_,
_,
_,
- _));
+ _))
+ .WillOnce(DoAll(SetArgPointee<3>(kDeviceId_), Return(0)));
// Act
- policy_handler_.OnCurrentDeviceIdUpdateRequired(kPolicyAppId_);
+ policy_handler_.OnCurrentDeviceIdUpdateRequired(handle, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnSystemInfoChanged) {
@@ -1303,11 +1315,17 @@ TEST_F(PolicyHandlerTest, GetAppRequestTypes) {
// Arrange
EnablePolicy();
ChangePolicyManagerToMock();
- // Check expectations
+ const transport_manager::DeviceHandle handle = 0u;
+// Check expectations
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(handle, kPolicyAppId_))
+ .WillOnce(Return(std::vector<std::string>()));
+#else
EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
.WillOnce(Return(std::vector<std::string>()));
+#endif
// Act
- policy_handler_.GetAppRequestTypes(kPolicyAppId_);
+ policy_handler_.GetAppRequestTypes(handle, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnVIIsReady) {
@@ -1376,13 +1394,14 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
std::shared_ptr<application_manager_test::MockApplication> application =
std::make_shared<application_manager_test::MockApplication>();
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(application));
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(_, _, _));
AppPermissions permissions(kPolicyAppId_);
// Act
- policy_handler_.SendOnAppPermissionsChanged(permissions, kPolicyAppId_);
+ policy_handler_.SendOnAppPermissionsChanged(
+ permissions, kDeviceId_, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, OnPTExchangeNeeded) {
@@ -1400,11 +1419,12 @@ TEST_F(PolicyHandlerTest, AddApplication) {
// Check expectations
EXPECT_CALL(
*mock_policy_manager_,
- AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
+ AddApplication(
+ kMacAddr_, kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
.WillOnce(Return(std::make_shared<utils::CallNothing>()));
// Act
- policy_handler_.AddApplication(kPolicyAppId_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_handler_.AddApplication(
+ kMacAddr_, kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT));
}
TEST_F(PolicyHandlerTest, HeartBeatTimeout) {
@@ -1439,9 +1459,10 @@ TEST_F(PolicyHandlerTest, OnAppRegisteredOnMobile) {
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, OnAppRegisteredOnMobile(kPolicyAppId_));
+ EXPECT_CALL(*mock_policy_manager_,
+ OnAppRegisteredOnMobile(kDeviceId, kPolicyAppId_));
// Act
- policy_handler_.OnAppRegisteredOnMobile(kPolicyAppId_);
+ policy_handler_.OnAppRegisteredOnMobile(kDeviceId, kPolicyAppId_);
}
TEST_F(PolicyHandlerTest, IsRequestTypeAllowed) {
@@ -1452,13 +1473,20 @@ TEST_F(PolicyHandlerTest, IsRequestTypeAllowed) {
mobile_apis::RequestType::eType type =
mobile_apis::RequestType::eType::EMERGENCY;
+ const transport_manager::DeviceHandle handle = 0u;
+
EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypesState(kPolicyAppId_))
.WillOnce(Return(policy::RequestType::State::AVAILABLE));
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(handle, kPolicyAppId_))
+ .WillOnce(Return(std::vector<std::string>({"HTTP"})));
+#else
EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
.WillOnce(Return(std::vector<std::string>({"HTTP"})));
+#endif
// Act
- EXPECT_FALSE(policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type));
+ EXPECT_FALSE(
+ policy_handler_.IsRequestTypeAllowed(handle, kPolicyAppId_, type));
}
TEST_F(PolicyHandlerTest, IsRequestSubTypeAllowed) {
@@ -1848,8 +1876,9 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentAllowed) {
connection_handler::DeviceHandle test_device_id = 100u;
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
- EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId, _))
.WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
test_app.insert(mock_app_);
@@ -1859,12 +1888,13 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentAllowed) {
EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
.WillOnce(Return(true));
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ ReactOnUserDevConsentForApp(test_device_id, kPolicyAppId_, is_allowed));
EXPECT_CALL(*mock_policy_manager_,
- ReactOnUserDevConsentForApp(kPolicyAppId_, is_allowed));
- EXPECT_CALL(*mock_policy_manager_,
- SendNotificationOnPermissionsUpdated(kPolicyAppId_));
+ SendNotificationOnPermissionsUpdated(kDeviceId, kPolicyAppId_));
- policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+ policy_handler_.OnDeviceConsentChanged(kDeviceId, is_allowed);
}
TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentNotAllowed) {
@@ -1872,27 +1902,29 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentNotAllowed) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- connection_handler::DeviceHandle test_device_id = 100u;
+ connection_handler::DeviceHandle handle = 100u;
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
// Check expectations
- EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
- .WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
+ EXPECT_CALL(conn_handler, GetDeviceID(kMacAddr_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(handle), Return(true)));
test_app.insert(mock_app_);
- EXPECT_CALL(*mock_app_, device()).WillOnce(Return(test_device_id));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(handle));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
.WillOnce(Return(true));
- EXPECT_CALL(*mock_policy_manager_, ReactOnUserDevConsentForApp(_, _))
+ EXPECT_CALL(*mock_policy_manager_,
+ ReactOnUserDevConsentForApp(handle, kPolicyAppId_, is_allowed))
.Times(0);
- EXPECT_CALL(*mock_policy_manager_, SendNotificationOnPermissionsUpdated(_))
+ EXPECT_CALL(*mock_policy_manager_,
+ SendNotificationOnPermissionsUpdated(kMacAddr_, kPolicyAppId_))
.Times(0);
- policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+ policy_handler_.OnDeviceConsentChanged(kMacAddr_, is_allowed);
}
TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
@@ -1903,8 +1935,9 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
connection_handler::DeviceHandle test_device_id = 100u;
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
- EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ EXPECT_CALL(conn_handler, GetDeviceID(kMacAddr_, _))
.WillOnce(DoAll(SetArgPointee<1>(test_device_id), Return(true)));
test_app.insert(mock_app_);
@@ -1916,12 +1949,13 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
EXPECT_CALL(*mock_policy_manager_, IsPredataPolicy(kPolicyAppId_))
.WillOnce(Return(false));
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ ReactOnUserDevConsentForApp(test_device_id, kPolicyAppId_, is_allowed));
EXPECT_CALL(*mock_policy_manager_,
- ReactOnUserDevConsentForApp(kPolicyAppId_, is_allowed));
- EXPECT_CALL(*mock_policy_manager_,
- SendNotificationOnPermissionsUpdated(kPolicyAppId_));
+ SendNotificationOnPermissionsUpdated(kMacAddr_, kPolicyAppId_));
- policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
+ policy_handler_.OnDeviceConsentChanged(kMacAddr_, is_allowed);
}
#ifdef ENABLE_SECURITY
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -1972,7 +2006,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_GetDefaultMacAddress) {
test_app.insert(mock_app_);
EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
@@ -1995,7 +2029,7 @@ void PolicyHandlerTest::GetAppIDForSending() {
// Check expectations
EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(mock_session_observer,
GetDataOnDeviceID(
@@ -2022,7 +2056,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
const uint32_t app_in_full_id = 1;
EXPECT_CALL(*mock_app_in_full, app_id())
.WillRepeatedly(Return(app_in_full_id));
- EXPECT_CALL(*mock_app_in_full, hmi_level())
+ EXPECT_CALL(*mock_app_in_full, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
ON_CALL(*mock_app_in_full, IsRegistered()).WillByDefault(Return(true));
@@ -2034,7 +2068,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
const uint32_t app_in_limited_id = 2;
EXPECT_CALL(*mock_app_in_limited, app_id())
.WillRepeatedly(Return(app_in_limited_id));
- EXPECT_CALL(*mock_app_in_limited, hmi_level())
+ EXPECT_CALL(*mock_app_in_limited, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_LIMITED));
ON_CALL(*mock_app_in_limited, IsRegistered()).WillByDefault(Return(true));
@@ -2046,7 +2080,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
const uint32_t app_in_background_id = 3;
EXPECT_CALL(*mock_app_in_background, app_id())
.WillRepeatedly(Return(app_in_background_id));
- EXPECT_CALL(*mock_app_in_background, hmi_level())
+ EXPECT_CALL(*mock_app_in_background, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_BACKGROUND));
ON_CALL(*mock_app_in_background, IsRegistered()).WillByDefault(Return(true));
@@ -2057,7 +2091,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
const uint32_t app_in_none_id = 4;
EXPECT_CALL(*mock_app_in_none, app_id())
.WillRepeatedly(Return(app_in_none_id));
- EXPECT_CALL(*mock_app_in_none, hmi_level())
+ EXPECT_CALL(*mock_app_in_none, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_NONE));
EXPECT_CALL(*mock_app_in_none, IsRegistered()).Times(0);
@@ -2087,7 +2121,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
const uint32_t app_in_none_id_1 = 1;
EXPECT_CALL(*mock_app_in_none_1, app_id())
.WillRepeatedly(Return(app_in_none_id_1));
- EXPECT_CALL(*mock_app_in_none_1, hmi_level())
+ EXPECT_CALL(*mock_app_in_none_1, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
ON_CALL(*mock_app_in_none_1, IsRegistered()).WillByDefault(Return(true));
@@ -2099,7 +2133,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
const uint32_t app_in_none_id_2 = 2;
EXPECT_CALL(*mock_app_in_none_2, app_id())
.WillRepeatedly(Return(app_in_none_id_2));
- EXPECT_CALL(*mock_app_in_none_2, hmi_level())
+ EXPECT_CALL(*mock_app_in_none_2, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_api::HMILevel::HMI_NONE));
ON_CALL(*mock_app_in_none_2, IsRegistered()).WillByDefault(Return(true));
@@ -2134,7 +2168,7 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*mock_app_, policy_app_id())
.WillRepeatedly(Return(kPolicyAppId_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
@@ -2161,7 +2195,7 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*mock_app_, policy_app_id())
.WillRepeatedly(Return(kPolicyAppId_));
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
@@ -2189,9 +2223,9 @@ TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) {
std::shared_ptr<application_manager_test::MockApplication> second_mock_app =
std::make_shared<application_manager_test::MockApplication>();
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_CALL(*second_mock_app, hmi_level())
+ EXPECT_CALL(*second_mock_app, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
EXPECT_CALL(*second_mock_app, app_id()).WillRepeatedly(Return(kAppId2_));
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index a82358b451..899fc00846 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -35,10 +35,12 @@
#include "application_manager/application.h"
#include "application_manager/application_manager_impl.h"
+#include "application_manager/display_capabilities_builder.h"
#include "application_manager/mock_app_extension.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_resumption_data.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/usage_statistics.h"
#include "config_profile/profile.h"
@@ -73,6 +75,12 @@ using namespace application_manager_test;
using namespace resumption;
using namespace mobile_apis::HMILevel;
+namespace {
+const WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+const int32_t kDefaultHmiAppId = 111;
+} // namespace
+
class ResumeCtrlTest : public ::testing::Test {
protected:
ResumeCtrlTest()
@@ -156,6 +164,43 @@ class ResumeCtrlTest : public ::testing::Test {
ON_CALL(*mock_app_, is_cloud_app()).WillByDefault(Return(false));
}
+ smart_objects::SmartObjectSPtr CreateStubCreateWindowRequest(
+ const std::string window_name,
+ const WindowID window_id,
+ const mobile_apis::WindowType::eType window_type) const {
+ auto request = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ smart_objects::SmartObject params(smart_objects::SmartType_Map);
+
+ params[strings::correlation_id] = window_id;
+
+ msg_params[strings::window_name] = window_name;
+ msg_params[strings::window_id] = window_id;
+ msg_params[strings::window_type] = window_type;
+ msg_params[strings::app_id] = kDefaultHmiAppId;
+
+ (*request)[strings::msg_params] = msg_params;
+ (*request)[strings::params] = params;
+
+ return request;
+ }
+
+ smart_objects::SmartObjectSPtr CreateStubCreateWindowResponse(
+ const int32_t correlation_id,
+ const hmi_apis::Common_Result::eType result_code) const {
+ auto response = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject params(smart_objects::SmartType_Map);
+
+ params[strings::correlation_id] = correlation_id;
+ params[hmi_response::code] = result_code;
+
+ (*response)[strings::params] = params;
+
+ return response;
+ }
+
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
@@ -185,6 +230,7 @@ class ResumeCtrlTest : public ::testing::Test {
const std::string kNaviLowbandwidthLevel_;
const std::string kProjectionLowbandwidthLevel_;
const std::string kMediaLowbandwidthLevel_;
+ NiceMock<application_manager_test::MockRPCService> mock_rpc_service_;
};
/**
@@ -572,12 +618,231 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToWayPoints) {
mobile_apis::HMILevel::HMI_FULL;
ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(hmi_test_level));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, hmi_test_level));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, hmi_test_level));
const bool result = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(result);
}
+TEST_F(ResumeCtrlTest,
+ RestoreAppWidgets_AppWithWidgets_SendCreateWindowRequests) {
+ using namespace smart_objects;
+ using namespace application_manager;
+ GetInfoFromApp();
+ const uint32_t count_of_widgets = 10u;
+
+ auto create_window_info_so = []() -> SmartObject {
+ SmartObject widgets_info(SmartType_Array);
+ for (uint32_t i = 0; i < count_of_widgets; ++i) {
+ SmartObject widget_info(SmartType_Map);
+ widget_info[strings::associated_service_type] = "ServiceType";
+ widget_info[strings::duplicate_updates_from_window_id] = 0;
+ widget_info[strings::window_name] =
+ std::string("Widget ") + std::to_string(i + 1);
+ widget_info[strings::window_type] =
+ static_cast<int32_t>(mobile_apis::WindowType::WIDGET);
+ widget_info[strings::window_id] = i + 1;
+ widgets_info[widgets_info.length()] = widget_info;
+ }
+ return widgets_info;
+ };
+
+ auto create_saved_app_so = [&create_window_info_so, this]() -> SmartObject {
+ smart_objects::SmartObject saved_app;
+ const auto test_app_widgets = create_window_info_so();
+ saved_app[strings::hash_id] = kHash_;
+ saved_app[strings::windows_info] = test_app_widgets;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = eType::HMI_FULL;
+ return saved_app;
+ };
+
+ const auto saved_app = create_saved_app_so();
+
+ const auto hmi_request = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ const auto hmi_requests =
+ smart_objects::SmartObjectList(count_of_widgets, hmi_request);
+
+ DisplayCapabilitiesBuilder builder(*mock_app_);
+ ON_CALL(*mock_app_, display_capabilities_builder())
+ .WillByDefault(ReturnRef(builder));
+ EXPECT_CALL(
+ *application_manager::MockMessageHelper::message_helper_mock(),
+ CreateUICreateWindowRequestsToHMI(_, _, saved_app[strings::windows_info]))
+ .WillOnce(Return(hmi_requests));
+
+ ON_CALL(mock_app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(_, commands::Command::SOURCE_SDL_TO_HMI))
+ .Times(count_of_widgets)
+ .WillRepeatedly(Return(true));
+
+ res_ctrl_->RestoreAppWidgets(mock_app_, saved_app);
+}
+
+TEST_F(ResumeCtrlTest,
+ RestoreWidgetsHMIState_AppWithWidgets_AddWidgetsInternally) {
+ const uint32_t count_of_widgets = 10u;
+
+ smart_objects::SmartObject saved_app;
+ saved_app[strings::hash_id] = kHash_;
+ saved_app[strings::windows_info] = smart_objects::SmartObject();
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = eType::HMI_FULL;
+
+ ON_CALL(mock_app_mngr_, application_by_hmi_app(kDefaultHmiAppId))
+ .WillByDefault(Return(mock_app_));
+ DisplayCapabilitiesBuilder builder(*mock_app_);
+ ON_CALL(*mock_app_, display_capabilities_builder())
+ .WillByDefault(ReturnRef(builder));
+
+ smart_objects::SmartObjectList requests;
+ smart_objects::SmartObjectList responses;
+ for (uint32_t i = 0; i < count_of_widgets; ++i) {
+ const auto window_type = mobile_apis::WindowType::WIDGET;
+ const WindowID window_id = i + 1;
+ const auto window_name = std::string("Widget ") + std::to_string(window_id);
+ requests.push_back(
+ CreateStubCreateWindowRequest(window_name, window_id, window_type));
+ responses.push_back(CreateStubCreateWindowResponse(
+ window_id, hmi_apis::Common_Result::SUCCESS));
+ EXPECT_CALL(mock_app_mngr_, CreateRegularState(_, window_type, _, _, _, _))
+ .WillRepeatedly(Return(nullptr));
+ EXPECT_CALL(*mock_app_, SetInitialState(window_id, window_name, _));
+ EXPECT_CALL(mock_state_controller_,
+ OnAppWindowAdded(_, window_id, window_type, _));
+ }
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateUICreateWindowRequestsToHMI(_, _, _))
+ .WillOnce(Return(requests));
+
+ ON_CALL(mock_app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(_, commands::Command::SOURCE_SDL_TO_HMI))
+ .Times(count_of_widgets)
+ .WillRepeatedly(Return(true));
+ res_ctrl_->RestoreAppWidgets(mock_app_, saved_app);
+ for (const auto& response : responses) {
+ res_ctrl_->RestoreWidgetsHMIState(*response);
+ }
+}
+
+TEST_F(ResumeCtrlTest,
+ RestoreAppWidgets_AppWithoutWidgets_NoCreateWindowRqSent) {
+ smart_objects::SmartObject saved_app;
+ saved_app[strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = eType::HMI_FULL;
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateUICreateWindowRequestsToHMI(_, _, _))
+ .Times(0);
+
+ res_ctrl_->RestoreAppWidgets(mock_app_, saved_app);
+}
+
+TEST_F(ResumeCtrlTest, RestoreWidgetsHMIState_HMIResponseWith_InvalidCorrId) {
+ smart_objects::SmartObject saved_app;
+ saved_app[strings::hash_id] = kHash_;
+ saved_app[strings::windows_info] = smart_objects::SmartObject();
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = eType::HMI_FULL;
+
+ const int32_t invalid_corr_id = -1;
+ auto response = CreateStubCreateWindowResponse(
+ invalid_corr_id, hmi_apis::Common_Result::SUCCESS);
+
+ ON_CALL(mock_app_mngr_, application_by_hmi_app(kDefaultHmiAppId))
+ .WillByDefault(Return(mock_app_));
+
+ DisplayCapabilitiesBuilder builder(*mock_app_);
+ ON_CALL(*mock_app_, display_capabilities_builder())
+ .WillByDefault(ReturnRef(builder));
+
+ smart_objects::SmartObjectList requests;
+
+ const auto window_type = mobile_apis::WindowType::WIDGET;
+ const WindowID window_id = 1;
+ const auto window_name = std::string("Widget ") + std::to_string(window_id);
+ requests.push_back(
+ CreateStubCreateWindowRequest(window_name, window_id, window_type));
+
+ EXPECT_CALL(mock_app_mngr_, CreateRegularState(_, window_type, _, _, _, _))
+ .Times(0);
+ EXPECT_CALL(*mock_app_, SetInitialState(window_id, window_name, _)).Times(0);
+ EXPECT_CALL(mock_state_controller_,
+ OnAppWindowAdded(_, window_id, window_type, _))
+ .Times(0);
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateUICreateWindowRequestsToHMI(_, _, _))
+ .WillOnce(Return(requests));
+
+ ON_CALL(mock_app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(_, commands::Command::SOURCE_SDL_TO_HMI))
+ .WillRepeatedly(Return(true));
+ res_ctrl_->RestoreAppWidgets(mock_app_, saved_app);
+ res_ctrl_->RestoreWidgetsHMIState(*response);
+}
+
+TEST_F(ResumeCtrlTest, RestoreWidgetsHMIState_HMIResponseWith_Unsuccess) {
+ smart_objects::SmartObject saved_app;
+ saved_app[strings::hash_id] = kHash_;
+ saved_app[strings::windows_info] = smart_objects::SmartObject();
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::hmi_level] = eType::HMI_FULL;
+
+ const int32_t correlation_id = 1;
+ auto response = CreateStubCreateWindowResponse(
+ correlation_id, hmi_apis::Common_Result::GENERIC_ERROR);
+
+ ON_CALL(mock_app_mngr_, application_by_hmi_app(kDefaultHmiAppId))
+ .WillByDefault(Return(mock_app_));
+
+ DisplayCapabilitiesBuilder builder(*mock_app_);
+ smart_objects::SmartObject stub_window_info(smart_objects::SmartType_Null);
+ auto stub_resume_cb = [](Application&, const smart_objects::SmartObject&) {};
+ builder.InitBuilder(stub_resume_cb, stub_window_info);
+ ON_CALL(*mock_app_, display_capabilities_builder())
+ .WillByDefault(ReturnRef(builder));
+
+ smart_objects::SmartObjectList requests;
+ smart_objects::SmartObjectList responses;
+
+ const auto window_type = mobile_apis::WindowType::WIDGET;
+ const WindowID window_id = 1;
+ const auto window_name = std::string("Widget ") + std::to_string(window_id);
+ requests.push_back(
+ CreateStubCreateWindowRequest(window_name, window_id, window_type));
+
+ EXPECT_CALL(mock_app_mngr_, CreateRegularState(_, window_type, _, _, _, _))
+ .Times(0);
+ EXPECT_CALL(*mock_app_, SetInitialState(window_id, window_name, _)).Times(0);
+ EXPECT_CALL(mock_state_controller_,
+ OnAppWindowAdded(_, window_id, window_type, _))
+ .Times(0);
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateUICreateWindowRequestsToHMI(_, _, _))
+ .WillOnce(Return(requests));
+
+ ON_CALL(mock_app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(_, commands::Command::SOURCE_SDL_TO_HMI))
+ .WillRepeatedly(Return(true));
+ res_ctrl_->RestoreAppWidgets(mock_app_, saved_app);
+ res_ctrl_->RestoreWidgetsHMIState(*response);
+}
+
TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
smart_objects::SmartObject saved_app;
@@ -632,7 +897,8 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
DataAccessor<application_manager::CommandsMap> data_accessor(
command, app_set_lock_ptr_);
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
@@ -681,7 +947,8 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppHasDeferredResumption) {
saved_app[application_manager::strings::time_stamp] = time_stamp;
// resume into deferred level instead of restored level
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, deferred_level))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, deferred_level))
.Times(AtLeast(1));
GetInfoFromApp();
ON_CALL(*mock_storage_,
@@ -716,7 +983,8 @@ TEST_F(ResumeCtrlTest,
saved_app[application_manager::strings::hmi_level] = restored_test_type;
saved_app[application_manager::strings::time_stamp] = time_stamp;
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, eType::HMI_LIMITED))
.Times(AtLeast(1));
GetInfoFromApp();
ON_CALL(*mock_storage_,
@@ -760,7 +1028,8 @@ TEST_F(
// in this test, it is expected that the app will resume into LIMITED, which
// is the higher level among NONE and LIMITED
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, eType::HMI_LIMITED))
.Times(AtLeast(1));
GetInfoFromApp();
ON_CALL(*mock_storage_,
@@ -816,7 +1085,8 @@ TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
@@ -847,7 +1117,8 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, kDefaultTestLevel_))
.Times(AtLeast(1));
res_ctrl_->SetupDefaultHMILevel(mock_app_);
@@ -876,7 +1147,8 @@ TEST_F(ResumeCtrlTest,
EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
// SetRegularState() should be called with kProjectionLowbandwidthLevel_
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_NONE))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, eType::HMI_NONE))
.Times(AtLeast(1));
res_ctrl_->SetupDefaultHMILevel(mock_app_);
@@ -903,7 +1175,8 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
MockStateController state_controller;
EXPECT_CALL(mock_app_mngr_, state_controller())
.WillOnce(ReturnRef(state_controller));
- EXPECT_CALL(state_controller, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(state_controller,
+ SetRegularState(_, kDefaultWindowId, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
@@ -932,7 +1205,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) {
EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
EXPECT_CALL(*mock_app_, set_is_resuming(true));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, kDefaultTestLevel_))
.Times(AtLeast(1));
const bool res =
res_ctrl_->SetAppHMIState(mock_app_, kDefaultTestLevel_, false);
@@ -945,7 +1219,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) {
EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
EXPECT_CALL(*mock_app_, set_is_resuming(true));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, test_type))
.Times(AtLeast(1));
const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
EXPECT_TRUE(res);
@@ -959,7 +1234,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) {
EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
EXPECT_CALL(*mock_app_, set_is_resuming(true));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, test_type))
.Times(AtLeast(1));
const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
@@ -974,7 +1250,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) {
.WillByDefault(Return(policy::kDeviceAllowed));
EXPECT_CALL(*mock_app_, set_is_resuming(true));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, test_type))
.Times(AtLeast(1));
const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
@@ -991,7 +1268,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
EXPECT_CALL(*mock_app_, set_is_resuming(true));
ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, kDefaultTestLevel_))
.Times(AtLeast(1));
const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
EXPECT_FALSE(res);
@@ -1246,7 +1524,8 @@ TEST_F(
DataAccessor<application_manager::CommandsMap> data_accessor(
command, app_set_lock_ptr_);
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
@@ -1353,7 +1632,8 @@ TEST_F(
DataAccessor<application_manager::CommandsMap> data_accessor(
command, app_set_lock_ptr_);
- EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, kDefaultWindowId, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 29718b631c..e362064a78 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -74,6 +74,7 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
CheckGlobalProporties(
resume_app_list[am::strings::application_global_properties]);
CheckSubscriptions(resume_app_list[am::strings::application_subscriptions]);
+ CheckWindowsInfo(resume_app_list[am::strings::windows_info]);
}
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
@@ -327,6 +328,33 @@ void ResumptionDataTest::CheckVRTitle(
EXPECT_EQ(vtitle, res_list[am::strings::vr_help_title].asString());
}
+void ResumptionDataTest::CheckWindowsInfo(sm::SmartObject& res_list) {
+ using namespace application_manager;
+ auto check_window_info = [this](
+ const smart_objects::SmartObject& window_info) {
+ using namespace application_manager;
+ const WindowID saved_window_id = window_info[strings::window_id].asInt();
+ const auto test_window_info = test_window_params_map_[saved_window_id];
+ const auto& saved_window_name =
+ window_info[strings::window_name].asString();
+ ASSERT_TRUE(0 != test_window_info.use_count());
+ const auto& window_name =
+ (*test_window_info)[strings::window_name].asString();
+ const auto& saved_duplicate_window_id =
+ window_info[strings::duplicate_updates_from_window_id].asInt();
+ const auto& saved_associated_service_type =
+ window_info[strings::associated_service_type].asString();
+ EXPECT_EQ(saved_window_name, window_name);
+ EXPECT_EQ("ServiceType", saved_associated_service_type);
+ EXPECT_EQ(0, saved_duplicate_window_id);
+ };
+
+ for (size_t i = 0; i < res_list.length(); ++i) {
+ const auto& saved_window_info = res_list[i];
+ check_window_info(saved_window_info);
+ }
+}
+
void ResumptionDataTest::PrepareData() {
mock_app_extension_ =
std::make_shared<NiceMock<application_manager_test::MockAppExtension> >();
@@ -341,9 +369,14 @@ void ResumptionDataTest::PrepareData() {
DataAccessor<am::SubMenuMap> sub_menu_m(test_submenu_map, sublock_ptr_);
DataAccessor<am::CommandsMap> commands_m(test_commands_map, comlock_ptr_);
DataAccessor<am::ChoiceSetMap> choice_set_m(test_choiceset_map, setlock_ptr_);
+ DataAccessor<am::WindowParamsMap> window_params_map(
+ test_window_params_map_, window_params_map_lock_ptr_);
SetSubscriptions();
DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_ptr_);
+ SetWindowsInfo();
+ SetDefaultCurrentHmiState();
+ SetDefaultWindowIds();
ON_CALL(*app_mock, is_application_data_changed()).WillByDefault(Return(true));
@@ -352,7 +385,8 @@ void ResumptionDataTest::PrepareData() {
ON_CALL(*app_mock, curHash()).WillByDefault(ReturnRef(hash_));
ON_CALL(*app_mock, get_grammar_id()).WillByDefault(Return(grammar_id_));
ON_CALL(*app_mock, device()).WillByDefault(Return(device_handle_));
- ON_CALL(*app_mock, hmi_level()).WillByDefault(Return(hmi_level_));
+ ON_CALL(*app_mock, hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
+ .WillByDefault(Return(hmi_level_));
ON_CALL(*app_mock, app_id()).WillByDefault(Return(app_id_));
ON_CALL(*app_mock, hmi_app_id()).WillByDefault(Return(hmi_app_id_));
ON_CALL(*app_mock, IsAudioApplication()).WillByDefault(Return(is_audio_));
@@ -375,6 +409,21 @@ void ResumptionDataTest::PrepareData() {
ON_CALL(*app_mock, SubscribedButtons()).WillByDefault(Return(btn_sub));
ON_CALL(*app_mock, getAppFiles()).WillByDefault(ReturnRef(app_files_map_));
+ ON_CALL(*app_mock, window_optional_params_map())
+ .WillByDefault(Return(window_params_map));
+}
+
+void ResumptionDataTest::SetDefaultCurrentHmiState() {
+ am::HmiStatePtr hmi_state =
+ std::make_shared<am::HmiState>(app_mock, mock_application_manager_);
+ hmi_state->set_window_type(mobile_apis::WindowType::WIDGET);
+
+ ON_CALL(*app_mock, CurrentHmiState(_)).WillByDefault(Return(hmi_state));
+}
+
+void ResumptionDataTest::SetDefaultWindowIds() {
+ const am::WindowIds window_ids{1, 2, 3, 4, 5};
+ ON_CALL(*app_mock, GetWindowIds()).WillByDefault(Return(window_ids));
}
void ResumptionDataTest::SetGlobalProporties() {
@@ -550,6 +599,21 @@ void ResumptionDataTest::SetSubscriptions() {
btn_subscr.insert(ButtonName::eType::OK);
}
+void ResumptionDataTest::SetWindowsInfo() {
+ using namespace application_manager;
+ const uint32_t number_of_widgets = 5;
+ for (uint32_t i = 0; i < number_of_widgets; ++i) {
+ auto window_info = std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ const WindowID window_id = i + 1;
+ (*window_info)[strings::window_name] =
+ std::string("Widget ") + std::to_string(window_id);
+ (*window_info)[strings::associated_service_type] = "ServiceType";
+ (*window_info)[strings::duplicate_updates_from_window_id] = 0;
+ test_window_params_map_[window_id] = window_info;
+ }
+}
+
} // namespace resumption_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index fbada47fec..0fe40366d6 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -75,10 +75,13 @@ namespace test {
namespace components {
namespace state_controller_test {
-namespace constants {
+namespace {
const uint32_t kCorrID = 314u;
const uint32_t kHMIAppID = 2718u;
-} // namespace constants
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+const am::WindowID kCustomWindowId = 2;
+} // namespace
struct HmiStatesComparator {
mobile_apis::HMILevel::eType hmi_level_;
@@ -213,7 +216,11 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr> invalid_states_for_not_audio_app;
std::vector<am::HmiStatePtr> invalid_states_for_audio_app;
std::vector<am::HmiState::StateID> valid_state_ids_;
- std::vector<am::ApplicationSharedPtr> applications_list_;
+
+ typedef std::map<am::ApplicationSharedPtr,
+ NiceMock<application_manager_test::MockApplication>*>
+ AppPtrMockMapping;
+ AppPtrMockMapping applications_list_;
connection_handler_test::MockConnectionHandlerSettings
mock_connection_handler__settings;
@@ -554,21 +561,26 @@ class StateControllerImplTest : public ::testing::Test {
// application properties, i.e. is_media_application flag from RAI and
// AppHmiTypes (NAVIGATION, etc.). Most likely logic should be changed
// after conclusion on APPLINK-20231
- std::vector<am::ApplicationSharedPtr>::iterator app = std::find_if(
- applications_list_.begin(),
- applications_list_.end(),
- [app_id](am::ApplicationSharedPtr a) { return app_id == a->app_id(); });
-
- if (app == applications_list_.end()) {
+ AppPtrMockMapping::iterator it =
+ std::find_if(applications_list_.begin(),
+ applications_list_.end(),
+ [app_id](AppPtrMockMapping::value_type& item) {
+ return app_id == item.first->app_id();
+ });
+
+ if (applications_list_.end() == it) {
return APP_TYPE_NON_MEDIA;
}
- if ((*app)->is_navi()) {
+ auto app = it->first;
+ if (app->is_navi()) {
return APP_TYPE_NAVI;
}
- if ((*app)->is_media_application()) {
+
+ if (app->is_media_application()) {
return APP_TYPE_MEDIA;
}
+
return APP_TYPE_NON_MEDIA;
}
@@ -644,17 +656,16 @@ class StateControllerImplTest : public ::testing::Test {
template <typename T, typename Q>
void TestMixState(void (StateControllerImplTest::*call_back_result)(
std::vector<am::HmiStatePtr>&, ApplicationType)) {
- std::vector<am::ApplicationSharedPtr>::iterator it_begin =
- applications_list_.begin();
- std::vector<am::ApplicationSharedPtr>::iterator it_end =
- applications_list_.end();
+ AppPtrMockMapping::iterator it_begin = applications_list_.begin();
+ AppPtrMockMapping::iterator it_end = applications_list_.end();
ApplicationType app_type;
uint32_t app_id;
am::ApplicationSharedPtr app;
+
for (; it_begin != it_end; ++it_begin) {
- app_id = (*it_begin)->app_id();
+ app_id = it_begin->first->app_id();
app_type = AppType(app_id);
- app = (*it_begin);
+ app = it_begin->first;
am::HmiStatePtr state_first = std::make_shared<T>(app, app_manager_mock_);
am::HmiStatePtr state_second =
std::make_shared<Q>(app, app_manager_mock_);
@@ -925,14 +936,14 @@ class StateControllerImplTest : public ::testing::Test {
MEDIA,
NAVI,
VC);
- applications_list_.push_back(simple_app_);
- applications_list_.push_back(media_app_);
- applications_list_.push_back(navi_app_);
- applications_list_.push_back(vc_app_);
- applications_list_.push_back(media_navi_app_);
- applications_list_.push_back(media_vc_app_);
- applications_list_.push_back(navi_vc_app_);
- applications_list_.push_back(media_navi_vc_app_);
+ applications_list_[simple_app_] = simple_app_ptr_;
+ applications_list_[media_app_] = media_app_ptr_;
+ applications_list_[navi_app_] = navi_app_ptr_;
+ applications_list_[vc_app_] = vc_app_ptr_;
+ applications_list_[media_navi_app_] = media_navi_app_ptr_;
+ applications_list_[media_vc_app_] = media_vc_app_ptr_;
+ applications_list_[navi_vc_app_] = navi_vc_app_ptr_;
+ applications_list_[media_navi_vc_app_] = media_navi_vc_app_ptr_;
}
void CheckAppConfiguration() {
ASSERT_EQ(simple_app_.get(), simple_app_ptr_);
@@ -1036,7 +1047,7 @@ class StateControllerImplTest : public ::testing::Test {
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
- GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
+ GetBCActivateAppRequestToHMI(_, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
ON_CALL(app_manager_mock_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
@@ -1044,22 +1055,36 @@ class StateControllerImplTest : public ::testing::Test {
.WillByDefault(Return(true));
}
- void ExpectSuccesfullSetHmiState(
+ void ExpectSuccessfulSetHmiState(
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>* app_mock,
+ am::HmiStatePtr old_state,
+ am::HmiStatePtr new_state) {
+ ExpectSuccessfulSetHmiState(
+ app, app_mock, kDefaultWindowId, old_state, new_state);
+ }
+
+ void ExpectSuccessfulSetHmiState(
am::ApplicationSharedPtr app,
NiceMock<application_manager_test::MockApplication>* app_mock,
+ am::WindowID window_id,
am::HmiStatePtr old_state,
am::HmiStatePtr new_state) {
- EXPECT_CALL(*app_mock, CurrentHmiState())
+ EXPECT_CALL(*app_mock, CurrentHmiState(window_id))
.WillOnce(Return(old_state))
.WillOnce(Return(new_state));
- EXPECT_CALL(*app_mock,
- SetRegularState(Truly(HmiStatesComparator(new_state))));
+ EXPECT_CALL(
+ *app_mock,
+ SetRegularState(window_id, Truly(HmiStatesComparator(new_state))));
if (!HmiStatesComparator(old_state)(new_state)) {
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app));
- EXPECT_CALL(
- app_manager_mock_,
- OnHMILevelChanged(
- app->app_id(), old_state->hmi_level(), new_state->hmi_level()));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(app, window_id, _));
+ if (kDefaultWindowId == window_id) {
+ EXPECT_CALL(
+ app_manager_mock_,
+ OnHMILevelChanged(
+ app->app_id(), old_state->hmi_level(), new_state->hmi_level()));
+ }
}
}
@@ -1068,22 +1093,33 @@ class StateControllerImplTest : public ::testing::Test {
NiceMock<application_manager_test::MockApplication>* app_mock,
am::HmiStatePtr old_state,
am::HmiStatePtr new_state) {
- EXPECT_CALL(*app_mock, RegularHmiState())
+ EXPECT_CALL(*app_mock, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(old_state))
.WillOnce(Return(old_state));
- ExpectSuccesfullSetHmiState(app, app_mock, old_state, new_state);
+ ExpectSuccessfulSetHmiState(app, app_mock, old_state, new_state);
}
void ExpectAppWontChangeHmiStateDueToConflictResolving(
am::ApplicationSharedPtr app,
NiceMock<application_manager_test::MockApplication>* app_mock,
+ const am::WindowID window_id,
am::HmiStatePtr state) {
- ON_CALL(*app_mock, RegularHmiState()).WillByDefault(Return(state));
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app)).Times(0);
+ ON_CALL(*app_mock, RegularHmiState(window_id)).WillByDefault(Return(state));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(app, window_id, _))
+ .Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(app->app_id(), _, _))
.Times(0);
}
+ void ExpectAppWontChangeHmiStateDueToConflictResolving(
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>* app_mock,
+ am::HmiStatePtr state) {
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ app, app_mock, kDefaultWindowId, state);
+ }
+
void InsertApplication(am::ApplicationSharedPtr app) {
application_set_.insert(app);
ON_CALL(app_manager_mock_, application(app->app_id()))
@@ -1135,13 +1171,14 @@ class StateControllerImplTest : public ::testing::Test {
using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(app_mock, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(NoneNotAudibleState()));
for (size_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
EXPECT_CALL(app_mock,
- AddHMIState(Truly(HmiStatesIDComparator(state_id))));
+ AddHMIState(kDefaultWindowId,
+ Truly(HmiStatesIDComparator(state_id))));
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_start_event(FunctionID::VR_Started);
@@ -1182,7 +1219,7 @@ class StateControllerImplTest : public ::testing::Test {
default:
break;
}
- EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(kDefaultWindowId, _)).Times(0);
}
}
@@ -1194,12 +1231,17 @@ class StateControllerImplTest : public ::testing::Test {
using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(app_mock, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(NoneNotAudibleState()));
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(app_mock, GetWindowIds()).WillRepeatedly(Return(window_ids));
+
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(app_mock, AddHMIState(Truly(HmiStatesIDComparator(state_id))))
+ EXPECT_CALL(
+ app_mock,
+ AddHMIState(kDefaultWindowId, Truly(HmiStatesIDComparator(state_id))))
.Times(1);
switch (state_id) {
@@ -1243,16 +1285,17 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
- EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(kDefaultWindowId, _)).Times(0);
}
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(app_mock, RemoveHMIState(state_id)).Times(1);
+ EXPECT_CALL(app_mock, RemoveHMIState(kDefaultWindowId, state_id))
+ .Times(1);
- EXPECT_CALL(app_mock, PostponedHmiState())
+ EXPECT_CALL(app_mock, PostponedHmiState(kDefaultWindowId))
.WillOnce(Return(NoneNotAudibleState()));
- EXPECT_CALL(app_mock, RemovePostponedState());
+ EXPECT_CALL(app_mock, RemovePostponedState(kDefaultWindowId));
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1295,7 +1338,7 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
- EXPECT_CALL(app_mock, RemoveHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, RemoveHMIState(kDefaultWindowId, _)).Times(0);
}
}
};
@@ -1307,6 +1350,7 @@ TEST_F(StateControllerImplTest, OnStateChangedWithEqualStates) {
for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) {
state_ctrl_->OnStateChanged(simple_app_,
+ kDefaultWindowId,
valid_states_for_not_audio_app_[i],
valid_states_for_not_audio_app_[i]);
}
@@ -1317,8 +1361,9 @@ TEST_F(StateControllerImplTest, OnStateChangedWithDifferentStates) {
for (uint32_t j = 0; j < valid_states_for_not_audio_app_.size(); ++j) {
HmiStatesComparator comp(valid_states_for_not_audio_app_[i]);
if (!comp(valid_states_for_not_audio_app_[j])) {
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
- .Times(1);
+ EXPECT_CALL(
+ message_helper_mock_,
+ SendHMIStatusNotification(simple_app_, kDefaultWindowId, _));
EXPECT_CALL(
app_manager_mock_,
OnHMILevelChanged(simple_app_id_,
@@ -1330,10 +1375,12 @@ TEST_F(StateControllerImplTest, OnStateChangedWithDifferentStates) {
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
}
state_ctrl_->OnStateChanged(simple_app_,
+ kDefaultWindowId,
valid_states_for_not_audio_app_[i],
valid_states_for_not_audio_app_[j]);
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
+ EXPECT_CALL(message_helper_mock_, SendHMIStatusNotification(_, _, _))
+ .Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
}
@@ -1356,10 +1403,12 @@ TEST_F(StateControllerImplTest, OnStateChangedToNone) {
SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
- state_ctrl_->OnStateChanged(simple_app_, none_state, not_none_state);
+ state_ctrl_->OnStateChanged(
+ simple_app_, kDefaultWindowId, none_state, not_none_state);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
- state_ctrl_->OnStateChanged(simple_app_, not_none_state, none_state);
+ state_ctrl_->OnStateChanged(
+ simple_app_, kDefaultWindowId, not_none_state, none_state);
}
TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
@@ -1377,18 +1426,21 @@ TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
it != valid_states_for_not_audio_app_.end();
++it) {
HmiStatePtr state_to_setup = *it;
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(initial_state))
.WillOnce(Return(state_to_setup));
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(simple_app_, kDefaultWindowId, _));
EXPECT_CALL(app_manager_mock_,
OnHMILevelChanged(simple_app_id_,
initial_state->hmi_level(),
state_to_setup->hmi_level()));
EXPECT_CALL(*simple_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
- state_ctrl_->SetRegularState(simple_app_, state_to_setup, false);
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(state_to_setup))));
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, state_to_setup, false);
initial_state = state_to_setup;
}
}
@@ -1413,18 +1465,21 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
it != valid_states_for_audio_app_.end();
++it) {
HmiStatePtr state_to_setup = *it;
- EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(initial_state))
.WillOnce(Return(state_to_setup));
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(audio_app));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(audio_app, kDefaultWindowId, _));
EXPECT_CALL(app_manager_mock_,
OnHMILevelChanged(audio_app->app_id(),
initial_state->hmi_level(),
state_to_setup->hmi_level()));
EXPECT_CALL(*audio_app_mock,
- SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
- state_ctrl_->SetRegularState(media_navi_vc_app_, state_to_setup, false);
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(state_to_setup))));
+ state_ctrl_->SetRegularState(
+ media_navi_vc_app_, kDefaultWindowId, state_to_setup, false);
initial_state = state_to_setup;
}
}
@@ -1452,7 +1507,7 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
HmiStatePtr state_to_setup = *it;
HmiStatePtr state_to_check = state_to_setup;
// First time current state is initial, then it changes to setup state
- EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(initial_state))
.WillOnce(Return(state_to_setup));
// Audio resume app when HMI level is LIMITED or FULL gets audible state
@@ -1480,8 +1535,10 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
// Check that we set correct state
EXPECT_CALL(*audio_app_mock,
- SetRegularState(Truly(HmiStatesComparator(state_to_check))));
- state_ctrl_->SetRegularState(media_navi_vc_app_, state_to_setup, false);
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(state_to_check))));
+ state_ctrl_->SetRegularState(
+ media_navi_vc_app_, kDefaultWindowId, state_to_setup, false);
initial_state = state_to_setup;
}
}
@@ -1494,11 +1551,13 @@ TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) {
invalid_state_it != common_invalid_states_.end();
++invalid_state_it) {
HmiStatePtr invalid_state = *invalid_state_it;
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
EXPECT_CALL(*simple_app_ptr_, is_resuming()).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
- state_ctrl_->SetRegularState(simple_app_, invalid_state, false);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(kDefaultWindowId, _))
+ .Times(0);
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, invalid_state, false);
}
for (std::vector<HmiStatePtr>::iterator invalid_state_it =
@@ -1506,11 +1565,14 @@ TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) {
invalid_state_it != common_invalid_states_.end();
++invalid_state_it) {
HmiStatePtr invalid_state = *invalid_state_it;
- EXPECT_CALL(*media_navi_vc_app_ptr_, CurrentHmiState()).Times(0);
+ EXPECT_CALL(*media_navi_vc_app_ptr_, CurrentHmiState(kDefaultWindowId))
+ .Times(0);
EXPECT_CALL(*media_navi_vc_app_ptr_, is_resuming()).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
- EXPECT_CALL(*media_navi_vc_app_ptr_, SetRegularState(_)).Times(0);
- state_ctrl_->SetRegularState(media_navi_vc_app_, invalid_state, false);
+ EXPECT_CALL(*media_navi_vc_app_ptr_, SetRegularState(kDefaultWindowId, _))
+ .Times(0);
+ state_ctrl_->SetRegularState(
+ media_navi_vc_app_, kDefaultWindowId, invalid_state, false);
}
}
@@ -1532,7 +1594,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullNotAudibleState());
@@ -1540,7 +1602,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullNotAudibleState(), false);
}
TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
@@ -1557,14 +1620,15 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullNotAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullNotAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1583,14 +1647,15 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullAudibleState());
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1607,7 +1672,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullAudibleState());
@@ -1615,7 +1680,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1633,7 +1699,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_full);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullAudibleState());
@@ -1641,7 +1707,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1660,7 +1727,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ ExpectSuccessfulSetHmiState(app_moved_to_limited,
app_moved_to_limited_mock,
BackgroundState(),
LimitedState());
@@ -1668,7 +1735,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_limited, kDefaultWindowId, LimitedState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1686,14 +1754,15 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ ExpectSuccessfulSetHmiState(app_moved_to_limited,
app_moved_to_limited_mock,
BackgroundState(),
LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_limited, kDefaultWindowId, LimitedState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1712,14 +1781,15 @@ TEST_F(StateControllerImplTest,
InsertApplication(app_in_full);
InsertApplication(app_moved_to_limited);
- ExpectSuccesfullSetHmiState(app_moved_to_limited,
+ ExpectSuccessfulSetHmiState(app_moved_to_limited,
app_moved_to_limited_mock,
BackgroundState(),
LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_full, app_in_full_mock, FullAudibleState());
- state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_limited, kDefaultWindowId, LimitedState(), false);
}
TEST_F(StateControllerImplTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
@@ -1743,7 +1813,7 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
InsertApplication(limited_app1);
InsertApplication(limited_app2);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullNotAudibleState());
@@ -1753,7 +1823,8 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
ExpectAppWontChangeHmiStateDueToConflictResolving(
limited_app2, limited_app2_mock, LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullNotAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1778,7 +1849,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullNotAudibleState());
@@ -1789,7 +1860,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullAudibleState(), LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullNotAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1814,7 +1886,7 @@ TEST_F(StateControllerImplTest,
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullNotAudibleState());
@@ -1825,7 +1897,8 @@ TEST_F(StateControllerImplTest,
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullNotAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullNotAudibleState(), false);
}
TEST_F(
@@ -1851,7 +1924,7 @@ TEST_F(
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullAudibleState());
@@ -1862,7 +1935,8 @@ TEST_F(
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(
@@ -1888,7 +1962,7 @@ TEST_F(
InsertApplication(limited_app);
InsertApplication(full_app);
- ExpectSuccesfullSetHmiState(app_moved_to_full,
+ ExpectSuccessfulSetHmiState(app_moved_to_full,
app_moved_to_full_mock,
BackgroundState(),
FullAudibleState());
@@ -1899,7 +1973,8 @@ TEST_F(
ExpectAppChangeHmiStateDueToConflictResolving(
full_app, full_app_mock, FullAudibleState(), LimitedState());
- state_ctrl_->SetRegularState(app_moved_to_full, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ app_moved_to_full, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1912,19 +1987,20 @@ TEST_F(StateControllerImplTest,
InsertApplication(media_app_);
InsertApplication(navi_app_);
InsertApplication(vc_app_);
- ExpectSuccesfullSetHmiState(media_navi_vc_app_,
+ ExpectSuccessfulSetHmiState(media_navi_vc_app_,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(LimitedState()));
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
vc_app_, vc_app_ptr_, LimitedState(), BackgroundState());
- state_ctrl_->SetRegularState(media_navi_vc_app_, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ media_navi_vc_app_, kDefaultWindowId, FullAudibleState(), false);
}
TEST_F(StateControllerImplTest,
@@ -1937,19 +2013,20 @@ TEST_F(StateControllerImplTest,
InsertApplication(media_app_);
InsertApplication(navi_app_);
InsertApplication(vc_app_);
- ExpectSuccesfullSetHmiState(media_navi_vc_app_,
+ ExpectSuccessfulSetHmiState(media_navi_vc_app_,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(LimitedState()));
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
vc_app_, vc_app_ptr_, FullAudibleState(), BackgroundState());
- state_ctrl_->SetRegularState(media_navi_vc_app_, FullAudibleState(), false);
+ state_ctrl_->SetRegularState(
+ media_navi_vc_app_, kDefaultWindowId, FullAudibleState(), false);
}
// TODO {AKozoriz} Changed logic in state_controller
@@ -1969,12 +2046,6 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
StateLevelPair(LimitedState(), Common_HMILevel::LIMITED));
hmi_states.push_back(
StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND));
- hmi_states.push_back(
- StateLevelPair(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- VideoStreamingState::NOT_STREAMABLE,
- SystemContext::SYSCTXT_MAIN),
- Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
@@ -1998,9 +2069,9 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
.WillOnce(Return(hmi_app_id));
EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
.WillOnce(Return(media_app_));
- ExpectSuccesfullSetHmiState(
+ ExpectSuccessfulSetHmiState(
media_app_, media_app_ptr_, initial_hmi_state, hmi_state);
- state_ctrl_->SetRegularState(media_app_, hmi_state, true);
+ state_ctrl_->SetRegularState(media_app_, kDefaultWindowId, hmi_state, true);
smart_objects::SmartObject message;
message[am::strings::params][am::hmi_response::code] =
Common_Result::SUCCESS;
@@ -2056,9 +2127,10 @@ TEST_F(StateControllerImplTest, SendEventBCActivateApp_HMIReceivesError) {
EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
.WillOnce(Return(simple_app_));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(kDefaultWindowId, _))
+ .Times(0);
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
.Times(0);
@@ -2084,13 +2156,14 @@ TEST_F(StateControllerImplTest, ActivateAppInvalidCorrelationId) {
.WillOnce(Return(hmi_app_id));
EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
.WillOnce(Return(am::ApplicationSharedPtr()));
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(kDefaultWindowId, _)).Times(0);
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
.Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(simple_app_->app_id(), _, _))
.Times(0);
SetBCActivateAppRequestToHMI(Common_HMILevel::FULL, corr_id);
- state_ctrl_->SetRegularState(simple_app_, FullNotAudibleState(), true);
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, FullNotAudibleState(), true);
smart_objects::SmartObject message;
message[am::strings::params][am::hmi_response::code] = Common_Result::SUCCESS;
message[am::strings::params][am::strings::correlation_id] = corr_id;
@@ -2516,43 +2589,43 @@ TEST_F(StateControllerImplTest, SetRegularStateWithNewHmiLvl) {
using namespace mobile_apis;
HMILevel::eType set_lvl = HMILevel::HMI_NONE;
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()))
.WillOnce(Return(BackgroundState()));
- state_ctrl_->SetRegularState(simple_app_, set_lvl);
+ state_ctrl_->SetRegularState(simple_app_, kDefaultWindowId, set_lvl);
set_lvl = HMILevel::HMI_LIMITED;
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()))
.WillOnce(Return(BackgroundState()));
- state_ctrl_->SetRegularState(simple_app_, set_lvl);
+ state_ctrl_->SetRegularState(simple_app_, kDefaultWindowId, set_lvl);
set_lvl = HMILevel::HMI_FULL;
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()));
const uint32_t corr_id = 314;
SetBCActivateAppRequestToHMI(
static_cast<hmi_apis::Common_HMILevel::eType>(set_lvl), corr_id);
- state_ctrl_->SetRegularState(simple_app_, set_lvl);
+ state_ctrl_->SetRegularState(simple_app_, kDefaultWindowId, set_lvl);
set_lvl = HMILevel::HMI_BACKGROUND;
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()))
.WillOnce(Return(BackgroundState()));
- state_ctrl_->SetRegularState(simple_app_, set_lvl);
+ state_ctrl_->SetRegularState(simple_app_, kDefaultWindowId, set_lvl);
}
TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
@@ -2562,16 +2635,18 @@ TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
AudioStreamingState::AUDIBLE,
VideoStreamingState::STREAMABLE,
SystemContext::SYSCTXT_MAIN);
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillRepeatedly(Return(BackgroundState()));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(check_state))
.WillOnce(Return(check_state));
EXPECT_CALL(*simple_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(check_state))));
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
state_ctrl_->SetRegularState(simple_app_,
+ kDefaultWindowId,
AudioStreamingState::AUDIBLE,
VideoStreamingState::STREAMABLE);
}
@@ -2588,23 +2663,27 @@ TEST_F(StateControllerImplTest,
// Non-media app can't have LIMITED-AUDIO state
EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(kDefaultWindowId, _)).Times(0);
EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(_))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
EXPECT_CALL(*simple_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(simple_app_, check_state, false);
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, check_state, false);
check_state = LimitedState();
EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*media_app_ptr_, CurrentHmiState()).Times(0);
- EXPECT_CALL(*media_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*media_app_ptr_, SetRegularState(kDefaultWindowId, _)).Times(0);
EXPECT_CALL(*media_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(media_app_, check_state, false);
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ media_app_, kDefaultWindowId, check_state, false);
}
TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
@@ -2621,7 +2700,7 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
HmiStatePtr check_state = FullNotAudibleState();
// Non-media app can't have LIMITED-AUDIO state
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(check_state))
.WillOnce(Return(check_state));
@@ -2631,16 +2710,19 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
SendOnResumeAudioSourceToHMI(simple_app_id_, _))
.Times(0);
EXPECT_CALL(*simple_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))))
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))))
.Times(0);
EXPECT_CALL(*simple_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(simple_app_, check_state, false);
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, check_state, false);
// Set state of media app after vr has stopped
check_state = LimitedState();
- EXPECT_CALL(*media_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(check_state))
.WillOnce(Return(check_state));
@@ -2649,11 +2731,14 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
EXPECT_CALL(message_helper_mock_,
SendOnResumeAudioSourceToHMI(media_app_id_, _));
EXPECT_CALL(*media_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))))
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))))
.Times(0);
EXPECT_CALL(*media_app_ptr_,
- SetRegularState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(media_app_, check_state, false);
+ SetRegularState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ media_app_, kDefaultWindowId, check_state, false);
}
TEST_F(StateControllerImplTest,
@@ -2676,28 +2761,32 @@ TEST_F(StateControllerImplTest,
HmiStatePtr check_state = FullNotAudibleState();
EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()).Times(0);
- EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(kDefaultWindowId, _)).Times(0);
EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(_))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
EXPECT_CALL(*simple_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(simple_app_, check_state, false);
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, check_state, false);
// Set media app
check_state = LimitedState();
EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*media_app_ptr_, RegularHmiState()).Times(0);
- EXPECT_CALL(*media_app_ptr_, CurrentHmiState()).Times(0);
- EXPECT_CALL(*media_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*media_app_ptr_, CurrentHmiState(kDefaultWindowId)).Times(0);
+ EXPECT_CALL(*media_app_ptr_, SetRegularState(kDefaultWindowId, _)).Times(0);
EXPECT_CALL(*media_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(media_app_, check_state, false);
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ media_app_, kDefaultWindowId, check_state, false);
}
TEST_F(StateControllerImplTest,
@@ -2730,8 +2819,10 @@ TEST_F(StateControllerImplTest,
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
EXPECT_CALL(*media_app_ptr_,
- SetPostponedState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(media_app_, check_state, false);
+ SetPostponedState(kDefaultWindowId,
+ Truly(HmiStatesComparator(check_state))));
+ state_ctrl_->SetRegularState(
+ media_app_, kDefaultWindowId, check_state, false);
}
TEST_F(StateControllerImplTest,
@@ -2759,13 +2850,13 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
.WillRepeatedly(Return(false));
- EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(hmi_state));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
- state_ctrl_->SetRegularState(navi_app_, hmi_state, false);
+ state_ctrl_->SetRegularState(navi_app_, kDefaultWindowId, hmi_state, false);
}
TEST_F(StateControllerImplTest,
@@ -2793,15 +2884,15 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
.WillRepeatedly(Return(false));
- EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(hmi_state));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
- EXPECT_CALL(*navi_app_ptr_, SetPostponedState(_)).Times(0);
+ EXPECT_CALL(*navi_app_ptr_, SetPostponedState(kDefaultWindowId, _)).Times(0);
- state_ctrl_->SetRegularState(navi_app_, hmi_state, false);
+ state_ctrl_->SetRegularState(navi_app_, kDefaultWindowId, hmi_state, false);
}
TEST_F(StateControllerImplTest,
@@ -2809,7 +2900,6 @@ TEST_F(StateControllerImplTest,
using namespace hmi_apis;
using namespace smart_objects;
using namespace am::event_engine;
- using namespace constants;
const uint32_t app_id = navi_app_->app_id();
// Precondition
@@ -2833,13 +2923,13 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
.WillRepeatedly(Return(false));
- EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(hmi_state));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
- state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
+ state_ctrl_->SetRegularState(navi_app_, kDefaultWindowId, hmi_state, true);
}
TEST_F(StateControllerImplTest,
@@ -2847,7 +2937,6 @@ TEST_F(StateControllerImplTest,
using namespace hmi_apis;
using namespace smart_objects;
using namespace am::event_engine;
- using namespace constants;
const uint32_t app_id = navi_app_->app_id();
// Precondition
@@ -2871,15 +2960,15 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
.WillRepeatedly(Return(false));
- EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(hmi_state));
EXPECT_CALL(app_manager_mock_, active_application())
.WillRepeatedly(Return(am::ApplicationSharedPtr()));
- EXPECT_CALL(*navi_app_ptr_, SetPostponedState(_)).Times(0);
+ EXPECT_CALL(*navi_app_ptr_, SetPostponedState(kDefaultWindowId, _)).Times(0);
- state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
+ state_ctrl_->SetRegularState(navi_app_, kDefaultWindowId, hmi_state, true);
}
TEST_F(StateControllerImplTest,
@@ -2900,13 +2989,16 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(FullAudibleState()));
EXPECT_CALL(*simple_app_ptr_, set_keep_context(false));
HmiStatePtr new_state;
- EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
- .WillOnce(SaveArg<0>(&new_state));
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(kDefaultWindowId, _))
+ .WillOnce(SaveArg<1>(&new_state));
+
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
state_ctrl_->on_event(event);
@@ -2931,12 +3023,15 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(LimitedState()));
HmiStatePtr new_state;
- EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
- .WillOnce(SaveArg<0>(&new_state));
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(kDefaultWindowId, _))
+ .WillOnce(SaveArg<1>(&new_state));
+
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
state_ctrl_->on_event(event);
@@ -2955,9 +3050,13 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
event.set_smart_object(msg);
EXPECT_CALL(app_manager_mock_, application(app_id))
.WillOnce(Return(simple_app_));
- EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId)).Times(0);
+
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
+
state_ctrl_->on_event(event);
}
@@ -2971,7 +3070,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectApp) {
const am::ApplicationSharedPtr incorrect_app;
EXPECT_CALL(app_manager_mock_, application(_))
.WillOnce(Return(incorrect_app));
- EXPECT_CALL(*simple_app_ptr_, hmi_level()).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId)).Times(0);
state_ctrl_->on_event(event);
}
@@ -2992,15 +3091,20 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
EXPECT_CALL(app_manager_mock_, application(app_id))
.WillOnce(Return(simple_app_));
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
- EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
// DeactivateApp
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()))
.WillOnce(Return(BackgroundState()));
+
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
+
state_ctrl_->on_event(event);
}
@@ -3021,16 +3125,21 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
EXPECT_CALL(app_manager_mock_, application(app_id))
.WillOnce(Return(simple_app_));
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
- EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
// DeactivateApp
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillOnce(Return(BackgroundState()))
.WillOnce(Return(BackgroundState()));
+
+ am::WindowIds window_ids = {kDefaultWindowId};
+ EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
+
state_ctrl_->on_event(event);
}
@@ -3050,25 +3159,35 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivatedIncorrectApp) {
}
TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
- using namespace constants;
-
smart_objects::SmartObject msg;
- for (std::vector<am::ApplicationSharedPtr>::const_iterator it =
- applications_list_.begin();
+ am::WindowIds window_ids = {kDefaultWindowId};
+
+ for (AppPtrMockMapping::const_iterator it = applications_list_.begin();
it != applications_list_.end();
++it) {
- uint32_t app_id = (*it)->app_id();
+ uint32_t app_id = it->first->app_id();
msg[am::strings::msg_params][am::strings::app_id] = app_id;
const hmi_apis::FunctionID::eType event_id =
hmi_apis::FunctionID::BasicCommunication_OnAppActivated;
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- EXPECT_CALL(app_manager_mock_, application(app_id)).WillOnce(Return(*it));
+ EXPECT_CALL(app_manager_mock_, application(app_id))
+ .WillOnce(Return(it->first));
// SetRegularState
- EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
- EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*it->second, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*it->second, IsAudioApplication()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*it->second, GetWindowIds()).WillOnce(Return(window_ids));
+
+ const am::HmiStatePtr old_state =
+ CreateHmiStateByHmiStateType<am::HmiState>(
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ simple_app_);
+ EXPECT_CALL(*it->second, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state));
smart_objects::SmartObjectSPtr activate_app =
std::make_shared<smart_objects::SmartObject>();
@@ -3149,9 +3268,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
simple_app_);
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(old_state));
- EXPECT_CALL(*simple_app_ptr_, AddHMIState(_)).Times(4);
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(kDefaultWindowId, _)).Times(4);
const am::HmiStatePtr default_state =
CreateHmiStateByHmiStateType<am::HmiState>(
@@ -3161,12 +3280,14 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(old_state));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(default_state));
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
- EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(simple_app_, kDefaultWindowId, _));
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _));
state_ctrl_->OnApplicationRegistered(simple_app_,
@@ -3200,9 +3321,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
simple_app_);
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(old_state));
- EXPECT_CALL(*simple_app_ptr_, AddHMIState(_)).Times(2);
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(kDefaultWindowId, _)).Times(2);
const am::HmiStatePtr default_state =
CreateHmiStateByHmiStateType<am::HmiState>(
@@ -3211,9 +3332,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
.WillOnce(Return(default_state));
- EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kDefaultWindowId))
.WillRepeatedly(Return(default_state));
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
@@ -3224,6 +3345,328 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
mobile_apis::HMILevel::HMI_BACKGROUND);
}
+TEST_F(
+ StateControllerImplTest,
+ SetRegularState_AppIsResumingAndAudioSourceIsActive_HmiStateIsNotChanged) {
+ am::event_engine::Event audio_source_event(
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+ audio_source_event.set_smart_object(message);
+ state_ctrl_->on_event(audio_source_event);
+
+ EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*media_app_ptr_, SetRegularState(_, _)).Times(0);
+
+ const am::HmiStatePtr new_state = FullAudibleState();
+ const bool send_activate_app = true;
+ state_ctrl_->SetRegularState(
+ media_app_, kDefaultWindowId, new_state, send_activate_app);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegularState_BcActivateAppSendFailed_HmiLevelIsNotChanged) {
+ const am::HmiStatePtr new_state = FullAudibleState();
+ SetBCActivateAppRequestToHMI(
+ static_cast<hmi_apis::Common_HMILevel::eType>(new_state->hmi_level()),
+ kCorrID);
+
+ smart_objects::SmartObjectSPtr bc_activate_app_request;
+ EXPECT_CALL(message_helper_mock_, GetBCActivateAppRequestToHMI(_, _, _, _, _))
+ .WillOnce(Return(bc_activate_app_request));
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_, _)).Times(0);
+
+ const bool send_activate_app = true;
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, new_state, send_activate_app);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegularState_SetLevelAudioAndVideoState_HmiStateIsChanged) {
+ HmiStatePtr old_state = NoneNotAudibleState();
+ HmiStatePtr new_state = BackgroundState();
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state));
+ ExpectSuccessfulSetHmiState(
+ simple_app_, simple_app_ptr_, old_state, new_state);
+
+ const bool send_activate_app = false;
+ state_ctrl_->SetRegularState(simple_app_,
+ kDefaultWindowId,
+ new_state->hmi_level(),
+ new_state->audio_streaming_state(),
+ new_state->video_streaming_state(),
+ send_activate_app);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegularState_SetLevelAudioVideoStatesAndContext_HmiStateIsChanged) {
+ HmiStatePtr old_state = NoneNotAudibleState();
+ HmiStatePtr new_state = BackgroundState();
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state));
+ ExpectSuccessfulSetHmiState(
+ simple_app_, simple_app_ptr_, old_state, new_state);
+
+ const bool send_activate_app = false;
+ state_ctrl_->SetRegularState(simple_app_,
+ kDefaultWindowId,
+ new_state->hmi_level(),
+ new_state->audio_streaming_state(),
+ new_state->video_streaming_state(),
+ new_state->system_context(),
+ send_activate_app);
+}
+
+TEST_F(StateControllerImplTest,
+ SetRegularState_SetSystemContextOnly_HmiStateIsChanged) {
+ HmiStatePtr old_state = FullAudibleState();
+ HmiStatePtr new_state = FullNotAudibleState();
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state));
+ ExpectSuccessfulSetHmiState(
+ simple_app_, simple_app_ptr_, old_state, new_state);
+
+ state_ctrl_->SetRegularState(
+ simple_app_, kDefaultWindowId, new_state->system_context());
+}
+
+TEST_F(StateControllerImplTest,
+ OnAppActivated_ActivateNotExistingWindow_HmiLevelIsNotChanged) {
+ InsertApplication(simple_app_);
+
+ am::event_engine::Event activate_widget_event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::strings::app_id] = simple_app_id_;
+ message[am::strings::msg_params][am::strings::window_id] = kCustomWindowId;
+ activate_widget_event.set_smart_object(message);
+
+ const am::WindowIds window_ids = {kDefaultWindowId};
+ ON_CALL(*simple_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ simple_app_, simple_app_ptr_, kCustomWindowId, NoneNotAudibleState());
+
+ state_ctrl_->on_event(activate_widget_event);
+}
+
+TEST_F(StateControllerImplTest,
+ OnAppActivated_ActivateCustomWindow_HmiStateIsChanged) {
+ InsertApplication(simple_app_);
+
+ am::event_engine::Event activate_widget_event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::strings::app_id] = simple_app_id_;
+ message[am::strings::msg_params][am::strings::window_id] = kCustomWindowId;
+ activate_widget_event.set_smart_object(message);
+
+ const am::WindowIds window_ids = {kDefaultWindowId, kCustomWindowId};
+ ON_CALL(*simple_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ std::vector<std::pair<HmiStatePtr, HmiStatePtr> > states_transition = {
+ std::make_pair(NoneNotAudibleState(), BackgroundState()),
+ std::make_pair(BackgroundState(), FullNotAudibleState())};
+
+ for (auto& states_pair : states_transition) {
+ HmiStatePtr old_state = states_pair.first;
+ HmiStatePtr new_state = states_pair.second;
+
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kCustomWindowId))
+ .WillOnce(Return(old_state->hmi_level()));
+ EXPECT_CALL(*simple_app_ptr_, audio_streaming_state())
+ .WillOnce(Return(old_state->audio_streaming_state()));
+ EXPECT_CALL(*simple_app_ptr_, video_streaming_state())
+ .WillOnce(Return(old_state->video_streaming_state()));
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kCustomWindowId))
+ .WillOnce(Return(old_state));
+ ExpectSuccessfulSetHmiState(
+ simple_app_, simple_app_ptr_, kCustomWindowId, old_state, new_state);
+
+ EXPECT_CALL(message_helper_mock_,
+ GetBCActivateAppRequestToHMI(_, _, _, _, _))
+ .Times(0);
+
+ state_ctrl_->on_event(activate_widget_event);
+ }
+}
+
+TEST_F(StateControllerImplTest,
+ OnAppDeactivated_DeactivateNotExistingWindow_HmiStateIsNotChanged) {
+ InsertApplication(simple_app_);
+
+ am::event_engine::Event activate_widget_event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::strings::app_id] = simple_app_id_;
+ message[am::strings::msg_params][am::strings::window_id] = kCustomWindowId;
+ activate_widget_event.set_smart_object(message);
+
+ const am::WindowIds window_ids = {kDefaultWindowId};
+ ON_CALL(*simple_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ simple_app_, simple_app_ptr_, kCustomWindowId, FullNotAudibleState());
+
+ state_ctrl_->on_event(activate_widget_event);
+}
+
+TEST_F(StateControllerImplTest,
+ OnAppDeactivated_DeactivateCustomWindow_HmiStateIsChanged) {
+ InsertApplication(simple_app_);
+
+ am::event_engine::Event activate_widget_event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::strings::app_id] = simple_app_id_;
+ message[am::strings::msg_params][am::strings::window_id] = kCustomWindowId;
+ activate_widget_event.set_smart_object(message);
+
+ const am::WindowIds window_ids = {kDefaultWindowId, kCustomWindowId};
+ ON_CALL(*simple_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ std::vector<std::pair<HmiStatePtr, HmiStatePtr> > states_transition = {
+ std::make_pair(FullNotAudibleState(), BackgroundState()),
+ std::make_pair(BackgroundState(), NoneNotAudibleState())};
+
+ for (auto& states_pair : states_transition) {
+ HmiStatePtr old_state = states_pair.first;
+ HmiStatePtr new_state = states_pair.second;
+
+ EXPECT_CALL(*simple_app_ptr_, hmi_level(kCustomWindowId))
+ .WillOnce(Return(old_state->hmi_level()));
+ EXPECT_CALL(*simple_app_ptr_, audio_streaming_state())
+ .WillOnce(Return(old_state->audio_streaming_state()));
+ EXPECT_CALL(*simple_app_ptr_, video_streaming_state())
+ .WillOnce(Return(old_state->video_streaming_state()));
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kCustomWindowId))
+ .WillOnce(Return(old_state));
+ ExpectSuccessfulSetHmiState(
+ simple_app_, simple_app_ptr_, kCustomWindowId, old_state, new_state);
+
+ EXPECT_CALL(message_helper_mock_,
+ GetBCActivateAppRequestToHMI(_, _, _, _, _))
+ .Times(0);
+
+ state_ctrl_->on_event(activate_widget_event);
+ }
+}
+
+TEST_F(
+ StateControllerImplTest,
+ ActivateDefaultWindow_AppWithWindowWasActivated_WindowStreamingStateIsUpdated) {
+ HmiStatePtr old_state = NoneNotAudibleState();
+ HmiStatePtr new_state = FullAudibleState();
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state))
+ .WillRepeatedly(Return(new_state));
+ ExpectSuccessfulSetHmiState(
+ media_app_, media_app_ptr_, kDefaultWindowId, old_state, new_state);
+
+ const am::WindowIds window_ids = {kDefaultWindowId, kCustomWindowId};
+ ON_CALL(*media_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kCustomWindowId))
+ .WillOnce(Return(old_state));
+
+ HmiStatePtr expected_window_state = NoneNotAudibleState();
+ expected_window_state->set_audio_streaming_state(
+ new_state->audio_streaming_state());
+ expected_window_state->set_video_streaming_state(
+ new_state->video_streaming_state());
+
+ EXPECT_CALL(
+ *media_app_ptr_,
+ SetRegularState(kCustomWindowId,
+ Truly(HmiStatesComparator(expected_window_state))));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(media_app_, kCustomWindowId, _));
+
+ state_ctrl_->ActivateDefaultWindow(media_app_);
+}
+
+TEST_F(StateControllerImplTest,
+ ExitDefaultWindow_AppWithWindowWasExited_WindowStreamingStateIsUpdated) {
+ HmiStatePtr old_state = FullAudibleState();
+ HmiStatePtr new_state = NoneNotAudibleState();
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kDefaultWindowId))
+ .WillOnce(Return(old_state))
+ .WillRepeatedly(Return(new_state));
+ ExpectSuccessfulSetHmiState(
+ media_app_, media_app_ptr_, kDefaultWindowId, old_state, new_state);
+
+ const am::WindowIds window_ids = {kDefaultWindowId, kCustomWindowId};
+ ON_CALL(*media_app_ptr_, GetWindowIds()).WillByDefault(Return(window_ids));
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState(kCustomWindowId))
+ .WillOnce(Return(old_state));
+
+ HmiStatePtr expected_window_state = FullAudibleState();
+ expected_window_state->set_audio_streaming_state(
+ new_state->audio_streaming_state());
+ expected_window_state->set_video_streaming_state(
+ new_state->video_streaming_state());
+
+ EXPECT_CALL(
+ *media_app_ptr_,
+ SetRegularState(kCustomWindowId,
+ Truly(HmiStatesComparator(expected_window_state))));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(media_app_, kCustomWindowId, _));
+
+ state_ctrl_->ExitDefaultWindow(media_app_);
+}
+
+TEST_F(StateControllerImplTest,
+ OnAppWindowAdded_NewAppWindowWasAdded_HmiNotificationIsSent) {
+ am::event_engine::Event audio_source_event(
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
+ smart_objects::SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+ audio_source_event.set_smart_object(message);
+ state_ctrl_->on_event(audio_source_event);
+
+ HmiStatePtr initial_state =
+ createHmiState(mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
+ mobile_apis::SystemContext::INVALID_ENUM);
+ HmiStatePtr expected_state = NoneNotAudibleState();
+
+ EXPECT_CALL(*simple_app_ptr_,
+ AddHMIState(kCustomWindowId,
+ Truly(HmiStatesIDComparator(
+ HmiState::StateID::STATE_ID_AUDIO_SOURCE))));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState(kCustomWindowId))
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(kCustomWindowId,
+ Truly(HmiStatesComparator(expected_state))));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState(kCustomWindowId))
+ .WillOnce(Return(initial_state))
+ .WillOnce(Return(expected_state));
+ EXPECT_CALL(message_helper_mock_,
+ SendHMIStatusNotification(simple_app_, kCustomWindowId, _));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+
+ state_ctrl_->OnAppWindowAdded(simple_app_,
+ kCustomWindowId,
+ mobile_apis::WindowType::WIDGET,
+ mobile_apis::HMILevel::HMI_NONE);
+}
+
} // namespace state_controller_test
} // namespace components
} // namespace test
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 0a1e8b2c17..a6773e8987 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -425,6 +425,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint8_t* bluetooth_uuid() const OVERRIDE;
+ const std::string& aoa_filter_manufacturer() const OVERRIDE;
+ const std::string& aoa_filter_model_name() const OVERRIDE;
+ const std::string& aoa_filter_description() const OVERRIDE;
+ const std::string& aoa_filter_version() const OVERRIDE;
+ const std::string& aoa_filter_uri() const OVERRIDE;
+ const std::string& aoa_filter_serial_number() const OVERRIDE;
+
// TransportManageMMESettings interface
const std::string& event_mq_name() const OVERRIDE;
@@ -982,6 +989,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint32_t cloud_app_retry_timeout_;
uint16_t cloud_app_max_retry_attempts_;
std::vector<uint8_t> bluetooth_uuid_;
+ std::string aoa_filter_manufacturer_;
+ std::string aoa_filter_model_name_;
+ std::string aoa_filter_description_;
+ std::string aoa_filter_version_;
+ std::string aoa_filter_uri_;
+ std::string aoa_filter_serial_number_;
std::string tts_delimiter_;
uint32_t audio_data_stopped_timeout_;
uint32_t video_data_stopped_timeout_;
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index c38b28db5f..02015e66d5 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -185,6 +185,12 @@ const char* kPendingRequestsAmoundKey = "PendingRequestsAmount";
const char* kSupportedDiagModesKey = "SupportedDiagModes";
const char* kTransportManagerDisconnectTimeoutKey = "DisconnectTimeout";
const char* kBluetoothUUIDKey = "BluetoothUUID";
+const char* kAOAFilterManufacturerKey = "AOAFilterManufacturer";
+const char* kAOAFilterModelNameKey = "AOAFilterModelName";
+const char* kAOAFilterDescriptionKey = "AOAFilterDescription";
+const char* kAOAFilterVersionKey = "AOAFilterVersion";
+const char* kAOAFilterURIKey = "AOAFilterURI";
+const char* kAOAFilterSerialNumber = "AOAFilterSerialNumber";
const char* kTTSDelimiterKey = "TTSDelimiter";
const char* kRecordingFileNameKey = "RecordingFileName";
const char* kRecordingFileSourceKey = "RecordingFileSource";
@@ -414,6 +420,12 @@ const std::vector<uint8_t> kDefaultBluetoothUUID = {0x93,
0xC8,
0x22,
0xA8};
+const char* kDefaultAOAFilterManufacturer = "SDL";
+const char* kDefaultAOAFilterModelName = "Core";
+const char* kDefaultAOAFilterDescription = "SmartDeviceLink Core Component USB";
+const char* kDefaultAOAFilterVersion = "1.0";
+const char* kDefaultAOAFilterURI = "http://www.smartdevicelink.org";
+const char* kDefaultAOAFilterSerialNumber = "N000000";
} // namespace
namespace profile {
@@ -827,6 +839,30 @@ const uint8_t* Profile::bluetooth_uuid() const {
return bluetooth_uuid_.data();
}
+const std::string& Profile::aoa_filter_manufacturer() const {
+ return aoa_filter_manufacturer_;
+}
+
+const std::string& Profile::aoa_filter_model_name() const {
+ return aoa_filter_model_name_;
+}
+
+const std::string& Profile::aoa_filter_description() const {
+ return aoa_filter_description_;
+}
+
+const std::string& Profile::aoa_filter_version() const {
+ return aoa_filter_version_;
+}
+
+const std::string& Profile::aoa_filter_uri() const {
+ return aoa_filter_uri_;
+}
+
+const std::string& Profile::aoa_filter_serial_number() const {
+ return aoa_filter_serial_number_;
+}
+
const std::string& Profile::tts_delimiter() const {
return tts_delimiter_;
}
@@ -1849,6 +1885,57 @@ void Profile::UpdateValues() {
bluetooth_uuid_ = kDefaultBluetoothUUID;
}
+ ReadStringValue(&aoa_filter_manufacturer_,
+ kDefaultAOAFilterManufacturer,
+ kTransportManagerSection,
+ kAOAFilterManufacturerKey);
+
+ LOG_UPDATED_VALUE(aoa_filter_manufacturer_,
+ kAOAFilterManufacturerKey,
+ kTransportManagerSection);
+
+ ReadStringValue(&aoa_filter_model_name_,
+ kDefaultAOAFilterModelName,
+ kTransportManagerSection,
+ kAOAFilterModelNameKey);
+
+ LOG_UPDATED_VALUE(
+ aoa_filter_model_name_, kAOAFilterModelNameKey, kTransportManagerSection);
+
+ ReadStringValue(&aoa_filter_description_,
+ kDefaultAOAFilterDescription,
+ kTransportManagerSection,
+ kAOAFilterDescriptionKey);
+
+ LOG_UPDATED_VALUE(aoa_filter_description_,
+ kAOAFilterDescriptionKey,
+ kTransportManagerSection);
+
+ ReadStringValue(&aoa_filter_version_,
+ kDefaultAOAFilterVersion,
+ kTransportManagerSection,
+ kAOAFilterVersionKey);
+
+ LOG_UPDATED_VALUE(
+ aoa_filter_version_, kAOAFilterVersionKey, kTransportManagerSection);
+
+ ReadStringValue(&aoa_filter_uri_,
+ kDefaultAOAFilterURI,
+ kTransportManagerSection,
+ kAOAFilterURIKey);
+
+ LOG_UPDATED_VALUE(
+ aoa_filter_uri_, kAOAFilterURIKey, kTransportManagerSection);
+
+ ReadStringValue(&aoa_filter_serial_number_,
+ kDefaultAOAFilterSerialNumber,
+ kTransportManagerSection,
+ kAOAFilterSerialNumber);
+
+ LOG_UPDATED_VALUE(aoa_filter_serial_number_,
+ kAOAFilterSerialNumber,
+ kTransportManagerSection);
+
// Event MQ
ReadStringValue(
&event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey);
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 8e45d4ecd9..52fb3d35df 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -139,7 +139,7 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData");
MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings");
MessageBrokerController::subscribeTo(
- "SystemCapability.OnSystemCapabilityUpdated");
+ "BasicCommunication.OnSystemCapabilityUpdated");
LOG4CXX_INFO(logger_, "Subscribed to notifications.");
}
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 521eadf48e..1e17974da4 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -94,9 +94,12 @@ class StateControllerImpl;
struct CommandParametersPermissions;
using policy::RPCParams;
typedef std::vector<ApplicationSharedPtr> AppSharedPtrs;
-struct ApplicationsAppIdSorter {
+struct ApplicationsSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) const {
+ if (lhs->app_id() == rhs->app_id()) {
+ return lhs->device() < rhs->device();
+ }
return lhs->app_id() < rhs->app_id();
}
};
@@ -110,7 +113,7 @@ struct ApplicationsPolicyAppIdSorter {
}
};
-typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplicationSet;
+typedef std::set<ApplicationSharedPtr, ApplicationsSorter> ApplicationSet;
typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
AppsWaitRegistrationSet;
@@ -278,15 +281,6 @@ class ApplicationManager {
mobile_apis::HMILevel::eType to) = 0;
/**
- * @brief Sends HMI status notification to mobile
- *
- * @param application_impl application with changed HMI status
- *
- **/
- virtual void SendHMIStatusNotification(
- const std::shared_ptr<Application> app) = 0;
-
- /**
* @brief Checks if driver distraction state is valid, creates message
* which is sent to the application if allowed, otherwise it is added
* to a list of postponed messages.
@@ -606,8 +600,8 @@ class ApplicationManager {
/**
* @brief Checks, if given RPC is allowed at current HMI level for specific
* application in policy table
- * @param policy_app_id Application id
- * @param hmi_level Current HMI level of application
+ * @param app Application
+ * @param window_id id of application's window
* @param function_id FunctionID of RPC
* @param params_permissions Permissions for RPC parameters (e.g.
* SubscribeVehicleData) defined in policy table
@@ -615,6 +609,7 @@ class ApplicationManager {
*/
virtual mobile_apis::Result::eType CheckPolicyPermissions(
const ApplicationSharedPtr app,
+ const WindowID window_id,
const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions = NULL) = 0;
@@ -635,11 +630,14 @@ class ApplicationManager {
/**
* @brief IsAppInReconnectMode check if application belongs to session
* affected by transport switching at the moment
+ * @param device_id device indentifier
* @param policy_app_id Application id
* @return True if application is registered within session being switched,
* otherwise - false
*/
- virtual bool IsAppInReconnectMode(const std::string& policy_app_id) const = 0;
+ virtual bool IsAppInReconnectMode(
+ const connection_handler::DeviceHandle& device_id,
+ const std::string& policy_app_id) const = 0;
virtual resumption::ResumeCtrl& resume_controller() = 0;
@@ -705,6 +703,7 @@ class ApplicationManager {
/**
* @brief CreateRegularState create regular HMI state for application
* @param app Application
+ * @param window_type type of window
* @param hmi_level of returned state
* @param audio_state of returned state
* @param system_context of returned state
@@ -712,10 +711,11 @@ class ApplicationManager {
*/
virtual HmiStatePtr CreateRegularState(
std::shared_ptr<Application> app,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::VideoStreamingState::eType video_state,
- mobile_apis::SystemContext::eType system_context) const = 0;
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
+ const mobile_apis::SystemContext::eType system_context) const = 0;
/**
* @brief Checks if application can stream (streaming service is started and
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 215a549579..a30625347d 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -63,9 +63,9 @@ class HMICapabilities {
virtual HMILanguageHandler& get_hmi_language_handler() = 0;
/*
- * @brief Checks is image type(Static/Dynamic) requested by
+ * @brief Checks if image type(Static/Dynamic) requested by
* Mobile Device is supported on current HMI.
- * @param image_type recieved type of image from Enum.
+ * @param image_type received type of image from Enum.
* @return Bool true if supported
*/
virtual bool VerifyImageType(const int32_t image_type) const = 0;
@@ -230,6 +230,20 @@ class HMICapabilities {
const smart_objects::SmartObject& display_capabilities) = 0;
/*
+ * @brief Retrieves information about the display capability
+ * @return Currently supported display capability
+ */
+ virtual const smart_objects::SmartObjectSPtr system_display_capabilities()
+ const = 0;
+
+ /*
+ * @brief Sets supported display capability
+ * @param display_capabilities supported display capability
+ */
+ virtual void set_system_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) = 0;
+
+ /*
* @brief Retrieves information about the HMI zone capabilities
*
* @return Currently supported HMI zone capabilities
@@ -441,6 +455,14 @@ class HMICapabilities {
virtual bool rc_supported() const = 0;
/*
+ * @brief Retrieves whether HMI supports passed Menu Layout
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool menu_layout_supported(
+ mobile_apis::MenuLayout::eType layout) const = 0;
+
+ /*
* @brief Interface used to store information regarding
* the navigation "System Capability"
*
@@ -525,6 +547,18 @@ class HMICapabilities {
virtual void convert_json_languages_to_obj(
const Json::Value& json_languages,
smart_objects::SmartObject& languages) const = 0;
+
+ /*
+ * @brief function that converts a single entry of audio pass thru capability
+ * to smart object
+ *
+ * @param capability json object that represents a single entry of audio pass
+ * thru capability
+ * @param output_so the converted object
+ */
+ virtual void convert_audio_capability_to_obj(
+ const Json::Value& capability,
+ smart_objects::SmartObject& output_so) const = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index 708c4ddd32..75655f7f08 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -38,6 +38,8 @@
#include <set>
#include <string>
#include <vector>
+#include "boost/optional.hpp"
+
#include "application_manager/application.h"
#include "application_manager/policies/policy_handler_observer.h"
#include "interfaces/MOBILE_API.h"
@@ -49,6 +51,7 @@
#include "smart_objects/smart_object.h"
#include "utils/callable.h"
#include "utils/custom_string.h"
+#include "utils/optional.h"
using namespace ::rpc::policy_table_interface_base;
namespace policy {
@@ -68,11 +71,12 @@ class PolicyHandlerInterface {
virtual bool ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string) = 0;
virtual bool UnloadPolicyLibrary() = 0;
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions,
const HMILevel& default_hmi) = 0;
-
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions) = 0;
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -87,6 +91,7 @@ class PolicyHandlerInterface {
std::string* priority) const = 0;
virtual void CheckPermissions(
const application_manager::ApplicationSharedPtr app,
+ const application_manager::WindowID window_id,
const PTString& rpc,
const RPCParams& rpc_params,
CheckPermissionResult& result) = 0;
@@ -95,7 +100,8 @@ class PolicyHandlerInterface {
const std::string& priority) const = 0;
virtual DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const = 0;
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
+ virtual bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const = 0;
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -121,6 +127,10 @@ class PolicyHandlerInterface {
virtual uint32_t TimeoutExchangeMSec() const = 0;
virtual void OnExceededTimeout() = 0;
virtual void OnSystemReady() = 0;
+ virtual const boost::optional<bool> LockScreenDismissalEnabledState()
+ const = 0;
+ virtual const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const = 0;
virtual void PTUpdatedAt(Counters counter, int value) = 0;
virtual void add_listener(PolicyHandlerObserver* listener) = 0;
virtual void remove_listener(PolicyHandlerObserver* listener) = 0;
@@ -130,6 +140,7 @@ class PolicyHandlerInterface {
virtual void SendOnAppPermissionsChanged(
const AppPermissions& permissions,
+ const std::string& device_id,
const std::string& policy_app_id) const = 0;
/**
@@ -169,7 +180,8 @@ class PolicyHandlerInterface {
*/
virtual void OnIgnitionCycleOver() = 0;
- virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
+ virtual void OnPendingPermissionChange(const std::string& device_id,
+ const std::string& policy_app_id) = 0;
/**
* Initializes PT exchange at user request
@@ -248,9 +260,11 @@ class PolicyHandlerInterface {
/**
* @brief Update currently used device id in policies manager for given
* application
+ * @param device_handle device identifier
* @param policy_app_id Application id
*/
virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) = 0;
/**
@@ -335,10 +349,12 @@ class PolicyHandlerInterface {
/**
* @brief Allows to add new or update existed application during
* registration process
+ * @param device_id device identifier
* @param application_id The policy aplication id.
* @return function that will notify update manager about new application
*/
virtual StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
@@ -377,17 +393,21 @@ class PolicyHandlerInterface {
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU.
*
+ * @param device_id device identifier
* @param application_id registered application.
*/
- virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+ virtual void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) = 0;
/**
* @brief Checks if certain request type is allowed for application
+ * @param device_handle device identifier
* @param policy_app_id Unique applicaion id
* @param type Request type
* @return true, if allowed, otherwise - false
*/
virtual bool IsRequestTypeAllowed(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id,
mobile_apis::RequestType::eType type) const = 0;
@@ -419,10 +439,12 @@ class PolicyHandlerInterface {
/**
* @brief Gets application request types
+ * @param device_handle device identifier
* @param policy_app_id Unique application id
* @return request types
*/
virtual const std::vector<std::string> GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const = 0;
/**
@@ -558,10 +580,12 @@ class PolicyHandlerInterface {
/**
* @brief Sets HMI default type for specified application
+ * @param device_handle device identifier
* @param application_id ID application
* @param app_types list of HMI types
*/
virtual void SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& application_id,
const smart_objects::SmartObject* app_types) = 0;
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 753581db0e..2fa4b0c218 100644
--- a/src/components/include/application_manager/state_controller.h
+++ b/src/components/include/application_manager/state_controller.h
@@ -41,50 +41,144 @@
namespace application_manager {
class StateController {
public:
+ /**
+ * @brief SetRegularState setup regular hmi state, that will appear if
+ * no specific events are active
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param state state of new regular state
+ * @param request_hmi_state_change: if true, ActivateAppRequest or
+ * CloseApplication will be sent to HMI dependent on hmi level of resolved hmi
+ * state
+ */
virtual void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr state,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
+ /**
+ * @brief SetRegularState Change regular hmi level and audio state
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param hmi_level of new regular state
+ * @param audio_state of new regular state
+ * @paran video_state of new regular state
+ * @param request_hmi_state_change: if true, ActivateAppRequest or
+ * CloseApplication will be sent to HMI dependent on hmi level of resolved hmi
+ * state
+ */
virtual void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
+ /**
+ * @brief SetRegularState Change regular hmi level
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param hmi_level of new regular state
+ * @param request_hmi_state_change: if true, ActivateAppRequest or
+ * CloseApplication will be sent to HMI dependent on hmi level of resolved hmi
+ * state
+ */
virtual void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
+ /**
+ * @brief SetRegularState Change regular hmi level, audio state and system
+ * context
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param hmi_level of new regular state
+ * @param audio_state of new regular state
+ * @param video_state of new regular state
+ * @param system_context of new regular state
+ * @param request_hmi_state_change: if true, ActivateAppRequest or
+ * CloseApplication will be sent to HMI dependent on hmi level of resolved hmi
+ * state
+ */
virtual void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
+ /**
+ * @brief SetRegularState Sets regular state with new hmi level
+ * to application
+ * @param app appication to setup regular state
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param hmi_level new hmi level for application
+ */
virtual void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level) = 0;
+ /**
+ * @brief SetRegularState Change regular audio state
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param audio_state of new regular state
+ * @param video_state of new regular state
+ */
virtual void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state) = 0;
+ /**
+ * @brief SetRegularState Change regular system context
+ * @param app appication to setup regular State
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param system_context of new regular state
+ */
virtual void SetRegularState(
ApplicationSharedPtr app,
+ const WindowID window_id,
const mobile_apis::SystemContext::eType system_context) = 0;
- virtual void SetRegularState(ApplicationSharedPtr app, HmiStatePtr state) = 0;
+ /**
+ * @brief SetRegularState Sets new regular state to application
+ * @param app appication to setup regular state
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param state new hmi state for application
+ */
+ virtual void SetRegularState(ApplicationSharedPtr app,
+ const WindowID window_id,
+ HmiStatePtr state) = 0;
+ /**
+ * @brief Sets default application state and apply currently active HMI states
+ * on application registration
+ * @param app application to apply states
+ * @param default_level default HMI level
+ */
virtual void OnApplicationRegistered(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level) = 0;
- virtual int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority) = 0;
+ /**
+ * @brief OnAppWidgetAdded Sets default state for widget and apply currently
+ * active HMI states
+ * @param app application to apply states
+ * @param window_id id of window to add
+ * @param default_level default HMI level
+ */
+ virtual void OnAppWindowAdded(
+ ApplicationSharedPtr app,
+ const WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType default_level) = 0;
+
/**
* @brief OnVideoStreamingStarted process video streaming started
* @param app projection or navigation application starting streaming
@@ -96,12 +190,41 @@ class StateController {
* @param app projection or navigation application stopping streaming
*/
virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app) = 0;
+
+ /**
+ * @brief OnStateChanged send HMIStatusNotification if needed
+ * @param app application
+ * @param window_id id of applicaion's window to apply HMI state
+ * @param old_state state before change
+ * @param new_state state after change
+ */
virtual void OnStateChanged(ApplicationSharedPtr app,
+ const WindowID window_id,
HmiStatePtr old_state,
HmiStatePtr new_state) = 0;
+ /**
+ * @brief Checks activity of Deactivate HMI state.
+ * @return Returns TRUE if deactivate HMI state is active, otherwise returns
+ * FALSE.
+ */
virtual bool IsStateActive(HmiState::StateID state_id) const = 0;
+
+ /**
+ * @brief ActivateDefaultWindow performs set of actions required for a proper
+ * application activation (i.e. main window activation)
+ * @param app pointer to application to be activated
+ */
+ virtual void ActivateDefaultWindow(ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief ExitDefaultWindow performs set of action required for a proper
+ * application exiting (i.e. main window exit)
+ * @param app pointer to application to be exited
+ */
+ virtual void ExitDefaultWindow(ApplicationSharedPtr app) = 0;
};
+
} // namespace application_manager
#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
index 8299d019f5..8203f5c9b6 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -45,14 +45,18 @@ namespace custom_str = utils::custom_string;
class PolicyListener {
public:
virtual ~PolicyListener() {}
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions,
const policy::HMILevel& default_hmi) = 0;
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions) = 0;
- virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
+ virtual void OnPendingPermissionChange(const std::string& device_id,
+ const std::string& policy_app_id) = 0;
virtual void OnUpdateStatusChanged(const std::string&) = 0;
virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) = 0;
virtual void OnSystemInfoUpdateRequired() = 0;
virtual custom_str::CustomString GetAppName(
@@ -95,10 +99,12 @@ class PolicyListener {
/**
* @brief Sends OnAppPermissionsChanged notification to HMI
* @param permissions contains parameter for OnAppPermisionChanged
+ * @param device_id device identifier
* @param policy_app_id contains policy application id
*/
virtual void SendOnAppPermissionsChanged(
const AppPermissions& permissions,
+ const std::string& device_id,
const std::string& policy_app_id) const = 0;
/**
@@ -146,7 +152,7 @@ class PolicyListener {
* @return list devices ids
*/
virtual std::vector<std::string> GetDevicesIds(
- const std::string& policy_app_id) = 0;
+ const std::string& policy_app_id) const = 0;
/**
* Notifies about changing HMI level
@@ -175,6 +181,12 @@ class PolicyListener {
virtual void OnUpdateHMIStatus(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notify Connected mobile apps about changing state of
+ * LockScreenDismissal
+ */
+ virtual void OnLockScreenDismissalStateChanged() = 0;
};
} // namespace policy
#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index 331b579365..c6f0202d59 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -36,6 +36,7 @@
#include <vector>
#include "utils/callable.h"
+#include "utils/optional.h"
#include "policy/access_remote.h"
#include "policy/cache_manager_interface.h"
@@ -132,6 +133,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Check if specified RPC for specified application
* has permission to be executed in specified HMI Level
* and also its permitted params.
+ * @param device_id device identifier
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
@@ -139,7 +141,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param CheckPermissionResult containing flag if HMI Level is allowed
* and list of allowed params.
*/
- virtual void CheckPermissions(const PTString& app_id,
+ virtual void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
@@ -165,6 +168,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void KmsChanged(int kilometers) = 0;
/**
+ * @brief Returns state of the lock screen that could be able to be dismissed
+ * while connected to SDL, allowing users the ability to interact with the
+ * app.
+ * @return bool True if lock screen can be dismissed.
+ */
+ virtual const boost::optional<bool> LockScreenDismissalEnabledState()
+ const = 0;
+
+ /**
+ * @brief Returns lock screen warning message. In case when specified language
+ * is absent in policy table will be returned message on default language
+ * ("en-us"). Otherwise returns uninitialized boost::optional<std::string>
+ * @return std::string Lock screen warning message
+ */
+ virtual const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const = 0;
+
+ /**
* @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
@@ -246,12 +267,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param device_handle device identifier
* @param app_id Unique application id
* @param is_device_allowed true if user allowing device otherwise false
* @return true if operation was successful
*/
- virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
- const bool is_device_allowed) = 0;
+ virtual bool ReactOnUserDevConsentForApp(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& app_id,
+ const bool is_device_allowed) = 0;
/**
* @brief Sets counter value that passed for receiving PT UPdate.
@@ -299,12 +323,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Get default HMI level for application
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @param default_hmi Default HMI level for application or empty, if value
* was not set
* @return true, if succedeed, otherwise - false
*/
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
+ virtual bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const = 0;
/**
@@ -350,11 +376,12 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets specific application permissions changes since last policy
* table update
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @return Permissions changes
*/
virtual AppPermissions GetAppPermissionsChanges(
- const std::string& policy_app_id) = 0;
+ const std::string& device_id, const std::string& policy_app_id) = 0;
/**
* @brief Removes specific application permissions changes
@@ -364,9 +391,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Return device id, which hosts specific application
+ * @param device_handle device identifier
* @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const = 0;
/**
@@ -387,10 +416,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
+ * @param device_id device identifier
* @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
- const std::string& application_id) = 0;
+ const std::string& device_id, const std::string& application_id) = 0;
/**
* @brief Marks device as upaired
@@ -401,11 +431,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
+ * @param device_id device identifier
* @param application_id Unique application id
* @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
virtual StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
@@ -485,10 +517,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * It will send OnAppPermissionSend notification and will try to start PTU.
+ *
+ * @param device_id device identifier
* @param application_id registered application.
*/
- virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+ virtual void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) = 0;
virtual void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) = 0;
@@ -511,10 +546,12 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets request types for application
+ * @param device_handle device identifier
* @param policy_app_id Unique application id
* @return request types of application
*/
virtual const std::vector<std::string> GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string policy_app_id) const = 0;
/**
@@ -675,11 +712,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Assigns new HMI types for specified application
+ * @param device_handle device identifier
* @param application_id Unique application id
* @param hmi_types new HMI types list
*/
- virtual void SetDefaultHmiTypes(const std::string& application_id,
- const std::vector<int>& hmi_types) = 0;
+ virtual void SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
/**
* @brief Gets HMI types
* @param application_id ID application
diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
index 0907e42142..d717822cac 100644
--- a/src/components/include/policy/policy_regular/policy/policy_listener.h
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -45,14 +45,18 @@ namespace custom_str = utils::custom_string;
class PolicyListener {
public:
virtual ~PolicyListener() {}
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions,
const policy::HMILevel& default_hmi) = 0;
- virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ virtual void OnPermissionsUpdated(const std::string& device_id,
+ const std::string& policy_app_id,
const Permissions& permissions) = 0;
- virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
+ virtual void OnPendingPermissionChange(const std::string& device_id,
+ const std::string& policy_app_id) = 0;
virtual void OnUpdateStatusChanged(const std::string&) = 0;
virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) = 0;
virtual void OnSystemInfoUpdateRequired() = 0;
virtual custom_str::CustomString GetAppName(
@@ -93,10 +97,12 @@ class PolicyListener {
/**
* @brief Sends OnAppPermissionsChanged notification to HMI
* @param permissions contains parameter for OnAppPermisionChanged
+ * @param device_id device identifier
* @param policy_app_id contains policy application id
*/
virtual void SendOnAppPermissionsChanged(
const AppPermissions& permissions,
+ const std::string& device_id,
const std::string& policy_app_id) const = 0;
/**
@@ -128,7 +134,7 @@ class PolicyListener {
* @return list devices ids
*/
virtual std::vector<std::string> GetDevicesIds(
- const std::string& policy_app_id) = 0;
+ const std::string& policy_app_id) const = 0;
/**
* Notifies about changing HMI level
@@ -157,6 +163,12 @@ class PolicyListener {
virtual void OnUpdateHMIStatus(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notify Connected mobile apps about changing state
+ * LockScreenDismissal
+ */
+ virtual void OnLockScreenDismissalStateChanged() = 0;
};
} // namespace policy
#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index f82657ef26..c1547da760 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -35,6 +35,7 @@
#include <cstdint>
#include <vector>
+#include "boost/optional.hpp"
#include "policy/access_remote.h"
#include "policy/cache_manager_interface.h"
@@ -43,6 +44,7 @@
#include "policy/policy_types.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/callable.h"
+#include "utils/optional.h"
namespace policy {
class PolicySettings;
@@ -165,6 +167,23 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void KmsChanged(int kilometers) = 0;
/**
+ * @brief Returns state of the lock screen that could be able to be dismissed
+ * while connected to SDL, allowing users the ability to interact with the
+ * app.
+ * @return bool True if lock screen can be dismissed.
+ */
+ virtual const boost::optional<bool> LockScreenDismissalEnabledState()
+ const = 0;
+
+ /**
+ * @brief Returns lock screen warning message
+ * @param language_code Specific language for which need message
+ * @return std::string Lock screen warning message
+ */
+ virtual const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const = 0;
+
+ /**
* @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
@@ -241,12 +260,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param device_handle device identifier
* @param app_id Unique application id
* @param is_device_allowed true if user allowing device otherwise false
* @return true if operation was successful
*/
- virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed) = 0;
+ virtual bool ReactOnUserDevConsentForApp(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string app_id,
+ bool is_device_allowed) = 0;
/**
* @brief Sets counter value that passed for receiving PT UPdate.
@@ -292,12 +314,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Get default HMI level for application
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @param default_hmi Default HMI level for application or empty, if value
* was not set
* @return true, if succedeed, otherwise - false
*/
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
+ virtual bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const = 0;
/**
@@ -341,11 +365,12 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets specific application permissions changes since last policy
* table update
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @return Permissions changes
*/
virtual AppPermissions GetAppPermissionsChanges(
- const std::string& policy_app_id) = 0;
+ const std::string& device_id, const std::string& policy_app_id) = 0;
/**
* @brief Removes specific application permissions changes
@@ -355,9 +380,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Return device id, which hosts specific application
+ * @param device_handle device identifier
* @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const = 0;
/**
@@ -378,10 +405,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
+ * @param device_id device identifier
* @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
- const std::string& application_id) = 0;
+ const std::string& device_id, const std::string& application_id) = 0;
/**
* @brief Marks device as upaired
@@ -392,11 +420,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
+ * @param device_id device identifier
* @param application_id Unique application id
* @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
virtual StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
@@ -617,10 +647,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * It will send OnAppPermissionSend notification and will try to start PTU.
+ *
+ * @param device_id device identifier
* @param application_id registered application.
*/
- virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+ virtual void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) = 0;
virtual void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) = 0;
@@ -655,11 +688,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Assigns new HMI types for specified application
+ * @param device_handle device identifier
* @param application_id Unique application id
* @param hmi_types new HMI types list
*/
- virtual void SetDefaultHmiTypes(const std::string& application_id,
- const std::vector<int>& hmi_types) = 0;
+ virtual void SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
/**
* @brief Gets HMI types
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index fcedcebcf8..60ee73c996 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -248,9 +248,10 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
bool(uint32_t app_id,
protocol_handler::ServiceType service_type));
- MOCK_METHOD4(CheckPolicyPermissions,
+ MOCK_METHOD5(CheckPolicyPermissions,
mobile_apis::Result::eType(
const application_manager::ApplicationSharedPtr app,
+ const application_manager::WindowID window_id,
const std::string& function_id,
const application_manager::RPCParams& rpc_params,
application_manager::CommandParametersPermissions*
@@ -277,9 +278,10 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(uint32_t app_id,
protocol_handler::ServiceType service_type,
bool state));
- MOCK_CONST_METHOD5(CreateRegularState,
+ MOCK_CONST_METHOD6(CreateRegularState,
application_manager::HmiStatePtr(
application_manager::ApplicationSharedPtr app,
+ const mobile_apis::WindowType::eType window_type,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
mobile_apis::VideoStreamingState::eType video_state,
@@ -335,8 +337,9 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD2(ProcessReconnection,
void(application_manager::ApplicationSharedPtr application,
const uint32_t connection_key));
- MOCK_CONST_METHOD1(IsAppInReconnectMode,
- bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD2(IsAppInReconnectMode,
+ bool(const connection_handler::DeviceHandle& device_id,
+ const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&());
MOCK_CONST_METHOD0(get_current_audio_source, uint32_t());
MOCK_METHOD1(set_current_audio_source, void(const uint32_t));
diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h
index 5518e01383..545090bf30 100644
--- a/src/components/include/test/application_manager/mock_state_controller.h
+++ b/src/components/include/test/application_manager/mock_state_controller.h
@@ -46,55 +46,68 @@ namespace am = application_manager;
class MockStateController : public am::StateController {
public:
- MOCK_METHOD3(SetRegularState,
+ MOCK_METHOD4(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
am::HmiStatePtr state,
- const bool SendActivateApp));
- MOCK_METHOD5(SetRegularState,
+ const bool request_hmi_state_change));
+ MOCK_METHOD6(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp));
- MOCK_METHOD3(SetRegularState,
+ const bool request_hmi_state_change));
+ MOCK_METHOD4(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp));
- MOCK_METHOD6(SetRegularState,
+ const bool request_hmi_state_change));
+ MOCK_METHOD7(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp));
- MOCK_METHOD2(SetRegularState,
+ const bool request_hmi_state_change));
+ MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::HMILevel::eType hmi_level));
- MOCK_METHOD3(SetRegularState,
+ MOCK_METHOD4(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state));
- MOCK_METHOD2(SetRegularState,
+ MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
const mobile_apis::SystemContext::eType system_context));
- MOCK_METHOD2(SetRegularState,
- void(am::ApplicationSharedPtr app, am::HmiStatePtr state));
+ MOCK_METHOD3(SetRegularState,
+ void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
+ am::HmiStatePtr state));
MOCK_METHOD2(OnApplicationRegistered,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level));
- MOCK_METHOD3(SendBCActivateApp,
- int64_t(am::ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority));
+ MOCK_METHOD4(OnAppWindowAdded,
+ void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
+ const mobile_apis::WindowType::eType window_type,
+ const mobile_apis::HMILevel::eType default_level));
MOCK_METHOD1(OnVideoStreamingStarted,
void(am::ApplicationConstSharedPtr app));
MOCK_METHOD1(OnVideoStreamingStopped,
void(am::ApplicationConstSharedPtr app));
- MOCK_METHOD3(OnStateChanged,
+ MOCK_METHOD4(OnStateChanged,
void(am::ApplicationSharedPtr app,
+ const am::WindowID window_id,
am::HmiStatePtr old_state,
am::HmiStatePtr new_state));
MOCK_CONST_METHOD1(IsStateActive, bool(am::HmiState::StateID state_id));
+ MOCK_METHOD1(ActivateDefaultWindow, void(am::ApplicationSharedPtr app));
+ MOCK_METHOD1(ExitDefaultWindow, void(am::ApplicationSharedPtr app));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index 059442f424..a2ec715dbf 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -57,12 +57,14 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
bool(const std::string& file,
const policy::BinaryMessage& pt_string));
MOCK_METHOD0(UnloadPolicyLibrary, bool());
- MOCK_METHOD3(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
+ MOCK_METHOD4(OnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
const policy::Permissions& permissions,
const policy::HMILevel& default_hmi));
- MOCK_METHOD2(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
const policy::Permissions& permissions));
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -77,8 +79,9 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD2(GetPriority,
bool(const std::string& policy_app_id,
std::string* priority));
- MOCK_METHOD4(CheckPermissions,
+ MOCK_METHOD5(CheckPermissions,
void(const application_manager::ApplicationSharedPtr app,
+ const application_manager::WindowID window_id,
const policy::PTString& rpc,
const application_manager::RPCParams& rpc_params,
policy::CheckPermissionResult& result));
@@ -86,8 +89,9 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
uint32_t(const std::string& priority));
MOCK_CONST_METHOD1(GetUserConsentForDevice,
policy::DeviceConsent(const std::string& device_id));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
+ MOCK_CONST_METHOD3(GetDefaultHmi,
+ bool(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi));
MOCK_METHOD3(GetInitialAppData,
@@ -109,6 +113,10 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD0(TimeoutExchangeMSec, uint32_t());
MOCK_METHOD0(OnExceededTimeout, void());
MOCK_METHOD0(OnSystemReady, void());
+ MOCK_CONST_METHOD0(LockScreenDismissalEnabledState,
+ const boost::optional<bool>());
+ MOCK_CONST_METHOD1(LockScreenDismissalWarningMessage,
+ const boost::optional<std::string>(const std::string&));
MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
@@ -123,8 +131,9 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD2(OnAllowSDLFunctionalityNotification,
void(bool is_allowed, const std::string& device_id));
MOCK_METHOD0(OnIgnitionCycleOver, void());
- MOCK_METHOD1(OnPendingPermissionChange,
- void(const std::string& policy_app_id));
+ MOCK_METHOD2(OnPendingPermissionChange,
+ void(const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD1(PTExchangeAtUserRequest, void(uint32_t correlation_id));
MOCK_METHOD2(AddDevice,
void(const std::string& device_id,
@@ -152,8 +161,9 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
const uint32_t correlation_id));
MOCK_METHOD1(OnGetStatusUpdate, void(const uint32_t correlation_id));
MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
- MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
- std::string(const std::string& policy_app_id));
+ MOCK_METHOD2(OnCurrentDeviceIdUpdateRequired,
+ std::string(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_METHOD1(OnSystemInfoChanged, void(const std::string& language));
MOCK_METHOD3(OnGetSystemInfo,
void(const std::string& ccpu_version,
@@ -178,14 +188,16 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD0(CanUpdate, bool());
MOCK_METHOD2(OnDeviceConsentChanged,
void(const std::string& device_id, bool is_allowed));
- MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
+ MOCK_CONST_METHOD3(SendOnAppPermissionsChanged,
void(const policy::AppPermissions& permissions,
+ const std::string& device_id,
const std::string& policy_app_id));
MOCK_METHOD0(OnPTExchangeNeeded, void());
MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>& apps));
- MOCK_METHOD2(
+ MOCK_METHOD3(
AddApplication,
policy::StatusNotifier(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
MOCK_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
@@ -193,10 +205,12 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
MOCK_METHOD0(OnAppsSearchStarted, void());
MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
- MOCK_CONST_METHOD2(IsRequestTypeAllowed,
- bool(const std::string& policy_app_id,
+ MOCK_METHOD2(OnAppRegisteredOnMobile,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_CONST_METHOD3(IsRequestTypeAllowed,
+ bool(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id,
mobile_apis::RequestType::eType type));
MOCK_CONST_METHOD2(IsRequestSubTypeAllowed,
bool(const std::string& policy_app_id,
@@ -210,9 +224,10 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD1(
GetAppRequestSubTypes,
const std::vector<std::string>(const std::string& policy_app_id));
- MOCK_CONST_METHOD1(
- GetAppRequestTypes,
- const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD2(GetAppRequestTypes,
+ const std::vector<std::string>(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
MOCK_CONST_METHOD1(GetEnabledCloudApps,
void(std::vector<std::string>& enabled_apps));
@@ -289,8 +304,9 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD2(GetModuleTypes,
bool(const std::string& policy_app_id,
std::vector<std::string>* modules));
- MOCK_METHOD2(SetDefaultHmiTypes,
- void(const std::string& application_id,
+ MOCK_METHOD3(SetDefaultHmiTypes,
+ void(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const smart_objects::SmartObject* app_types));
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
index 6f754ad2c9..0a6bef45dd 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
@@ -110,6 +110,10 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
policy_table::AppServiceParameters* app_service_parameters));
MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(LockScreenDismissalEnabledState,
+ const boost::optional<bool>());
+ MOCK_CONST_METHOD1(LockScreenDismissalWarningMessage,
+ const boost::optional<std::string>(const std::string&));
MOCK_CONST_METHOD1(GetDeviceConsent,
DeviceConsent(const std::string& device_id));
MOCK_METHOD2(SetDeviceConsent,
@@ -120,11 +124,11 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_CONST_METHOD1(GetCachedDeviceConsent,
DeviceConsent(const std::string& device_id));
MOCK_METHOD1(SetVINValue, bool(const std::string& value));
- MOCK_METHOD3(GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(
- const std::vector<std::string>& msg_codes,
- const std::string& language,
- const std::string& active_hmi_language));
+ MOCK_CONST_METHOD3(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language));
MOCK_METHOD2(GetUpdateUrls,
void(const std::string& service_type,
EndpointUrls& out_end_points));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
index 1e42423a03..16341ed4f4 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -38,6 +38,7 @@
#include <vector>
#include "gmock/gmock.h"
+#include "utils/macro.h"
#include "policy/policy_listener.h"
#include "policy/policy_table/types.h"
@@ -54,18 +55,22 @@ namespace custom_str = utils::custom_string;
class MockPolicyListener : public ::policy::PolicyListener {
public:
- MOCK_METHOD3(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
+ MOCK_METHOD4(OnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
const policy::Permissions& permissions,
const policy::HMILevel& default_hmi));
- MOCK_METHOD2(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
const policy::Permissions& permissions));
- MOCK_METHOD1(OnPendingPermissionChange,
- void(const std::string& policy_app_id));
+ MOCK_METHOD2(OnPendingPermissionChange,
+ void(const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
- MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
- std::string(const std::string& policy_app_id));
+ MOCK_METHOD2(OnCurrentDeviceIdUpdateRequired,
+ std::string(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
MOCK_METHOD1(GetAppName,
custom_str::CustomString(const std::string& policy_app_id));
@@ -85,10 +90,13 @@ class MockPolicyListener : public ::policy::PolicyListener {
void(const std::string& policy_app_id,
const std::string& auth_token));
MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
- MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
- void(const policy::AppPermissions&, const std::string&));
- MOCK_METHOD1(GetDevicesIds,
- std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD3(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions& permissions,
+ const std::string& device_id,
+ const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetDevicesIds,
+ std::vector<std::string>(const std::string& policy_app_id));
MOCK_METHOD3(OnUpdateHMILevel,
void(const std::string& device_id,
const std::string& policy_app_id,
@@ -103,6 +111,7 @@ class MockPolicyListener : public ::policy::PolicyListener {
void(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level));
+ MOCK_METHOD0(OnLockScreenDismissalStateChanged, void());
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index 7ebf73ae54..5313628890 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -68,8 +68,9 @@ class MockPolicyManager : public PolicyManager {
void(const std::string& service_type,
EndpointUrls& out_end_points));
MOCK_METHOD0(RequestPTUpdate, void());
- MOCK_METHOD5(CheckPermissions,
- void(const PTString& app_id,
+ MOCK_METHOD6(CheckPermissions,
+ void(const PTString& device_id,
+ const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
@@ -77,6 +78,10 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD0(ResetUserConsent, bool());
MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
MOCK_METHOD1(KmsChanged, void(int kilometers));
+ MOCK_CONST_METHOD0(LockScreenDismissalEnabledState,
+ const boost::optional<bool>());
+ MOCK_CONST_METHOD1(LockScreenDismissalWarningMessage,
+ const boost::optional<std::string>(const std::string&));
MOCK_METHOD0(IncrementIgnitionCycles, void());
MOCK_METHOD0(ForcePTExchange, std::string());
MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string());
@@ -95,8 +100,10 @@ class MockPolicyManager : public PolicyManager {
std::vector<policy::FunctionalGroupPermission>& permissions));
MOCK_METHOD2(SetUserConsentForDevice,
void(const std::string& device_id, const bool is_allowed));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD3(ReactOnUserDevConsentForApp,
+ bool(const transport_manager::DeviceHandle& device_handle,
+ const std::string& app_id,
+ bool is_device_allowed));
MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
MOCK_METHOD3(GetInitialAppData,
@@ -113,8 +120,9 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(SetUserConsentForApp,
void(const policy::PermissionConsent& permissions,
const policy::PolicyManager::NotificationMode mode));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
+ MOCK_CONST_METHOD3(GetDefaultHmi,
+ bool(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi));
MOCK_CONST_METHOD2(GetPriority,
bool(const std::string& policy_app_id,
@@ -130,26 +138,32 @@ class MockPolicyManager : public PolicyManager {
void(const std::string& device_id,
const std::string& policy_app_id,
std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD1(GetAppPermissionsChanges,
- policy::AppPermissions(const std::string& policy_app_id));
+ MOCK_METHOD2(GetAppPermissionsChanges,
+ policy::AppPermissions(const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
- MOCK_CONST_METHOD1(GetCurrentDeviceId,
- std::string&(const std::string& policy_app_id));
+ MOCK_CONST_METHOD2(
+ GetCurrentDeviceId,
+ std::string&(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
MOCK_METHOD3(SetSystemInfo,
void(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language));
- MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
- void(const std::string& application_id));
+ MOCK_METHOD2(SendNotificationOnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& application_id));
MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
- MOCK_METHOD2(
+ MOCK_METHOD3(
AddApplication,
StatusNotifier(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
- MOCK_METHOD2(SetDefaultHmiTypes,
- void(const std::string& application_id,
+ MOCK_METHOD3(SetDefaultHmiTypes,
+ void(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const std::vector<int>& hmi_types));
MOCK_METHOD2(GetHMITypes,
bool(const std::string& application_id,
@@ -177,13 +191,15 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
MOCK_METHOD0(OnAppsSearchStarted, void());
MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
+ MOCK_METHOD2(OnAppRegisteredOnMobile,
+ void(const std::string& device_id,
+ const std::string& application_id));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
- MOCK_CONST_METHOD1(
- GetAppRequestTypes,
- const std::vector<std::string>(const std::string policy_app_id));
+ MOCK_CONST_METHOD2(GetAppRequestTypes,
+ const std::vector<std::string>(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
MOCK_CONST_METHOD1(GetEnabledCloudApps,
void(std::vector<std::string>& enabled_apps));
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index dacdaf202f..c296701e34 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -91,11 +91,15 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD2(SetHybridAppPreference,
void(const std::string& policy_app_id,
const std::string& hybrid_app_preference));
+ MOCK_CONST_METHOD0(LockScreenDismissalEnabledState,
+ const boost::optional<bool>());
+ MOCK_CONST_METHOD1(LockScreenDismissalWarningMessage,
+ const boost::optional<std::string>(const std::string&));
MOCK_METHOD1(SetVINValue, bool(const std::string& value));
- MOCK_METHOD2(GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(
- const std::vector<std::string>& msg_codes,
- const std::string& language));
+ MOCK_CONST_METHOD2(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language));
MOCK_CONST_METHOD2(
GetAppServiceParameters,
void(const std::string& policy_app_id,
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
index f409100a49..d0d85409a2 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
@@ -35,6 +35,7 @@
#include <string>
#include "gmock/gmock.h"
+#include "utils/macro.h"
#include "policy/policy_listener.h"
#include "policy/policy_table/types.h"
@@ -52,17 +53,21 @@ namespace custom_str = utils::custom_string;
class MockPolicyListener : public ::policy::PolicyListener {
public:
MOCK_METHOD3(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD4(OnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
const policy::Permissions& permissions,
const policy::HMILevel& default_hmi));
- MOCK_METHOD2(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
- const policy::Permissions& permissions));
- MOCK_METHOD1(OnPendingPermissionChange,
- void(const std::string& policy_app_id));
+ MOCK_METHOD2(OnPendingPermissionChange,
+ void(const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
- MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
- std::string(const std::string& policy_app_id));
+ MOCK_METHOD2(OnCurrentDeviceIdUpdateRequired,
+ std::string(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
MOCK_METHOD1(GetAppName,
custom_str::CustomString(const std::string& policy_app_id));
@@ -78,14 +83,17 @@ class MockPolicyListener : public ::policy::PolicyListener {
MOCK_METHOD2(OnAuthTokenUpdated,
void(const std::string& policy_app_id,
const std::string& auth_token));
- MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
- void(const policy::AppPermissions&, const std::string&));
+ MOCK_CONST_METHOD3(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions& permissions,
+ const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD3(OnUpdateHMILevel,
void(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level));
- MOCK_METHOD1(GetDevicesIds,
- std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetDevicesIds,
+ std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD1(GetRegisteredLinks,
void(std::map<std::string, std::string>&));
MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
@@ -96,6 +104,7 @@ class MockPolicyListener : public ::policy::PolicyListener {
void(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level));
+ MOCK_METHOD0(OnLockScreenDismissalStateChanged, void());
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 73bf2d387b..c6e692cf0b 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -78,6 +78,10 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD0(ResetUserConsent, bool());
MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
MOCK_METHOD1(KmsChanged, void(int kilometers));
+ MOCK_CONST_METHOD0(LockScreenDismissalEnabledState,
+ const boost::optional<bool>());
+ MOCK_CONST_METHOD1(LockScreenDismissalWarningMessage,
+ const boost::optional<std::string>(const std::string&));
MOCK_METHOD0(IncrementIgnitionCycles, void());
MOCK_METHOD0(ForcePTExchange, std::string());
MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string());
@@ -96,8 +100,10 @@ class MockPolicyManager : public PolicyManager {
std::vector<policy::FunctionalGroupPermission>& permissions));
MOCK_METHOD2(SetUserConsentForDevice,
void(const std::string& device_id, const bool is_allowed));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string app_id, bool is_device_allowed));
+ MOCK_METHOD3(ReactOnUserDevConsentForApp,
+ bool(const transport_manager::DeviceHandle& device_handle,
+ const std::string app_id,
+ bool is_device_allowed));
MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
MOCK_METHOD3(GetInitialAppData,
@@ -113,8 +119,9 @@ class MockPolicyManager : public PolicyManager {
const policy::DeviceInfo& device_info));
MOCK_METHOD1(SetUserConsentForApp,
void(const policy::PermissionConsent& permissions));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
+ MOCK_CONST_METHOD3(GetDefaultHmi,
+ bool(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi));
MOCK_CONST_METHOD2(GetPriority,
bool(const std::string& policy_app_id,
@@ -129,26 +136,32 @@ class MockPolicyManager : public PolicyManager {
void(const std::string& device_id,
const std::string& policy_app_id,
std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD1(GetAppPermissionsChanges,
- policy::AppPermissions(const std::string& policy_app_id));
+ MOCK_METHOD2(GetAppPermissionsChanges,
+ policy::AppPermissions(const std::string& device_id,
+ const std::string& policy_app_id));
MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
- MOCK_CONST_METHOD1(GetCurrentDeviceId,
- std::string&(const std::string& policy_app_id));
+ MOCK_CONST_METHOD2(
+ GetCurrentDeviceId,
+ std::string&(const transport_manager::DeviceHandle& device_handle,
+ const std::string& policy_app_id));
MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
MOCK_METHOD3(SetSystemInfo,
void(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language));
- MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
- void(const std::string& application_id));
+ MOCK_METHOD2(SendNotificationOnPermissionsUpdated,
+ void(const std::string& device_id,
+ const std::string& application_id));
MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
- MOCK_METHOD2(
+ MOCK_METHOD3(
AddApplication,
StatusNotifier(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
- MOCK_METHOD2(SetDefaultHmiTypes,
- void(const std::string& application_id,
+ MOCK_METHOD3(SetDefaultHmiTypes,
+ void(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const std::vector<int>& hmi_types));
MOCK_METHOD2(GetHMITypes,
bool(const std::string& application_id,
@@ -175,8 +188,9 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
MOCK_METHOD0(OnAppsSearchStarted, void());
MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
+ MOCK_METHOD2(OnAppRegisteredOnMobile,
+ void(const std::string& device_id,
+ const std::string& application_id));
MOCK_CONST_METHOD1(
GetAppRequestTypes,
const std::vector<std::string>(const std::string policy_app_id));
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index eb12ce1b55..6ed4ac5d51 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -66,6 +66,12 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(cloud_app_retry_timeout, uint32_t());
MOCK_CONST_METHOD0(cloud_app_max_retry_attempts, uint16_t());
MOCK_CONST_METHOD0(bluetooth_uuid, const uint8_t*());
+ MOCK_CONST_METHOD0(aoa_filter_manufacturer, const std::string&());
+ MOCK_CONST_METHOD0(aoa_filter_model_name, const std::string&());
+ MOCK_CONST_METHOD0(aoa_filter_description, const std::string&());
+ MOCK_CONST_METHOD0(aoa_filter_version, const std::string&());
+ MOCK_CONST_METHOD0(aoa_filter_uri, const std::string&());
+ MOCK_CONST_METHOD0(aoa_filter_serial_number, const std::string&());
};
} // namespace transport_manager_test
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index 4a183ad22d..83d0b3e833 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -81,6 +81,13 @@ class TransportManagerSettings : public TransportManagerMMESettings {
virtual uint16_t cloud_app_max_retry_attempts() const = 0;
virtual const uint8_t* bluetooth_uuid() const = 0;
+
+ virtual const std::string& aoa_filter_manufacturer() const = 0;
+ virtual const std::string& aoa_filter_model_name() const = 0;
+ virtual const std::string& aoa_filter_description() const = 0;
+ virtual const std::string& aoa_filter_version() const = 0;
+ virtual const std::string& aoa_filter_uri() const = 0;
+ virtual const std::string& aoa_filter_serial_number() const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index a69d2f05c8..df7fbbfbad 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -66,6 +66,28 @@
<element name="READ_ONLY" value="26"/>
</enum>
+<enum name="WindowType">
+ <element name="MAIN">
+ <description>
+ This window type describes the main screen on a display.
+ </description>
+ </element>
+ <element name="WIDGET">
+ <description>
+ A widget is a small window that the app can create to provide information and softbuttons for a quick app control.
+ </description>
+ </element>
+</enum>
+
+<enum name="PredefinedWindows">
+ <element name="DEFAULT_WINDOW" value="0">
+ <description>The default window is a main window pre-created on behalf of the app.</description>
+ </element>
+ <element name="PRIMARY_WIDGET" value="1">
+ <description>The primary widget of the app.</description>
+ </element>
+</enum>
+
<enum name="TransportType">
<description>Lists of the transport types used for device connection to HU.</description>
<element name="BLUETOOTH"/>
@@ -116,6 +138,27 @@
<element name="SOURCE" />
<element name="SHUFFLE" />
<element name="REPEAT" />
+
+ <!-- Navigation Subscription Buttons -->
+ <element name="NAV_CENTER_LOCATION" />
+ <element name="NAV_ZOOM_IN" />
+ <element name="NAV_ZOOM_OUT" />
+ <element name="NAV_PAN_UP" />
+ <element name="NAV_PAN_UP_RIGHT" />
+ <element name="NAV_PAN_RIGHT" />
+ <element name="NAV_PAN_DOWN_RIGHT" />
+ <element name="NAV_PAN_DOWN" />
+ <element name="NAV_PAN_DOWN_LEFT" />
+ <element name="NAV_PAN_LEFT" />
+ <element name="NAV_PAN_UP_LEFT" />
+ <element name="NAV_TILT_TOGGLE">
+ <description>If supported, this toggles between a top-down view and an angled/3D view. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
+ </element>
+ <element name="NAV_ROTATE_CLOCKWISE" />
+ <element name="NAV_ROTATE_COUNTERCLOCKWISE" />
+ <element name="NAV_HEADING_TOGGLE">
+ <description>If supported, this toggles between locking the orientation to north or to the vehicle's heading. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
+ </element>
</enum>
<enum name="ButtonEventMode">
@@ -514,6 +557,9 @@
<element name="mediaTrack">
<description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
</element>
+ <element name="templateTitle">
+ <description>The title of the new template that will be displayed; applies to "Show"</description>
+ </element>
<element name="alertText1">
<description>The first line of the alert text field; applies to "Alert"</description>
</element>
@@ -585,7 +631,7 @@
</element>
<element name="timeToDestination"/>
<!-- TO DO to be removed -->
- <element name="turnText"/>
+ <element name="turnText"/>
</enum>
<enum name="MetadataType">
@@ -667,6 +713,9 @@
<element name="locationImage">
<description>The optional image of a destination / location</description>
</element>
+ <element name="alertIcon">
+ <description>The image field for Alert</description>
+ </element>
</enum>
<enum name="TextAlignment">
@@ -1845,6 +1894,13 @@
<param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
<description>The speed in KPH</description>
</param>
+ <param name="shifted" type="Boolean" mandatory="false">
+ <description>
+ True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ False, if the GPS data is raw and un-shifted.
+ If not provided, then value is assumed False.
+ </description>
+ </param>
</struct>
<struct name="SisData">
@@ -1880,9 +1936,15 @@
<description> True if the hd radio is on, false is the radio is off</description>
</param>
<param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
- <description>number of HD sub-channels if available</description>
+ <description>
+ Number of HD sub-channels if available.
+ Note that this parameter is deprecated in MOBILE API.
+ </description>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
+ <param name="availableHdChannels" type="Integer" minvalue="0" maxvalue="7" array="true" minsize="0" maxsize="8" mandatory="false">
+ <description>The list of available hd sub-channel indexes. Empty list means no Hd channel is available. Read-only.</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="0" maxvalue="7" mandatory="false">
<description>Current HD sub-channel if available</description>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -1936,9 +1998,17 @@
</description>
</param>
<param name="availableHDsAvailable" type="Boolean" mandatory="false" >
- <description>
+ <description>
Availability of the getting the number of available HD channels.
True: Available, False: Not Available, Not present: Not Available.
+ Note that this parameter is deprecated in MOBILE API
+ </description>
+ </param>
+
+ <param name="availableHdChannelsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the list of available HD sub-channel indexes.
+ True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
<param name="stateAvailable" type="Boolean" mandatory="false" >
@@ -2040,6 +2110,8 @@
<param name="heatedMirrorsEnable" type="Boolean" mandatory="false">
<description>value false means disabled, value true means enabled.</description>
</param>
+ <param name="climateEnable" type="Boolean" mandatory="false">
+ </param>
</struct>
<struct name="ClimateControlCapabilities">
@@ -2141,6 +2213,12 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="climateEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable climate control.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<struct name="EqualizerSettings">
@@ -2576,6 +2654,17 @@
</param>
</struct>
+<struct name="TemplateConfiguration">
+ <param name="template" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created window template.
+ Currently only predefined window template layouts are defined.
+ </description>
+ </param>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" />
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" />
+</struct>
+
<struct name="HMIApplication">
<description>Data type containing information about application needed by HMI.</description>
<param name="appName" type="String" maxlength="100" mandatory="true">
@@ -2609,7 +2698,7 @@
<param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
<description>
Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
+ Must not interfere with any name of previously registered applications from the same device.
</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -2667,6 +2756,12 @@
</param>
</struct>
+<enum name="MenuLayout">
+ <description>How the main menu or submenu is laid out on screen</description>
+ <element name="LIST" />
+ <element name="TILES" />
+</enum>
+
<struct name="Choice">
<description>A choice is an option given to the user which can be selected either by menu, or through voice recognition system.</description>
<param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -2807,6 +2902,9 @@
<param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
<description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
</param>
+ <param name="menuLayoutsAvailable" type="Common.MenuLayout" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>An array of available menu layouts. If this parameter is not provided, only the `LIST` layout is assumed to be available</description>
+ </param>
</struct>
<struct name="SoftButtonCapabilities">
@@ -2827,6 +2925,12 @@
<param name="imageSupported" type="Boolean" mandatory="true">
<description>Must be true if the button supports referencing a static or dynamic image.</description>
</param>
+ <param name="textSupported" type="Boolean" mandatory="false" >
+ <description>
+ The button supports the use of text.
+ If not included, the default value should be considered true that the button will support text.
+ </description>
+ </param>
</struct>
<struct name="HMICapabilities">
@@ -2883,8 +2987,11 @@
<description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
<description>If omitted, the entire keyboard will be enabled.</description>
</param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ <param name="autoCompleteList" type="String" maxlength="1000" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ Allows an app to prepopulate the text field with a list of suggested or completed entries as the user types.
+ If empty, the auto-complete list will be removed from the screen.
+ </description>
</param>
</struct>
@@ -3300,6 +3407,74 @@
<param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
<description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
</param>
+ <param name="diagonalScreenSize" type="Float" minvalue="0" mandatory="false">
+ <description>The diagonal screen size in inches.</description>
+ </param>
+ <param name="pixelPerInch" type="Float" minvalue="0" mandatory="false">
+ <description>PPI is the diagonal resolution in pixels divided by the diagonal screen size in inches.</description>
+ </param>
+ <param name="scale" type="Float" minvalue="1" maxvalue="10" mandatory="false">
+ <description>The scaling factor the app should use to change the size of the projecting view.</description>
+ </param>
+ </struct>
+
+
+ <struct name="WindowTypeCapabilities">
+ <param name="type" type="Common.WindowType" mandatory="true" />
+ <param name="maximumNumberOfWindows" type="Integer" mandatory="true" />
+ </struct>
+
+ <struct name="WindowCapability">
+ <param name="windowID" type="Integer" mandatory="false">
+ <description>
+ The specified ID of the window. Can be set to a predefined window,
+ or omitted for the main window on the main display.
+ </description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="imageTypeSupported" type="ImageType" array="true" minsize="0" maxsize="1000" mandatory="false">
+ <description>Provides information about image types supported by the system.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
+ <description>A set of all window templates available on the head unit.</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>The number of on-window custom presets available (if any); otherwise omitted.</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The number of buttons and the capabilities of each on-window button.</description>
+ </param>
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The number of soft buttons available on-window and the capabilities for each button.</description>
+ </param>
+ </struct>
+
+ <struct name="DisplayCapability">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayName" type="String" mandatory="false" />
+ <param name="windowTypeSupported" type="WindowTypeCapabilities" array="true" minsize="1" mandatory="false">
+ <description>
+ Informs the application how many windows the app is allowed to create per type.
+ </description>
+ </param>
+ <param name="windowCapabilities" type="WindowCapability" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>
+ Contains a list of capabilities of all windows related to the app.
+ Once the app has registered the capabilities of all windows are provided.
+ GetSystemCapability still allows requesting window capabilities of all windows.
+ After registration, only windows with capabilities changed will be included.
+ Following cases will cause only affected windows to be included:
+ 1. App creates a new window. After the window is created, a system capability notification will be sent
+ related only to the created window.
+ 2. App sets a new layout to the window. The new layout changes window capabilties.
+ The notification will reflect those changes to the single window.
+ </description>
+ </param>
</struct>
<struct name="SystemCapabilities">
@@ -3311,6 +3486,7 @@
</param>
</struct>
+
<struct name="RemoteControlCapabilities">
<param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
@@ -3790,10 +3966,14 @@
<element name="VIDEO_STREAMING"/>
<element name="REMOTE_CONTROL"/>
<element name="APP_SERVICES" />
+ <element name="DISPLAYS"/>
</enum>
<struct name="SystemCapability">
- <description>The systemCapabilityType identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <description>
+ The systemCapabilityType identifies which data object exists in this struct. For example,
+ if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist
+ </description>
<param name="systemCapabilityType" type="Common.SystemCapabilityType" mandatory="true">
<description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other param included.</description>
</param>
@@ -3810,8 +3990,13 @@
<description>Describes extended capabilities of the module's phone feature</description>
</param>
<param name="appServicesCapabilities" type="Common.AppServicesCapabilities" mandatory="false">
- <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
- </param>
+ <description>
+ An array of currently available services.
+ If this is an update to the capability the affected services will include
+ an update reason in that item
+ </description>
+ </param>
+ <param name="displayCapabilities" type="Common.DisplayCapability" array="true" minsize="1" maxsize="1000" mandatory="false"/>
</struct>
</interface>
@@ -3981,17 +4166,35 @@
</function>
<function name="ActivateApp" messagetype="response">
</function>
+ <function name="CloseApplication" messagetype="request">
+ <description>Request from the application to exit the foreground.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ </function>
+ <function name="CloseApplication" messagetype="response">
+ </function>
<function name="OnAppActivated" messagetype="notification">
<description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
<param name="appID" type="Integer" mandatory="true">
<description>ID of selected application.</description>
</param>
+ <param name="windowID" type="Integer" mandatory="false">
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended. If this param is not included, it will be assumed that this request is specifically for the main window on the main display. See PredefinedWindows enum.
+ </description>
+ </param>
</function>
<function name="OnAppDeactivated" messagetype="notification">
<description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
<param name="appID" type="Integer" mandatory="true">
<description>ID of deactivated application.</description>
</param>
+ <param name="windowID" type="Integer" mandatory="false">
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended. If this param is not included, it will be assumed that this request is specifically for the main window on the main display. See PredefinedWindows enum.
+ </description>
+ </param>
</function>
<function name="OnAppRegistered" messagetype="notification">
<description>Issued by SDL to notify HMI about new application registered.</description>
@@ -4010,7 +4213,7 @@
<param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
<description>
Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
+ Must not interfere with any name of previously registered applications from the same device.
</description>
</param>
<param name="resumeVrGrammars" type="Boolean" mandatory="false">
@@ -4162,45 +4365,54 @@
</function>
<function name="OnPutFile" messagetype="notification" >
- <description>
- Notification, that comes to HMI when mobile sents file with systemFile flag
- </description>
+ <description>
+ Notification that is sent to HMI when a mobile application uploads a file
+ </description>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
- <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Full Size of file. sends in first OnPutFile notification if file is splited
- into many PutFiles
- </description>
- </param>
+ <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Full Size of file. sends in first OnPutFile notification if file is splited
+ into many PutFiles
+ </description>
+ </param>
- <param name="FileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
+ <param name="FileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
- </function>
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+ <param name="isSystemFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If true the system will pass the data thru as it arrives to a predetermined area outside of core.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description> ID of application that uploaded this file. </description>
+ </param>
+ </function>
<function name="GetFilePath" messagetype="request">
<description>This request is sent to retrieve a file path from the HMI.</description>
@@ -4267,10 +4479,17 @@
</param>
</function>
<function name="OnSystemCapabilityUpdated" messagetype="notification">
- <description>A notification to inform the HMI that a specific system capability has changed.</description>
+ <description>
+ A notification between HMI and SDL that a specific system capability has been changed.
+ It can be sent in both directions SDL to HMI and HMI to SDL. Direction is dependent on
+ the point where capabilities have been changed
+ </description>
<param name="systemCapability" type="Common.SystemCapability" mandatory="true">
<description>The system capability that has been updated</description>
</param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>ID of application that is related to this RPC.</description>
+ </param>
</function>
</interface>
@@ -4358,6 +4577,11 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application related to this RPC.</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
<function name="PerformInteraction" messagetype="response">
<param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
@@ -4381,7 +4605,7 @@
<description>
Request new VR synonyms registration
Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
+ Must not interfere with any name of previously registered applications from the same device.
</description>
</param>
<param name="language" type="Common.Language" mandatory="true">
@@ -4549,7 +4773,7 @@
</function>
</interface>
-<interface name="UI" version="1.3.0" date="2018-09-05">
+<interface name="UI" version="1.4.0" date="2019-07-24">
<function name="Alert" messagetype="request">
<description>Request from SDL to show an alert message on the display.</description>
<param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
@@ -4570,19 +4794,64 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application requested this RPC.</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
+ <param name="alertIcon" type="Common.Image" mandatory="false" >
+ <description>
+ Image to be displayed for the corresponding alert. See Image.
+ If omitted, no (or the default if applicable) icon should be displayed.
+ </description>
+ </param>
</function>
+
<function name="Alert" messagetype="response">
<param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
<description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
</param>
</function>
+
+ <function name="SetDisplayLayout" messagetype="request">
+ <description>This RPC is deprecated. Use Show RPC to change layout.</description>
+ <param name="displayLayout" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ </function>
+
+ <function name="SetDisplayLayout" messagetype="response">
+ <description>This RPC is deprecated. Use Show RPC to change layout.</description>
+ <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+ <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+ <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+ <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+ </function>
+
<function name="Show" messagetype="request">
- <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
- <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
+ <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="8">
+ <description>Array of lines of show text fields. See TextFieldStruct. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
mainField1: The text that should be displayed in a single or upper display line.
mainField2: The text that should be displayed on the second display line.
mainField3: The text that should be displayed on the second "page" first display line.
mainField4: The text that should be displayed on the second "page" second display line.
+ templateTitle: The title of the new template that will be displayed.
statusBar: statusBar.
mediaClock: Text value for MediaClock field.
mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
@@ -4612,16 +4881,105 @@
<param name="appID" type="Integer" mandatory="true">
<description>Id of application related to this RPC.</description>
</param>
+ <param name="windowID" type="Integer" mandatory="false" >
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended.
+ If this param is not included,
+ it will be assumed that this request is specifically for the main window
+ on the main display.
+ See PredefinedWindows enum.
+ </description>
+ </param>
+
+ <param name="templateConfiguration" type="Common.TemplateConfiguration" mandatory="false">
+ <description>
+ Used to set an alternate template layout to a window.
+ </description>
+ </param>
</function>
+
<function name="Show" messagetype="response">
</function>
+
+ <function name="CreateWindow" messagetype="request">
+ <description>
+ Create a new window on the display with the specified window type.
+ </description>
+ <param name="windowID" type="Integer" mandatory="true">
+ <description>
+ A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
+ </description>
+ </param>
+
+ <param name="windowName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The window name to be used by the HMI. The name of the pre-created default window will match the app name.
+ Multiple apps can share the same window name except for the default main window.
+ Creating a window with a name which is already in use by the app will result in `DUPLICATE_NAME`.
+ </description>
+ </param>
+
+ <param name="type" type="Common.WindowType" mandatory="true">
+ <description>The type of the window to be created. Main window or widget.</description>
+ </param>
+
+ <param name="associatedServiceType" type="String" mandatory="false">
+ <description>
+ Allows an app to create a widget related to a specific service type.
+ As an example if a `MEDIA` app becomes active, this app becomes audible and is allowed to play audio.
+ Actions such as skip or play/pause will be directed to this active media app.
+ In case of widgets, the system can provide a single "media" widget which will act as a placeholder for the active media app.
+ It is only allowed to have one window per service type. This means that a media app can only have a single MEDIA widget.
+ Still the app can create widgets omitting this parameter.
+ Those widgets would be available as app specific widgets that are permanently included in the HMI.
+ This parameter is related to widgets only. The default main window, which is pre-created during app registration,
+ will be created based on the HMI types specified in the app registration request.
+ </description>
+ </param>
+
+ <param name="duplicateUpdatesFromWindowID" type="Integer" mandatory="false">
+ <description>
+ Optional parameter. Specify whether the content sent to an existing window
+ should be duplicated to the created window.
+ If there isn't a window with the ID, the request will be rejected with `INVALID_DATA`.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+
+ <function name="CreateWindow" messagetype="response">
+ </function>
+
+ <function name="DeleteWindow" messagetype="request">
+ <description>
+ Deletes previously created window of the SDL application.
+ </description>
+ <param name="windowID" type="Integer" mandatory="true">
+ <description>
+ A unique ID to identify the window. The value of '0' will always be the default main window
+ on the main display and cannot be deleted.
+ See PredefinedWindows enum.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+
+ <function name="DeleteWindow" messagetype="response">
+ </function>
+
<function name="AddCommand" messagetype="request">
<description>Request from SDL to add a command to the application menu.</description>
<param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>ID of the command to be added.</description>
</param>
<param name="menuParams" type="Common.MenuParams" mandatory="false">
- <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
+ <description>
+ Optional sub value containing parameters of the command (position, name, etc.). See MenuParams.
+ If omitted the command should be added to the end of the list of commands.</description>
</param>
<param name="cmdIcon" type="Common.Image" mandatory="false">
<description>Image to be displayed for representing the command. See Image.</description>
@@ -4631,8 +4989,10 @@
<description>ID of application that concerns this RPC.</description>
</param>
</function>
+
<function name="AddCommand" messagetype="response">
- </function>
+ </function>
+
<function name="DeleteCommand" messagetype="request">
<description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
<param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
@@ -4642,8 +5002,10 @@
<description>ID of application that concerns this RPC.</description>
</param>
</function>
+
<function name="DeleteCommand" messagetype="response">
</function>
+
<function name="AddSubMenu" messagetype="request">
<description>Request from SDL to add a sub menu to the in-application menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
@@ -4658,6 +5020,9 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
+ <param name="menuLayout" type="Common.MenuLayout" mandatory="false">
+ <description>Sets the layout of the submenu screen.</description>
+ </param>
</function>
<function name="AddSubMenu" messagetype="response">
</function>
@@ -4672,6 +5037,20 @@
</function>
<function name="DeleteSubMenu" messagetype="response">
</function>
+ <function name="ShowAppMenu" messagetype="request">
+ <description>Request from SDL to show an app's menu or a corresponding sub-menu.</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="false">
+ <description>
+ If ommited the HMI opens the app's menu.
+ If set to a sub-menu ID the HMI opens the corresponding sub-menu previously added using `AddSubMenu`.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="ShowAppMenu" messagetype="response">
+ </function>
<function name="PerformInteraction" messagetype="request">
<description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
<param name="initialText" type="Common.TextFieldStruct" mandatory="false">
@@ -4696,6 +5075,11 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that concerns this RPC.</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
<function name="PerformInteraction" messagetype="response">
<param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
@@ -4708,6 +5092,23 @@
</description>
</param>
</function>
+ <function name="CancelInteraction" messagetype="request">
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ The ID of the specific interaction you want to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.
+ </description>
+ </param>
+ <param name="functionID" type="Integer" mandatory="true">
+ <description>
+ The ID of the type of interaction the developer wants to dismiss. Only values 10, (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), and 26 (SliderID) are permitted.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="CancelInteraction" messagetype="response">
+ </function>
<function name="SetMediaClockTimer" messagetype="request">
<description>Sets the initial media clock value and automatic update method.</description>
<param name="startTime" type="Common.TimeFormat" mandatory="false">
@@ -4755,6 +5156,9 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that concerns this RPC.</description>
</param>
+ <param name="menuLayout" type="Common.MenuLayout" mandatory="false">
+ <description>Sets the layout of the main menu screen. If this is sent while a menu is already on-screen, the head unit will change the display to the new layout type.</description>
+ </param>
</function>
<function name="SetGlobalProperties" messagetype="response">
</function>
@@ -4778,6 +5182,11 @@
<param name="appID" type="Integer" mandatory="false">
<description>ID of application that is related to this RPC.</description>
</param>
+ <param name="windowID" type="Integer" mandatory="false">
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended. If this param is not included, it will be assumed that this request is specifically for the main window on the main display. See PredefinedWindows enum.
+ </description>
+ </param>
</function>
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
@@ -4786,7 +5195,17 @@
<param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
<description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
</param>
- <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
+ <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true">
+ <description>
+ Describes an audio configuration that the system supports for PerformAudioPassThru.
+ Note: please fill out both audioPassThruCapabilities and audioPassThruCapabilitiesList parameters, as:
+ - Newer SDL Core uses audioPassThruCapabilitiesList instead of audioPassThruCapabilities, and
+ - audioPassThruCapabilities is a mandatory field and cannot be omitted.
+ </description>
+ </param>
+ <param name="audioPassThruCapabilitiesList" type="Common.AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Describes the audio configurations that the system supports for PerformAudioPassThru.</description>
+ </param>
<param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
<param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
<description>Must be returned if the platform supports on-screen SoftButtons.</description>
@@ -4803,10 +5222,10 @@
<param name="appName" type="String" maxlength="100" mandatory="false">
<description>
Request new app name registration
- Needs to be unique over all applications.
+ Needs to be unique over all applications from the same device.
May not be empty. May not start with a new line character.
- May not interfere with any name or synonym of any registered applications.
- Applications with the same name will be rejected. (SDL makes all the checks)
+ May not interfere with any name or synonym of any registered applications from the same device.
+ Additional applications with the same name from the same device will be rejected.
</description>
</param>
<param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
@@ -4863,33 +5282,7 @@
</function>
<function name="SetAppIcon" messagetype="response">
</function>
- <function name="SetDisplayLayout" messagetype="request">
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
- <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
- </function>
- <function name="SetDisplayLayout" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
- <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
- </function>
+
<function name="ShowCustomForm" messagetype="request">
<description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
<param name="customFormID" type="String" maxlength="500" mandatory="true">
@@ -4969,6 +5362,11 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that concerns this RPC.</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
<function name="Slider" messagetype="response">
<param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
@@ -4990,6 +5388,11 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application related to this RPC.</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
<function name="ScrollableMessage" messagetype="response">
</function>
@@ -6326,7 +6729,10 @@
<interface name="AppService" version="1.0.0" date="2019-03-18">
<description>Interface used for interacting with app services as a producer or consumer</description>
<function name="PublishAppService" messagetype="request">
- <description>Registers a service offered by this app on the module</description>
+ <description>
+ Registers a service offered by this app on the module.
+ Subsequent calls with the same service type will update the manifest for that service.
+ </description>
<param name="appServiceManifest" type="Common.AppServiceManifest" mandatory="true">
<description> The manifest of the service that wishes to be published.</description>
@@ -6341,6 +6747,18 @@
</param>
</function>
+ <function name="UnpublishAppService" messagetype="request">
+ <description>Unpublish an existing service published by the HMI.</description>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description> The ID of the service to be unpublished. </description>
+ </param>
+ </function>
+
+ <function name="UnpublishAppService" messagetype="response">
+ <description>The response to UnpublishAppService</description>
+ </function>
+
<function name="OnAppServiceData" messagetype="notification">
<description>This notification includes the data that is updated from the specific service. HMI->SDL if the HMI is a producer, SDL->HMI if the HMI is a consumer</description>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index a2cdb88b4d..a16a4afa53 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-<interface name="SmartDeviceLink RAPI" version="5.2.0" minVersion="1.0" date="2019-03-19">
+<interface name="SmartDeviceLink RAPI" version="6.0.0" minVersion="1.0" date="2019-03-19">
<enum name="Result" internal_scope="base" since="1.0">
<element name="SUCCESS">
<description>The request succeeded</description>
@@ -346,7 +346,29 @@
<description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
</element>
</enum>
-
+
+ <enum name="WindowType" since="6.0">
+ <element name="MAIN">
+ <description>
+ This window type describes the main window on a display.
+ </description>
+ </element>
+ <element name="WIDGET">
+ <description>
+ A widget is a small window that the app can create to provide information and soft buttons for quick app control.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="PredefinedWindows" since="6.0">
+ <element name="DEFAULT_WINDOW" value="0">
+ <description>The default window is a main window pre-created on behalf of the app.</description>
+ </element>
+ <element name="PRIMARY_WIDGET" value="1">
+ <description>The primary widget of the app.</description>
+ </element>
+ </enum>
+
<enum name="HMILevel" since="1.0">
<description>Enumeration that describes current levels of HMI.</description>
<element name="FULL" internal_name="HMI_FULL" />
@@ -623,6 +645,26 @@
<element name="SOURCE" since="4.5" />
<element name="SHUFFLE" since="4.5" />
<element name="REPEAT" since="4.5" />
+ <!-- Navigation Buttons -->
+ <element name="NAV_CENTER_LOCATION" since="6.0" />
+ <element name="NAV_ZOOM_IN" since="6.0" />
+ <element name="NAV_ZOOM_OUT" since="6.0" />
+ <element name="NAV_PAN_UP" since="6.0" />
+ <element name="NAV_PAN_UP_RIGHT" since="6.0" />
+ <element name="NAV_PAN_RIGHT" since="6.0" />
+ <element name="NAV_PAN_DOWN_RIGHT" since="6.0" />
+ <element name="NAV_PAN_DOWN" since="6.0" />
+ <element name="NAV_PAN_DOWN_LEFT" since="6.0" />
+ <element name="NAV_PAN_LEFT" since="6.0" />
+ <element name="NAV_PAN_UP_LEFT" since="6.0" />
+ <element name="NAV_TILT_TOGGLE" since="6.0" >
+ <description>If supported, this toggles between a top-down view and an angled/3D view. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
+ </element>
+ <element name="NAV_ROTATE_CLOCKWISE" since="6.0" />
+ <element name="NAV_ROTATE_COUNTERCLOCKWISE" since="6.0" />
+ <element name="NAV_HEADING_TOGGLE" since="6.0" >
+ <description>If supported, this toggles between locking the orientation to north or to the vehicle's heading. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
+ </element>
</enum>
<enum name="MediaClockFormat" since="1.0">
@@ -732,7 +774,11 @@
<element name="mediaTrack">
<description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
</element>
-
+
+ <element name="templateTitle" since="6.0">
+ <description>The title of the new template that will be displayed; applies to "Show"</description>
+ </element>
+
<element name="alertText1">
<description>The first line of the alert text field; applies to "Alert"</description>
</element>
@@ -871,7 +917,11 @@
<element name="locationImage" since="4.0">
<description>The optional image of a destination / location</description>
</element>
-
+
+ <element name="alertIcon" since="6.0">
+ <description>The image field for Alert</description>>
+ </element>
+
</enum>
<enum name="CharacterSet" since="1.0">
@@ -1909,6 +1959,12 @@
</element>
</enum>
+ <enum name="MenuLayout" since="6.0">
+ <description>How the main menu or submenu is laid out on screen</description>
+ <element name="LIST" />
+ <element name="TILES" />
+ </enum>
+
<struct name="GPSData" since="2.0">
<description>Struct with the GPS data.</description>
<param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
@@ -2014,6 +2070,13 @@
<param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
</history>
</param>
+ <param name="shifted" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ False, if the GPS data is raw and un-shifted.
+ If not provided, then value is assumed False.
+ </description>
+ </param>
</struct>
<struct name="VehicleDataResult" since="2.0">
@@ -2174,7 +2237,10 @@
<param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
</struct>
- <struct name="DisplayCapabilities" since="1.0">
+ <struct name="DisplayCapabilities" deprecated="true" since="6.0">
+ <history>
+ <struct name="DisplayCapabilities" since="1.0" until="6.0"/>
+ </history>
<description>Contains information about the display capabilities.</description>
<param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
<description>The type of the display. See DisplayType</description>
@@ -2206,7 +2272,9 @@
<param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
<description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
</param>
-
+ <param name="menuLayoutsAvailable" type="MenuLayout" array="true" minsize="1" maxsize="1000" mandatory="false" since="6.0">
+ <description>An array of available menu layouts. If this parameter is not provided, only the `LIST` layout is assumed to be available</description>
+ </param>
<!-- TODO: Add pixel density? -->
</struct>
@@ -2260,6 +2328,12 @@
<param name="imageSupported" type="Boolean" mandatory="true">
<description>The button supports referencing a static or dynamic image.</description>
</param>
+ <param name="textSupported" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ The button supports the use of text.
+ If not included, the default value should be considered true that the button will support text.
+ </description>
+ </param>
</struct>
<struct name="PresetBankCapabilities" since="2.0">
@@ -2269,6 +2343,60 @@
</param>
</struct>
+ <struct name="WindowCapability" since="6.0">
+ <param name="windowID" type="Integer" mandatory="false">
+ <description>
+ The specified ID of the window. Can be set to a predefined window,
+ or omitted for the main window on the main display.
+ </description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="imageTypeSupported" type="ImageType" array="true" minsize="0" maxsize="1000" mandatory="false">
+ <description>Provides information about image types supported by the system.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
+ <description>A set of all window templates available on the head unit.</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>The number of on-window custom presets available (if any); otherwise omitted.</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The number of buttons and the capabilities of each on-window button.</description>
+ </param>
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The number of soft buttons available on-window and the capabilities for each button.</description>
+ </param>
+ </struct>
+
+ <struct name="WindowTypeCapabilities" since="6.0">
+ <param name="type" type="WindowType" mandatory="true" />
+ <param name="maximumNumberOfWindows" type="Integer" mandatory="true" />
+ </struct>
+
+ <struct name="DisplayCapability" since="6.0">
+ <param name="displayName" type="String" mandatory="false" />
+ <param name="windowTypeSupported" type="WindowTypeCapabilities" array="true" minsize="1" mandatory="false">
+ <description>
+ Informs the application how many windows the app is allowed to create per type.
+ </description>
+ </param>
+ <param name="windowCapabilities" type="WindowCapability" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>
+ Contains a list of capabilities of all windows related to the app.
+ Once the app has registered the capabilities of all windows are provided.
+ GetSystemCapability still allows requesting window capabilities of all windows.
+ After registration, only windows with capabilities changed will be included. Following cases will cause only affected windows to be included:
+ 1. App creates a new window. After the window is created, a system capability notification will be sent related only to the created window.
+ 2. App sets a new layout to the window. The new layout changes window capabilties. The notification will reflect those changes to the single window.
+ </description>
+ </param>
+ </struct>
+
<struct name="HMICapabilities" since="3.0">
<param name="navigation" type="Boolean" mandatory="false">
<description>Availability of build in Nav. True: Available, False: Not Available</description>
@@ -2342,7 +2470,7 @@
<description>Trim of the vehicle, e.g. SE</description>
</param>
</struct>
-
+
<enum name="KeyboardLayout" since="3.0">
<description>Enumeration listing possible keyboard layouts.</description>
<element name="QWERTY" />
@@ -2376,25 +2504,34 @@
<description>Configuration of on-screen keyboard (if available).</description>
<param name="language" type="Language" mandatory="false">
<description>The keyboard language.</description>
- </param>
+ </param>
<param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
<description>Desired keyboard layout.</description>
- </param>
+ </param>
<param name="keypressMode" type="KeypressMode" mandatory="false" >
<description>
Desired keypress mode.
If omitted, this value will be set to RESEND_CURRENT_ENTRY.
</description>
- </param>
+ </param>
<param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
<description>Array of keyboard characters to enable.</description>
<description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
<description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false" deprecated="true" since="6.0">
+ <description>Deprecated, use autoCompleteList instead.</description>
+ <history>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false" since="3.0" until="6.0" />
+ </history>
+ </param>
+ <param name="autoCompleteList" type="String" maxlength="1000" minsize="0" maxsize="100" array="true" mandatory="false" since="6.0">
+ <description>
+ Allows an app to prepopulate the text field with a list of suggested or completed entries as the user types.
+ If empty, the auto-complete list will be removed from the screen.
+ </description>
+ </param>
+ </struct>
<struct name="DeviceInfo" since="3.0">
<description>Various information about connecting device.</description>
@@ -2645,6 +2782,12 @@
<element name="GetAppServiceDataID" value="53" hexvalue="35" since="5.1" />
<element name="GetFileID" value="54" hexvalue="36" since="5.1" />
<element name="PerformAppServiceInteractionID" value="55" hexvalue="37" since="5.1" />
+ <element name="UnpublishAppServiceID" value="56" hexvalue="38" since="6.0" />
+ <element name="CancelInteractionID" value="57" hexvalue="39" since="6.0" />
+ <element name="CloseApplicationID" value="58" hexvalue="3A" since="6.0" />
+ <element name="ShowAppMenuID" value="59" hexvalue="3B" since="6.0" />
+ <element name="CreateWindowID" value="60" hexvalue="3C" since="6.0" />
+ <element name="DeleteWindowID" value="61" hexvalue="3D" since="6.0" />
<!--
Base Notifications
@@ -2829,6 +2972,7 @@
<element name="VIDEO_STREAMING"/>
<element name="REMOTE_CONTROL"/>
<element name="APP_SERVICES" since="5.1"/>
+ <element name="DISPLAYS" since="6.0"/>
</enum>
<struct name="NavigationCapability" since="4.5">
@@ -2872,6 +3016,15 @@
<param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
<description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
</param>
+ <param name="diagonalScreenSize" type="Float" minvalue="0" mandatory="false" since="6.0">
+ <description>The diagonal screen size in inches.</description>
+ </param>
+ <param name="pixelPerInch" type="Float" minvalue="0" mandatory="false" since="6.0">
+ <description>PPI is the diagonal resolution in pixels divided by the diagonal screen size in inches.</description>
+ </param>
+ <param name="scale" type="Float" minvalue="1" maxvalue="10" mandatory="false" since="6.0">
+ <description>The scaling factor the app should use to change the size of the projecting view.</description>
+ </param>
</struct>
<struct name="RGBColor" since="5.0">
@@ -2894,7 +3047,18 @@
<description>The color of the background</description>
</param>
</struct>
-
+
+ <struct name="TemplateConfiguration" since="6.0">
+ <param name="template" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created window template.
+ Currently only predefined window template layouts are defined.
+ </description>
+ </param>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" />
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" />
+ </struct>
+
<!---Remote control -->
<enum name="MassageZone" since="5.0">
@@ -3100,16 +3264,21 @@
<param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
<description> True if the hd radio is on, false if the radio is off</description>
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
- <description>number of HD sub-channels if available</description>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" deprecated="true" since="6.0">
+ <description>Number of HD sub-channels if available</description>
<history>
<param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.0"/>
</history>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <param name="availableHdChannels" type="Integer" minvalue="0" maxvalue="7" array="true" minsize="0" maxsize="8" mandatory="false" since="6.0">
+ <description>The list of available HD sub-channel indexes. Empty list means no Hd channel is available. Read-only. </description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="0" maxvalue="7" mandatory="false" since="6.0">
<description>Current HD sub-channel if available</description>
<history>
<param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.0"/>
</history>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -3160,6 +3329,8 @@
<param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
<description>value false means disabled, value true means enabled.</description>
</param>
+ <param name="climateEnable" type="Boolean" mandatory="false" since="6.0">
+ </param>
</struct>
<struct name="RadioControlCapabilities" since="4.5">
@@ -3201,11 +3372,20 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false">
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" deprecated="true" since="6.0">
<description>
Availability of the getting the number of available HD channels.
True: Available, False: Not Available, Not present: Not Available.
</description>
+ <history>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" since="4.5" until="6.0"/>
+ </history>
+ </param>
+ <param name="availableHdChannelsAvailable" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ Availability of the list of available HD sub-channel indexes.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
</param>
<param name="stateAvailable" type="Boolean" mandatory="false">
<description>
@@ -3346,6 +3526,12 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="climateEnableAvailable" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ Availability of the control of enable/disable climate control.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<struct name="EqualizerSettings" since="5.0">
@@ -3830,7 +4016,7 @@
Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
</description>
</param>
- <param name="mediaImage" type="Image" mandatory="false" since="5.2">
+ <param name="mediaImage" type="Image" mandatory="false" since="6.0">
<description>
Music: The album art of the current track
Podcast: The podcast or chapter artwork of the current podcast episode
@@ -4148,6 +4334,7 @@
<param name="appServicesCapabilities" type="AppServicesCapabilities" mandatory="false" since="5.1">
<description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
</param>
+ <param name="displayCapabilities" type="DisplayCapability" array="true" minsize="1" maxsize="1000" mandatory="false" since="6.0"/>
</struct>
<!-- Requests/Responses -->
@@ -4165,11 +4352,11 @@
<param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
<description>
The mobile application name, e.g. "Ford Drive Green".
- Needs to be unique over all applications.
+ Needs to be unique over all applications from the same device.
May not be empty.
May not start with a new line character.
- May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
- Needs to be unique over all applications. Applications with the same name will be rejected.
+ May not interfere with any name or synonym of previously registered applications from the same device and any predefined blacklist of words (global commands)
+ Additional applications with the same name from the same device will be rejected.
Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
</description>
</param>
@@ -4178,7 +4365,7 @@
<description>
TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- Needs to be unique over all applications.
+ Needs to be unique over all applications from the same device.
May not be empty.
May not start with a new line character.
Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
@@ -4196,7 +4383,7 @@
<param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
Defines an additional voice recognition command.
- May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
+ May not interfere with any app name of previously registered applications from the same device and any predefined blacklist of words (global commands)
Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
</description>
</param>
@@ -4296,22 +4483,45 @@
<param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
<description>The currently active display language on the module. See "Language" for options.</description>
</param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false" deprecated="true" since="6.0">
+ <description>
+ See DisplayCapabilities. This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
+ </description>
+ <history>
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false" since="2.0" until="6.0"/>
+ </history>
</param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" deprecated="true" since="6.0">
+ <description>
+ See ButtonCapabilities. This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
+ </description>
+ <history>
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0" until="6.0"/>
+ </history>
</param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" deprecated="true" since="6.0">
+ <description>
+ If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.
+ This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
+ </description>
+ <history>
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0" until="6.0"/>
+ </history>
</param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" deprecated="true" since="6.0">
+ <description>
+ If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.
+ This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
+ </description>
+ <history>
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0" until="6.0"/>
+ </history>
</param>
+
<param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See HmiZoneCapabilities</description>
</param>
@@ -4396,6 +4606,108 @@
</function>
+ <function name="CreateWindow" functionID="CreateWindowID" messagetype="request" since="6.0">
+ <description>
+ Create a new window on the display with the specified window type.
+ </description>
+ <param name="windowID" type="Integer" mandatory="true">
+ <description>
+ A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
+ </description>
+ </param>
+
+ <param name="windowName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The window name to be used by the HMI. The name of the pre-created default window will match the app name.
+ Multiple apps can share the same window name except for the default main window.
+ Creating a window with a name which is already in use by the app will result in `DUPLICATE_NAME`.
+ </description>
+ </param>
+
+ <param name="type" type="WindowType" mandatory="true">
+ <description>The type of the window to be created. Main window or widget.</description>
+ </param>
+
+ <param name="associatedServiceType" type="String" mandatory="false">
+ <description>
+ Allows an app to create a widget related to a specific service type.
+ As an example if a `MEDIA` app becomes active, this app becomes audible and is allowed to play audio. Actions such as skip or play/pause will be
+ directed to this active media app. In case of widgets, the system can provide a single "media" widget which will act as a placeholder for the active media app.
+
+ It is only allowed to have one window per service type. This means that a media app can only have a single MEDIA widget. Still the app can create widgets omitting this parameter. Those widgets would be available as app specific widgets that are permanently included in the HMI.
+
+ This parameter is related to widgets only. The default main window, which is pre-created during app registration, will be created based on the HMI types specified in the app registration request.
+ </description>
+ </param>
+ <param name="duplicateUpdatesFromWindowID" type="Integer" mandatory="false">
+ <description>
+ Optional parameter. Specify whether the content sent to an existing window
+ should be duplicated to the created window.
+ If there isn't a window with the ID, the request will be rejected with `INVALID_DATA`.
+ </description>
+ </param>
+ </function>
+
+ <function name="CreateWindow" functionID="CreateWindowID" messagetype="response" since="6.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_DATA"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="DISALLOWED"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ </function>
+
+ <function name="DeleteWindow" functionID="DeleteWindowID" messagetype="request" since="6.0">
+ <description>
+ Deletes previously created window of the SDL application.
+ </description>
+ <param name="windowID" type="Integer" mandatory="true">
+ <description>
+ A unique ID to identify the window. The value of '0' will always be the default main window on the main display and cannot be deleted.
+ See PredefinedWindows enum.
+ </description>
+ </param>
+ </function>
+
+ <function name="DeleteWindow" functionID="DeleteWindowID" messagetype="response" since="6.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_DATA"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="DISALLOWED"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ </function>
+
<function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
<description>Allows setting global properties.</description>
@@ -4442,6 +4754,10 @@
<param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
<description>On-screen keyboard configuration (if available).</description>
</param>
+
+ <param name="menuLayout" type="MenuLayout" mandatory="false" since="6.0">
+ <description>Sets the layout of the main menu screen. If this is sent while a menu is already on-screen, the head unit will change the display to the new layout type.</description>
+ </param>
</function>
<function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
@@ -4617,6 +4933,10 @@
<param name="menuIcon" type="Image" mandatory="false" since="5.0">
<description>The image field for AddSubMenu</description>
</param>
+
+ <param name="menuLayout" type="MenuLayout" mandatory="false" since="6.0">
+ <description>Sets the layout of the submenu screen.</description>
+ </param>
</function>
<function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
@@ -4676,6 +4996,37 @@
</function>
+ <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="request" since="6.0">
+ <description>Shows the built in menu view</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="false">
+ <description>
+ If omitted the HMI opens the app's menu.
+ If set to a sub-menu ID the HMI opens the corresponding sub-menu previously added using `AddSubMenu`.
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="response" since="6.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
<function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
<description>creates interaction choice set to be used later by performInteraction</description>
@@ -4769,6 +5120,12 @@
<param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
<description>See LayoutMode.</description>
</param>
+
+ <param name="cancelID" type="Integer" mandatory="false" since="6.0">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
@@ -4902,6 +5259,19 @@
If omitted on supported displays, the displayed alert shall not have any SoftButtons.
</description>
</param>
+
+ <param name="alertIcon" type="Image" mandatory="false" since="6.0">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon should be displayed.
+ </description>
+ </param>
+
+ <param name="cancelID" type="Integer" mandatory="false" since="6.0">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
@@ -5035,6 +5405,27 @@
If omitted on supported displays, the currently set metadata tags will not change.
If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
</param>
+
+ <param name="templateTitle" type="String" maxlength="100" mandatory="false" since="6.0">
+ <description>
+ The title of the new template that will be displayed.
+ How this will be displayed is dependent on the OEM design and implementation of the template.
+ </description>
+ </param>
+
+ <param name="windowID" type="Integer" mandatory="false" since="6.0" >
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended. If this param is not included,
+ it will be assumed that this request is specifically for the main window on the main display.
+ See PredefinedWindows enum.
+ </description>
+ </param>
+
+ <param name="templateConfiguration" type="TemplateConfiguration" mandatory="false" since="6.0">
+ <description>
+ Used to set an alternate template layout to a window.
+ </description>
+ </param>
</function>
<function name="Show" functionID="ShowID" messagetype="response" since="1.0">
@@ -6117,6 +6508,13 @@
If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
</description>
</param>
+
+ <param name="cancelID" type="Integer" mandatory="false" since="6.0">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
+
</function>
<function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response" since="2.0">
@@ -6171,6 +6569,11 @@
If omitted, the value is set to 10000.
</description>
</param>
+ <param name="cancelID" type="Integer" mandatory="false" since="6.0">
+ <description>
+ An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
+ </description>
+ </param>
</function>
<function name="Slider" functionID="SliderID" messagetype="response" since="2.0">
@@ -6675,12 +7078,8 @@
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
- <description>
- Used to set an alternate display layout.
- If not sent, default screen for given platform will be shown
- </description>
-
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" deprecated="true" since="6.0">
+ <description>This RPC is deprecated. Use Show RPC to change layout.</description>
<param name="displayLayout" type="String" maxlength="500" mandatory="true">
<description>
Predefined or dynamically created screen layout.
@@ -6693,12 +7092,12 @@
<param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
-
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" deprecated="true" since="6.0">
+ <description>This RPC is deprecated. Use Show RPC to change layout.</description>
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
-
+
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
@@ -6710,23 +7109,23 @@
<element name="REJECTED"/>
<element name="UNSUPPORTED_REQUEST"/>
</param>
-
+
<param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
<description>See DisplayCapabilities</description>
</param>
-
+
<param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
<description>See ButtonCapabilities</description >
</param>
-
+
<param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
<description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
</param>
-
+
<param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
<description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
</param>
-
+
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
<description>Provides additional human readable info regarding the result.</description>
</param>
@@ -7201,10 +7600,16 @@
</function>
<function name="PublishAppService" functionID="PublishAppServiceID" messagetype="request" since="5.1">
- <description>Registers a service offered by this app on the module</description>
+ <description>
+ Registers a service offered by this app on the module.
+ Subsequent calls with the same service type will update the manifest for that service.
+ </description>
<param name="appServiceManifest" type="AppServiceManifest" mandatory="true">
- <description> The manifest of the service that wishes to be published.</description>
+ <description>
+ The manifest of the service that wishes to be published.
+ If already published, the updated manifest for this service.
+ </description>
</param>
</function>
@@ -7236,6 +7641,38 @@
</param>
</function>
+ <function name="UnpublishAppService" functionID="UnpublishAppServiceID" messagetype="request" since="6.0">
+ <description> Unpublish an existing service published by this application. </description>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description> The ID of the service to be unpublished. </description>
+ </param>
+ </function>
+
+ <function name="UnpublishAppService" functionID="UnpublishAppServiceID" messagetype="response" since="6.0">
+ <description> The response to UnpublishAppService </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="INVALID_ID"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
<function name="GetAppServiceData" functionID="GetAppServiceDataID" messagetype="request" since="5.1">
<description> This request asks the module for current data related to the specific service. It also includes an option to subscribe to that service for future updates</description>
@@ -7311,6 +7748,70 @@
</param>
</function>
+ <function name="CancelInteraction" functionID="CancelInteractionID" messagetype="request" since="6.0">
+ <description>
+ Close an active interaction on the HMI.
+ </description>
+
+ <param name="cancelID" type="Integer" mandatory="false">
+ <description>
+ The ID of the specific interaction you want to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.
+ </description>
+ </param>
+
+ <param name="functionID" type="Integer" mandatory="true">
+ <description>
+ The ID of the type of interaction the developer wants to dismiss. Only values 10, (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), and 26 (SliderID) are permitted.
+ </description>
+ </param>
+ </function>
+
+ <function name="CancelInteraction" functionID="CancelInteractionID" messagetype="response" since="6.0">
+ <description>
+ If no applicable request can be dismissed, the result will be IGNORED.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="DISALLOWED"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="CloseApplication" functionID="CloseApplicationID" messagetype="request" since="6.0">
+ <description>Request from the application to exit the foreground and enter HMI_NONE.</description>
+ </function>
+
+ <function name="CloseApplication" functionID="CloseApplicationID" messagetype="response" since="6.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="DISALLOWED"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
@@ -7332,6 +7833,11 @@
If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).
</description>
</param>
+ <param name="windowID" type="Integer" mandatory="false" since="6.0">
+ <description>
+ This is the unique ID assigned to the window that this RPC is intended. If this param is not included, it will be assumed that this request is specifically for the main window on the main display. See PredefinedWindows enum.
+ </description>
+ </param>
</function>
<function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
@@ -7482,6 +7988,21 @@
<param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
+ <param name="lockScreenDismissalEnabled" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ If enabled, the lock screen will be able to be dismissed while connected to SDL, allowing users
+ the ability to interact with the app. Dismissals should include a warning to the user and ensure
+ that they are not the driver.
+ </description>
+ </param>
+ <param name="lockScreenDismissalWarning" type="String" mandatory="false" since="6.0">
+ <description>
+ Warning message to be displayed on the lock screen when dismissal is enabled.
+ This warning should be used to ensure that the user is not the driver of the vehicle,
+ ex. `Swipe down to dismiss, acknowledging that you are not the driver.`.
+ This parameter must be present if "lockScreenDismissalEnabled" is set to true.
+ </description>
+ </param>
</function>
<function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt
index f5d596f681..265a62a0d8 100644
--- a/src/components/media_manager/test/CMakeLists.txt
+++ b/src/components/media_manager/test/CMakeLists.txt
@@ -58,7 +58,7 @@ set(LIBRARIES
connectionHandler
encryption
Resumption
- Policy
+ PolicyStatic
${SecurityManagerLibrary}
)
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index bd05291245..80c3cb60e6 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -29,10 +29,9 @@
# POSSIBILITY OF SUCH DAMAGE.
# --- Policy
-set(target Policy)
set(install_destination bin)
set(copy_destination ${CMAKE_BINARY_DIR}/src/appMain)
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}Policy${CMAKE_SHARED_LIBRARY_SUFFIX})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
@@ -75,21 +74,25 @@ else ()
list(APPEND LIBRARIES sqlite3)
endif ()
-add_library(${target} SHARED ${SOURCES})
-target_link_libraries(${target} ${LIBRARIES} )
+add_library(PolicyStatic ${SOURCES})
+target_link_libraries(PolicyStatic ${LIBRARIES})
+
+
+add_library(Policy SHARED "src/policy_manager_impl.cc")
+target_link_libraries(Policy PolicyStatic)
if (ENABLE_LOG)
- target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ target_link_libraries(Policy log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_custom_target(copy_library_${target} ALL
+add_custom_target(copy_library_Policy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${library_name}
${copy_destination}
- DEPENDS ${target}
+ DEPENDS Policy
COMMENT "Copying library ${library_name}")
-install(TARGETS ${target}
+install(TARGETS Policy
DESTINATION ${install_destination}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index 15eb51565d..19a475371d 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_
#include <map>
+#include "boost/optional.hpp"
#include "policy/cache_manager_interface.h"
#include "policy/pt_ext_representation.h"
@@ -158,6 +159,11 @@ class CacheManager : public CacheManagerInterface {
*/
virtual const VehicleInfo GetVehicleInfo() const;
+ const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
+
+ const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const OVERRIDE;
+
/**
* @brief Get a list of enabled cloud applications
* @param enabled_apps List filled with the policy app id of each enabled
@@ -283,7 +289,7 @@ class CacheManager : public CacheManagerInterface {
std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
const std::string& language,
- const std::string& active_hmi_language);
+ const std::string& active_hmi_language) const;
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
index 980ad42dcd..0cbbb6df1f 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -35,6 +35,7 @@
#include <string>
#include <vector>
+#include "boost/optional.hpp"
#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
@@ -270,6 +271,24 @@ class CacheManagerInterface {
const std::string& policy_app_id) const = 0;
/**
+ * @brief Returns state of the lock screen that could be able to be dismissed
+ * while connected to SDL, allowing users the ability to interact with the
+ * app.
+ * @return bool True if lock screen can be dismissed.
+ */
+ virtual const boost::optional<bool> LockScreenDismissalEnabledState()
+ const = 0;
+
+ /**
+ * @brief Returns lock screen warning message. In case when specified language
+ * is absent in policy table will be returned message on default language
+ * ("en-us"). Otherwise returns uninitialized boost::optional<std::string>
+ * @return std::string Lock screen warning message
+ */
+ virtual const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const = 0;
+
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -290,7 +309,7 @@ class CacheManagerInterface {
virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
const std::string& language,
- const std::string& active_hmi_language) = 0;
+ const std::string& active_hmi_language) const = 0;
/**
* @brief Get list of URL to send PTS to
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index 2f8f6cf070..261f66a3b2 100644
--- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -122,6 +122,7 @@ class PolicyManagerImpl : public PolicyManager {
* @brief Check if specified RPC for specified application
* has permission to be executed in specified HMI Level
* and also its permitted params.
+ * @param device_id device identifier
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
@@ -129,7 +130,8 @@ class PolicyManagerImpl : public PolicyManager {
* @param result containing flag if HMI Level is allowed
* and list of allowed params.
*/
- void CheckPermissions(const PTString& app_id,
+ void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
@@ -148,6 +150,11 @@ class PolicyManagerImpl : public PolicyManager {
*/
void KmsChanged(int kilometers) OVERRIDE;
+ const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
+
+ const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const OVERRIDE;
+
/**
* @brief Increments counter of ignition cycles
*/
@@ -262,12 +269,15 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param device_handle device identifier
* @param app_id Unique application id
* @param is_device_allowed true if user allowing device otherwise false
* @return true if operation was successful
*/
- bool ReactOnUserDevConsentForApp(const std::string& app_id,
- const bool is_device_allowed) OVERRIDE;
+ bool ReactOnUserDevConsentForApp(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& app_id,
+ const bool is_device_allowed) OVERRIDE;
/**
* @brief Retrieves data from app_policies about app on its registration:
@@ -310,12 +320,14 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Get default HMI level for application
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @param default_hmi Default HMI level for application or empty, if value
* was not set
* @return true, if succedeed, otherwise - false
*/
- bool GetDefaultHmi(const std::string& policy_app_id,
+ bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
/**
@@ -360,9 +372,11 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Return device id, which hosts specific application
+ * @param device_id device identifier
* @param policy_app_id Application id, which is required to update device id
*/
std::string& GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_id,
const std::string& policy_app_id) const OVERRIDE;
/**
@@ -404,11 +418,12 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Gets specific application permissions changes since last policy
* table update
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @return Permissions changes
*/
AppPermissions GetAppPermissionsChanges(
- const std::string& policy_app_id) OVERRIDE;
+ const std::string& device_id, const std::string& policy_app_id) OVERRIDE;
/**
* @brief Removes specific application permissions changes
@@ -418,10 +433,11 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
+ * @param device_id device identifier
* @param application_id Unique application id
*/
void SendNotificationOnPermissionsUpdated(
- const std::string& application_id) OVERRIDE;
+ const std::string& device_id, const std::string& application_id) OVERRIDE;
/**
* @brief Removes unpaired device records and related records from DB
@@ -452,20 +468,24 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
+ * @param device_id device identifier
* @param application_id Unique application id
* @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
/**
* @brief Assigns new HMI types for specified application
+ * @param device_handle device identifier
* @param application_id Unique application id
* @param hmi_types new HMI types list
*/
- void SetDefaultHmiTypes(const std::string& application_id,
+ void SetDefaultHmiTypes(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const std::vector<int>& hmi_types) OVERRIDE;
/**
@@ -559,10 +579,12 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Gets request types for application
+ * @param device_handle device identifier
* @param policy_app_id Unique application id
* @return request types of application
*/
const std::vector<std::string> GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string policy_app_id) const OVERRIDE;
/**
@@ -684,10 +706,13 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * It will send OnAppPermissionSend notification and will try to start PTU.
+ *
+ * @param device_id device identifier
* @param application_id registered application.
*/
- void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+ void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) OVERRIDE;
@@ -851,6 +876,17 @@ class PolicyManagerImpl : public PolicyManager {
const std::shared_ptr<policy_table::Table> snapshot);
/**
+ * @brief Compares current policies to the updated one.
+ * Trigger actions in case if certain fields after udate was changes.
+ * This function should be called after PT update.
+ * Actions require already updated policy table
+ * @param update Shared pointer to policy table udpate
+ * @param snapshot Shared pointer to old copy of policy table
+ */
+ void CheckPermissionsChangesAfterUpdate(const policy_table::Table& update,
+ const policy_table::Table& snapshot);
+
+ /**
* @brief Processes results from policy table update analysis done by
* CheckPermissionsChanges() by filling ApplicationsPoliciesActions struct
* with actions which should be done for every application and passes them to
@@ -902,19 +938,23 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Allows to process case when added application is not present in
* policy db.
+ * @param device_id device identifier
* @param policy application id.
* @param cuuren consent for application's device.
*/
- void AddNewApplication(const std::string& application_id,
+ void AddNewApplication(const std::string& device_id,
+ const std::string& application_id,
DeviceConsent device_consent);
/**
* @brief Allows to process case when added application is already
* in policy db.
+ * @param device_id device identifier
* @param policy application id.
* @param cuuren consent for application's device.
*/
- void PromoteExistedApplication(const std::string& application_id,
+ void PromoteExistedApplication(const std::string& device_id,
+ const std::string& application_id,
DeviceConsent device_consent);
/**
@@ -932,9 +972,12 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Checks whether need ask the permission of users
+ * @param device_id device identifier
+ * @param appid policy application id
* @return true if user consent is needed
*/
- virtual bool IsConsentNeeded(const std::string& app_id);
+ virtual bool IsConsentNeeded(const std::string& device_id,
+ const std::string& app_id);
/**
* @brief Changes isConsentNeeded for app pending permissions, in case
@@ -1020,11 +1063,13 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Notify application about its permissions changes by preparing and
* sending OnPermissionsChanged notification
+ * @param device_id device identifier
* @param policy_app_id Application id to send notification to
* @param app_group_permissons Current permissions for groups assigned to
* application
*/
void NotifyPermissionsChanges(
+ const std::string& device_id,
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& app_group_permissions);
@@ -1049,11 +1094,13 @@ class PolicyManagerImpl : public PolicyManager {
* user consents (if any) and ExternalConsent consents (if any) will be
* updated
* appropiately to current ExternalConsent status stored by policy table
+ * @param device_id device identifier
* @param application_id Application id
* @param processing_policy Defines whether consents timestamps must be
* considered or external consents take over
*/
void ProcessExternalConsentStatusForApp(
+ const std::string& device_id,
const std::string& application_id,
const ConsentProcessingPolicy processing_policy);
/**
@@ -1081,16 +1128,20 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Notifies system by sending OnAppPermissionChanged notification
+ * @param device_id device identifier
* @param app_policy Reference to application policy
*/
- void NotifySystem(const AppPoliciesValueType& app_policy) const;
+ void NotifySystem(const std::string& device_id,
+ const AppPoliciesValueType& app_policy) const;
/**
* @brief Sends OnPermissionChange notification to application if its
* currently registered
+ * @param device_id device identifier
* @param app_policy Reference to application policy
*/
- void SendPermissionsToApp(const AppPoliciesValueType& app_policy);
+ void SendPermissionsToApp(const std::string& device_id,
+ const AppPoliciesValueType& app_policy);
/**
* @brief Gets groups names from collection of groups permissions
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index 28b0caf95b..d3aee9dcf8 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -472,6 +472,36 @@ enum FunctionID {
PerformAppServiceInteractionID = 55,
/**
+ * @brief UnpublishAppServiceID.
+ */
+ UnpublishAppServiceID = 56,
+
+ /**
+ * @brief CancelInteractionID.
+ */
+ CancelInteractionID = 57,
+
+ /**
+ * @brief CloseApplicationID.
+ */
+ CloseApplicationID = 58,
+
+ /**
+ * @brief ShowAppMenuID.
+ */
+ ShowAppMenuID = 59,
+
+ /**
+ * @brief CreateWindowID.
+ */
+ CreateWindowID = 60,
+
+ /**
+ * @brief DeleteWindowID.
+ */
+ DeleteWindowID = 61,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
index 994fd86579..8795e2690f 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -364,6 +364,7 @@ struct ModuleConfig : CompositeType {
Optional<String<0, 65535> > certificate;
Optional<Boolean> preloaded_pt;
Optional<Boolean> full_app_id_supported;
+ Optional<Boolean> lock_screen_dismissal_enabled;
public:
ModuleConfig();
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index bd38f7bf8f..4170e7aaa6 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -1561,10 +1561,44 @@ bool CacheManager::UnknownRPCPassthroughAllowed(
return false;
}
+const boost::optional<bool> CacheManager::LockScreenDismissalEnabledState()
+ const {
+ boost::optional<bool> empty;
+ CACHE_MANAGER_CHECK(empty);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
+ if (module_config.lock_screen_dismissal_enabled.is_initialized()) {
+ return boost::optional<bool>(*module_config.lock_screen_dismissal_enabled);
+ }
+ return empty;
+}
+
+const boost::optional<std::string>
+CacheManager::LockScreenDismissalWarningMessage(
+ const std::string& language) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ boost::optional<std::string> empty;
+ CACHE_MANAGER_CHECK(empty);
+
+ const std::string lock_screen_dismissal_warning_message =
+ "LockScreenDismissalWarning";
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ std::vector<std::string> msg_codes{lock_screen_dismissal_warning_message};
+
+ const auto messages = GetUserFriendlyMsg(msg_codes, language, "en-us");
+
+ if (messages.empty() || messages[0].text_body.empty()) {
+ return empty;
+ }
+
+ return boost::optional<std::string>(messages[0].text_body);
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
const std::string& language,
- const std::string& active_hmi_language) {
+ const std::string& active_hmi_language) const {
LOG4CXX_AUTO_TRACE(logger_);
std::vector<UserFriendlyMessage> result;
CACHE_MANAGER_CHECK(result);
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 15900f0187..c11bdefb90 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -53,10 +53,12 @@
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-policy::PolicyManager* CreateManager() {
+__attribute__((visibility("default"))) policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
}
-void DeleteManager(policy::PolicyManager* pm) {
+
+__attribute__((visibility("default"))) void DeleteManager(
+ policy::PolicyManager* pm) {
delete pm;
}
namespace {
@@ -491,6 +493,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
ProcessAppPolicyCheckResults(
results, pt_update->policy_table.app_policies_section.apps);
+ CheckPermissionsChangesAfterUpdate(*pt_update, *policy_table_snapshot);
+
listener_->OnCertificateUpdated(
*(pt_update->policy_table.module_config.certificate));
@@ -538,6 +542,17 @@ CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges(
return out_results;
}
+void PolicyManagerImpl::CheckPermissionsChangesAfterUpdate(
+ const policy_table::Table& update, const policy_table::Table& snapshot) {
+ const auto new_lock_screen_dismissal_enabled =
+ update.policy_table.module_config.lock_screen_dismissal_enabled;
+ const auto old_lock_screen_dismissal_enabled =
+ snapshot.policy_table.module_config.lock_screen_dismissal_enabled;
+ if (new_lock_screen_dismissal_enabled != old_lock_screen_dismissal_enabled) {
+ listener()->OnLockScreenDismissalStateChanged();
+ }
+}
+
void PolicyManagerImpl::ProcessAppPolicyCheckResults(
const CheckAppPolicyResults& results,
const policy_table::ApplicationPolicies& app_policies) {
@@ -552,33 +567,35 @@ void PolicyManagerImpl::ProcessAppPolicyCheckResults(
void PolicyManagerImpl::ProcessActionsForAppPolicies(
const ApplicationsPoliciesActions& actions,
const policy_table::ApplicationPolicies& app_policies) {
- ApplicationsPoliciesActions::const_iterator it_actions = actions.begin();
- for (; it_actions != actions.end(); ++it_actions) {
- policy_table::ApplicationPolicies::const_iterator app_policy =
- app_policies.find(it_actions->first);
+ for (const auto& action : actions) {
+ const auto& app_policy = app_policies.find(action.first);
if (app_policies.end() == app_policy) {
continue;
}
- if (it_actions->second.is_consent_needed) {
- // Post-check after ExternalConsent consent changes
- const std::string& policy_app_id = app_policy->first;
- if (!IsConsentNeeded(policy_app_id)) {
- sync_primitives::AutoLock lock(app_permissions_diff_lock_);
+ const auto devices_ids = listener()->GetDevicesIds(app_policy->first);
+ for (const auto& device_id : devices_ids) {
+ if (action.second.is_consent_needed) {
+ // Post-check after ExternalConsent consent changes
+ const auto& policy_app_id = app_policy->first;
+ if (!IsConsentNeeded(device_id, policy_app_id)) {
+ sync_primitives::AutoLock lock(app_permissions_diff_lock_);
- PendingPermissions::iterator app_id_diff =
- app_permissions_diff_.find(policy_app_id);
+ const auto& app_id_diff = app_permissions_diff_.find(policy_app_id);
- if (app_permissions_diff_.end() != app_id_diff) {
- app_id_diff->second.appPermissionsConsentNeeded = false;
+ if (app_permissions_diff_.end() != app_id_diff) {
+ app_id_diff->second.appPermissionsConsentNeeded = false;
+ }
}
}
- }
- if (it_actions->second.is_notify_system) {
- NotifySystem(*app_policy);
- }
- if (it_actions->second.is_send_permissions_to_app) {
- SendPermissionsToApp(*app_policy);
+
+ if (action.second.is_notify_system) {
+ NotifySystem(device_id, *app_policy);
+ }
+
+ if (action.second.is_send_permissions_to_app) {
+ SendPermissionsToApp(device_id, *app_policy);
+ }
}
}
}
@@ -702,10 +719,11 @@ void PolicyManagerImpl::OnAppsSearchCompleted(const bool trigger_ptu) {
}
const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
+ const transport_manager::DeviceHandle& device_handle,
const std::string policy_app_id) const {
std::vector<std::string> request_types;
- if (kDeviceDisallowed ==
- cache_->GetDeviceConsent(GetCurrentDeviceId(policy_app_id))) {
+ if (kDeviceAllowed != cache_->GetDeviceConsent(
+ GetCurrentDeviceId(device_handle, policy_app_id))) {
cache_->GetAppRequestTypes(kPreDataConsentId, request_types);
} else {
cache_->GetAppRequestTypes(policy_app_id, request_types);
@@ -805,7 +823,8 @@ bool PolicyManagerImpl::UnknownRPCPassthroughAllowed(
return cache_->UnknownRPCPassthroughAllowed(policy_app_id);
}
-void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
+void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
@@ -814,8 +833,6 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
"CheckPermissions for " << app_id << " and rpc " << rpc
<< " for " << hmi_level << " level.");
- const std::string device_id = GetCurrentDeviceId(app_id);
-
Permissions rpc_permissions;
// Check, if there are calculated permission present in cache
@@ -985,9 +1002,8 @@ policy_table::Strings PolicyManagerImpl::GetGroupsNames(
}
void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
- const std::string& application_id) {
+ const std::string& device_id, const std::string& application_id) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(application_id);
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
"Couldn't find device info for application id "
@@ -1015,15 +1031,16 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
- listener()->OnPermissionsUpdated(application_id, notification_data);
+ listener()->OnPermissionsUpdated(
+ device_id, application_id, notification_data);
return;
}
std::string default_hmi;
- GetDefaultHmi(application_id, &default_hmi);
+ GetDefaultHmi(device_id, application_id, &default_hmi);
listener()->OnPermissionsUpdated(
- application_id, notification_data, default_hmi);
+ device_id, application_id, notification_data, default_hmi);
}
bool PolicyManagerImpl::CleanupUnpairedDevices() {
@@ -1056,14 +1073,16 @@ void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
}
bool PolicyManagerImpl::ReactOnUserDevConsentForApp(
- const std::string& app_id, const bool is_device_allowed) {
- std::vector<std::string> current_request_types = GetAppRequestTypes(app_id);
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& app_id,
+ const bool is_device_allowed) {
+ auto current_request_types = GetAppRequestTypes(device_handle, app_id);
std::string current_priority, new_priority;
GetPriority(app_id, &current_priority);
bool result = cache_->ReactOnUserDevConsentForApp(app_id, is_device_allowed);
- std::vector<std::string> new_request_types = GetAppRequestTypes(app_id);
+ auto new_request_types = GetAppRequestTypes(device_handle, app_id);
GetPriority(app_id, &new_priority);
std::sort(current_request_types.begin(), current_request_types.end());
std::sort(new_request_types.begin(), new_request_types.end());
@@ -1088,7 +1107,8 @@ bool PolicyManagerImpl::ReactOnUserDevConsentForApp(
}
if (permissions.requestTypeChanged || (!permissions.priority.empty())) {
- listener_->SendOnAppPermissionsChanged(permissions, app_id);
+ const auto& device_id = GetCurrentDeviceId(device_handle, app_id);
+ listener_->SendOnAppPermissionsChanged(permissions, device_id, app_id);
}
return result;
}
@@ -1206,6 +1226,7 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges(
}
void PolicyManagerImpl::NotifyPermissionsChanges(
+ const std::string& device_id,
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& app_group_permissions) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1221,7 +1242,7 @@ void PolicyManagerImpl::NotifyPermissionsChanges(
PrepareNotificationData(
functional_groups, app_groups, app_group_permissions, notification_data);
- listener()->OnPermissionsUpdated(policy_app_id, notification_data);
+ listener()->OnPermissionsUpdated(device_id, policy_app_id, notification_data);
}
void PolicyManagerImpl::SetUserConsentForApp(
@@ -1260,14 +1281,15 @@ void PolicyManagerImpl::SetUserConsentForApp(
CheckPendingPermissionsChanges(verified_permissions.policy_app_id,
updated_app_group_permissons);
- NotifyPermissionsChanges(verified_permissions.policy_app_id,
+ NotifyPermissionsChanges(verified_permissions.device_id,
+ verified_permissions.policy_app_id,
updated_app_group_permissons);
}
-bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
+bool PolicyManagerImpl::GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(policy_app_id);
DeviceConsent device_consent = GetUserConsentForDevice(device_id);
const std::string app_id = policy::kDeviceAllowed != device_consent
? kPreDataConsentId
@@ -1372,11 +1394,13 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
bool allowed_by_default = false;
- if (cache_->IsDefaultPolicy(policy_app_id)) {
+ const auto device_consent = GetUserConsentForDevice(device_id);
+ if ((policy::kDeviceAllowed == device_consent) &&
+ cache_->IsDefaultPolicy(policy_app_id)) {
app_id_to_check = kDefaultId;
allowed_by_default = true;
} else if (cache_->IsPredataPolicy(policy_app_id) ||
- policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
+ policy::kDeviceAllowed != device_consent) {
app_id_to_check = kPreDataConsentId;
allowed_by_default = true;
}
@@ -1460,9 +1484,11 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
std::string& PolicyManagerImpl::GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const {
LOG4CXX_INFO(logger_, "GetDeviceInfo");
- last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
+ last_device_id_ =
+ listener()->OnCurrentDeviceIdUpdateRequired(device_handle, policy_app_id);
return last_device_id_;
}
@@ -1566,15 +1592,16 @@ void PolicyManagerImpl::UpdateAppConsentWithExternalConsent(
}
void PolicyManagerImpl::NotifySystem(
+ const std::string& device_id,
const PolicyManagerImpl::AppPoliciesValueType& app_policy) const {
- listener()->OnPendingPermissionChange(app_policy.first);
+ listener()->OnPendingPermissionChange(device_id, app_policy.first);
}
void PolicyManagerImpl::SendPermissionsToApp(
+ const std::string& device_id,
const PolicyManagerImpl::AppPoliciesValueType& app_policy) {
const std::string app_id = app_policy.first;
- const std::string device_id = GetCurrentDeviceId(app_id);
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
"Couldn't find device info for application id: " << app_id);
@@ -1597,6 +1624,7 @@ void PolicyManagerImpl::SendPermissionsToApp(
LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
listener()->OnPermissionsUpdated(
+ device_id,
app_id,
notification_data,
policy_table::EnumToJsonString(app_policy.second.default_hmi));
@@ -1738,6 +1766,19 @@ void PolicyManagerImpl::KmsChanged(int kilometers) {
}
}
+const boost::optional<bool> PolicyManagerImpl::LockScreenDismissalEnabledState()
+ const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->LockScreenDismissalEnabledState();
+}
+
+const boost::optional<std::string>
+PolicyManagerImpl::LockScreenDismissalWarningMessage(
+ const std::string& language) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->LockScreenDismissalWarningMessage(language);
+}
+
void PolicyManagerImpl::IncrementIgnitionCycles() {
cache_->IncrementIgnitionCycles();
}
@@ -1844,10 +1885,10 @@ bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
return cache_->IsApplicationRevoked(app_id);
}
-bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
+bool PolicyManagerImpl::IsConsentNeeded(const std::string& device_id,
+ const std::string& app_id) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(app_id);
- int count = cache_->CountUnconsentedGroups(app_id, device_id);
+ const int count = cache_->CountUnconsentedGroups(app_id, device_id);
LOG4CXX_DEBUG(logger_, "There are: " << count << " unconsented groups.");
return count != 0;
}
@@ -1857,7 +1898,7 @@ void PolicyManagerImpl::SetVINValue(const std::string& value) {
}
AppPermissions PolicyManagerImpl::GetAppPermissionsChanges(
- const std::string& policy_app_id) {
+ const std::string& device_id, const std::string& policy_app_id) {
PendingPermissions::iterator app_id_diff =
app_permissions_diff_.find(policy_app_id);
@@ -1866,7 +1907,8 @@ AppPermissions PolicyManagerImpl::GetAppPermissionsChanges(
if (app_permissions_diff_.end() != app_id_diff) {
permissions = app_id_diff->second;
} else {
- permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
+ permissions.appPermissionsConsentNeeded =
+ IsConsentNeeded(device_id, policy_app_id);
permissions.appRevoked = IsApplicationRevoked(policy_app_id);
GetPriority(permissions.application_id, &permissions.priority);
}
@@ -1895,9 +1937,9 @@ void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) {
}
void PolicyManagerImpl::OnAppRegisteredOnMobile(
- const std::string& application_id) {
+ const std::string& device_id, const std::string& application_id) {
StartPTExchange();
- SendNotificationOnPermissionsUpdated(application_id);
+ SendNotificationOnPermissionsUpdated(device_id, application_id);
}
void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
@@ -1986,20 +2028,23 @@ class CallStatusChange : public utils::Callable {
};
StatusNotifier PolicyManagerImpl::AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(application_id);
- DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ auto device_consent = GetUserConsentForDevice(device_id);
+ LOG4CXX_DEBUG(logger_,
+ "check_device_id: " << device_id << " check_device_consent: "
+ << device_consent);
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
LOG4CXX_DEBUG(logger_, "Adding new application");
- AddNewApplication(application_id, device_consent);
+ AddNewApplication(device_id, application_id, device_consent);
return std::make_shared<CallStatusChange>(update_status_manager_,
device_consent);
}
LOG4CXX_DEBUG(logger_, "Promote existed application");
- PromoteExistedApplication(application_id, device_consent);
+ PromoteExistedApplication(device_id, application_id, device_consent);
update_status_manager_.OnExistedApplicationAdded(cache_->UpdateRequired());
return std::make_shared<utils::CallNothing>();
}
@@ -2016,6 +2061,7 @@ bool PolicyManagerImpl::IsPredataPolicy(
}
void PolicyManagerImpl::ProcessExternalConsentStatusForApp(
+ const std::string& device_id,
const std::string& application_id,
const ConsentProcessingPolicy processing_policy) {
ExternalConsentStatus status = cache_->GetExternalConsentStatus();
@@ -2027,7 +2073,7 @@ void PolicyManagerImpl::ProcessExternalConsentStatusForApp(
CalculateGroupsConsentFromExternalConsent(
groups_by_status, allowed_groups, disallowed_groups);
- const std::string device_id = GetCurrentDeviceId(application_id);
+ LOG4CXX_DEBUG(logger_, "check device_id: " << device_id);
UpdateAppConsentWithExternalConsent(device_id,
application_id,
allowed_groups,
@@ -2035,7 +2081,8 @@ void PolicyManagerImpl::ProcessExternalConsentStatusForApp(
processing_policy);
}
-void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
+void PolicyManagerImpl::AddNewApplication(const std::string& device_id,
+ const std::string& application_id,
DeviceConsent device_consent) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2055,19 +2102,31 @@ void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
}
ProcessExternalConsentStatusForApp(
- application_id, ConsentProcessingPolicy::kExternalConsentBased);
+ device_id,
+ application_id,
+ ConsentProcessingPolicy::kExternalConsentBased);
}
void PolicyManagerImpl::PromoteExistedApplication(
- const std::string& application_id, DeviceConsent device_consent) {
+ const std::string& device_id,
+ const std::string& application_id,
+ DeviceConsent device_consent) {
// If device consent changed to allowed during application being
// disconnected, app permissions should be changed also
+ LOG4CXX_DEBUG(logger_,
+ "kDeviceAllowed == device_consent: "
+ << (kDeviceAllowed == device_consent)
+ << " device_consent: " << device_consent);
if (kDeviceAllowed == device_consent &&
cache_->IsPredataPolicy(application_id)) {
+ LOG4CXX_INFO(logger_,
+ "Setting "
+ << policy::kDefaultId
+ << " permissions for application id: " << application_id);
cache_->SetDefaultPolicy(application_id);
}
- ProcessExternalConsentStatusForApp(application_id,
- ConsentProcessingPolicy::kTimestampBased);
+ ProcessExternalConsentStatusForApp(
+ device_id, application_id, ConsentProcessingPolicy::kTimestampBased);
}
bool PolicyManagerImpl::IsNewApplication(
@@ -2147,10 +2206,12 @@ std::ostream& operator<<(std::ostream& output,
return output;
}
-void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
- const std::vector<int>& hmi_types) {
+void PolicyManagerImpl::SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
+ const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
- const std::string device_id = GetCurrentDeviceId(application_id);
+ const auto device_id = GetCurrentDeviceId(device_handle, application_id);
ApplicationOnDevice who = {device_id, application_id};
access_remote_->SetDefaultHmiTypes(who, hmi_types);
}
@@ -2188,7 +2249,7 @@ bool PolicyManagerImpl::CheckModule(const PTString& app_id,
void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
std::string default_hmi("NONE");
- if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ if (GetDefaultHmi(who.dev_id, who.app_id, &default_hmi)) {
listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
} else {
LOG4CXX_WARN(
@@ -2225,7 +2286,8 @@ void PolicyManagerImpl::SendAppPermissionsChanged(
const std::string& device_id, const std::string& application_id) {
Permissions notification_data;
GetPermissions(device_id, application_id, &notification_data);
- listener()->OnPermissionsUpdated(application_id, notification_data);
+ listener()->OnPermissionsUpdated(
+ device_id, application_id, notification_data);
}
void PolicyManagerImpl::SendAuthTokenUpdated(const std::string policy_app_id) {
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index bb25623b35..6f60b43af9 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -1159,6 +1159,36 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("UnpublishAppService" == literal) {
+ *result = UnpublishAppServiceID;
+ return true;
+ }
+
+ if ("CancelInteraction" == literal) {
+ *result = CancelInteractionID;
+ return true;
+ }
+
+ if ("CreateWindow" == literal) {
+ *result = CreateWindowID;
+ return true;
+ }
+
+ if ("DeleteWindow" == literal) {
+ *result = DeleteWindowID;
+ return true;
+ }
+
+ if ("CloseApplication" == literal) {
+ *result = CloseApplicationID;
+ return true;
+ }
+
+ if ("ShowAppMenu" == literal) {
+ *result = ShowAppMenuID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
index ca3f8a1648..d39b3f7623 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -788,8 +788,9 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
, preloaded_date(impl::ValueMember(value__, "preloaded_date"))
, certificate(impl::ValueMember(value__, "certificate"))
, preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
- , full_app_id_supported(
- impl::ValueMember(value__, "full_app_id_supported")) {}
+ , full_app_id_supported(impl::ValueMember(value__, "full_app_id_supported"))
+ , lock_screen_dismissal_enabled(
+ impl::ValueMember(value__, "lock_screen_dismissal_enabled")) {}
void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
exchange_after_x_days = from.exchange_after_x_days;
@@ -801,6 +802,7 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
endpoints = from.endpoints;
notifications_per_minute_by_priority =
from.notifications_per_minute_by_priority;
+ lock_screen_dismissal_enabled = from.lock_screen_dismissal_enabled;
certificate.assign_if_valid(from.certificate);
vehicle_make.assign_if_valid(from.vehicle_make);
@@ -834,6 +836,9 @@ Json::Value ModuleConfig::ToJsonValue() const {
impl::WriteJsonField("vehicle_year", vehicle_year, &result__);
impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
+ impl::WriteJsonField("lock_screen_dismissal_enabled",
+ lock_screen_dismissal_enabled,
+ &result__);
return result__;
}
@@ -883,6 +888,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_date.is_valid()) {
return false;
}
+ if (!lock_screen_dismissal_enabled.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -925,6 +933,9 @@ bool ModuleConfig::struct_empty() const {
if (notifications_per_minute_by_priority.is_initialized()) {
return false;
}
+ if (lock_screen_dismissal_enabled.is_initialized()) {
+ return false;
+ }
if (vehicle_make.is_initialized()) {
return false;
}
@@ -979,6 +990,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
notifications_per_minute_by_priority.ReportErrors(
&report__->ReportSubobject("notifications_per_minute_by_priority"));
}
+ if (!lock_screen_dismissal_enabled.is_valid()) {
+ lock_screen_dismissal_enabled.ReportErrors(
+ &report__->ReportSubobject("lock_screen_dismissal_enabled"));
+ }
if (!vehicle_make.is_valid()) {
vehicle_make.ReportErrors(&report__->ReportSubobject("vehicle_make"));
}
@@ -1037,6 +1052,7 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
seconds_between_retries.SetPolicyTableType(pt_type);
endpoints.SetPolicyTableType(pt_type);
notifications_per_minute_by_priority.SetPolicyTableType(pt_type);
+ lock_screen_dismissal_enabled.SetPolicyTableType(pt_type);
vehicle_make.SetPolicyTableType(pt_type);
vehicle_model.SetPolicyTableType(pt_type);
vehicle_year.SetPolicyTableType(pt_type);
diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc
index f4cac214a5..5592fdecd8 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -76,7 +76,8 @@ const std::string kCreateSchema =
" `vehicle_model` VARCHAR(45), "
" `vehicle_year` VARCHAR(4), "
" `preloaded_date` VARCHAR (10), "
- " `certificate` VARCHAR (45) "
+ " `certificate` VARCHAR (45), "
+ " `lock_screen_dismissal_enabled` BOOL"
"); "
"CREATE TABLE IF NOT EXISTS `functional_group`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
@@ -459,7 +460,7 @@ const std::string kInsertInitData =
" VALUES (0, 0, 0, 0); "
"INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, `is_first_run`,"
" `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`, "
- " `exchange_after_x_days`, `timeout_after_x_seconds`) "
+ " `exchange_after_x_days`, `timeout_after_x_seconds`)"
" VALUES(1, 0, 0, 0, 0, 0); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('EMERGENCY'); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NAVIGATION'); "
@@ -734,7 +735,7 @@ const std::string kUpdateModuleConfig =
" `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
" `timeout_after_x_seconds` = ?, `vehicle_make` = ?, "
" `vehicle_model` = ?, `vehicle_year` = ?, `preloaded_date` = ?, "
- " `certificate` = ? ";
+ " `certificate` = ?, lock_screen_dismissal_enabled = ?";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
@@ -785,7 +786,8 @@ const std::string kSelectModuleConfig =
"SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, "
" `exchange_after_x_kilometers`, `exchange_after_x_days`, "
" `timeout_after_x_seconds`, `vehicle_make`,"
- " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate` "
+ " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate`, "
+ " `lock_screen_dismissal_enabled` "
" FROM `module_config`";
const std::string kSelectEndpoints =
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 1bb0cf0fa1..d5950f9d42 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -552,6 +552,9 @@ void SQLPTRepresentation::GatherModuleConfig(
*config->vehicle_year = query.GetString(7);
*config->preloaded_date = query.GetString(8);
*config->certificate = query.GetString(9);
+ if (!query.IsNull(10)) {
+ *config->lock_screen_dismissal_enabled = query.GetBoolean(10);
+ }
}
utils::dbms::SQLQuery endpoints(db());
@@ -1412,6 +1415,10 @@ bool SQLPTRepresentation::SaveModuleConfig(
config.certificate.is_initialized() ? query.Bind(9, *(config.certificate))
: query.Bind(9);
+ config.lock_screen_dismissal_enabled.is_initialized()
+ ? query.Bind(10, *(config.lock_screen_dismissal_enabled))
+ : query.Bind(10);
+
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Incorrect update module config");
return false;
diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt
index 8b77c90dd2..77b1b35973 100644
--- a/src/components/policy/policy_external/test/CMakeLists.txt
+++ b/src/components/policy/policy_external/test/CMakeLists.txt
@@ -42,7 +42,7 @@ include_directories(
set(testLibraries
gmock
Utils
- Policy
+ PolicyStatic
UsageStatistics
ConfigProfile
)
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index 066b5756e2..bb8c6fc12a 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -92,7 +92,8 @@ TEST_F(PolicyManagerImplTest,
EXPECT_CALL(*cache_manager_, IsApplicationRepresented(_))
.WillOnce(Return(true));
EXPECT_EQ(policy_manager_->GetPolicyTableStatus(), "UP_TO_DATE");
- policy_manager_->AddApplication(kDefaultId,
+ policy_manager_->AddApplication(kDefaultDeviceMacAddress,
+ kDefaultId,
HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ(policy_manager_->GetPolicyTableStatus(), "UP_TO_DATE");
}
@@ -142,8 +143,11 @@ TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_1_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
std::ifstream ifile(kValidSdlPtUpdateJson);
Json::Reader reader;
@@ -174,8 +178,8 @@ TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered) {
EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
// Registration is allowed
CheckRpcPermissions("RegisterAppInterface", ::policy::kRpcAllowed);
}
@@ -187,12 +191,13 @@ TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered_HMIDefault) {
EmulatePTAppRevoked(kPtu2Json);
EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
// Default HMI level is NONE
- EXPECT_TRUE(policy_manager_->GetDefaultHmi(application_id_, &default_hmi));
+ EXPECT_TRUE(policy_manager_->GetDefaultHmi(
+ device_id_1_, application_id_, &default_hmi));
EXPECT_EQ("NONE", default_hmi);
}
@@ -210,12 +215,16 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth");
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillRepeatedly(Return(device_id_1_));
+
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_1_))
+ .Times(0);
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_1_))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_)));
+
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Check before action
policy_table::RpcParameters rpc_parameters;
rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
@@ -227,7 +236,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
policy_manager_->CheckPermissions(
- app_id_1_, kHmiLevelFull, "Alert", input_params, output);
+ device_id_1_, app_id_1_, kHmiLevelFull, "Alert", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -248,7 +257,7 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_FALSE(cache->IsPTPreloaded());
policy_manager_->CheckPermissions(
- app_id_1_, kHmiLevelFull, "Alert", input_params, output);
+ device_id_1_, app_id_1_, kHmiLevelFull, "Alert", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
ASSERT_TRUE(output.list_of_allowed_params.empty());
@@ -269,12 +278,14 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .WillRepeatedly(Return(device_id_1_));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, application_id_))
+ .Times(0);
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_)));
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_MEDIA));
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_MEDIA));
// Emulate PTU with new policies for app added above
std::ifstream ifile(kValidSdlPtUpdateJson);
Json::Reader reader;
@@ -323,8 +334,6 @@ TEST_F(PolicyManagerImplTest2,
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .WillOnce(Return(device_id_1_));
cache->AddDevice(device_id_1_, "Bluetooth");
cache->SetDeviceData(device_id_1_,
"hardware IPX",
@@ -334,8 +343,12 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth");
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "Alert", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "Alert",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
// Check list of parameters empty
@@ -344,21 +357,22 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
CheckPermissions_NoParametersInPT_CheckRpcsInDifferentLevels) {
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Arrange
AddSetDeviceData();
LoadPTUFromJsonFile("json/sdl_update_pt_send_location.json");
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
ASSERT_TRUE(output.list_of_allowed_params.empty());
@@ -367,8 +381,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
ASSERT_TRUE(output.list_of_allowed_params.empty());
@@ -376,7 +394,8 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -388,8 +407,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
// Check list of parameters is empty
@@ -399,24 +422,25 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(
PolicyManagerImplTest2,
CheckPermissions_ParamsNotAllowedInPT_AddAppWithAllParams_CheckRpcsInDiffLvls) {
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Arrange
AddSetDeviceData();
// File have empty parameters, so they are forbidden
LoadPTUFromJsonFile("json/sdl_update_pt_send_location_no_params.json");
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
// Group which has RPC does not require user consent, so its auto-allowed for
// user. Since RPC 'parameters' section is present, but empty, that means
@@ -431,8 +455,12 @@ TEST_F(
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -443,7 +471,8 @@ TEST_F(
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -459,8 +488,12 @@ TEST_F(
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -472,6 +505,8 @@ TEST_F(
TEST_F(PolicyManagerImplTest2,
CheckPermissions_SomeParamsAllowedInPT_CheckRpcsInDiffLvls) {
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Arrange
AddSetDeviceData();
@@ -479,19 +514,18 @@ TEST_F(PolicyManagerImplTest2,
//"locationDescription", "phoneNumber" are allowed
LoadPTUFromJsonFile("json/sdl_update_pt_send_location_some_params.json");
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -520,8 +554,12 @@ TEST_F(PolicyManagerImplTest2,
output.list_of_undefined_params.clear();
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -539,7 +577,8 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -559,8 +598,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
// Check lists of parameters are empty
@@ -585,10 +628,12 @@ TEST_F(PolicyManagerImplTest2, GetCorrectStatus_PTUSuccessful) {
CreateLocalPT(preloaded_pt_filename_);
// Check
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Adding changes PT status
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Before load PT we should send notification about start updating
policy_manager_->OnUpdateStarted();
@@ -613,6 +658,8 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
CheckPermissions_DiffParamsAllowedInGroups_CheckRpcsInDiffLvls) {
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Arrange
AddSetDeviceData();
// Load Json to cache
@@ -621,19 +668,18 @@ TEST_F(PolicyManagerImplTest2,
// Allowed both groups of parameters
LoadPTUFromJsonFile("json/sdl_update_pt_2_groups_have_params.json");
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
// Check list of allowed parameters is not empty
@@ -652,8 +698,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
// Check list of allowed parameters is not empty
@@ -672,7 +722,8 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -696,8 +747,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
// Check lists of parameters are empty
@@ -726,9 +781,12 @@ TEST_F(PolicyManagerImplTest2,
2,
"Bluetooth"));
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
std::ifstream ifile("json/sdl_update_pt_2_groups_no_params_in1.json");
Json::Reader reader;
@@ -743,19 +801,18 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_undefined_params.empty());
@@ -763,8 +820,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_undefined_params.empty());
@@ -772,7 +833,8 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -785,8 +847,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_allowed_params.empty());
@@ -813,9 +879,12 @@ TEST_F(PolicyManagerImplTest2,
2,
"Bluetooth"));
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
std::ifstream ifile(
"json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json");
@@ -831,19 +900,18 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_undefined_params.empty());
@@ -851,15 +919,20 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_undefined_params.empty());
EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -871,8 +944,12 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
EXPECT_TRUE(output.list_of_allowed_params.empty());
EXPECT_TRUE(output.list_of_disallowed_params.empty());
@@ -917,8 +994,8 @@ TEST_F(
GetPTU(kValidSdlPtUpdateJson);
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Try to add existing app
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check no update required
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
@@ -939,14 +1016,14 @@ TEST_F(PolicyManagerImplTest2,
GetPTU(kValidSdlPtUpdateJson);
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
// Set PT was updated 10 days ago (limit is 30 days for now)
// So no limit exceeded
policy_manager_->PTUpdatedAt(counter, days - 10);
- policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ policy_manager_->OnAppRegisteredOnMobile(device_id_2_, app_id_2_);
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
@@ -959,13 +1036,13 @@ TEST_F(PolicyManagerImplTest2,
GetPTU(kValidSdlPtUpdateJson);
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
// Set PT was updated 50 days ago (limit is 30 days for now)
policy_manager_->PTUpdatedAt(counter, days - 50);
- policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ policy_manager_->OnAppRegisteredOnMobile(device_id_2_, app_id_2_);
EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
@@ -979,8 +1056,8 @@ TEST_F(
GetPTU(kValidSdlPtUpdateJson);
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Try to add existing app
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
// Set PT was updated 10 days ago (limit is 30 days for now)
@@ -993,7 +1070,7 @@ TEST_F(
for (int i = 0; i < ign_cycles; ++i) {
policy_manager_->IncrementIgnitionCycles();
}
- policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ policy_manager_->OnAppRegisteredOnMobile(device_id_2_, app_id_2_);
// Check update required
EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
@@ -1022,10 +1099,10 @@ TEST_F(PolicyManagerImplTest2,
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
policy_manager_->SetUserConsentForDevice(device_id_2_, true);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
- .WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -1045,7 +1122,8 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->SetUserConsentForApp(perm_consent,
policy::PolicyManager::kSilentMode);
- policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id_2_,
+ app_id_2_);
std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
std::vector< ::policy::FunctionalGroupPermission>::iterator it;
policy_manager_->GetUserConsentForApp(
@@ -1069,8 +1147,10 @@ TEST_F(PolicyManagerImplTest2,
CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
// Check keep context in updated policies for app
EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
@@ -1080,8 +1160,10 @@ TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
// Check keep context in updated policies for app
EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
@@ -1130,10 +1212,10 @@ TEST_F(
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
policy_manager_->SetUserConsentForDevice(device_id_2_, true);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
- .WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_2_)));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -1153,7 +1235,8 @@ TEST_F(
policy_manager_->SetUserConsentForApp(perm_consent,
policy::PolicyManager::kSilentMode);
- policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id_2_,
+ app_id_2_);
std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
std::vector< ::policy::FunctionalGroupPermission>::iterator it;
policy_manager_->GetPermissionsForApp(
@@ -1177,19 +1260,23 @@ TEST_F(
PolicyManagerImplTest2,
GetAppRequestTypes_AddApp_UpdateAppPolicies_ExpectReceivedRequestTypesCorrect) {
// Arrange
+ const transport_manager::DeviceHandle handle = 1;
CreateLocalPT(preloaded_pt_filename_);
-
- policy_manager_->AddApplication(app_id_3_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_3_))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_)));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_3_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_3_, HmiTypes(policy_table::AHT_DEFAULT));
::policy::StringArray app_requests =
- policy_manager_->GetAppRequestTypes(app_id_3_);
+ policy_manager_->GetAppRequestTypes(handle, app_id_3_);
EXPECT_EQ(1u, app_requests.size());
Json::Value root = GetPTU(kPtuRequestTypeJson);
Json::Value request_Types = Json::Value(Json::arrayValue);
request_Types =
root["policy_table"]["app_policies"][app_id_3_]["RequestType"];
- app_requests = policy_manager_->GetAppRequestTypes(app_id_3_);
+ app_requests = policy_manager_->GetAppRequestTypes(handle, app_id_3_);
EXPECT_EQ(request_Types.size(), app_requests.size());
// Check nicknames match
for (uint32_t i = 0; i < request_Types.size(); ++i) {
@@ -1213,9 +1300,11 @@ TEST_F(
rpc::ValidationReport report("policy_table");
pt->ReportErrors(&report);
}
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Add new app
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
uint32_t result = policy_manager_->HeartBeatTimeout(app_id_2_);
// By default hertbeat timeout is 0
EXPECT_EQ(0u, result);
@@ -1261,10 +1350,10 @@ TEST_F(PolicyManagerImplTest2,
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
policy_manager_->SetUserConsentForDevice(device_id_2_, true);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
- .WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_2_)));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -1284,7 +1373,8 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->SetUserConsentForApp(perm_consent,
policy::PolicyManager::kSilentMode);
- policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id_2_,
+ app_id_2_);
std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
std::vector< ::policy::FunctionalGroupPermission>::iterator it;
policy_manager_->GetPermissionsForApp(
@@ -1330,20 +1420,22 @@ TEST_F(PolicyManagerImplTest2,
SingleInvalidRequestTypeInPTU_ExpectReplaceWithDefaultValues) {
// Arrange
const std::string section_name = app_id_2_;
+ const transport_manager::DeviceHandle handle = 1;
// Arrange
CreateLocalPT(preloaded_pt_filename_);
// Setting device consent to 'true' in order to have defult application
// permissions, request type etc.
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_2_))
.WillRepeatedly(Return(device_id_1_));
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
-
+ EXPECT_CALL(listener_, GetDevicesIds(section_name))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_)));
// Add app
- policy_manager_->AddApplication(section_name,
- HmiTypes(policy_table::AHT_DEFAULT));
- EXPECT_CALL(listener_, OnPendingPermissionChange(section_name));
+ policy_manager_->AddApplication(
+ device_id_1_, section_name, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, OnPendingPermissionChange(device_id_1_, section_name));
// PTU has single invalid RequestTypes, which must be dropped and replaced
// with default RT
@@ -1351,18 +1443,18 @@ TEST_F(PolicyManagerImplTest2,
// Get RequestTypes from <app_id> section of app policies after PT update
::policy::StringArray app_request_types_after =
- policy_manager_->GetAppRequestTypes(section_name);
+ policy_manager_->GetAppRequestTypes(handle, section_name);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(kDefaultId))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, kDefaultId))
.WillOnce(Return(device_id_1_));
::policy::StringArray default_request_types_after =
- policy_manager_->GetAppRequestTypes(kDefaultId);
+ policy_manager_->GetAppRequestTypes(handle, kDefaultId);
// Check sizes of Request types of PT and PTU
EXPECT_EQ(4u, app_request_types_after.size());
::policy::AppPermissions permissions =
- policy_manager_->GetAppPermissionsChanges(section_name);
+ policy_manager_->GetAppPermissionsChanges(device_id_1_, section_name);
EXPECT_TRUE(permissions.requestTypeChanged);
policy_table::RequestType temp_res1;
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index 3c6377cf5f..ddb5474df3 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -259,25 +259,30 @@ TEST_F(
PolicyManagerImplTest2,
AddValidRequestTypeToPT_GetNewAppWithSpecificPoliciesViaPTU_ExpectRTAdded) {
const std::string& app_id = application_id_;
+ const transport_manager::DeviceHandle handle = 1;
// Arrange
CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_CALL(listener_, GetDevicesIds(app_id))
+ .WillRepeatedly(Return(transport_manager::DeviceList(1, device_id_1_)));
// Add app
- policy_manager_->AddApplication(app_id, HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id, HmiTypes(policy_table::AHT_DEFAULT));
// Check app gets RequestTypes from pre_DataConsent of app_policies
// section
- pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id);
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, app_id);
// Only single item as in pre_DataConsent in preloaded PT
EXPECT_EQ(1u, pt_request_types_.size());
- EXPECT_CALL(listener_, OnPendingPermissionChange(app_id)).Times(1);
+ EXPECT_CALL(listener_, OnPendingPermissionChange(device_id_1_, app_id))
+ .Times(1);
// PTU has RequestTypes as [] - means 'all allowed'
Json::Value root = GetPTU("json/PTU2.json");
// Setting device consent to 'true' in order to have appropriate application
// permissions, request type etc.
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id))
.WillRepeatedly(Return(device_id_1_));
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
@@ -288,13 +293,13 @@ TEST_F(
pt_request_types_.clear();
// Get RequestTypes from <app_id> section of app policies after PT update
- pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id);
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, app_id);
// Check sizes of Request types of PT and PTU
ASSERT_EQ(ptu_request_types_size_, pt_request_types_.size());
::policy::AppPermissions permissions =
- policy_manager_->GetAppPermissionsChanges(app_id);
+ policy_manager_->GetAppPermissionsChanges(device_id_1_, app_id);
EXPECT_TRUE(permissions.requestTypeChanged);
::policy::StringArray result;
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index 47b3959aee..b809c83d75 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -341,8 +341,10 @@ TEST_F(PolicyManagerImplTest, MarkUnpairedDevice) {
TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
// Arrange
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_)).Times(1);
- EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(app_id_2_));
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_2_))
+ .Times(1);
+ EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(handle, app_id_2_));
}
TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) {
@@ -424,7 +426,7 @@ TEST_F(
status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
@@ -473,7 +475,7 @@ TEST_F(
status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
@@ -529,12 +531,12 @@ TEST_F(
EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_1_))
.WillRepeatedly(Return(device_id_1_));
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Check ExternalConsent consents for application
updated_device_data = pt->policy_table.device_data->find(device_id_1_);
@@ -597,12 +599,12 @@ TEST_F(
EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_1_))
.WillRepeatedly(Return(device_id_1_));
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Checking ExternalConsent consents after setting new ExternalConsent status
ApplicationPolicies::const_iterator app_parameters =
@@ -652,15 +654,12 @@ TEST_F(
EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillOnce(Return(device_id_1_)) // registered
- .WillOnce(Return("")) // not registered
- .WillRepeatedly(Return(device_id_1_)); // again registered
-
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_1_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// First register w/o app having groups to consent
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Act
std::shared_ptr<policy_table::Table> pt =
@@ -691,8 +690,8 @@ TEST_F(
EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
// Second time register w/ app having groups to consent
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Checking ExternalConsent consents after setting new ExternalConsent status
ApplicationPolicies::const_iterator app_parameters =
@@ -742,15 +741,11 @@ TEST_F(
EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillOnce(Return(device_id_1_)) // registered
- .WillOnce(Return("")) // not registered
- .WillRepeatedly(Return(device_id_1_)); // registered again
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
// First register w/o app having groups to consent
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Act
std::shared_ptr<policy_table::Table> pt =
@@ -781,8 +776,8 @@ TEST_F(
EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
// Second time register w/ app having groups to consent
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
// Check ExternalConsent consents for application
updated_device_data = pt->policy_table.device_data->find(device_id_1_);
@@ -840,12 +835,11 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillRepeatedly(Return(device_id_1_));
-
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_1_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
@@ -965,12 +959,11 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillRepeatedly(Return(device_id_1_));
-
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_1_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
@@ -1099,7 +1092,7 @@ TEST_F(
status_on.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
status_on.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _));
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status_on));
@@ -1135,7 +1128,8 @@ TEST_F(
status_off.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOff));
status_off.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOff));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _)).Times(1);
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_1_, _))
+ .Times(1);
EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status_off));
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 82d87cd7ba..8a62772992 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -307,7 +307,10 @@ void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
// Arrange
CreateLocalPT(preloaded_pt_filename_);
// Get RequestTypes from section of preloaded_pt app_policies
- pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, section_name))
+ .WillRepeatedly(Return(device_id_1_));
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, section_name);
EXPECT_EQ(rt_number, pt_request_types_.size());
Json::Value root = GetPTU(update_file_name);
// Get Request Types from JSON (PTU)
@@ -316,7 +319,7 @@ void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
ptu_request_types_size_ = ptu_request_types_.size();
pt_request_types_.clear();
// Get RequestTypes from section of PT app policies after update
- pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, section_name);
// Check number of RT in PTU and PT now are equal
ASSERT_EQ(ptu_request_types_size_ - invalid_rt_number,
pt_request_types_.size());
@@ -329,14 +332,17 @@ void PolicyManagerImplTest2::AddRTtoAppSectionPT(
const uint32_t invalid_rt_number) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, section_name))
+ .WillRepeatedly(Return(device_id_1_));
// Add app
- policy_manager_->AddApplication(section_name,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, section_name, HmiTypes(policy_table::AHT_DEFAULT));
// Check app gets RequestTypes from pre_DataConsent of app_policies
// section
- pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, section_name);
EXPECT_EQ(rt_number, pt_request_types_.size());
- EXPECT_CALL(listener_, OnPendingPermissionChange(section_name)).Times(1);
+ EXPECT_CALL(listener_, OnPendingPermissionChange(_, section_name)).Times(1);
Json::Value root = GetPTU(update_file_name);
// Get App Request Types from PTU
@@ -346,13 +352,13 @@ void PolicyManagerImplTest2::AddRTtoAppSectionPT(
pt_request_types_.clear();
// Get RequestTypes from <app_id> section of app policies after PT update
- pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(handle, section_name);
// Check sizes of Request types of PT and PTU
ASSERT_EQ(ptu_request_types_size_ - invalid_rt_number,
pt_request_types_.size());
::policy::AppPermissions permissions =
- policy_manager_->GetAppPermissionsChanges(section_name);
+ policy_manager_->GetAppPermissionsChanges(device_id_1_, section_name);
EXPECT_TRUE(permissions.requestTypeChanged);
}
@@ -449,9 +455,13 @@ void PolicyManagerImplTest2::
2,
"Bluetooth"));
+ EXPECT_CALL(listener_, GetDevicesIds(application_id_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
// Expect all parameters are allowed
std::ifstream ifile(update_file);
@@ -467,19 +477,18 @@ void PolicyManagerImplTest2::
EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
- // Will be called each time permissions are checked
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
- .Times(4)
- .WillRepeatedly(Return(device_id_1_));
-
// Check RPC in each level
::policy::RPCParams input_params;
InsertRpcParametersInList(input_params);
::policy::CheckPermissionResult output;
// Rpc in FULL level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
// Check list of allowed parameters is not empty
@@ -489,8 +498,12 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in LIMITED level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelLimited,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
// Check list of allowed parameters is not empty
@@ -500,7 +513,8 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in BACKGROUND level
- policy_manager_->CheckPermissions(application_id_,
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
kHmiLevelBackground,
"SendLocation",
input_params,
@@ -515,8 +529,12 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in NONE level
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelNone,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
// Check lists of parameters are empty
@@ -529,8 +547,12 @@ void PolicyManagerImplTest2::CheckRpcPermissions(
const std::string& rpc_name, const PermitResult& expected_permission) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- policy_manager_->CheckPermissions(
- application_id_, kHmiLevelFull, rpc_name, input_params, output);
+ policy_manager_->CheckPermissions(device_id_1_,
+ application_id_,
+ kHmiLevelFull,
+ rpc_name,
+ input_params,
+ output);
EXPECT_EQ(expected_permission, output.hmi_level_permitted);
}
@@ -541,7 +563,7 @@ void PolicyManagerImplTest2::CheckRpcPermissions(
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
policy_manager_->CheckPermissions(
- app_id, kHmiLevelFull, rpc_name, input_params, output);
+ device_id_1_, app_id, kHmiLevelFull, rpc_name, input_params, output);
EXPECT_EQ(out_expected_permission, output.hmi_level_permitted);
}
@@ -576,8 +598,9 @@ void PolicyManagerImplTest2::AddSetDeviceData() {
"Bluetooth"));
// Add app from consented device. App will be assigned with default policies
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->AddApplication(
+ device_id_1_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
(policy_manager_->GetCache())->AddDevice(device_id_1_, "Bluetooth");
}
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index c58ae00ff4..e42ecbacd7 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -34,6 +34,7 @@
#include "policy/policy_manager_impl_test_base.h"
#include "utils/date_time.h"
+#include "utils/macro.h"
namespace test {
namespace components {
@@ -49,13 +50,13 @@ TEST_F(
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_1_))
.WillRepeatedly(Return(device_id_1_));
policy_manager_->SetUserConsentForDevice(device_id_1_, true);
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
@@ -76,13 +77,14 @@ TEST_F(
policy_manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
policy_manager_->PTUpdatedAt(KILOMETERS, 1000);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_1_))
.WillRepeatedly(Return(device_id_1_));
policy_manager_->SetUserConsentForDevice(device_id_1_, false);
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
@@ -92,10 +94,13 @@ TEST_F(
ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithoutConsent_ExpectPreDataConsent) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
- policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, false);
+ policy_manager_->ReactOnUserDevConsentForApp(handle, app_id_1_, false);
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
}
@@ -106,8 +111,8 @@ TEST_F(PolicyManagerImplTest2,
CreateLocalPT(kSdlPreloadedPtJson2);
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- policy_manager_->AddApplication(application_id_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, application_id_, HmiTypes(policy_table::AHT_DEFAULT));
// Expect RPCs from pre_dataConsent group are allowed
// Next checks are equal to BaseBeforeDataConsent_APIs.xml checks from task
@@ -155,11 +160,11 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, CheckPreDataConsent_GetDefaultHmiLevel_NONE) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
// Default HMI level is NONE
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(device_id_1_, app_id_2_, &default_hmi);
EXPECT_EQ("NONE", default_hmi);
// Default priority level is NONE
@@ -173,11 +178,11 @@ TEST_F(PolicyManagerImplTest2,
CheckPreDataConsent_GetDefaultHmiLevel_BACKGROUNG) {
// Arrange
CreateLocalPT(kSdlPreloadedPtJson2);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
// Default HMI level is BACKGROUND
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(device_id_1_, app_id_2_, &default_hmi);
EXPECT_EQ("BACKGROUND", default_hmi);
// Default priority level is EMERGENCY
std::string priority1;
@@ -191,10 +196,13 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are different
CreateLocalPT("json/ptu_requestType.json");
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
- policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
+ policy_manager_->ReactOnUserDevConsentForApp(handle, app_id_1_, true);
EXPECT_FALSE(policy_manager_->IsPredataPolicy(app_id_1_));
// Expect app_id_1_ has default policy
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_1_));
@@ -206,11 +214,14 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are the same
CreateLocalPT(kPtu2RequestTypeJson);
- policy_manager_->AddApplication(app_id_1_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ const transport_manager::DeviceHandle handle = 1;
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(handle, app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_1_, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
- EXPECT_CALL(listener_, OnPendingPermissionChange(app_id_1_)).Times(0);
- policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
+ EXPECT_CALL(listener_, OnPendingPermissionChange(_, app_id_1_)).Times(0);
+ policy_manager_->ReactOnUserDevConsentForApp(handle, app_id_1_, true);
EXPECT_FALSE(policy_manager_->IsPredataPolicy(app_id_1_));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_1_));
}
@@ -297,12 +308,12 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceDisallowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(device_id_2_, app_id_2_, &default_hmi);
EXPECT_EQ("NONE", default_hmi);
}
@@ -310,12 +321,12 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string default_hmi1;
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
+ policy_manager_->GetDefaultHmi(device_id_1_, app_id_2_, &default_hmi1);
EXPECT_EQ("NONE", default_hmi1);
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
@@ -333,13 +344,13 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
std::string default_hmi2;
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ policy_manager_->GetDefaultHmi(device_id_2_, app_id_2_, &default_hmi2);
EXPECT_EQ("LIMITED", default_hmi2);
}
@@ -347,8 +358,8 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string priority1;
@@ -370,10 +381,10 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
std::string priority2;
EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority2));
@@ -490,8 +501,10 @@ TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
::policy::StringArray app_nicknames;
::policy::StringArray app_hmi_types;
policy_manager_->GetInitialAppData(app_id_2_, &app_nicknames, &app_hmi_types);
@@ -534,8 +547,8 @@ TEST_F(
CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
// Check keep context in preData policy
@@ -548,8 +561,8 @@ TEST_F(PolicyManagerImplTest2,
CreateLocalPT(preloaded_pt_filename_);
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((policy_manager_->GetCache())
->SetDeviceData(device_id_2_,
"hardware IPX",
@@ -563,10 +576,10 @@ TEST_F(PolicyManagerImplTest2,
::policy::DeviceConsent consent =
policy_manager_->GetUserConsentForDevice(device_id_2_);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
// Check keep context in default policy
EXPECT_FALSE(policy_manager_->CanAppKeepContext(app_id_2_));
@@ -576,8 +589,8 @@ TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_AddAppFromUnconsentedDevice_ExpectAppCannotStealFocus) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
// Check keep context in preData policy
@@ -590,8 +603,8 @@ TEST_F(PolicyManagerImplTest2,
CreateLocalPT(preloaded_pt_filename_);
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((policy_manager_->GetCache())
->SetDeviceData(device_id_2_,
"hardware IPX",
@@ -605,10 +618,10 @@ TEST_F(PolicyManagerImplTest2,
::policy::DeviceConsent consent =
policy_manager_->GetUserConsentForDevice(device_id_2_);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(_, app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
// Check keep context in default policy
EXPECT_FALSE(policy_manager_->CanAppStealFocus(app_id_2_));
@@ -618,8 +631,8 @@ TEST_F(PolicyManagerImplTest2,
IsPredataPolicy_SetAppWIthPredataPolicy_ExpectPredataPolicy) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
}
@@ -629,18 +642,18 @@ TEST_F(
SendNotificationOnPermissionsUpdated_SetDeviceAllowed_ExpectNotificationSent) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_)).Times(0);
+ policy_manager_->AddApplication(
+ device_id_1_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string default_hmi1;
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
+ policy_manager_->GetDefaultHmi(device_id_1_, app_id_2_, &default_hmi1);
EXPECT_EQ("NONE", default_hmi1);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
- .WillOnce(Return(""));
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_2_, _, default_hmi1))
+ EXPECT_CALL(listener_, OnPermissionsUpdated(device_id_1_, app_id_2_, _))
.Times(0);
- policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id_1_,
+ app_id_2_);
ASSERT_TRUE(
(policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
@@ -658,16 +671,17 @@ TEST_F(
policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
- .WillRepeatedly(Return(device_id_2_));
- policy_manager_->AddApplication(app_id_2_,
- HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, GetDevicesIds(app_id_2_)).Times(0);
+ policy_manager_->AddApplication(
+ device_id_2_, app_id_2_, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
std::string default_hmi2;
- policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ policy_manager_->GetDefaultHmi(device_id_2_, app_id_2_, &default_hmi2);
EXPECT_EQ("LIMITED", default_hmi2);
- EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_2_, _, default_hmi2));
- policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ EXPECT_CALL(listener_,
+ OnPermissionsUpdated(device_id_2_, app_id_2_, _, default_hmi2));
+ policy_manager_->SendNotificationOnPermissionsUpdated(device_id_2_,
+ app_id_2_);
}
} // namespace policy_test
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index 3679b2efea..f7f34564b6 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -38,6 +38,8 @@ include_directories (
${JSONCPP_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
${LOG4CXX_INCLUDE_DIRECTORY}
${BOOST_INCLUDE_DIR}
)
@@ -87,8 +89,13 @@ else ()
list(APPEND LIBRARIES sqlite3)
endif ()
-add_library(Policy SHARED ${SOURCES})
-target_link_libraries(Policy ${LIBRARIES})
+
+add_library(PolicyStatic ${SOURCES})
+target_link_libraries(PolicyStatic ${LIBRARIES})
+
+
+add_library(Policy SHARED "src/policy_manager_impl.cc")
+target_link_libraries(Policy PolicyStatic)
if(ENABLE_LOG)
target_link_libraries(Policy log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index 30732f685c..1c28b596c0 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -146,6 +146,10 @@ class CacheManager : public CacheManagerInterface {
*/
virtual const VehicleInfo GetVehicleInfo() const;
+ const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
+
+ const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const OVERRIDE;
/**
* @brief Get a list of enabled cloud applications
* @param enabled_apps List filled with the policy app id of each enabled
@@ -267,7 +271,8 @@ class CacheManager : public CacheManagerInterface {
* @return Array of appropriate messages parameters
*/
std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language);
+ const std::vector<std::string>& msg_codes,
+ const std::string& language) const;
/**
* @brief Get list of URLs related to particular service
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
index da15a4ecab..e8f2644bc5 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -35,11 +35,13 @@
#include <string>
#include <vector>
+#include "boost/optional.hpp"
#include "policy/policy_settings.h"
#include "policy/policy_table/types.h"
#include "policy/policy_types.h"
#include "policy/usage_statistics/counter.h"
+#include "utils/optional.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -255,6 +257,23 @@ class CacheManagerInterface {
const std::string& policy_app_id) const = 0;
/**
+ * @brief Returns state of the lock screen that could be able to be dismissed
+ * while connected to SDL, allowing users the ability to interact with the
+ * app.
+ * @return bool True if lock screen can be dismissed.
+ */
+ virtual const boost::optional<bool> LockScreenDismissalEnabledState()
+ const = 0;
+
+ /**
+ * @brief Returns lock screen warning message. In case when specified language
+ * is absent in policy table will be returned message on default language
+ * ("en-us"). Otherwise returns uninitialized boost::optional<std::string>
+ * @return std::string Lock screen warning message
+ */
+ virtual const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language_code) const = 0;
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -274,7 +293,7 @@ class CacheManagerInterface {
*/
virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
- const std::string& language) = 0;
+ const std::string& language) const = 0;
/**
* @brief Get list of URLs related to particular service
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index 1860f7e591..903f7820d2 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -162,6 +162,11 @@ class PolicyManagerImpl : public PolicyManager {
*/
void KmsChanged(int kilometers) OVERRIDE;
+ const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
+
+ const boost::optional<std::string> LockScreenDismissalWarningMessage(
+ const std::string& language) const OVERRIDE;
+
/**
* @brief Increments counter of ignition cycles
*/
@@ -260,12 +265,15 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param device_handle device identifier
* @param app_id Unique application id
* @param is_device_allowed true if user allowing device otherwise false
* @return true if operation was successful
*/
- bool ReactOnUserDevConsentForApp(const std::string app_id,
- const bool is_device_allowed) OVERRIDE;
+ bool ReactOnUserDevConsentForApp(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string app_id,
+ const bool is_device_allowed) OVERRIDE;
/**
* @brief Retrieves data from app_policies about app on its registration:
@@ -306,12 +314,14 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Get default HMI level for application
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @param default_hmi Default HMI level for application or empty, if value
* was not set
* @return true, if succedeed, otherwise - false
*/
- bool GetDefaultHmi(const std::string& policy_app_id,
+ bool GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
/**
@@ -354,9 +364,11 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Return device id, which hosts specific application
+ * @param device_handle device identifier
* @param policy_app_id Application id, which is required to update device id
*/
std::string& GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const OVERRIDE;
/**
@@ -398,11 +410,12 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Gets specific application permissions changes since last policy
* table update
+ * @param device_id device identifier
* @param policy_app_id Unique application id
* @return Permissions changes
*/
AppPermissions GetAppPermissionsChanges(
- const std::string& policy_app_id) OVERRIDE;
+ const std::string& device_id, const std::string& policy_app_id) OVERRIDE;
/**
* @brief Removes specific application permissions changes
@@ -412,10 +425,11 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
+ * @param device_id device identifier
* @param application_id Unique application id
*/
void SendNotificationOnPermissionsUpdated(
- const std::string& application_id) OVERRIDE;
+ const std::string& device_id, const std::string& application_id) OVERRIDE;
/**
* @brief Removes unpaired device records and related records from DB
@@ -446,20 +460,24 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
+ * @param device_id device identifier
* @param application_id Unique application id
* @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
StatusNotifier AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
/**
* @brief Assigns new HMI types for specified application
+ * @param device_handle device identifier
* @param application_id Unique application id
* @param hmi_types new HMI types list
*/
- void SetDefaultHmiTypes(const std::string& application_id,
+ void SetDefaultHmiTypes(const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
const std::vector<int>& hmi_types) OVERRIDE;
/**
@@ -679,10 +697,13 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * It will send OnAppPermissionSend notification and will try to start PTU.
+ *
+ * @param device_id device identifier
* @param application_id registered application.
*/
- void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+ void OnAppRegisteredOnMobile(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) OVERRIDE;
@@ -820,6 +841,17 @@ class PolicyManagerImpl : public PolicyManager {
const std::shared_ptr<policy_table::Table> snapshot);
/**
+ * @brief Compares current policies to the updated one.
+ * Trigger actions in case if certain fields after update were changed.
+ * This function should be called after PT update.
+ * Actions require already updated policy table
+ * @param update Shared pointer to policy table update
+ * @param snapshot Shared pointer to old copy of policy table
+ */
+ void CheckPermissionsChangesAfterUpdate(const policy_table::Table& update,
+ const policy_table::Table& snapshot);
+
+ /**
* @brief Fill structure to be sent with OnPermissionsChanged notification
*
* @param Policy table struct, which contains rpc functional groups data
@@ -875,9 +907,12 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief Checks whether need ask the permission of users
+ * @param device_id device identifier
+ * @param app_id policy application id
* @return true if user consent is needed
*/
- virtual bool IsConsentNeeded(const std::string& app_id);
+ virtual bool IsConsentNeeded(const std::string& device_id,
+ const std::string& app_id);
/**
* @brief Changes isConsentNeeded for app pending permissions, in case
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 679950277d..899e40993e 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -457,6 +457,36 @@ enum FunctionID {
PerformAppServiceInteractionID = 55,
/**
+ * @brief UnpublishAppServiceID.
+ */
+ UnpublishAppServiceID = 56,
+
+ /**
+ * @brief CancelInteractionID.
+ */
+ CancelInteractionID = 57,
+
+ /**
+ * @brief CloseApplicationID.
+ */
+ CloseApplicationID = 58,
+
+ /**
+ * @brief ShowAppMenuID.
+ */
+ ShowAppMenuID = 59,
+
+ /**
+ * @brief CreateWindowID.
+ */
+ CreateWindowID = 60,
+
+ /**
+ * @brief DeleteWindowID.
+ */
+ DeleteWindowID = 61,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
index e41069a86c..c2a8f901ad 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -302,6 +302,7 @@ struct ModuleConfig : CompositeType {
Optional<String<4, 4> > vehicle_year;
Optional<String<0, 10> > preloaded_date;
Optional<String<0, 65535> > certificate;
+ Optional<Boolean> lock_screen_dismissal_enabled;
public:
ModuleConfig();
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 94ce52b6f1..d121886765 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -856,8 +856,47 @@ bool CacheManager::UnknownRPCPassthroughAllowed(
return false;
}
+const boost::optional<bool> CacheManager::LockScreenDismissalEnabledState()
+ const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ boost::optional<bool> empty;
+ CACHE_MANAGER_CHECK(empty);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
+ if (module_config.lock_screen_dismissal_enabled.is_initialized()) {
+ LOG4CXX_TRACE(logger_,
+ "state = " << *module_config.lock_screen_dismissal_enabled);
+ return boost::optional<bool>(*module_config.lock_screen_dismissal_enabled);
+ }
+ LOG4CXX_TRACE(logger_, "state = empty");
+ return empty;
+}
+
+const boost::optional<std::string>
+CacheManager::LockScreenDismissalWarningMessage(
+ const std::string& language) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ boost::optional<std::string> empty;
+ CACHE_MANAGER_CHECK(empty);
+
+ const std::string lock_screen_dismissal_warning_message =
+ "LockScreenDismissalWarning";
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ std::vector<std::string> msg_codes{lock_screen_dismissal_warning_message};
+
+ const auto messages = GetUserFriendlyMsg(msg_codes, language);
+
+ if (messages.empty() || messages[0].text_body.empty()) {
+ return empty;
+ }
+
+ return boost::optional<std::string>(messages[0].text_body);
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language) {
+ const std::vector<std::string>& msg_codes,
+ const std::string& language) const {
LOG4CXX_AUTO_TRACE(logger_);
std::vector<UserFriendlyMessage> result;
CACHE_MANAGER_CHECK(result);
@@ -903,6 +942,12 @@ std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
UserFriendlyMessage msg;
msg.message_code = *it;
+ msg.tts = *message_string.tts;
+ msg.label = *message_string.label;
+ msg.line1 = *message_string.line1;
+ msg.line2 = *message_string.line2;
+ msg.text_body = *message_string.textBody;
+
result.push_back(msg);
}
return result;
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index 5fa0b314b3..26e4984e6d 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -263,30 +263,45 @@ bool CheckAppPolicy::IsKnownAppication(
void policy::CheckAppPolicy::NotifySystem(
const policy::AppPoliciesValueType& app_policy) const {
- pm_->listener()->OnPendingPermissionChange(app_policy.first);
+ auto& listener = *pm_->listener();
+ const auto devices_ids = listener.GetDevicesIds(app_policy.first);
+ if (devices_ids.empty()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't find device info for application id: " << app_policy.first);
+ return;
+ }
+
+ for (const auto& device_id : devices_ids) {
+ listener.OnPendingPermissionChange(device_id, app_policy.first);
+ }
}
void CheckAppPolicy::SendPermissionsToApp(
const std::string& app_id, const policy_table::Strings& groups) const {
- const std::string device_id = pm_->GetCurrentDeviceId(app_id);
- if (device_id.empty()) {
+ const auto devices_ids = pm_->listener()->GetDevicesIds(app_id);
+ if (devices_ids.empty()) {
LOG4CXX_WARN(logger_,
"Couldn't find device info for application id: " << app_id);
return;
}
- std::vector<FunctionalGroupPermission> group_permissons;
- pm_->GetPermissionsForApp(device_id, app_id, group_permissons);
- Permissions notification_data;
- pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
- groups,
- group_permissons,
- notification_data);
+ for (const auto& device_id : devices_ids) {
+ std::vector<FunctionalGroupPermission> group_permissons;
+ pm_->GetPermissionsForApp(device_id, app_id, group_permissons);
+
+ Permissions notification_data;
+ pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
+ groups,
+ group_permissons,
+ notification_data);
- LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
- // Default_hmi is Ford-specific and should not be used with basic policy
- const std::string default_hmi;
- pm_->listener()->OnPermissionsUpdated(app_id, notification_data, default_hmi);
+ LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
+ // Default_hmi is Ford-specific and should not be used with basic policy
+ const std::string default_hmi;
+ pm_->listener()->OnPermissionsUpdated(
+ device_id, app_id, notification_data, default_hmi);
+ }
}
bool CheckAppPolicy::IsAppRevoked(
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index 0884fc53b6..5a7c822a9b 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -53,10 +53,12 @@
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-policy::PolicyManager* CreateManager() {
+__attribute__((visibility("default"))) policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
}
-void DeleteManager(policy::PolicyManager* pm) {
+
+__attribute__((visibility("default"))) void DeleteManager(
+ policy::PolicyManager* pm) {
delete pm;
}
@@ -356,6 +358,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
ForcePTExchange();
return false;
}
+ CheckPermissionsChangesAfterUpdate(*pt_update, *policy_table_snapshot);
listener_->OnCertificateUpdated(
*(pt_update->policy_table.module_config.certificate));
@@ -390,7 +393,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
void PolicyManagerImpl::CheckPermissionsChanges(
const std::shared_ptr<policy_table::Table> pt_update,
const std::shared_ptr<policy_table::Table> snapshot) {
- LOG4CXX_INFO(logger_, "Checking incoming permissions.");
+ LOG4CXX_AUTO_TRACE(logger_);
// Replace predefined policies with its actual setting, e.g. "123":"default"
// to actual values of default section
@@ -401,6 +404,17 @@ void PolicyManagerImpl::CheckPermissionsChanges(
CheckAppPolicy(this, pt_update, snapshot));
}
+void PolicyManagerImpl::CheckPermissionsChangesAfterUpdate(
+ const policy_table::Table& update, const policy_table::Table& snapshot) {
+ const auto new_lock_screen_dismissal_enabled =
+ update.policy_table.module_config.lock_screen_dismissal_enabled;
+ const auto old_lock_screen_dismissal_enabled =
+ snapshot.policy_table.module_config.lock_screen_dismissal_enabled;
+ if (new_lock_screen_dismissal_enabled != old_lock_screen_dismissal_enabled) {
+ listener()->OnLockScreenDismissalStateChanged();
+ }
+}
+
void PolicyManagerImpl::PrepareNotificationData(
const policy_table::FunctionalGroupings& groups,
const policy_table::Strings& group_names,
@@ -514,9 +528,9 @@ void PolicyManagerImpl::OnAppsSearchCompleted(const bool trigger_ptu) {
}
void PolicyManagerImpl::OnAppRegisteredOnMobile(
- const std::string& application_id) {
+ const std::string& device_id, const std::string& application_id) {
StartPTExchange();
- SendNotificationOnPermissionsUpdated(application_id);
+ SendNotificationOnPermissionsUpdated(device_id, application_id);
}
void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
@@ -669,16 +683,8 @@ bool PolicyManagerImpl::ResetUserConsent() {
}
void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
- const std::string& application_id) {
+ const std::string& device_id, const std::string& application_id) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(application_id);
- if (device_id.empty()) {
- LOG4CXX_WARN(logger_,
- "Couldn't find device info for application id "
- "'" << application_id
- << "'");
- return;
- }
std::vector<FunctionalGroupPermission> app_group_permissions;
GetPermissionsForApp(device_id, application_id, app_group_permissions);
@@ -687,12 +693,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
cache_->GetFunctionalGroupings(functional_groupings);
policy_table::Strings app_groups;
- std::vector<FunctionalGroupPermission>::const_iterator it =
- app_group_permissions.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- app_group_permissions.end();
- for (; it != it_end; ++it) {
- app_groups.push_back((*it).group_name);
+ for (const auto& group_permission : app_group_permissions) {
+ app_groups.push_back(group_permission.group_name);
}
Permissions notification_data;
@@ -702,19 +704,19 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
notification_data);
LOG4CXX_INFO(logger_,
- "Send notification for application_id:" << application_id);
+ "Send notification for application_id: " << application_id);
- std::string default_hmi;
- default_hmi = "NONE";
+ std::string default_hmi = "NONE";
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
- listener()->OnPermissionsUpdated(application_id, notification_data);
+ listener()->OnPermissionsUpdated(
+ device_id, application_id, notification_data);
return;
}
listener()->OnPermissionsUpdated(
- application_id, notification_data, default_hmi);
+ device_id, application_id, notification_data, default_hmi);
}
bool PolicyManagerImpl::CleanupUnpairedDevices() {
@@ -744,8 +746,13 @@ void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
}
}
-bool PolicyManagerImpl::ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed) {
+bool PolicyManagerImpl::ReactOnUserDevConsentForApp(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string app_id,
+ bool is_device_allowed) {
+ UNUSED(device_handle);
+ UNUSED(app_id);
+ UNUSED(is_device_allowed);
return true;
}
@@ -856,11 +863,11 @@ void PolicyManagerImpl::SetUserConsentForApp(
LOG4CXX_AUTO_TRACE(logger_);
}
-bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
+bool PolicyManagerImpl::GetDefaultHmi(const std::string& device_id,
+ const std::string& policy_app_id,
std::string* default_hmi) const {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(policy_app_id);
- DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ const DeviceConsent device_consent = GetUserConsentForDevice(device_id);
const std::string app_id = policy::kDeviceAllowed != device_consent
? kPreDataConsentId
: policy_app_id;
@@ -943,7 +950,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
app_id_to_check = kDefaultId;
allowed_by_default = true;
} else if (cache_->IsPredataPolicy(policy_app_id) ||
- policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
+ policy::kDeviceAllowed != GetUserConsentForDevice(device_id)) {
app_id_to_check = kPreDataConsentId;
allowed_by_default = true;
}
@@ -998,9 +1005,11 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
std::string& PolicyManagerImpl::GetCurrentDeviceId(
+ const transport_manager::DeviceHandle& device_handle,
const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
- last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
+ last_device_id_ =
+ listener()->OnCurrentDeviceIdUpdateRequired(device_handle, policy_app_id);
return last_device_id_;
}
@@ -1068,6 +1077,17 @@ void PolicyManagerImpl::KmsChanged(int kilometers) {
}
}
+const boost::optional<bool> PolicyManagerImpl::LockScreenDismissalEnabledState()
+ const {
+ return cache_->LockScreenDismissalEnabledState();
+}
+
+const boost::optional<std::string>
+PolicyManagerImpl::LockScreenDismissalWarningMessage(
+ const std::string& language) const {
+ return cache_->LockScreenDismissalWarningMessage(language);
+}
+
void PolicyManagerImpl::IncrementIgnitionCycles() {
cache_->IncrementIgnitionCycles();
}
@@ -1179,7 +1199,8 @@ bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
return cache_->IsApplicationRevoked(app_id);
}
-bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
+bool PolicyManagerImpl::IsConsentNeeded(const std::string& device_id,
+ const std::string& app_id) {
LOG4CXX_AUTO_TRACE(logger_);
return false;
}
@@ -1187,14 +1208,15 @@ bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
void PolicyManagerImpl::SetVINValue(const std::string& value) {}
AppPermissions PolicyManagerImpl::GetAppPermissionsChanges(
- const std::string& policy_app_id) {
+ const std::string& device_id, const std::string& policy_app_id) {
typedef std::map<std::string, AppPermissions>::iterator PermissionsIt;
PermissionsIt app_id_diff = app_permissions_diff_.find(policy_app_id);
AppPermissions permissions(policy_app_id);
if (app_permissions_diff_.end() != app_id_diff) {
permissions = app_id_diff->second;
} else {
- permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
+ permissions.appPermissionsConsentNeeded =
+ IsConsentNeeded(device_id, policy_app_id);
permissions.appRevoked = IsApplicationRevoked(policy_app_id);
GetPriority(permissions.application_id, &permissions.priority);
}
@@ -1282,11 +1304,11 @@ class CallStatusChange : public utils::Callable {
};
StatusNotifier PolicyManagerImpl::AddApplication(
+ const std::string& device_id,
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(application_id);
- DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ auto device_consent = GetUserConsentForDevice(device_id);
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
AddNewApplication(application_id, device_consent);
@@ -1414,10 +1436,13 @@ void PolicyManagerImpl::RetrySequence() {
timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
}
-void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
- const std::vector<int>& hmi_types) {
+void PolicyManagerImpl::SetDefaultHmiTypes(
+ const transport_manager::DeviceHandle& device_handle,
+ const std::string& application_id,
+ const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
- const std::string device_id = GetCurrentDeviceId(application_id);
+ const std::string device_id =
+ GetCurrentDeviceId(device_handle, application_id);
ApplicationOnDevice who = {device_id, application_id};
access_remote_->SetDefaultHmiTypes(who, hmi_types);
}
@@ -1455,7 +1480,7 @@ bool PolicyManagerImpl::CheckModule(const PTString& app_id,
void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
std::string default_hmi("NONE");
- if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ if (GetDefaultHmi(who.dev_id, who.app_id, &default_hmi)) {
listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
} else {
LOG4CXX_WARN(
@@ -1492,7 +1517,8 @@ void PolicyManagerImpl::SendAppPermissionsChanged(
const std::string& device_id, const std::string& application_id) {
Permissions notification_data;
GetPermissions(device_id, application_id, &notification_data);
- listener()->OnPermissionsUpdated(application_id, notification_data);
+ listener()->OnPermissionsUpdated(
+ device_id, application_id, notification_data);
}
void PolicyManagerImpl::SendAuthTokenUpdated(const std::string policy_app_id) {
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 421ccacded..56bbd53762 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -859,6 +859,18 @@ bool IsValidEnum(FunctionID val) {
return true;
case PerformAppServiceInteractionID:
return true;
+ case UnpublishAppServiceID:
+ return true;
+ case CancelInteractionID:
+ return true;
+ case CreateWindowID:
+ return true;
+ case DeleteWindowID:
+ return true;
+ case CloseApplicationID:
+ return true;
+ case ShowAppMenuID:
+ return true;
case OnHMIStatusID:
return true;
case OnAppInterfaceUnregisteredID:
@@ -1022,6 +1034,18 @@ const char* EnumToJsonString(FunctionID val) {
return "GetAppServiceData";
case PerformAppServiceInteractionID:
return "PerformAppServiceInteraction";
+ case UnpublishAppServiceID:
+ return "UnpublishAppService";
+ case CancelInteractionID:
+ return "CancelInteraction";
+ case CreateWindowID:
+ return "CreateWindow";
+ case DeleteWindowID:
+ return "DeleteWindow";
+ case CloseApplicationID:
+ return "CloseApplication";
+ case ShowAppMenuID:
+ return "ShowAppMenu";
case OnHMIStatusID:
return "OnHMIStatus";
case OnAppInterfaceUnregisteredID:
@@ -1346,6 +1370,36 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("UnpublishAppService" == literal) {
+ *result = UnpublishAppServiceID;
+ return true;
+ }
+
+ if ("CancelInteraction" == literal) {
+ *result = CancelInteractionID;
+ return true;
+ }
+
+ if ("CreateWindow" == literal) {
+ *result = CreateWindowID;
+ return true;
+ }
+
+ if ("DeleteWindow" == literal) {
+ *result = DeleteWindowID;
+ return true;
+ }
+
+ if ("CloseApplication" == literal) {
+ *result = CloseApplicationID;
+ return true;
+ }
+
+ if ("ShowAppMenu" == literal) {
+ *result = ShowAppMenuID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index bdf1329dee..7fdfde996c 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -678,7 +678,9 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
, vehicle_model(impl::ValueMember(value__, "vehicle_model"))
, vehicle_year(impl::ValueMember(value__, "vehicle_year"))
, preloaded_date(impl::ValueMember(value__, "preloaded_date"))
- , certificate(impl::ValueMember(value__, "certificate")) {}
+ , certificate(impl::ValueMember(value__, "certificate"))
+ , lock_screen_dismissal_enabled(
+ impl::ValueMember(value__, "lock_screen_dismissal_enabled")) {}
void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
// device_certificates = from.device_certificates; // According to the
@@ -692,6 +694,8 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
notifications_per_minute_by_priority =
from.notifications_per_minute_by_priority;
+ lock_screen_dismissal_enabled = from.lock_screen_dismissal_enabled;
+
vehicle_make.assign_if_valid(from.vehicle_make);
vehicle_model.assign_if_valid(from.vehicle_model);
vehicle_year.assign_if_valid(from.vehicle_year);
@@ -723,6 +727,9 @@ Json::Value ModuleConfig::ToJsonValue() const {
impl::WriteJsonField("vehicle_year", vehicle_year, &result__);
impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
+ impl::WriteJsonField("lock_screen_dismissal_enabled",
+ lock_screen_dismissal_enabled,
+ &result__);
return result__;
}
@@ -754,6 +761,9 @@ bool ModuleConfig::is_valid() const {
if (!notifications_per_minute_by_priority.is_valid()) {
return false;
}
+ if (!lock_screen_dismissal_enabled.is_valid()) {
+ return false;
+ }
if (!vehicle_make.is_valid()) {
return false;
}
@@ -808,6 +818,9 @@ bool ModuleConfig::struct_empty() const {
if (notifications_per_minute_by_priority.is_initialized()) {
return false;
}
+ if (lock_screen_dismissal_enabled.is_initialized()) {
+ return false;
+ }
if (vehicle_make.is_initialized()) {
return false;
}
@@ -863,6 +876,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
notifications_per_minute_by_priority.ReportErrors(
&report__->ReportSubobject("notifications_per_minute_by_priority"));
}
+ if (!lock_screen_dismissal_enabled.is_valid()) {
+ lock_screen_dismissal_enabled.ReportErrors(
+ &report__->ReportSubobject("lock_screen_dismissal_enabled"));
+ }
if (!vehicle_make.is_valid()) {
vehicle_make.ReportErrors(&report__->ReportSubobject("vehicle_make"));
}
@@ -902,6 +919,7 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
seconds_between_retries.SetPolicyTableType(pt_type);
endpoints.SetPolicyTableType(pt_type);
notifications_per_minute_by_priority.SetPolicyTableType(pt_type);
+ lock_screen_dismissal_enabled.SetPolicyTableType(pt_type);
vehicle_make.SetPolicyTableType(pt_type);
vehicle_model.SetPolicyTableType(pt_type);
vehicle_year.SetPolicyTableType(pt_type);
diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
index a97b0ab153..b3816d37f8 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -71,7 +71,8 @@ const std::string kCreateSchema =
" `certificate` TEXT, "
" `vehicle_make` VARCHAR(45), "
" `vehicle_model` VARCHAR(45), "
- " `vehicle_year` VARCHAR(4) "
+ " `vehicle_year` VARCHAR(4), "
+ " `lock_screen_dismissal_enabled` BOOL"
"); "
"CREATE TABLE IF NOT EXISTS `functional_group`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
@@ -419,7 +420,7 @@ const std::string kInsertInitData =
" VALUES (0, 0, 0, 0); "
"INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, `is_first_run`,"
" `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`, "
- " `exchange_after_x_days`, `timeout_after_x_seconds`) "
+ " `exchange_after_x_days`, `timeout_after_x_seconds`)"
" VALUES(1, 0, 0, 0, 0, 0); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('EMERGENCY'); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NAVIGATION'); "
@@ -674,15 +675,17 @@ const std::string kInsertLanguage =
"INSERT OR IGNORE INTO `language` (`code`) VALUES (?)";
const std::string kInsertMessageString =
- "INSERT INTO `message` (`language_code`, `message_type_name`) "
- "VALUES (?, ?)";
+ "INSERT INTO `message` (`language_code`, `message_type_name`, `tts`, "
+ "`label`, `line1`, `line2`, `textBody`) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?)";
const std::string kUpdateModuleConfig =
"UPDATE `module_config` SET `preloaded_pt` = ?, "
" `exchange_after_x_ignition_cycles` = ?,"
" `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
" `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, "
- " `vehicle_model` = ?, `vehicle_year` = ? ";
+ " `vehicle_model` = ?, `vehicle_year` = ?, lock_screen_dismissal_enabled "
+ "= ?";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
@@ -722,7 +725,7 @@ const std::string kSelectModuleConfig =
"SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, "
" `exchange_after_x_kilometers`, `exchange_after_x_days`, "
" `timeout_after_x_seconds`, `certificate`, `vehicle_make`,"
- " `vehicle_model`, `vehicle_year` "
+ " `vehicle_model`, `vehicle_year` ,`lock_screen_dismissal_enabled`"
" FROM `module_config`";
const std::string kSelectEndpoints =
@@ -907,6 +910,5 @@ const std::string kSaveModuleMeta =
"`ignition_cycles_since_last_exchange` = ? ";
const std::string kSelectModuleMeta = "SELECT* FROM `module_meta`";
-
} // namespace sql_pt
} // namespace policy
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index 20ba9ec651..8ac04ba5f3 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -525,7 +525,9 @@ void SQLPTRepresentation::GatherModuleConfig(
*config->vehicle_make = query.GetString(6);
*config->vehicle_model = query.GetString(7);
*config->vehicle_year = query.GetString(8);
- *config->preloaded_date = query.GetString(9);
+ if (!query.IsNull(9)) {
+ *config->lock_screen_dismissal_enabled = query.GetBoolean(9);
+ }
}
utils::dbms::SQLQuery endpoints(db());
@@ -1365,6 +1367,9 @@ bool SQLPTRepresentation::SaveModuleConfig(
: query.Bind(7);
config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year))
: query.Bind(8);
+ config.lock_screen_dismissal_enabled.is_initialized()
+ ? query.Bind(9, *(config.lock_screen_dismissal_enabled))
+ : query.Bind(9);
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Incorrect update module config");
return false;
@@ -1519,6 +1524,25 @@ bool SQLPTRepresentation::SaveMessageString(
query.Bind(0, lang);
query.Bind(1, type);
+ if (strings.tts.is_valid() && strings.tts.is_initialized()) {
+ query.Bind(2, (*strings.tts));
+ }
+
+ if (strings.label.is_valid() && strings.label.is_initialized()) {
+ query.Bind(3, (*strings.label));
+ }
+
+ if (strings.line1.is_valid() && strings.line1.is_initialized()) {
+ query.Bind(4, *(strings.line1));
+ }
+
+ if (strings.line2.is_valid() && strings.line2.is_initialized()) {
+ query.Bind(5, (*strings.line2));
+ }
+
+ if (strings.textBody.is_valid() && strings.textBody.is_initialized()) {
+ query.Bind(6, (*strings.textBody));
+ }
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into message.");
diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
index bd6af96867..428a056882 100644
--- a/src/components/policy/policy_regular/test/CMakeLists.txt
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -49,7 +49,7 @@ collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
set(LIBRARIES
gmock
Utils
- Policy
+ PolicyStatic
UsageStatistics
)
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index 39ff0efa7e..eb06856eae 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -40,6 +40,7 @@
#include "json/writer.h"
#include "config_profile/profile.h"
+#include "connection_handler/connection_handler.h"
#include "policy/mock_cache_manager.h"
#include "policy/mock_policy_listener.h"
#include "policy/mock_policy_settings.h"
@@ -177,6 +178,8 @@ class PolicyManagerImplTest2 : public ::testing::Test {
, app_id2("1010101010")
, dev_id1("XXX123456789ZZZ")
, dev_id2("08-00-27-CE-76-FE")
+ , dev_handle1(123456789)
+ , dev_handle2(1010101010)
, PTU_request_types(Json::arrayValue) {}
protected:
@@ -190,6 +193,8 @@ class PolicyManagerImplTest2 : public ::testing::Test {
const std::string app_id2;
const std::string dev_id1;
const std::string dev_id2;
+ const connection_handler::DeviceHandle dev_handle1;
+ const connection_handler::DeviceHandle dev_handle2;
Json::Value PTU_request_types;
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
const std::string kAppStorageFolder = "storage_PolicyManagerImplTest2";
@@ -242,6 +247,53 @@ class PolicyManagerImplTest2 : public ::testing::Test {
ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
}
+ Json::Value AddWidgetSupportToPt(const std::string& section_name,
+ const uint32_t group_number) {
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ auto& groups =
+ root["policy_table"]["app_policies"][section_name]["groups"];
+ if (groups.empty()) {
+ groups = Json::Value(Json::arrayValue);
+ }
+ groups[group_number] = Json::Value("WidgetSupport");
+ }
+ ifile.close();
+ return root;
+ }
+
+ std::string AddWidgetSupportToPt(Json::Value* root,
+ const std::string& section_name,
+ const uint32_t group_number) {
+ if (root) {
+ auto& groups =
+ (*root)["policy_table"]["app_policies"][section_name]["groups"];
+ if (groups.empty()) {
+ groups = Json::Value(Json::arrayValue);
+ }
+ groups[group_number] = Json::Value("WidgetSupport");
+ return root->toStyledString();
+ }
+ return std::string();
+ }
+
+ std::string AddWidgetSupportToFunctionalGroups(Json::Value* root,
+ const std::string& rpc_name,
+ const std::string& hmi_level) {
+ if (root) {
+ Json::Value val(Json::objectValue);
+ Json::Value val2(Json::arrayValue);
+ val2[0] = hmi_level;
+ val[rpc_name]["hmi_levels"] = val2;
+ (*root)["policy_table"]["functional_groupings"]["WidgetSupport"]["rpcs"] =
+ val;
+ return root->toStyledString();
+ }
+ return std::string();
+ }
+
void AddRTtoPT(const std::string& update_file_name,
const std::string& section_name,
const uint32_t rt_number,
@@ -271,12 +323,13 @@ class PolicyManagerImplTest2 : public ::testing::Test {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
// Add app
- manager->AddApplication(section_name, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id1, section_name, HmiTypes(policy_table::AHT_DEFAULT));
// Check app gets RequestTypes from pre_DataConsent of app_policies
// section
PT_request_types = manager->GetAppRequestTypes(section_name);
EXPECT_EQ(rt_number, PT_request_types.size());
- EXPECT_CALL(listener, OnPendingPermissionChange(section_name)).Times(1);
+ EXPECT_CALL(listener, OnPendingPermissionChange(_, section_name)).Times(1);
Json::Value root = GetPTU(update_file_name);
// Get App Request Types from PTU
@@ -292,7 +345,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
PT_request_types.size());
::policy::AppPermissions permissions =
- manager->GetAppPermissionsChanges(section_name);
+ manager->GetAppPermissionsChanges(dev_id1, section_name);
EXPECT_TRUE(permissions.requestTypeChanged);
}
@@ -537,11 +590,14 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth");
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id1))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id1))
.WillRepeatedly(Return(dev_id1));
manager->SetUserConsentForDevice(dev_id1, true);
// Add app from consented device. App will be assigned with default policies
- manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id1))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
// Check before action
policy_table::RpcParameters rpc_parameters;
rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
@@ -579,6 +635,122 @@ TEST_F(PolicyManagerImplTest2,
ASSERT_TRUE(output.list_of_allowed_params.empty());
}
+TEST_F(
+ PolicyManagerImplTest2,
+ CheckPermissions_PersistsWidgetAppPermissionsAfter_PTU_ExpectRPCAllowed) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
+ (manager->GetCache())
+ ->SetDeviceData(dev_id1,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id1))
+ .WillRepeatedly(Return(dev_id1));
+ manager->SetUserConsentForDevice(dev_id1, true);
+ // Add app from consented device. App will be assigned with default policies
+ manager->AddApplication(
+ app_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id1))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ // Act
+ const char* const rpc_name = "CreateWindow";
+ const char* const hmi_level = "NONE";
+ const uint32_t group_number = 0;
+ Json::Value root = AddWidgetSupportToPt("default", group_number);
+ std::string json =
+ AddWidgetSupportToFunctionalGroups(&root, rpc_name, hmi_level);
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ manager->CheckPermissions(
+ dev_id1, app_id1, hmi_level, rpc_name, input_params, output);
+
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+ // Act
+ json = AddWidgetSupportToPt(&root, app_id1, group_number);
+ msg = BinaryMessage(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ output.hmi_level_permitted = ::policy::kRpcDisallowed;
+ manager->CheckPermissions(
+ dev_id1, app_id1, hmi_level, rpc_name, input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ CheckPermissions_AbsenceOfWidgetPermissionsAfter_PTU_ExpectRPCDisallowed) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
+ (manager->GetCache())
+ ->SetDeviceData(dev_id1,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id1))
+ .WillRepeatedly(Return(dev_id1));
+ manager->SetUserConsentForDevice(dev_id1, true);
+ // Add app from consented device. App will be assigned with default policies
+ manager->AddApplication(
+ dev_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id1))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
+ // Act
+ const char* const rpc_name = "DeleteWindow";
+ const char* const hmi_level = "NONE";
+ const uint32_t group_number = 0;
+ Json::Value root = AddWidgetSupportToPt("default", group_number);
+ std::string json =
+ AddWidgetSupportToFunctionalGroups(&root, rpc_name, hmi_level);
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ manager->CheckPermissions(
+ dev_id1, app_id1, hmi_level, rpc_name, input_params, output);
+
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+ output.hmi_level_permitted = ::policy::kRpcDisallowed;
+ // Act
+ root["policy_table"]["app_policies"][app_id1]["groups"] =
+ Json::Value(Json::arrayValue);
+ root["policy_table"]["app_policies"][app_id1]["groups"][group_number] =
+ Json::Value("Base-4");
+ json = root.toStyledString();
+ msg = BinaryMessage(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ manager->CheckPermissions(
+ dev_id1, app_id1, hmi_level, rpc_name, input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
TEST_F(PolicyManagerImplTest2,
CheckPermissions_SetAppIDwithPolicies_ExpectRPCAllowed) {
// Arrange
@@ -594,11 +766,11 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired("1234"))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, "1234"))
.WillRepeatedly(Return(dev_id1));
manager->SetUserConsentForDevice(dev_id1, true);
// Add app from consented device. App will be assigned with default policies
- manager->AddApplication("1234", HmiTypes(policy_table::AHT_MEDIA));
+ manager->AddApplication(dev_id1, "1234", HmiTypes(policy_table::AHT_MEDIA));
// Emulate PTU with new policies for app added above
std::ifstream ifile("sdl_preloaded_pt.json");
Json::Reader reader;
@@ -785,8 +957,8 @@ TEST_F(
AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpdateRequired) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- ::policy::StatusNotifier notifyer =
- manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ ::policy::StatusNotifier notifyer = manager->AddApplication(
+ dev_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
DCHECK(notifyer);
(*notifyer)();
EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
@@ -798,9 +970,10 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are different
CreateLocalPT("ptu_requestType.json");
- manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- manager->ReactOnUserDevConsentForApp(app_id1, true);
+ manager->ReactOnUserDevConsentForApp(dev_handle1, app_id1, true);
EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
}
@@ -811,10 +984,11 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are the same
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id1, app_id1, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- EXPECT_CALL(listener, OnPendingPermissionChange(app_id1)).Times(0);
- manager->ReactOnUserDevConsentForApp(app_id1, true);
+ EXPECT_CALL(listener, OnPendingPermissionChange(_, app_id1)).Times(0);
+ manager->ReactOnUserDevConsentForApp(dev_handle1, app_id1, true);
EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
}
@@ -828,7 +1002,8 @@ TEST_F(
GetPTU("valid_sdl_pt_update.json");
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
// Try to add existing app
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check no update required
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
}
@@ -876,13 +1051,14 @@ TEST_F(PolicyManagerImplTest2,
GetPTU("valid_sdl_pt_update.json");
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
// Set PT was updated 10 days ago (limit is 30 days for now)
// So no limit exceeded
manager->PTUpdatedAt(counter, days - 10);
- manager->OnAppRegisteredOnMobile(app_id2);
+ manager->OnAppRegisteredOnMobile(dev_id2, app_id2);
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
}
@@ -1087,11 +1263,12 @@ TEST_F(PolicyManagerImplTest2,
DISABLED_GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
// Arrange
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
std::string default_hmi1;
- manager->GetDefaultHmi(app_id2, &default_hmi1);
+ manager->GetDefaultHmi(dev_id2, app_id2, &default_hmi1);
EXPECT_EQ("", default_hmi1);
ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
ASSERT_TRUE((manager->GetCache())
@@ -1107,12 +1284,13 @@ TEST_F(PolicyManagerImplTest2,
::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
std::string default_hmi2;
- manager->GetDefaultHmi(app_id2, &default_hmi2);
+ manager->GetDefaultHmi(dev_id2, app_id2, &default_hmi2);
EXPECT_EQ("", default_hmi2);
}
@@ -1120,7 +1298,8 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
// Arrange
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
std::string priority1;
@@ -1140,9 +1319,10 @@ TEST_F(PolicyManagerImplTest2,
::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
std::string priority2;
EXPECT_TRUE(manager->GetPriority(app_id2, &priority2));
@@ -1152,7 +1332,10 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id2))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
::policy::StringArray app_nicknames;
::policy::StringArray app_hmi_types;
manager->GetInitialAppData(app_id2, &app_nicknames, &app_hmi_types);
@@ -1194,7 +1377,8 @@ TEST_F(
CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
// Check keep context in preData policy
@@ -1206,7 +1390,8 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((manager->GetCache())
->SetDeviceData(dev_id2,
"hardware IPX",
@@ -1219,9 +1404,10 @@ TEST_F(PolicyManagerImplTest2,
manager->SetUserConsentForDevice(dev_id2, true);
::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
// Check keep context in default policy
EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
@@ -1231,7 +1417,10 @@ TEST_F(PolicyManagerImplTest2,
CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id2))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
GetPTU("valid_sdl_pt_update.json");
// Check keep context in updated policies for app
EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
@@ -1242,7 +1431,8 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((manager->GetCache())
->SetDeviceData(dev_id2,
"hardware IPX",
@@ -1255,9 +1445,10 @@ TEST_F(PolicyManagerImplTest2,
manager->SetUserConsentForDevice(dev_id2, true);
::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
// Check keep context in default policy
EXPECT_TRUE(manager->CanAppStealFocus(app_id2));
@@ -1267,7 +1458,10 @@ TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id2))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
GetPTU("valid_sdl_pt_update.json");
// Check keep context in updated policies for app
EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
@@ -1275,9 +1469,11 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
// Arrange
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2)).Times(2);
- EXPECT_EQ(custom_str::CustomString(""), manager->GetCurrentDeviceId(app_id2));
- EXPECT_EQ("", manager->GetCurrentDeviceId(app_id2));
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(dev_handle2, app_id2))
+ .Times(2);
+ EXPECT_EQ(custom_str::CustomString(""),
+ manager->GetCurrentDeviceId(dev_handle2, app_id2));
+ EXPECT_EQ("", manager->GetCurrentDeviceId(dev_handle2, app_id2));
}
TEST_F(PolicyManagerImplTest2,
@@ -1321,9 +1517,12 @@ TEST_F(
->SetUserPermissionsForDevice(
dev_id2, consented_groups, disallowed_groups);
manager->SetUserConsentForDevice(dev_id2, true);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(_, app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id2))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
GetPTU("valid_sdl_pt_update.json");
::policy::PermissionConsent perm_consent;
@@ -1342,7 +1541,7 @@ TEST_F(
perm_consent.group_permissions = groups_permissions;
manager->SetUserConsentForApp(perm_consent);
- manager->SendNotificationOnPermissionsUpdated(app_id2);
+ manager->SendNotificationOnPermissionsUpdated(dev_id2, app_id2);
std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
std::vector< ::policy::FunctionalGroupPermission>::iterator it;
manager->GetPermissionsForApp(dev_id2, app_id2, actual_groups_permissions);
@@ -1377,7 +1576,10 @@ TEST_F(
pt->ReportErrors(&report);
}
// Add new app
- manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ manager->AddApplication(
+ dev_id2, app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener, GetDevicesIds(app_id2))
+ .WillRepeatedly(Return(transport_manager::DeviceList()));
uint32_t result = manager->HeartBeatTimeout(app_id2);
// By default hertbeat timeout is 0
EXPECT_EQ(0u, result);
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
index 07a85eaa22..985e244235 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
@@ -185,12 +185,14 @@ Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=(
template <typename T, T minval, T maxval>
Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator++() {
++value_;
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
return *this;
}
template <typename T, T minval, T maxval>
Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator+=(int value) {
value_ += value;
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
return *this;
}
diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt
index 093413ef3b..a9c0e14224 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -63,7 +63,7 @@ set(LIBRARIES
HMI_API
MOBILE_API
Utils
- Policy
+ PolicyStatic
)
add_library("TelemetryMonitor" ${SOURCES})
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
index 2cc482297b..9d99b1b548 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
@@ -48,7 +48,8 @@ namespace transport_adapter {
class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
public:
- UsbDeviceScanner(class TransportAdapterController* controller);
+ UsbDeviceScanner(class TransportAdapterController* controller,
+ const TransportManagerSettings& settings);
virtual ~UsbDeviceScanner();
protected:
@@ -65,6 +66,7 @@ class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
void SupportedDeviceFound(PlatformUsbDevice* device);
TransportAdapterController* controller_;
+ const TransportManagerSettings& settings_;
typedef std::list<PlatformUsbDevice*> Devices;
Devices devices_;
diff --git a/src/components/transport_manager/src/usb/libusb/usb_handler.cc b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
index df3b7e128e..975f71e84c 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_handler.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
@@ -90,20 +90,20 @@ UsbHandler::UsbHandler()
UsbHandler::~UsbHandler() {
shutdown_requested_ = true;
- if (libusb_context_ != 0) {
+ thread_->stop();
+ LOG4CXX_INFO(logger_, "UsbHandler thread finished");
+ if (libusb_context_ != 0) { // This wakes up libusb_handle_events()
libusb_hotplug_deregister_callback(libusb_context_,
arrived_callback_handle_);
libusb_hotplug_deregister_callback(libusb_context_, left_callback_handle_);
}
- thread_->stop();
- LOG4CXX_INFO(logger_, "UsbHandler thread finished");
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
if (libusb_context_) {
libusb_exit(libusb_context_);
libusb_context_ = 0;
}
- thread_->join();
- delete thread_->delegate();
- threads::DeleteThread(thread_);
}
void UsbHandler::DeviceArrived(libusb_device* device_libusb) {
diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
index 3ecc1e22f3..d1e9c64c3b 100644
--- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -45,7 +45,7 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
UsbAoaAdapter::UsbAoaAdapter(resumption::LastState& last_state,
const TransportManagerSettings& settings)
- : TransportAdapterImpl(new UsbDeviceScanner(this),
+ : TransportAdapterImpl(new UsbDeviceScanner(this, settings),
new UsbConnectionFactory(this),
NULL,
last_state,
diff --git a/src/components/transport_manager/src/usb/usb_device_scanner.cc b/src/components/transport_manager/src/usb/usb_device_scanner.cc
index 3a17203307..cff42123a4 100644
--- a/src/components/transport_manager/src/usb/usb_device_scanner.cc
+++ b/src/components/transport_manager/src/usb/usb_device_scanner.cc
@@ -47,6 +47,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
class AoaInitSequence : public UsbControlTransferSequence {
public:
AoaInitSequence();
+ AoaInitSequence(const TransportManagerSettings& settings);
virtual ~AoaInitSequence() {}
private:
@@ -86,8 +87,9 @@ void UsbDeviceScanner::OnDeviceLeft(PlatformUsbDevice* device) {
}
}
-UsbDeviceScanner::UsbDeviceScanner(TransportAdapterController* controller)
- : controller_(controller) {}
+UsbDeviceScanner::UsbDeviceScanner(TransportAdapterController* controller,
+ const TransportManagerSettings& settings)
+ : controller_(controller), settings_(settings) {}
UsbDeviceScanner::~UsbDeviceScanner() {}
@@ -171,14 +173,14 @@ class AoaInitSequence::AoaTurnIntoAccessoryMode : public UsbControlOutTransfer {
}
};
-static char manufacturer[] = "SDL";
-static char model_name[] = "Core";
-static char description[] = "SmartDeviceLink Core Component USB";
-static char version[] = "1.0";
-static char uri[] = "http://www.smartdevicelink.org";
-static char serial_num[] = "N000000";
-
-AoaInitSequence::AoaInitSequence() : UsbControlTransferSequence() {
+AoaInitSequence::AoaInitSequence(const TransportManagerSettings& settings)
+ : UsbControlTransferSequence() {
+ auto manufacturer = settings.aoa_filter_manufacturer().c_str();
+ auto model_name = settings.aoa_filter_model_name().c_str();
+ auto description = settings.aoa_filter_description().c_str();
+ auto version = settings.aoa_filter_version().c_str();
+ auto uri = settings.aoa_filter_uri().c_str();
+ auto serial_num = settings.aoa_filter_serial_number().c_str();
AddTransfer(new AoaGetProtocolRequest);
AddTransfer(new AoaSendIdString(0, manufacturer, sizeof(manufacturer)));
AddTransfer(new AoaSendIdString(1, model_name, sizeof(model_name)));
@@ -192,7 +194,8 @@ AoaInitSequence::AoaInitSequence() : UsbControlTransferSequence() {
void UsbDeviceScanner::TurnIntoAccessoryMode(PlatformUsbDevice* device) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "PlatformUsbDevice: " << device);
- GetUsbHandler()->StartControlTransferSequence(new AoaInitSequence, device);
+ GetUsbHandler()->StartControlTransferSequence(new AoaInitSequence(settings_),
+ device);
}
void UsbDeviceScanner::SupportedDeviceFound(PlatformUsbDevice* device) {
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index 9562b50e78..451a8a629e 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -58,7 +58,10 @@ set(EXCLUDE_PATHS
${DBMS_PATHS}
)
-set(LIBRARIES)
+set(LIBRARIES
+ encryption
+ jsoncpp
+)
if(NOT BUILD_BACKTRACE_SUPPORT)
list(APPEND EXCLUDE_PATHS
diff --git a/src/components/utils/src/push_log.cc b/src/components/utils/src/push_log.cc
index 6e16c99181..dea0e75274 100644
--- a/src/components/utils/src/push_log.cc
+++ b/src/components/utils/src/push_log.cc
@@ -36,8 +36,12 @@
namespace logger {
-static bool logs_enabled_ = false;
-static LogMessageLoopThread* log_message_loop_thread = NULL;
+struct __attribute__((visibility("default"))) LogsEnabled {
+ static std::atomic_bool logs_enabled_;
+};
+
+std::atomic_bool LogsEnabled::logs_enabled_(false);
+static std::unique_ptr<LogMessageLoopThread> log_message_loop_thread;
bool push_log(log4cxx::LoggerPtr logger,
log4cxx::LevelPtr level,
@@ -73,22 +77,22 @@ bool push_log(log4cxx::LoggerPtr logger,
}
bool logs_enabled() {
- return logs_enabled_;
+ return LogsEnabled::logs_enabled_;
}
void set_logs_enabled(bool state) {
- logs_enabled_ = state;
+ LogsEnabled::logs_enabled_ = state;
}
void create_log_message_loop_thread() {
if (!log_message_loop_thread) {
- log_message_loop_thread = new LogMessageLoopThread();
+ log_message_loop_thread =
+ std::unique_ptr<LogMessageLoopThread>(new LogMessageLoopThread);
}
}
void delete_log_message_loop_thread() {
- delete log_message_loop_thread;
- log_message_loop_thread = NULL;
+ log_message_loop_thread.reset();
}
void flush_logger() {
diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt
index f6bd24ff09..b5127ccabc 100644
--- a/src/components/utils/test/CMakeLists.txt
+++ b/src/components/utils/test/CMakeLists.txt
@@ -87,7 +87,7 @@ collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
set(LIBRARIES
gmock
Utils
- Policy
+ PolicyStatic
ConfigProfile
)
diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
index 21f07e6ac5..955de31dc7 100755
--- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py
+++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
@@ -270,7 +270,7 @@ class Parser(object):
result = self._parse_version(attrib[attribute])
until = result
elif attribute == "deprecated":
- deprecated = attributes[attribute]
+ deprecated = attrib[attribute]
elif attribute == "removed":
removed = attrib[attribute]
else: