summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2021-10-27 11:15:13 -0400
committerGitHub <noreply@github.com>2021-10-27 11:15:13 -0400
commit68f082169e0a40fccd9eb0db3c83911c28870f07 (patch)
treea43ab7c105412b9b4baf3f93178bfc7d030a5652
parentf43fbe015e5c7f84d1bcc1c154aeec6afad217d9 (diff)
parent0907428858f2eeadc9707d4192971cf555a7785c (diff)
downloadsdl_core-68f082169e0a40fccd9eb0db3c83911c28870f07.tar.gz
Merge pull request #3775 from smartdevicelink/release/8.0.08.0.0
Release 8.0.0
-rw-r--r--.github/CONTRIBUTING.md1
-rw-r--r--.github/workflows/sdl_core_github_ci.yml44
-rw-r--r--.github/workflows/sdl_core_github_ci_coverity.yml63
-rw-r--r--.travis.yml32
-rw-r--r--CMakeLists.txt41
-rw-r--r--README.md8
-rw-r--r--src/3rd_party/CMakeLists.txt22
-rw-r--r--src/appMain/CMakeLists.txt11
-rw-r--r--src/appMain/boostlogconfig.ini51
-rw-r--r--src/appMain/daemon.sh2
-rwxr-xr-xsrc/appMain/hmi_capabilities.json6
-rw-r--r--src/appMain/life_cycle_impl.cc6
-rw-r--r--src/appMain/main.cc23
-rw-r--r--src/appMain/sample_policy_manager.py6
-rw-r--r--src/appMain/sdl_preloaded_pt.json292
-rw-r--r--src/appMain/smartDeviceLink.ini7
-rw-r--r--src/appMain/test/CMakeLists.txt1
-rw-r--r--src/components/application_manager/CMakeLists.txt2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h8
-rw-r--r--src/components/application_manager/include/application_manager/app_service_manager.h3
-rw-r--r--src/components/application_manager/include/application_manager/application.h12
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h3
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h124
-rw-r--r--src/components/application_manager/include/application_manager/commands/button_notification_to_mobile.h109
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h9
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h368
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_hmi.h17
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_mobile_impl.h372
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_to_hmi.h3
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h9
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h3
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_observer.h18
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h3
-rw-r--r--src/components/application_manager/include/application_manager/hmi_language_handler.h5
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h2
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h103
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h8
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h6
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h18
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h5
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h6
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h54
-rw-r--r--src/components/application_manager/include/application_manager/request_controller_impl.h (renamed from src/components/application_manager/include/application_manager/request_controller.h)215
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h17
-rw-r--r--src/components/application_manager/include/application_manager/request_timeout_handler_impl.h75
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h3
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_json.h8
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_processor_impl.h13
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h11
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h9
-rw-r--r--src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h3
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h3
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h7
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc33
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h12
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h8
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h5
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_pending_resumption_handler.h3
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h18
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h21
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_pending_resumption_handler.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc85
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc54
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_app_extension_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_pending_resumption_handler_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc37
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h)20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_request.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h)51
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_response.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h)32
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_create_window_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_request.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h)47
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_response.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h)40
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/cancel_interaction_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_window_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h22
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h34
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h34
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_window_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_app_menu_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h17
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subtle_alert_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h27
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_app_extension.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_pending_resumption_handler.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_reset_timeout_notification.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc)11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_request.cc163
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_response.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc)61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_request.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_response.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc)65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc54
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc30
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc49
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc107
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc200
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc144
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc153
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc30
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc53
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc44
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc53
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_app_extension.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_pending_resumption_handler.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc40
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_request_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc37
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_request_test.cc217
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_response_test.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_request_test.cc185
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_response_test.cc146
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_request_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc32
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc37
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc498
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc195
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc50
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc50
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc50
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc42
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc23
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc27
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h5
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h3
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h3
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_pending_resumption_handler.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h7
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_pending_resumption_handler.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc41
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_type_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/include/vehicle_info_plugin/commands/vi_commands_test.h9
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_info_pending_resumption_test.cc16
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc2
-rw-r--r--src/components/application_manager/src/application_data_impl.cc18
-rw-r--r--src/components/application_manager/src/application_impl.cc16
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc624
-rw-r--r--src/components/application_manager/src/application_state.cc9
-rw-r--r--src/components/application_manager/src/commands/button_notification_to_mobile.cc219
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc245
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc906
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc54
-rw-r--r--src/components/application_manager/src/commands/request_from_mobile_impl.cc906
-rw-r--r--src/components/application_manager/src/commands/request_to_hmi.cc45
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc21
-rw-r--r--src/components/application_manager/src/event_engine/event_observer.cc10
-rw-r--r--src/components/application_manager/src/help_prompt_manager_impl.cc4
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc15
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc2
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc8
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc8
-rw-r--r--src/components/application_manager/src/hmi_state.cc26
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc311
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc9
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc65
-rw-r--r--src/components/application_manager/src/policies/policy_retry_sequence.cc77
-rw-r--r--src/components/application_manager/src/request_controller_impl.cc (renamed from src/components/application_manager/src/request_controller.cc)327
-rw-r--r--src/components/application_manager/src/request_info.cc39
-rw-r--r--src/components/application_manager/src/request_timeout_handler_impl.cc123
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc4
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc2
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc4
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_processor_impl.cc82
-rw-r--r--src/components/application_manager/src/rpc_passing_handler.cc4
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc37
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc11
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc12
-rw-r--r--src/components/application_manager/src/system_time/system_time_handler_impl.cc2
-rwxr-xr-xsrc/components/application_manager/test/CMakeLists.txt3
-rw-r--r--src/components/application_manager/test/app_launch/CMakeLists.txt2
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc14
-rw-r--r--src/components/application_manager/test/application_helper_test.cc14
-rw-r--r--src/components/application_manager/test/application_impl_test.cc6
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc6
-rw-r--r--src/components/application_manager/test/commands/command_mobile_request_impl_test.cc (renamed from src/components/application_manager/test/commands/command_request_impl_test.cc)222
-rw-r--r--src/components/application_manager/test/event_engine_test.cc2
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc3
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc1
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc26
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h7
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h34
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_observer.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h47
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_request.h3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h3
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc9
-rw-r--r--src/components/application_manager/test/mobile_event_engine_test.cc2
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc59
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc2
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc78
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc41
-rw-r--r--src/components/application_manager/test/request_timeout_handler_test.cc306
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc32
-rw-r--r--src/components/application_manager/test/rpc_service_impl_test.cc13
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json116
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc126
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc18
-rw-r--r--src/components/config_profile/CMakeLists.txt2
-rw-r--r--src/components/config_profile/include/config_profile/ini_file.h132
-rw-r--r--src/components/config_profile/include/config_profile/profile.h21
-rw-r--r--src/components/config_profile/src/ini_file.cc418
-rw-r--r--src/components/config_profile/src/profile.cc249
-rw-r--r--src/components/config_profile/test/CMakeLists.txt2
-rw-r--r--src/components/config_profile/test/ini_file_test.cc330
-rw-r--r--src/components/config_profile/test/profile_test.cc5
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc4
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cc6
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt2
-rw-r--r--src/components/include/application_manager/application_manager.h102
-rw-r--r--src/components/include/application_manager/application_manager_settings.h1
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h5
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h4
-rw-r--r--src/components/include/application_manager/request_controller.h224
-rw-r--r--src/components/include/application_manager/request_timeout_handler.h85
-rw-r--r--src/components/include/media_manager/media_manager.h7
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h9
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h16
-rw-r--r--src/components/include/resumption/last_state.h12
-rw-r--r--src/components/include/security_manager/security_manager.h13
-rw-r--r--src/components/include/security_manager/ssl_context.h1
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h44
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h1
-rw-r--r--src/components/include/test/application_manager/mock_request_controller.h96
-rw-r--r--src/components/include/test/application_manager/mock_request_timeout_handler.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc)61
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin.h7
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h3
-rw-r--r--src/components/include/test/media_manager/mock_media_manager.h6
-rw-r--r--src/components/include/test/resumption/mock_last_state.h4
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager.h2
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h2
-rw-r--r--src/components/include/transport_manager/transport_manager.h3
-rw-r--r--src/components/interfaces/HMI_API.xml220
-rw-r--r--src/components/media_manager/CMakeLists.txt2
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h1
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h7
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_adapter.cc4
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc6
-rw-r--r--src/components/media_manager/src/file_streamer_adapter.cc2
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc33
-rw-r--r--src/components/media_manager/src/pipe_streamer_adapter.cc2
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc2
-rw-r--r--src/components/media_manager/src/streamer_adapter.cc2
-rw-r--r--src/components/media_manager/test/CMakeLists.txt2
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc15
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt4
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h8
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc13
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc6
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc4
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc12
-rw-r--r--src/components/policy/policy_external/test/boostlogconfig.ini46
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json161
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json161
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc1
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h10
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc30
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc40
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc4
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc12
-rw-r--r--src/components/policy/policy_regular/test/boostlogconfig.ini51
-rw-r--r--src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json161
-rw-r--r--src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json161
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h5
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc2
-rw-r--r--src/components/protocol_handler/src/incoming_data_handler.cc18
-rw-r--r--src/components/protocol_handler/src/multiframe_builder.cc21
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc30
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc17
-rw-r--r--src/components/protocol_handler/src/service_status_update_handler.cc4
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h4
-rw-r--r--src/components/protocol_handler/test/service_status_update_handler_test.cc4
-rw-r--r--src/components/resumption/include/resumption/last_state_impl.h9
-rw-r--r--src/components/resumption/src/last_state_impl.cc37
-rw-r--r--src/components/resumption/test/last_state_test.cc7
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h17
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc56
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc50
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc8
-rw-r--r--src/components/security_manager/test/security_manager_test.cc112
-rw-r--r--src/components/security_manager/test/security_query_test.cc17
-rw-r--r--src/components/security_manager/test/ssl_certificate_handshake_test.cc14
-rw-r--r--src/components/smart_objects/CMakeLists.txt2
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h15
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h2
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h23
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h11
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc21
-rw-r--r--src/components/smart_objects/src/number_schema_item.cc5
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc33
-rw-r--r--src/components/telemetry_monitor/test/CMakeLists.txt8
-rw-r--r--src/components/telemetry_monitor/test/boostlogconfig.ini22
-rw-r--r--src/components/test_main.cc3
-rw-r--r--src/components/transport_manager/CMakeLists.txt3
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h11
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h5
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h11
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_default.h3
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h3
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h4
-rw-r--r--src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc2
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc6
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc4
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc21
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc100
-rw-r--r--src/components/transport_manager/src/websocket_server/websocket_server_transport_adapter.cc10
-rw-r--r--src/components/transport_manager/src/websocket_server/websocket_session.cc2
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h7
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc2
-rw-r--r--src/components/utils/CMakeLists.txt35
-rw-r--r--src/components/utils/include/utils/convert_utils.h14
-rw-r--r--src/components/utils/include/utils/file_system.h3
-rw-r--r--src/components/utils/include/utils/logger/boostlogger.h (renamed from src/components/utils/src/threads/thread_manager.cc)39
-rw-r--r--src/components/utils/include/utils/threads/pulse_thread_delegate.h101
-rw-r--r--src/components/utils/include/utils/threads/thread_manager.h81
-rw-r--r--src/components/utils/src/file_system.cc19
-rw-r--r--src/components/utils/src/lock_boost.cc8
-rw-r--r--src/components/utils/src/logger/boostlogger.cc209
-rw-r--r--src/components/utils/src/threads/pulse_thread_delegate.cc111
-rw-r--r--src/components/utils/src/timer.cc4
-rw-r--r--src/components/utils/test/CMakeLists.txt7
-rw-r--r--src/components/utils/test/boostlogconfig.ini51
-rw-r--r--src/components/utils/test/file_system_test.cc4
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/appenders/CMakeLists.txt4
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryBase.py61
-rwxr-xr-xtools/infrastructure/check_style.sh2
-rwxr-xr-xtools/infrastructure/git-hooks/pre-commit6
-rw-r--r--tools/policy_table_validator/main.cpp15
m---------tools/rpc_spec0
620 files changed, 10778 insertions, 10863 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index bc90d907c1..c24cd68807 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -4,7 +4,6 @@ Third party contributions are essential for making SDL great. However, we do hav
## Environment
Currently supported:
-* Ubuntu Linux 16.04 with GCC 5.4.x
* Ubuntu Linux 18.04 with GCC 7.3.x
* Ubuntu Linux 20.04 with GCC 9.3.x
* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)
diff --git a/.github/workflows/sdl_core_github_ci.yml b/.github/workflows/sdl_core_github_ci.yml
new file mode 100644
index 0000000000..14ff51c2fe
--- /dev/null
+++ b/.github/workflows/sdl_core_github_ci.yml
@@ -0,0 +1,44 @@
+name: SDL Core Build
+on: [push, pull_request]
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: Init Submodules
+ run: git -C ${{ github.workspace }} submodule update --init --recursive
+ # Install Dependencies
+ - name: Apt Get Dependencies
+ run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools && sudo apt-get install -f clang-format-8
+ - name: Setup CMAKE
+ uses: jwlawson/actions-setup-cmake@v1.8
+ with:
+ cmake-version: '3.16.3'
+ # Check Style
+ - name: Check Style
+ run: ${{ github.workspace }}/tools/infrastructure/check_style.sh
+ # Build Project
+ - name: Cache 3rd Party
+ id: core-3rd-party
+ uses: actions/cache@v2
+ with:
+ path: ${{ github.workspace }}/core_3rd_party
+ key: ${{ runner.os }}-core-3rd-party-v3
+ - name: Make 3rd Party Directory
+ if: steps.core-3rd-party.outputs.cache-hit != 'true'
+ run: mkdir ${{ github.workspace }}/core_3rd_party
+ - name: Make Directories
+ run: cd ${{ github.workspace }} && cd ../ && mkdir build && cd build
+ - name: Set 3rd Party Path
+ run: echo "THIRD_PARTY_INSTALL_PREFIX=${{ github.workspace }}/core_3rd_party" >> $GITHUB_ENV
+ - name: Set 3rd Party ARCH Path
+ run: echo "THIRD_PARTY_INSTALL_PREFIX_ARCH=${{ github.workspace }}/core_3rd_party" >> $GITHUB_ENV
+ - name: Configure
+ run: cmake ../sdl_core -DBUILD_TESTS=ON -DLOGGER_NAME=BOOST
+ - name: Build
+ run: make install-3rd_party && make -j `nproc` install
+ - name: Set Library Path
+ run: echo "LD_LIBRARY_PATH=$THIRD_PARTY_INSTALL_PREFIX/lib:." >> $GITHUB_ENV
+ # run tests
+ - name: Unit Tests
+ run: make test
diff --git a/.github/workflows/sdl_core_github_ci_coverity.yml b/.github/workflows/sdl_core_github_ci_coverity.yml
new file mode 100644
index 0000000000..c60482d30f
--- /dev/null
+++ b/.github/workflows/sdl_core_github_ci_coverity.yml
@@ -0,0 +1,63 @@
+name: SDL Core Build With Coverity
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+jobs:
+ build:
+ environment: Coverity
+ runs-on: ubuntu-20.04
+ steps:
+ - shell: bash
+ env:
+ COVERITY_SECRET: ${{ secrets.COVERITY_TOKEN }}
+ run: |
+ echo "$COVERITY_SECRET" && echo ${{ secrets.COVERITY_TOKEN }} && echo "end"
+ - uses: actions/checkout@v2
+ - name: Init Submodules
+ run: git -C ${{ github.workspace }} submodule update --init --recursive
+ # Install Dependencies
+ - name: Apt Get Dependencies
+ run: sudo apt-get update && sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools && sudo apt-get install -f clang-format-6.0
+ - name: Setup CMAKE
+ uses: jwlawson/actions-setup-cmake@v1.8
+ with:
+ cmake-version: '3.16.3'
+ # Build Project
+ - name: Cache 3rd Party
+ id: core-3rd-party
+ uses: actions/cache@v2
+ with:
+ path: ${{ github.workspace }}/core_3rd_party
+ key: ${{ runner.os }}-core-3rd-party-v3
+ - name: Make 3rd Party Directory
+ if: steps.core-3rd-party.outputs.cache-hit != 'true'
+ run: mkdir ${{ github.workspace }}/core_3rd_party
+ - name: Make Directories
+ run: cd ${{ github.workspace }} && cd ../ && mkdir build && cd build
+ - name: Set 3rd Party Path
+ run: echo "THIRD_PARTY_INSTALL_PREFIX=${{ github.workspace }}/core_3rd_party" >> $GITHUB_ENV
+ - name: Set 3rd Party ARCH Path
+ run: echo "THIRD_PARTY_INSTALL_PREFIX_ARCH=${{ github.workspace }}/core_3rd_party" >> $GITHUB_ENV
+ - name: Configure
+ run: cmake ../sdl_core -DLOGGER_NAME=BOOST
+ - name: Download Coverity
+ env:
+ COVERITY_SECRET: ${{ secrets.COVERITY_TOKEN }}
+ run: wget https://scan.coverity.com/download/linux64 --post-data "token=${COVERITY_SECRET}&project=smartdevicelink%2Fsdl_core" -O coverity_tool.tgz
+ - name: unzip
+ run: tar zxvf coverity_tool.tgz
+ - name: Build
+ run: make install-3rd_party && ./cov-analysis-linux64-2020.09/bin/cov-build --dir cov-int make -j `nproc` install
+ - name: Set Library Path
+ run: echo "LD_LIBRARY_PATH=$THIRD_PARTY_INSTALL_PREFIX/lib:." >> $GITHUB_ENV
+ - name: Compress Coverity
+ run: tar czvf myproject.tgz cov-int
+ - name: Upload Coverity
+ env:
+ COVERITY_SECRET: ${{ secrets.COVERITY_TOKEN }}
+ run: curl --form token=${COVERITY_SECRET} --form email=jack@livio.io --form file=@myproject.tgz --form version="Version" --form description="Description" https://scan.coverity.com/builds?project=smartdevicelink%2Fsdl_core
+
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 9d9cfedb82..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-language: cpp
-dist: xenial
-sudo: required
-only:
- - master
- - develop
- - \/feature\/.+
- - \/fix\/.+
- - \/hotfix\/.+
- - \/release\/.+
-
-addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
-
-before_install:
- - sudo apt-get update
- - sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck python3-pip python3-setuptools
- - sudo apt-get install -f clang-format-6.0
-
-script:
- - cppcheck --force -isrc/3rd_party -isrc/3rd_party-static --quiet --error-exitcode=1 src
- - ./tools/infrastructure/check_style.sh
- - mkdir build && cd build
- - cmake ../ -DBUILD_TESTS=ON
- - make install-3rd_party && make -j `nproc` install && sudo ldconfig && make test
-env:
- global:
- - LC_CTYPE=en_US.UTF-8
- - CTEST_OUTPUT_ON_FAILURE=TRUE
- - LD_LIBRARY_PATH=.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 764a050b91..3b53b87e39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@
# POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 2.8.11)
+cmake_policy(SET CMP0054 NEW)
set (PROJECT smartDeviceLinkCore)
project (${PROJECT})
@@ -52,13 +53,18 @@ option(ENABLE_LOG "Logging feature" ON)
option(ENABLE_GCOV "gcov code coverage feature" OFF)
option(ENABLE_SANITIZE "Sanitize tool" OFF)
option(ENABLE_SECURITY "Security Ford protocol protection" ON)
-option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON)
option(ENABLE_IAP2EMULATION "IAP2 emulation via tcp" OFF)
option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON)
option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON)
option(USE_CCACHE "Turn on ccache usage" ON)
option(USE_DISTCC "Turn on distributed build_usage" OFF)
+set(LOGGER_NAME "LOG4CXX" CACHE STRING "Logging library to use (BOOST, LOG4CXX)")
+set_property(CACHE LOGGER_NAME PROPERTY STRINGS BOOST LOG4CXX)
+if(LOGGER_NAME STREQUAL "")
+ set(LOGGER_NAME "LOG4CXX")
+endif()
+
set (EXTENDED_POLICY "PROPRIETARY" CACHE STRING "Policy mode (PROPRIETARY, HTTP or EXTERNAL_PROPRIETARY)")
set_property(CACHE EXTENDED_POLICY PROPERTY STRINGS PROPRIETARY HTTP EXTERNAL_PROPRIETARY)
if(EXTENDED_POLICY STREQUAL "")
@@ -186,6 +192,12 @@ get_property(cValue CACHE ENABLE_SECURITY PROPERTY VALUE)
file(APPEND "${build_config_path}" "//${cHelpString}\n")
file(APPEND "${build_config_path}" "ENABLE_SECURITY:${cType}=${cValue}\n\n")
+get_property(cHelpString CACHE LOGGER_NAME PROPERTY HELPSTRING)
+get_property(cType CACHE LOGGER_NAME PROPERTY TYPE)
+get_property(cValue CACHE LOGGER_NAME PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "LOGGER_NAME:${cType}=${cValue}\n\n")
+
get_property(cHelpString CACHE EXTENDED_MEDIA_MODE PROPERTY HELPSTRING)
get_property(cType CACHE EXTENDED_MEDIA_MODE PROPERTY TYPE)
get_property(cValue CACHE EXTENDED_MEDIA_MODE PROPERTY VALUE)
@@ -204,12 +216,6 @@ get_property(cValue CACHE HMI PROPERTY VALUE)
file(APPEND "${build_config_path}" "//${cHelpString}\n")
file(APPEND "${build_config_path}" "HMI:${cType}=${cValue}\n\n")
-get_property(cHelpString CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY HELPSTRING)
-get_property(cType CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY TYPE)
-get_property(cValue CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY VALUE)
-file(APPEND "${build_config_path}" "//${cHelpString}\n")
-file(APPEND "${build_config_path}" "ENABLE_HMI_PTU_DECRYPTION:${cType}=${cValue}\n")
-
get_property(cHelpString CACHE BUILD_WEBSOCKET_SERVER_SUPPORT PROPERTY HELPSTRING)
get_property(cType CACHE BUILD_WEBSOCKET_SERVER_SUPPORT PROPERTY TYPE)
get_property(cValue CACHE BUILD_WEBSOCKET_SERVER_SUPPORT PROPERTY VALUE)
@@ -376,6 +382,14 @@ else()
set(POLICY_MOCK_INCLUDE_PATH ${COMPONENTS_DIR}/include/test/policy/policy_regular/)
endif()
+if(${LOGGER_NAME} STREQUAL "LOG4CXX")
+ add_definitions(-DLOG4CXX_LOGGER)
+ message(STATUS "Selected the apache log4cxx logging library")
+else()
+ add_definitions(-DBOOST_LOGGER)
+ message(STATUS "Selected the boost logging library")
+endif()
+
# TODO(AK): check current OS here
add_definitions(-DOS_POSIX)
@@ -419,10 +433,16 @@ include_directories(
add_subdirectory(./src/3rd_party EXCLUDE_FROM_ALL)
find_package(OpenSSL REQUIRED)
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
+ message(STATUS "Including log4cxx")
include_directories ( ${LOG4CXX_INCLUDE_DIRECTORY} )
endif()
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "BOOST")
+ message(STATUS "Including boost")
+ include_directories ( ${BOOST_INCLUDE_DIR} )
+endif()
+
if(ENABLE_SECURITY)
add_definitions(-DENABLE_SECURITY)
set(SecurityManagerLibrary SecurityManager)
@@ -431,11 +451,6 @@ if(ENABLE_SECURITY)
message(STATUS "Security enabled")
endif()
-if(ENABLE_HMI_PTU_DECRYPTION)
- add_definitions(-DUSE_HMI_PTU_DECRYPTION)
- message(STATUS "HMI PTU decription enabled")
-endif()
-
if(ENABLE_IAP2EMULATION)
add_definitions(-DENABLE_IAP2EMULATION)
message(STATUS "IAP2 emulation enabled")
diff --git a/README.md b/README.md
index 3bc7781268..c933b81162 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
-[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/badge/icon?subject=UT%20coverage%20build)](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/)
-[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/badge/icon?subject=Smoke%20tests)](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/)
-[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/badge/icon?subject=Coding%20style)](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/)
+[![Github Actions Build Status](https://github.com/smartdevicelink/sdl_core/actions/workflows/sdl_core_github_ci.yml/badge.svg)](https://github.com/smartdevicelink/sdl_core/actions/workflows/sdl_core_github_ci.yml)
+[![Jenkins Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/badge/icon?subject=UT%20coverage%20build)](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/)
+[![Jenkins Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/badge/icon?subject=Smoke%20tests)](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/)
+[![Jenkins Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/badge/icon?subject=Coding%20style)](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/)
# SmartDeviceLink (SDL)
@@ -19,7 +20,6 @@ Pull Requests Welcome!
## Environment
Currently supported:
-* Ubuntu Linux 16.04 with GCC 5.4.x
* Ubuntu Linux 18.04 with GCC 7.5.x
* Ubuntu Linux 20.04 with GCC 9.3.x
* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index ce4bf20dab..9626f646ae 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -47,7 +47,7 @@ if(FORCE_3RD_PARTY)
endif()
endif()
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
# --- libexpat
add_subdirectory(expat-2.1.0)
set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
@@ -186,7 +186,7 @@ find_package(PkgConfig)
pkg_check_modules(BSON libbson)
message (STATUS "bson installed in " ${BSON_LIBDIR} ", " ${BSON_INCLUDEDIR})
-if ((NOT "${BSON_FOUND}") OR ("${BSON_VERSION}" VERSION_LESS "1.2.0"))
+if ((NOT "${BSON_FOUND}") OR ("${BSON_VERSION}" VERSION_LESS "1.2.5"))
message (STATUS "Building bson required")
set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib CACHE INTERNAL "Sources of bson library" FORCE)
set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of bson libraries" FORCE)
@@ -222,7 +222,11 @@ endif()
set(BOOST_ROOT ${3RD_PARTY_INSTALL_PREFIX})
set(Boost_NO_BOOST_CMAKE ON)
-find_package(Boost 1.72.0 COMPONENTS system thread date_time filesystem regex)
+set(BOOST_COMPONENTS system thread date_time filesystem regex)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "BOOST")
+ list(APPEND BOOST_COMPONENTS log log_setup)
+endif()
+find_package(Boost 1.72.0 COMPONENTS ${BOOST_COMPONENTS})
if (NOT ${Boost_FOUND})
set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
@@ -234,15 +238,23 @@ if (NOT ${Boost_FOUND})
set(BOOST_INSTALL_COMMAND sudo ./b2 install)
endif()
include(ExternalProject)
+
+ set(boost_component_install_flags --with-system --with-thread --with-date_time --with-filesystem --with-regex)
+ set(boost_component_libraries system thread date_time filesystem regex)
+ if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "BOOST")
+ list(APPEND boost_component_install_flags --with-log)
+ list(APPEND boost_component_libraries log)
+ endif()
+ string (REPLACE ";" "," boost_component_libraries_str "${boost_component_libraries}")
ExternalProject_Add(
Boost
URL https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.gz/download
URL_HASH SHA1=668c29007e5380d71fac8a39ecba6a02cb0086d5
DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem,regex --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=${boost_component_libraries_str} --prefix=${3RD_PARTY_INSTALL_PREFIX}
BUILD_COMMAND ./b2
- INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --clean --prefix=${3RD_PARTY_INSTALL_PREFIX} && ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --with-filesystem --with-regex --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
+ INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --clean --prefix=${3RD_PARTY_INSTALL_PREFIX} && ${BOOST_INSTALL_COMMAND} ${boost_component_install_flags} --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
BUILD_IN_SOURCE true
)
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index c2b7255ecc..cdd3760fa0 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -138,7 +138,7 @@ if (BUILD_USB_SUPPORT)
endif()
endif()
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
@@ -160,7 +160,12 @@ target_link_libraries(${PROJECT} ${LIBRARIES})
add_dependencies(${PROJECT} Policy)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/build_config.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+if (${LOGGER_NAME} STREQUAL "LOG4CXX")
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+else()
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/boostlogconfig.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
@@ -217,7 +222,7 @@ endif ()
# Install rules
install(TARGETS ${PROJECT} DESTINATION bin)
install(
- FILES build_config.txt log4cxx.properties audio.8bit.wav test.txt
+ FILES build_config.txt log4cxx.properties boostlogconfig.ini audio.8bit.wav test.txt
${CMAKE_CURRENT_BINARY_DIR}/smartDeviceLink.ini
hmi_capabilities.json sdl_preloaded_pt.json sample_policy_manager.py
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
diff --git a/src/appMain/boostlogconfig.ini b/src/appMain/boostlogconfig.ini
new file mode 100644
index 0000000000..a5d43a5bf0
--- /dev/null
+++ b/src/appMain/boostlogconfig.ini
@@ -0,0 +1,51 @@
+# Core settings
+[Core]
+DisableLogging=false
+
+# Console Logging
+[Sinks.Console]
+DisableLogging=true
+Destination=Console
+Filter="%Severity% >= debug"
+Format="%Severity% [%TimeStamp%][%Component%] %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# SDL log file
+[Sinks.AllMessages]
+DisableLogging=false
+Destination=TextFile
+FileName=SmartDeviceLinkCore.log
+Append=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for all TransportManager messages
+[Sinks.TransportManager]
+DisableLogging=false
+Destination=TextFile
+FileName=TransportManager.log
+Append=false
+Filter="%Component% = TransportManager"
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for handling Ford protocol info (include ProtocolHandler, ConnectionHandler, SecurityManager)
+[Sinks.ProtocolFordHandling]
+DisableLogging=false
+Destination=TextFile
+FileName=ProtocolFordHandling.log
+Append=false
+Filter="%Component% = ConnectionHandler or %Component% = HeartBeatMonitor or %Component% = ProtocolHandler or %Component% = SecurityManager"
+Format="%Severity% [%TimeStamp%][%Component%] %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+[Sinks.Telnet]
+DisableLogging=true
+Destination=Syslog
+Asynchronous=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+LocalAddress="http://127.0.0.1:6676/" \ No newline at end of file
diff --git a/src/appMain/daemon.sh b/src/appMain/daemon.sh
index fbde0d750a..04431de039 100644
--- a/src/appMain/daemon.sh
+++ b/src/appMain/daemon.sh
@@ -19,7 +19,7 @@ function core_start() {
return 2
else
echo "Starting SmartDeviceLink Core"
- LD_LIBRARY_PATH=$DIR ${DIR}/${CORE_APPLICATION_NAME} &
+ ${DIR}/${CORE_APPLICATION_NAME} &
CORE_PID=$!
echo $CORE_PID > $CORE_PID_FILE
return 0
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 8adb8da4b7..e5ee4f00b6 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -1160,6 +1160,12 @@
"shortPressAvailable": true,
"longPressAvailable": true,
"upDownAvailable": true
+ },
+ {
+ "name" : "CUSTOM_BUTTON",
+ "longPressAvailable" : true,
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
}
],
"presetBankCapabilities": {
diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc
index a14ca1240c..8b67877ac8 100644
--- a/src/appMain/life_cycle_impl.cc
+++ b/src/appMain/life_cycle_impl.cc
@@ -264,15 +264,15 @@ void LifeCycleImpl::StopComponents() {
DCHECK_OR_RETURN_VOID(hmi_handler_);
hmi_handler_->set_message_observer(NULL);
- DCHECK_OR_RETURN_VOID(connection_handler_);
- connection_handler_->set_connection_handler_observer(NULL);
-
DCHECK_OR_RETURN_VOID(protocol_handler_);
protocol_handler_->RemoveProtocolObserver(&(app_manager_->GetRPCHandler()));
DCHECK_OR_RETURN_VOID(app_manager_);
app_manager_->Stop();
+ DCHECK_OR_RETURN_VOID(connection_handler_);
+ connection_handler_->set_connection_handler_observer(NULL);
+
SDL_LOG_INFO("Stopping Protocol Handler");
DCHECK_OR_RETURN_VOID(protocol_handler_);
protocol_handler_->RemoveProtocolObserver(media_manager_);
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index 34c5b4dbfa..cedaf50497 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -43,7 +43,15 @@
// ----------------------------------------------------------------------------
#ifdef ENABLE_LOG
+
+#ifdef LOG4CXX_LOGGER
+#include "utils/appenders_loader.h"
#include "utils/logger/log4cxxlogger.h"
+
+#else // LOG4CXX_LOGGER
+#include "utils/logger/boostlogger.h"
+#endif // LOG4CXX_LOGGER
+
#include "utils/logger/logger_impl.h"
#endif // ENABLE_LOG
@@ -53,7 +61,6 @@
#include "signal_handlers.h"
#include "config_profile/profile.h"
-#include "utils/appenders_loader.h"
#include "utils/signals.h"
#include "utils/system.h"
@@ -142,18 +149,24 @@ int32_t main(int32_t argc, char** argv) {
if (profile_instance.logs_enabled()) {
// Logger initialization
// Redefine for each paticular logger implementation
+#ifdef LOG4CXX_LOGGER
auto logger = std::unique_ptr<logger::Log4CXXLogger>(
new logger::Log4CXXLogger("log4cxx.properties"));
+
+ if (!utils::appenders_loader.Loaded()) {
+ SDL_LOG_ERROR("Appenders plugin not loaded, file logging disabled");
+ }
+#else // LOG4CXX_LOGGER
+ auto logger = std::unique_ptr<logger::BoostLogger>(
+ new logger::BoostLogger("boostlogconfig.ini"));
+#endif // LOG4CXX_LOGGER
+
logger_impl->Init(std::move(logger));
}
#endif
threads::Thread::SetNameForId(threads::Thread::CurrentId(), "SDLCore");
- if (!utils::appenders_loader.Loaded()) {
- SDL_LOG_ERROR("Appenders plugin not loaded, file logging disabled");
- }
-
SDL_LOG_INFO("Application started!");
SDL_LOG_INFO("SDL version: " << profile_instance.sdl_version());
diff --git a/src/appMain/sample_policy_manager.py b/src/appMain/sample_policy_manager.py
index 542aa5339b..75a04685ed 100644
--- a/src/appMain/sample_policy_manager.py
+++ b/src/appMain/sample_policy_manager.py
@@ -154,7 +154,11 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler):
print('\033[31;1mMissing fileName parameter: %s\033[0m' % str(json_data))
return
- self.write_message(self.handle_func(json_data, self.encryption, self.add_http_header))
+ msg = {
+ "requestType": json_data['requestType'],
+ "data": self.handle_func(json_data, self.encryption, self.add_http_header)
+ }
+ self.write_message(msg)
def on_close(self):
print ("Connection Closed\n")
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 50bbce6a97..4887405909 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -1736,12 +1736,6 @@
"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",
@@ -1833,9 +1827,6 @@
"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."
},
@@ -1897,9 +1888,6 @@
"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."
},
@@ -1968,11 +1956,6 @@
"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"
@@ -2057,11 +2040,6 @@
"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"
@@ -2182,12 +2160,6 @@
"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",
@@ -2286,11 +2258,6 @@
"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"
@@ -2375,11 +2342,6 @@
"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"
@@ -2471,11 +2433,6 @@
"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"
@@ -2554,10 +2511,6 @@
"line1": "Disable Updates",
"textBody": "Disable Updates"
},
- "es-en": {
- "line1": "Deshab. actual.",
- "textBody": "Deshab. actual."
- },
"es-es": {
"line1": "Desact. actual."
},
@@ -2621,9 +2574,6 @@
"en-us": {
"line1": "Enable Apps"
},
- "es-en": {
- "line1": "Hab. aplic."
- },
"es-es": {
"line1": "Activar apl."
},
@@ -2687,10 +2637,6 @@
"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."
},
@@ -2756,10 +2702,6 @@
"line1": "Update Needed",
"textBody": "Update Needed"
},
- "es-en": {
- "line1": "Actualiz. neces.",
- "textBody": "Actualiz. neces."
- },
"es-es": {
"line1": "Actu. necesaria"
},
@@ -2825,10 +2767,6 @@
"line1": "Updating...",
"textBody": "Updating..."
},
- "es-en": {
- "line1": "Actualizando...",
- "textBody": "Actualizando..."
- },
"es-es": {
"line1": "Actualizando..."
},
@@ -2894,10 +2832,6 @@
"line1": "Up-To-Date",
"textBody": "Up-To-Date"
},
- "es-en": {
- "line1": "Actualizado",
- "textBody": "Actualizado"
- },
"es-es": {
"line1": "Actualizada"
},
@@ -2968,11 +2902,6 @@
"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"
@@ -3616,7 +3545,16 @@
"name": "pressureTelltale",
"key": "OEM_REF_PRES_TEL",
"type": "WarningLightStatus",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "pressureTelltale",
+ "key": "OEM_REF_PRES_TEL",
+ "type": "WarningLightStatus",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "leftFront",
@@ -3646,7 +3584,40 @@
],
"key": "OEM_REF_LEFT_FR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "leftFront",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_LEFT_FR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_LEFT_FR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_LEFT_FR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_LEFT_FR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "rightFront",
@@ -3676,7 +3647,40 @@
],
"key": "OEM_REF_RIGHT_FR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "rightFront",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_RIGHT_FR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_RIGHT_FR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_RIGHT_FR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_RIGHT_FR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "leftRear",
@@ -3706,7 +3710,40 @@
],
"key": "OEM_REF_LEFT_REAR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "leftRear",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_LEFT_REAR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_LEFT_REAR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_LEFT_REAR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_LEFT_REAR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "rightRear",
@@ -3736,7 +3773,40 @@
],
"key": "OEM_REF_RIGHT_REAR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "rightRear",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_RIGHT_REAR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_RIGHT_REAR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_RIGHT_REAR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_RIGHT_REAR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "innerLeftRear",
@@ -3766,7 +3836,40 @@
],
"key": "OEM_REF_IN_LEFT_REAR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "innerLeftRear",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_IN_LEFT_REAR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_IN_LEFT_REAR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_IN_LEFT_REAR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_IN_LEFT_REAR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
},
{
"name": "innerRightRear",
@@ -3796,7 +3899,40 @@
],
"key": "OEM_REF_IN_RIGHT_REAR",
"type": "Struct",
- "mandatory": true
+ "mandatory": true,
+ "since": "2.0",
+ "until": "8.0"
+ },
+ {
+ "name": "innerRightRear",
+ "params": [
+ {
+ "name": "status",
+ "key": "OEM_REF_IN_RIGHT_REAR_ST",
+ "type": "ComponentVolumeStatus",
+ "mandatory": true
+ },
+ {
+ "name": "tpms",
+ "key": "OEM_REF_IN_RIGHT_REAR_TMPS",
+ "type": "TPMS",
+ "mandatory": false,
+ "since": "5.0"
+ },
+ {
+ "name": "pressure",
+ "key": "OEM_REF_IN_RIGHT_REAR_PRES",
+ "type": "Float",
+ "mandatory": false,
+ "minvalue": 0,
+ "maxvalue": 2000,
+ "since": "5.0"
+ }
+ ],
+ "key": "OEM_REF_IN_RIGHT_REAR",
+ "type": "Struct",
+ "mandatory": false,
+ "since": "8.0"
}
],
"key": "OEM_REF_TIRE_PRES",
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index ed0e672552..56822db0ef 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -58,6 +58,8 @@ HMICapabilitiesCacheFile = hmi_capabilities_cache.json
MaxCmdID = 2000000000
; SDL respond timeout (in milliseconds) in case of HMI has not respond on a mobile request
DefaultTimeout = 10000
+; Extra time to compensate default timeout due to external delays
+DefaultTimeoutCompensation = 1000
; Available disk space in bytes for each application file handling
; Default value is 100 MiB
AppDirectoryQuota = 104857600
@@ -158,7 +160,7 @@ ListFilesRequest = 5
HelpCommand = Help
[AppInfo]
-; The path for applications info storage.
+; The file name for applications info storage.
AppInfoStorage = app_info.dat
[Security Manager]
@@ -269,7 +271,8 @@ HashStringSize = 32
[SDL4]
; Section for features added in protocol version 4
; Path where apps icons must be stored
-AppIconsFolder = storage
+; Specify a dedicated folder, as old files in this folder can be automatically removed
+AppIconsFolder = icons
; Max size of the folder in bytes
AppIconsFolderMaxSize = 104857600
; Amount of oldest icons to remove in case of max folder size was reached
diff --git a/src/appMain/test/CMakeLists.txt b/src/appMain/test/CMakeLists.txt
index 057e1e9869..c700c5dc57 100644
--- a/src/appMain/test/CMakeLists.txt
+++ b/src/appMain/test/CMakeLists.txt
@@ -41,6 +41,7 @@ set(testSources
set(LIBRARIES
gmock
+ SmartObjects
)
create_test(low_voltage_signals_handler_test "${testSources}" "${LIBRARIES}")
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index c7f2aede9a..6dde632a39 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -175,7 +175,7 @@ list(APPEND LIBRARIES
AMPolicyLibrary
)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
index 9e60183960..dba2579f8f 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
@@ -54,10 +54,6 @@ class AppLaunchDataJson : public AppLaunchDataImpl {
AppLaunchDataJson(const AppLaunchSettings& settings,
resumption::LastStateWrapperPtr last_state_wrapper);
- DEPRECATED
- AppLaunchDataJson(const AppLaunchSettings& settings,
- resumption::LastState& last_state);
-
/**
* @brief allows to destroy AppLaunchDataJson object
*/
@@ -99,10 +95,6 @@ class AppLaunchDataJson : public AppLaunchDataImpl {
int32_t& found_index,
Json::Value& dictionary) const;
- DEPRECATED
- Json::Value& GetApplicationListAndIndex(const ApplicationData& app_data,
- int32_t& founded_index) const;
-
private:
/**
* @brief update time stamp
diff --git a/src/components/application_manager/include/application_manager/app_service_manager.h b/src/components/application_manager/include/application_manager/app_service_manager.h
index 94606909c6..e3a5f64602 100644
--- a/src/components/application_manager/include/application_manager/app_service_manager.h
+++ b/src/components/application_manager/include/application_manager/app_service_manager.h
@@ -65,9 +65,6 @@ class AppServiceManager {
AppServiceManager(ApplicationManager& app_manager,
resumption::LastStateWrapperPtr last_state);
- DEPRECATED AppServiceManager(ApplicationManager& app_manager,
- resumption::LastState& last_state);
-
/**
* @brief Class destructor
*/
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index bc966cd00c..86b26f24ef 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -46,6 +46,7 @@
#include "application_manager/hmi_state.h"
#include "application_manager/message.h"
#include "connection_handler/device.h"
+#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "protocol_handler/protocol_handler.h"
#include "smart_objects/smart_object.h"
@@ -106,6 +107,8 @@ struct AppFile {
mobile_apis::FileType::eType file_type;
};
typedef std::map<std::string, AppFile> AppFilesMap;
+typedef std::map<int32_t, hmi_apis::Common_ButtonName::eType>
+ ButtonSubscriptionsMap;
class InitialApplicationData {
public:
virtual ~InitialApplicationData() {}
@@ -203,6 +206,7 @@ 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* menu_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;
@@ -242,6 +246,8 @@ class DynamicApplicationData {
const smart_objects::SmartObject& keyboard_props) = 0;
virtual void set_menu_title(const smart_objects::SmartObject& menu_title) = 0;
virtual void set_menu_icon(const smart_objects::SmartObject& menu_icon) = 0;
+ virtual void set_menu_layout(
+ const smart_objects::SmartObject& menu_layout) = 0;
virtual uint32_t audio_stream_retry_number() const = 0;
@@ -372,12 +378,6 @@ class DynamicApplicationData {
virtual smart_objects::SmartObject FindSubMenu(uint32_t menu_id) const = 0;
/*
- * @brief Returns true if sub menu with such name already exist
- */
- DEPRECATED virtual bool IsSubMenuNameAlreadyExist(
- const std::string& name, const uint32_t parent_id) = 0;
-
- /*
* @brief Adds a interaction choice set to the application
*
* @param choice_set_id Unique ID used for this interaction choice set
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 a64e0c8f33..086e71b48b 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
@@ -102,6 +102,7 @@ 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* menu_layout() const;
smart_objects::SmartObject day_color_scheme() const OVERRIDE;
smart_objects::SmartObject night_color_scheme() const OVERRIDE;
@@ -141,6 +142,7 @@ class DynamicApplicationDataImpl : public virtual Application {
void set_keyboard_props(const smart_objects::SmartObject& keyboard_props);
void set_menu_title(const smart_objects::SmartObject& menu_title);
void set_menu_icon(const smart_objects::SmartObject& menu_icon);
+ void set_menu_layout(const smart_objects::SmartObject& menu_layout);
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);
@@ -323,6 +325,7 @@ class DynamicApplicationDataImpl : public virtual Application {
smart_objects::SmartObject* keyboard_props_;
smart_objects::SmartObject* menu_title_;
smart_objects::SmartObject* menu_icon_;
+ smart_objects::SmartObject* menu_layout_;
smart_objects::SmartObject* tbt_show_command_;
smart_objects::SmartObjectSPtr display_capabilities_;
AppWindowsTemplates window_templates_;
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 9191a06c6b..c59456a022 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
@@ -53,7 +53,6 @@
#include "application_manager/hmi_interfaces_impl.h"
#include "application_manager/message.h"
#include "application_manager/message_helper.h"
-#include "application_manager/request_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/rpc_handler.h"
#include "application_manager/rpc_service.h"
@@ -121,6 +120,9 @@ enum VRTTSSessionChanging { kVRSessionChanging = 0, kTTSSessionChanging };
typedef std::map<protocol_handler::ServiceType, std::set<uint32_t> >
ServiceStreamingStatusMap;
+typedef std::map<const int32_t, ExpiredButtonRequestData>
+ ExpiredButtonRequestsMap;
+
struct CommandParametersPermissions;
typedef std::map<std::string, hmi_apis::Common_TransportType::eType>
DeviceTypes;
@@ -159,10 +161,6 @@ class ApplicationManagerImpl
const policy::PolicySettings& policy_settings);
~ApplicationManagerImpl();
- DEPRECATED
- bool Init(resumption::LastState&,
- media_manager::MediaManager* media_manager) OVERRIDE;
-
/**
* Inits application manager
*/
@@ -189,8 +187,6 @@ class ApplicationManagerImpl
uint32_t hmi_app_id) const OVERRIDE;
ApplicationSharedPtr application_by_policy_id(
const std::string& policy_app_id) const OVERRIDE;
- DEPRECATED ApplicationSharedPtr
- application_by_name(const std::string& app_name) const OVERRIDE;
ApplicationSharedPtr pending_application_by_policy_id(
const std::string& policy_app_id) const OVERRIDE;
ApplicationSharedPtr reregister_application_by_policy_id(
@@ -690,6 +686,15 @@ class ApplicationManagerImpl
const uint32_t corr_id,
const int32_t function_id) OVERRIDE;
+ bool RetainRequestInstance(const uint32_t connection_key,
+ const uint32_t correlation_id) OVERRIDE;
+
+ bool RemoveRetainedRequest(const uint32_t connection_key,
+ const uint32_t correlation_id) OVERRIDE;
+
+ bool IsStillWaitingForResponse(const uint32_t connection_key,
+ const uint32_t correlation_id) const OVERRIDE;
+
void OnQueryAppsRequest(
const connection_handler::DeviceHandle device) OVERRIDE;
@@ -787,14 +792,14 @@ class ApplicationManagerImpl
*
* @param ptr Reference to shared pointer that point on hmi notification
*/
- void addNotification(const CommandSharedPtr ptr);
+ void AddNotification(const CommandSharedPtr ptr);
/**
* @ Add notification to collection
*
- * @param ptr Reference to shared pointer that point on hmi notification
+ * @param notification Pointer that points to hmi notification
*/
- void removeNotification(const commands::Command* notification);
+ void RemoveNotification(const commands::Command* notification);
/**
* @ Updates request timeout
@@ -803,7 +808,7 @@ class ApplicationManagerImpl
* @param mobile_correlation_id Correlation ID of the mobile request
* @param new_timeout_value New timeout in milliseconds to be set
*/
- void updateRequestTimeout(uint32_t connection_key,
+ void UpdateRequestTimeout(uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value) OVERRIDE;
@@ -853,13 +858,18 @@ class ApplicationManagerImpl
protocol_handler::ServiceType service_type) const OVERRIDE;
/**
- * @brief Ends opened navi services (audio/video) for application
+ * @brief Ends opened navi services audio and video for application
* @param app_id Application id
*/
void EndNaviServices(uint32_t app_id) OVERRIDE;
- DEPRECATED
- void ForbidStreaming(uint32_t app_id) OVERRIDE;
+ /**
+ * @brief Ends opened navi service audio or video for application
+ * @param app_id Application id
+ * @param service_type Service type to check
+ */
+ void EndService(const uint32_t app_id,
+ const protocol_handler::ServiceType service_type) OVERRIDE;
void ForbidStreaming(uint32_t app_id,
protocol_handler::ServiceType service_type) OVERRIDE;
@@ -875,10 +885,6 @@ class ApplicationManagerImpl
protocol_handler::ServiceType service_type,
bool state) OVERRIDE;
- void OnAppStreaming(uint32_t app_id,
- protocol_handler::ServiceType service_type,
- const Application::StreamingState new_state) OVERRIDE;
-
mobile_api::HMILevel::eType GetDefaultHmiLevel(
ApplicationConstSharedPtr application) const;
@@ -999,6 +1005,18 @@ class ApplicationManagerImpl
return *rpc_handler_;
}
+ request_controller::RequestTimeoutHandler& get_request_timeout_handler()
+ const OVERRIDE {
+ DCHECK(request_timeout_handler_);
+ return *request_timeout_handler_;
+ }
+
+ request_controller::RequestController& get_request_controller()
+ const OVERRIDE {
+ DCHECK(request_ctrl_);
+ return *request_ctrl_;
+ }
+
void SetRPCService(std::unique_ptr<rpc_service::RPCService>& rpc_service) {
rpc_service_ = std::move(rpc_service);
}
@@ -1323,10 +1341,12 @@ class ApplicationManagerImpl
const HmiStatePtr to);
/**
- * @brief Starts EndStream timer for a specified application
+ * @brief Starts EndStream timer for a specified application service type
* @param app_id Application to process
+ * @param service_type Type of service to track
*/
- void StartEndStreamTimer(const uint32_t app_id);
+ void StartEndStreamTimer(const uint32_t app_id,
+ const protocol_handler::ServiceType service_type);
/**
* @brief Allows to send appropriate message to mobile device.
@@ -1369,13 +1389,19 @@ class ApplicationManagerImpl
bool ResetVrHelpTitleItems(ApplicationSharedPtr app) const;
private:
- /*
- * NaviServiceStatusMap shows which navi service (audio/video) is opened
- * for specified application. Two bool values in std::pair mean:
- * 1st value - is video service opened or not
- * 2nd value - is audio service opened or not
- */
- typedef std::map<uint32_t, std::pair<bool, bool> > NaviServiceStatusMap;
+ struct NaviServiceStatusDescriptor {
+ bool is_video_service_active_;
+ bool is_audio_service_active_;
+ };
+
+ struct NaviServiceDescriptor {
+ uint32_t app_id_;
+ protocol_handler::ServiceType service_type_;
+ TimerSPtr timer_to_stop_service_;
+ };
+
+ typedef std::map<uint32_t, NaviServiceStatusDescriptor> NaviServiceStatusMap;
+ typedef std::deque<NaviServiceDescriptor> NaviServicesDequeue;
/**
* @brief GetHashedAppID allows to obtain unique application id as a string.
@@ -1415,10 +1441,9 @@ class ApplicationManagerImpl
/**
* @brief Suspends streaming ability of application in case application's HMI
- * level
- * has been changed to not allowed for streaming
+ * level has been changed to not allowed for streaming
*/
- void EndNaviStreaming();
+ void EndStreaming();
/**
* @brief Starts specified navi service for application
@@ -1451,8 +1476,10 @@ class ApplicationManagerImpl
* @brief Disallows streaming for application, but doesn't close
* opened services. Streaming ability could be restored by AllowStreaming();
* @param app_id Application to proceed
+ * @param service_type Type of service to disallow
*/
- void DisallowStreaming(uint32_t app_id);
+ void DisallowStreaming(const uint32_t app_id,
+ const protocol_handler::ServiceType service_type);
/**
* @brief Types of directories used by Application Manager
@@ -1544,6 +1571,16 @@ class ApplicationManagerImpl
static std::vector<std::string> ConvertRejectedParamList(
const std::vector<std::string>& input);
+ void AddExpiredButtonRequest(
+ const uint32_t app_id,
+ const int32_t corr_id,
+ const hmi_apis::Common_ButtonName::eType button_name) OVERRIDE;
+
+ utils::Optional<ExpiredButtonRequestData> GetExpiredButtonRequestData(
+ const int32_t corr_id) const OVERRIDE;
+
+ void DeleteExpiredButtonRequest(const int32_t corr_id) OVERRIDE;
+
private:
const ApplicationManagerSettings& settings_;
/**
@@ -1602,8 +1639,10 @@ class ApplicationManagerImpl
connection_handler::ConnectionHandler* connection_handler_;
std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
+ std::unique_ptr<request_controller::RequestTimeoutHandler>
+ request_timeout_handler_;
+ std::unique_ptr<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_;
/**
@@ -1646,19 +1685,21 @@ class ApplicationManagerImpl
HmiInterfacesImpl hmi_interfaces_;
- NaviServiceStatusMap navi_service_status_;
sync_primitives::Lock navi_service_status_lock_;
- std::deque<uint32_t> navi_app_to_stop_;
+ NaviServiceStatusMap navi_service_status_;
+
sync_primitives::Lock navi_app_to_stop_lock_;
- std::deque<uint32_t> navi_app_to_end_stream_;
+ NaviServicesDequeue navi_app_to_stop_;
+
+ sync_primitives::Lock navi_app_to_end_stream_lock_;
+ NaviServicesDequeue navi_app_to_end_stream_;
+
+ sync_primitives::Lock streaming_timer_pool_lock_;
+ std::vector<TimerSPtr> streaming_timer_pool_;
+
uint32_t navi_close_app_timeout_;
uint32_t navi_end_stream_timeout_;
- std::vector<TimerSPtr> close_app_timer_pool_;
- std::vector<TimerSPtr> end_stream_timer_pool_;
- sync_primitives::Lock close_app_timer_pool_lock_;
- sync_primitives::Lock end_stream_timer_pool_lock_;
-
mutable sync_primitives::Lock wait_for_hmi_lock_;
sync_primitives::ConditionalVariable wait_for_hmi_condvar_;
@@ -1705,6 +1746,9 @@ class ApplicationManagerImpl
ServiceStreamingStatusMap streaming_application_services_;
sync_primitives::Lock streaming_services_lock_;
+ mutable sync_primitives::Lock expired_button_requests_lock_;
+ mutable ExpiredButtonRequestsMap expired_button_requests_;
+
#ifdef BUILD_TESTS
public:
/**
diff --git a/src/components/application_manager/include/application_manager/commands/button_notification_to_mobile.h b/src/components/application_manager/include/application_manager/commands/button_notification_to_mobile.h
new file mode 100644
index 0000000000..66a2683133
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/button_notification_to_mobile.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2021, 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_COMMANDS_BUTTON_NOTIFICATION_TO_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_BUTTON_NOTIFICATION_TO_MOBILE_H_
+
+#include "application_manager/application.h"
+#include "command_notification_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief Class is intended to encapsulate shared button notification logic in
+ * base class. Entities defined in this file do not conform to any version of
+ * HMI or mobile API, and exist only to remove duplication in OnButtonPress and
+ * OnButtonEvent notifications.
+ **/
+class ButtonNotificationToMobile
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief ButtonNotificationToMobile class constructor
+ **/
+ ButtonNotificationToMobile(
+ 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 ButtonNotificationToMobile class destructor
+ **/
+ ~ButtonNotificationToMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ protected:
+ virtual void SendButtonNotification(app_mngr::ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief HandleCustomButton handle event for custom buttons
+ * @param app pointer to application data.
+ **/
+ void HandleCustomButton(app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief HandleOKButton handle event for OK button
+ * @param app pointer to application data.
+ **/
+ void HandleOKButton(app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief HandleMediaButton handle event for media buttons
+ * @param app pointer to application data.
+ **/
+ void HandleMediaButton(app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief DoesParamExist check whether param is exists in msg_params
+ * @param param_name name of parameter to find
+ **/
+ bool DoesParamExist(const std::string& param_name) const;
+
+ /**
+ * @brief SubscribedApps get subscribed apps for btn id received in message
+ * @return Return applications list subscribed to current button
+ **/
+ std::vector<ApplicationSharedPtr> SubscribedApps() const;
+};
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_BUTTON_NOTIFICATION_TO_MOBILE_H_
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 a7241ce16d..f8bc66df2a 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -115,7 +115,14 @@ class Command {
* has exceed it's limit
*
*/
- virtual void onTimeOut() = 0;
+ virtual void HandleTimeOut() = 0;
+
+ /**
+ * @brief Function is called by RequestInfo when request controller
+ * updates request timeout
+ * Function sets request state to "AwaitingResponse"
+ */
+ virtual void OnUpdateTimeOut() = 0;
/**
* @brief AllowedToTerminate tells if request controller is allowed
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 e3e30a9eff..534f07aa37 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
@@ -40,6 +40,8 @@
#include "policy/policy_types.h"
#include "utils/logger.h"
+#include <algorithm>
+
namespace application_manager {
/**
@@ -50,9 +52,40 @@ struct CommandParametersPermissions {
RPCParams allowed_params;
RPCParams disallowed_params;
RPCParams undefined_params;
+
+ bool AreDisallowedParamsIncluded(const RPCParams& parameters) {
+ return std::includes(disallowed_params.begin(),
+ disallowed_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
+
+ bool AreUndefinedParamsIncluded(const RPCParams& parameters) {
+ return std::includes(undefined_params.begin(),
+ undefined_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
};
namespace commands {
+
+/**
+ * @brief Checks Mobile result code for single RPC
+ * @param result_code contains result code from response to Mobile
+ * @return true if result code complies to successful result codes,
+ * false otherwise.
+ */
+bool IsMobileResultSuccess(const mobile_apis::Result::eType result_code);
+
+/**
+ * @brief Checks HMI result code for single RPC
+ * @param result_code contains result code from HMI response
+ * @return true if result code complies to successful result codes,
+ * false otherwise.
+ */
+bool IsHMIResultSuccess(const hmi_apis::Common_Result::eType result_code);
+
/**
* @brief Class is intended to encapsulate RPC as an object
**/
@@ -131,7 +164,7 @@ class CommandImpl : public Command {
* has exceed it's limit
*
*/
- void onTimeOut() OVERRIDE;
+ void HandleTimeOut() OVERRIDE;
/**
* @brief AllowedToTerminate tells request Controller if it can terminate this
@@ -149,6 +182,8 @@ class CommandImpl : public Command {
*/
void SetAllowedToTerminate(const bool allowed) OVERRIDE;
+ void OnUpdateTimeOut() OVERRIDE;
+
/**
* @brief Calculates command`s internal consecutive number
* for specified application used during resumption.
@@ -167,6 +202,16 @@ class CommandImpl : public Command {
*/
bool CheckSyntax(const std::string& str, bool allow_empty_line = false) const;
+ /**
+ * @brief Checks HMI result code for single RPC
+ * @param result_code contains result code from HMI response
+ * @param interface to check availability
+ * @return true if result code complies to successful result codes,
+ * false otherwise.
+ */
+ bool IsHMIResultSuccess(hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const;
+
// members
static const int32_t hmi_protocol_type_;
static const int32_t mobile_protocol_type_;
@@ -183,6 +228,29 @@ class CommandImpl : public Command {
bool CheckAllowedParameters(const Command::CommandSource source);
/**
+ * @brief Adds disallowed parameters back to response with appropriate
+ * reasons
+ * @param response Response message, which should be extended with blocked
+ * parameters reasons
+ */
+ void AddDisallowedParameters(smart_objects::SmartObject& response);
+
+ /**
+ * @brief Adds disallowed parameters to response info
+ * @param response Response message, which info should be extended
+ */
+ void AddDisallowedParametersToInfo(
+ smart_objects::SmartObject& response) const;
+
+ /**
+ * @brief Adds param to disallowed parameters enumeration
+ * @param info string with disallowed params enumeration
+ * @param param disallowed param
+ */
+ void AddDisallowedParameterToInfoString(std::string& info,
+ const std::string& param) const;
+
+ /**
* @brief Remove from current message parameters disallowed by policy table
*/
void RemoveDisallowedParameters();
@@ -201,6 +269,13 @@ class CommandImpl : public Command {
*/
bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message);
+ /**
+ * @brief Adds disallowed parameters to info string, sets result codes if
+ * necessary
+ * @param response Command smart object
+ */
+ void FormatResponse(smart_objects::SmartObject& response);
+
MessageSharedPtr message_;
uint32_t default_timeout_;
bool allowed_to_terminate_;
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
index 87c19ca1d1..97e2dce0eb 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2016, Ford Motor Company
All rights reserved.
@@ -33,196 +33,104 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+#include <memory>
+
+#include "application_manager/application_manager.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/smart_object.h"
#include "utils/lock.h"
namespace application_manager {
-namespace commands {
-
-struct ResponseInfo {
- ResponseInfo();
- ResponseInfo(const hmi_apis::Common_Result::eType result,
- const HmiInterfaces::InterfaceID hmi_interface,
- ApplicationManager& application_manager);
- hmi_apis::Common_Result::eType result_code;
- HmiInterfaces::InterfaceID interface;
- HmiInterfaces::InterfaceState interface_state;
- bool is_ok;
- bool is_unsupported_resource;
- bool is_not_used;
-};
-
-namespace ns_smart = ns_smart_device_link::ns_smart_objects;
-
-/**
- * @brief MergeInfos merge 2 infos in one string
- * @param first - info string that should be first in result info
- * @param second - info string that should be second in result info
- * @return if first is empty return second
- * if second is empty return first
- * if both are empty return empty string
- * if both are not empty return empty first +", " + second
- */
-std::string MergeInfos(const std::string& first, const std::string& second);
-
-/**
- * @brief MergeInfos merge 2 infos into one string with info
- * @param first_info -contains result_code from HMI response and
- * interface that returns response
- * @param first_str - info string that should be first in result info
- * @param second_info -contains result_code from HMI response and
- * interface that returns response
- * @param second_str - info string that should be second in result info
- * @return if first_info is not available and second_str not empty return second
- * if second_info is not available and first_str not empty return first
- * other cases return result MergeInfos for 2 params
- */
-std::string MergeInfos(const ResponseInfo& first_info,
- const std::string& first_str,
- const ResponseInfo& second_info,
- const std::string& second_str);
+namespace commands {
/**
- * @brief MergeInfos merge 3 infos in one string
- * @param first - info string that should be first in result info
- * @param second - info string that should be second in result info
- * @param third - info string that should be second in result info
- * @return resulting string contain merge all incoming parameters
- */
-std::string MergeInfos(const std::string& first,
- const std::string& second,
- const std::string& third);
-
+ * @brief Class is intended to encapsulate RPC as an object
+ **/
class CommandRequestImpl : public CommandImpl,
public event_engine::EventObserver {
public:
- enum RequestState { kAwaitingHMIResponse = 0, kTimedOut, kCompleted };
+ enum RequestState {
+ kAwaitingResponse = 0,
+ kTimedOut,
+ kProcessEvent,
+ };
/**
- * @brief The HashUpdateMode enum defines whether request has to update
- * hash after its execution is finished
- */
- enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate };
-
+ * @brief CommandRequestImpl class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
CommandRequestImpl(const MessageSharedPtr& message,
ApplicationManager& application_manager,
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler);
- ~CommandRequestImpl();
-
- /**
- * @brief Checks command permissions according to policy table
- */
- bool CheckPermissions() OVERRIDE;
-
/**
- * @brief Init sets hash update mode for request
- */
- bool Init() OVERRIDE;
+ * @brief CommandRequestImpl class destructor
+ *
+ **/
+ virtual ~CommandRequestImpl();
/**
- * @brief Cleanup all resources used by command
+ * @brief Send request to mobile
+ * @param function_id Function id
+ * @param msg Request to mobile
+ * @param use_event - true if request should be subscribed to an event,
+ * otherwise false
**/
- bool CleanUp() OVERRIDE;
+ void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id,
+ smart_objects::SmartObjectSPtr msg,
+ bool use_events);
/**
* @brief Execute corresponding command by calling the action on reciever
**/
void Run() OVERRIDE;
+ virtual void on_event(const event_engine::MobileEvent& event);
+
/*
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*
*/
- virtual void onTimeOut();
+ void HandleTimeOut() FINAL;
/**
* @brief Default EvenObserver's pure virtual method implementation
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
-
- virtual void on_event(const event_engine::MobileEvent& event);
+ void HandleOnEvent(const event_engine::Event& event) FINAL;
- /*
- * @brief Creates Mobile response
+ /**
+ * @brief Default EvenObserver's pure virtual method implementation
*
- * @param success true if successful; false, if failed
- * @param result_code Result code (SUCCESS, INVALID_DATA, e.t.c)
- * @param info Provides additional human readable info regarding the result
- * @param response_params Additional params in response
+ * @param event The received event
*/
- void SendResponse(
- const bool success,
- const mobile_apis::Result::eType& result_code,
- const char* info = NULL,
- const smart_objects::SmartObject* response_params = NULL,
- const std::vector<uint8_t> binary_data = std::vector<uint8_t>());
-
- void SendProviderRequest(
- const mobile_apis::FunctionID::eType& mobile_function_id,
- const hmi_apis::FunctionID::eType& hmi_function_id,
- const smart_objects::SmartObject* msg,
- bool use_events = false);
-
- void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id,
- smart_objects::SmartObjectSPtr msg,
- bool use_events = false);
+ void HandleOnEvent(const event_engine::MobileEvent& event) FINAL;
- /*
- * @brief Sends HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- * @param use_events true if we need subscribe on event(HMI request)
- * @return hmi correlation id
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceeded its limit
+ * @note default value is required as a lot of requests don't use it
+ * as they use automatically generated reason
*/
- uint32_t SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject* msg_params = NULL,
- bool use_events = false);
+ virtual void OnTimeOut();
- /*
- * @brief Creates HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- */
- void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
- const ns_smart::SmartObject& msg_params) const;
+ virtual void on_event(const event_engine::Event&);
- /**
- * @brief Converts HMI result code to Mobile result code
- *
- * @param hmi_code HMI result code
- * @return Mobile result code
- */
- mobile_apis::Result::eType GetMobileResultCode(
- const hmi_apis::Common_Result::eType& hmi_code) const;
+ void OnUpdateTimeOut() OVERRIDE;
- /**
- * @brief Checks Mobile result code for single RPC
- * @param result_code contains result code from response to Mobile
- * @return true if result code complies to successful result codes,
- * false otherwise.
- */
- static bool IsMobileResultSuccess(
- const mobile_apis::Result::eType result_code);
+ bool IncrementReferenceCount() const OVERRIDE;
- /**
- * @brief Checks HMI result code for single RPC
- * @param result_code contains result code from HMI response
- * @return true if result code complies to successful result codes,
- * false otherwise.
- */
- static bool IsHMIResultSuccess(
- const hmi_apis::Common_Result::eType result_code);
+ bool DecrementReferenceCount() const OVERRIDE;
protected:
/**
@@ -235,125 +143,50 @@ class CommandRequestImpl : public CommandImpl,
bool CheckAllowedParameters(const Command::CommandSource source);
/**
- * @brief Checks HMI capabilities for specified button support
- * @param button Button to check
- * @return true if button is present in HMI capabilities
- * otherwise returns false
- */
- bool CheckHMICapabilities(const mobile_apis::ButtonName::eType button) const;
-
- /**
- * @brief Adds disallowed parameters back to response with appropriate
- * reasons
- * @param response Response message, which should be extended with blocked
- * parameters reasons
- */
- void AddDisallowedParameters(smart_objects::SmartObject& response);
-
- /**
- * @brief Checks if any request param was marked as disallowed by policy
- * @return true if any param was marked as disallowed
- */
- bool HasDisallowedParams() const;
-
- /**
- * @brief Checks result code from HMI for single RPC
- * and returns parameter for sending to mobile app.
- * @param result_code contains result code from HMI response
- * @param interface contains interface for which HMI sent response
- * @return true if result code complies successful result cods
- * otherwise returns false.
- */
- bool PrepareResultForMobileResponse(
- hmi_apis::Common_Result::eType result_code,
- HmiInterfaces::InterfaceID interface) const;
-
- /**
- * @brief Checks result code from HMI for splitted RPC
- * and returns parameter for sending to mobile app.
- * @param first contains result_code from HMI response and
- * interface that returns response
- * @param second contains result_code from HMI response and
- * interface that returns response
- * @return true if result code complies successful result code
- * otherwise returns false
- */
- bool PrepareResultForMobileResponse(ResponseInfo& out_first,
- ResponseInfo& out_second) const;
-
- /**
- * @brief If message from HMI contains returns this info
- * or process result code from HMI and checks state of interface
- * and create info.
- * @param interface contains interface for which HMI sent response
- * @param result_code contains result code from HMI
- * @param response_from_hmi contains response from HMI
- * @param out_info contain info for sending to application
+ * @brief Adds interface to be awaited by SDL request
+ * @param interface_id interface from which SDL expects response in given time
*/
- void GetInfo(const smart_objects::SmartObject& response_from_hmi,
- std::string& out_info);
+ void StartAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
/**
- * @brief Prepare result code for sending to mobile application
- * @param first contains result_code from HMI response and
- * interface that returns response
- * @param second contains result_code from HMI response and
- * interface that returns response.
- * @return resulting code for sending to mobile application.
+ * @brief Gets interface awaiting state.
+ * @param interface_id interface which SDL awaits for response in given time
+ * @return true if SDL awaits for response from given interface in
+ * interface_id
*/
- mobile_apis::Result::eType PrepareResultCodeForResponse(
- const ResponseInfo& first, const ResponseInfo& second);
+ bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const;
/**
- * @brief Resolves if the return code must be
- * UNSUPPORTED_RESOURCE
- * @param first contains result_code from HMI response and
- * interface that returns response
- * @param second contains result_code from HMI response and
- * interface that returns response.
- * @return True, if the communication return code must be
- * UNSUPPORTED_RESOURCE, otherwise false.
+ * @brief Stops SDL awaiting from given HMI interface
+ * @param interface_id interface from which SDL no longer awaits
+ * for response in given time
*/
- bool IsResultCodeUnsupported(const ResponseInfo& first,
- const ResponseInfo& second) const;
+ void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
/**
- * @brief CheckResult checks whether the overall result
- * of the responses is successful
- * @param first response
- * @param second response
- * @return true if the overall result is successful
- * otherwise - false
+ * @brief Checks if there some not delivered hmi responses exist
+ * @return true if pending responses exist, otherwise - false
*/
- bool CheckResult(const ResponseInfo& first, const ResponseInfo& second) const;
+ bool IsPendingResponseExist() const;
- protected:
/**
- * @brief Returns policy parameters permissions
- * @return Parameters permissions struct reference
+ * @brief Checks if there some not delivered hmi responses exist
+ * @return true if pending responses exist, otherwise - false
*/
- const CommandParametersPermissions& parameters_permissions() const;
-
- /**
- * @brief Adds interface to be awaited for by sdl request command
- @param interface_id interface which SDL expects to response in given time
- */
- void StartAwaitForInterface(const HmiInterfaces::InterfaceID interface_id);
/**
- * @brief Gets interface await state.
- * @param interface_id interface which SDL awaits for response in given time
- * @return true if SDL awaits for response from given interface in
- * interface_id
+ * @brief Returns current state of request
+ * @return current request state. E.g. kAwaitingResponse, kTimedOut,
+ * kResponded
*/
- bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const;
+ virtual RequestState current_state() const;
/**
- * @brief Sets given HMI interface await status to false
- * @param interface_id interface which SDL no longer awaits for response in
- * given time
+ * @brief Sets current state of request
+ * @param request state to set. E.g. kAwaitingResponse, kTimedOut,
+ * kResponded
*/
- void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
+ virtual void set_current_state(const RequestState state);
/**
* @brief This set stores all the interfaces which are awaited by SDL to
@@ -363,60 +196,33 @@ class CommandRequestImpl : public CommandImpl,
mutable sync_primitives::Lock awaiting_response_interfaces_lock_;
- RequestState current_state_;
- sync_primitives::Lock state_lock_;
-
- /**
- * @brief hash_update_mode_ Defines whether request must update hash value of
- * application or not
- */
- HashUpdateMode hash_update_mode_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
-
/**
- * @brief Adds param to disallowed parameters enumeration
- * @param info string with disallowed params enumeration
- * @param param disallowed param
+ * @brief This lock is used to guarantee thread safe access to request state
*/
- void AddDisallowedParameterToInfoString(std::string& info,
- const std::string& param) const;
+ mutable sync_primitives::RecursiveLock state_lock_;
/**
- * @brief Adds disallowed parameters to response info
- * @param response Response message, which info should be extended
+ * @brief Current state of request to synchronize its life cycle
*/
- void AddDisallowedParametersToInfo(
- smart_objects::SmartObject& response) const;
-
- bool ProcessHMIInterfacesAvailability(
- const uint32_t hmi_correlation_id,
- const hmi_apis::FunctionID::eType& function_id);
+ RequestState current_state_;
- /**
- * @brief UpdateHash updates hash field for application and sends
- * OnHashChanged notification to mobile side in case of approriate hash mode
- * is set
- */
- void UpdateHash();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
/**
- * @brief is_success_result_ Defines whether request succeded, at the moment
- * it is value of 'success' field of appropriate response sent to mobile
+ * @brief Changes request state to "kProcessEvent", retain request instance
+ * @return false if request is not ready to handle event right now.
+ * If request is succesfully retained returns true
*/
- bool is_success_result_;
+ bool StartOnEventHandling();
/**
- * @brief Add information for the component of response in case of timeout
- * @param response Response message, which info should be extended
+ * @brief Changes request state to "kAwaitingResponse", removes request
+ * instance retained before
*/
- void AddTimeOutComponentInfoToMessage(
- smart_objects::SmartObject& response) const;
+ void FinalizeOnEventHandling();
};
} // namespace commands
-
} // namespace application_manager
-
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
index 4464056175..c4fd25f5e0 100644
--- a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
-#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/command_request_impl.h"
#include "interfaces/HMI_API.h"
#include "smart_objects/smart_object.h"
@@ -43,7 +43,7 @@ namespace commands {
namespace ns_smart = ns_smart_device_link::ns_smart_objects;
-class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
+class RequestFromHMI : public CommandRequestImpl {
public:
RequestFromHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager,
@@ -54,8 +54,11 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
virtual bool Init();
virtual bool CleanUp();
virtual void Run();
- virtual void on_event(const event_engine::Event& event);
+
+ void on_event(const event_engine::Event& event);
void on_event(const event_engine::MobileEvent& event) OVERRIDE;
+ void OnTimeOut() OVERRIDE;
+
/**
* @brief SendResponse allows to send response to hmi
* @param correlation_id the correlation id for the rfesponse.
@@ -91,7 +94,7 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
const mobile_apis::FunctionID::eType& mobile_function_id,
const hmi_apis::FunctionID::eType& hmi_function_id,
const smart_objects::SmartObject* msg,
- bool use_events = false);
+ bool use_events);
void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id,
const ApplicationSharedPtr app,
@@ -106,12 +109,6 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
const uint32_t hmi_correlation_id,
const hmi_apis::FunctionID::eType& function_id);
- protected:
- bool IsMobileResultSuccess(mobile_apis::Result::eType result_code) const;
-
- bool IsHMIResultSuccess(hmi_apis::Common_Result::eType result_code,
- HmiInterfaces::InterfaceID interface) const;
-
private:
/**
* @brief Fills common parameters for SO
diff --git a/src/components/application_manager/include/application_manager/commands/request_from_mobile_impl.h b/src/components/application_manager/include/application_manager/commands/request_from_mobile_impl.h
new file mode 100644
index 0000000000..e4f0bed223
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/request_from_mobile_impl.h
@@ -0,0 +1,372 @@
+/*
+ Copyright (c) 2020, 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_COMMANDS_REQUEST_FROM_MOBILE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_MOBILE_IMPL_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
+
+namespace application_manager {
+namespace commands {
+
+struct ResponseInfo {
+ ResponseInfo();
+ ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager);
+ hmi_apis::Common_Result::eType result_code;
+ HmiInterfaces::InterfaceID interface;
+ HmiInterfaces::InterfaceState interface_state;
+ bool is_ok;
+ bool is_unsupported_resource;
+ bool is_not_used;
+};
+
+/**
+ * @brief MergeInfos merge 2 infos in one string
+ * @param first - info string that should be first in result info
+ * @param second - info string that should be second in result info
+ * @return if first is empty return second
+ * if second is empty return first
+ * if both are empty return empty string
+ * if both are not empty return empty first +", " + second
+ */
+std::string MergeInfos(const std::string& first, const std::string& second);
+
+/**
+ * @brief MergeInfos merge 2 infos into one string with info
+ * @param first_info -contains result_code from HMI response and
+ * interface that returns response
+ * @param first_str - info string that should be first in result info
+ * @param second_info -contains result_code from HMI response and
+ * interface that returns response
+ * @param second_str - info string that should be second in result info
+ * @return if first_info is not available and second_str not empty return second
+ * if second_info is not available and first_str not empty return first
+ * other cases return result MergeInfos for 2 params
+ */
+std::string MergeInfos(const ResponseInfo& first_info,
+ const std::string& first_str,
+ const ResponseInfo& second_info,
+ const std::string& second_str);
+
+/**
+ * @brief MergeInfos merge 3 infos in one string
+ * @param first - info string that should be first in result info
+ * @param second - info string that should be second in result info
+ * @param third - info string that should be second in result info
+ * @return resulting string contain merge all incoming parameters
+ */
+std::string MergeInfos(const std::string& first,
+ const std::string& second,
+ const std::string& third);
+
+class RequestFromMobileImpl : public CommandRequestImpl {
+ public:
+ /**
+ * @brief The HashUpdateMode enum defines whether request has to update
+ * hash after its execution is finished
+ */
+ enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate };
+
+ RequestFromMobileImpl(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief RequestFromMobileImpl class destructor
+ *
+ **/
+ virtual ~RequestFromMobileImpl();
+
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ bool CheckPermissions() OVERRIDE;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Cleanup all resources used by command
+ **/
+ bool CleanUp() OVERRIDE;
+
+ /**
+ * @brief Execute corresponding command by calling the action on reciever
+ **/
+ void Run() OVERRIDE;
+
+ void on_event(const event_engine::Event& event) OVERRIDE;
+ void on_event(const event_engine::MobileEvent& event) OVERRIDE;
+
+ void OnTimeOut() OVERRIDE;
+
+ void SendProviderRequest(
+ const mobile_apis::FunctionID::eType& mobile_function_id,
+ const hmi_apis::FunctionID::eType& hmi_function_id,
+ const smart_objects::SmartObject* msg,
+ bool use_events);
+
+ /*
+ * @brief Creates Mobile response
+ *
+ * @param success true if successful; false, if failed
+ * @param result_code Result code (SUCCESS, INVALID_DATA, e.t.c)
+ * @param info Provides additional human readable info regarding the result
+ * @param response_params Additional params in response
+ */
+ void SendResponse(
+ const bool success,
+ const mobile_apis::Result::eType& result_code,
+ const char* info = NULL,
+ const smart_objects::SmartObject* response_params = NULL,
+ const std::vector<uint8_t> binary_data = std::vector<uint8_t>());
+ /*
+ * @brief Sends HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ * @param use_events true if we need subscribe on event(HMI request)
+ * @return hmi correlation id
+ */
+ uint32_t SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params = NULL,
+ bool use_events = false);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMINotification(
+ const hmi_apis::FunctionID::eType& function_id,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& msg_params)
+ const;
+
+ /**
+ * @brief Converts HMI result code to Mobile result code
+ *
+ * @param hmi_code HMI result code
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const;
+
+ protected:
+ /**
+ * @brief Checks HMI capabilities for specified button support
+ * @param button Button to check
+ * @return true if button is present in HMI capabilities
+ * otherwise returns false
+ */
+ bool CheckHMICapabilities(const mobile_apis::ButtonName::eType button) const;
+
+ /**
+ * @brief Remove from current message parameters disallowed by policy table
+ */
+ void RemoveDisallowedParameters();
+
+ /**
+ * @brief Checks if any request param was marked as disallowed by policy
+ * @return true if any param was marked as disallowed
+ */
+ bool HasDisallowedParams() const;
+
+ /**
+ * @brief Checks result code from HMI for single RPC
+ * and returns parameter for sending to mobile app.
+ * @param result_code contains result code from HMI response
+ * @param interface contains interface for which HMI sent response
+ * @return true if result code complies successful result code
+ * otherwise returns false.
+ */
+ bool PrepareResultForMobileResponse(
+ hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app.
+ * @param out_first contains result_code from HMI response and
+ * interface that returns response
+ * @param out_second contains result_code from HMI response and
+ * interface that returns response
+ * @return true if result code complies successful result code
+ * otherwise returns false
+ */
+ bool PrepareResultForMobileResponse(ResponseInfo& out_first,
+ ResponseInfo& out_second) const;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app.
+ * @param out_first Contains result_code from HMI response and
+ * interface that returns response
+ * @param out_second Contains result_code from HMI response and
+ * interface that returns response
+ * @param out_third Contains result_code from HMI response and
+ * interface that returns response
+ * @return true if result code complies successful result code
+ * otherwise returns false
+ */
+ bool PrepareResultForMobileResponse(ResponseInfo& out_first,
+ ResponseInfo& out_second,
+ ResponseInfo& out_third) const;
+
+ /**
+ * @brief If message from HMI contains returns this info
+ * or process result code from HMI and checks state of interface
+ * and create info.
+ * @param response_from_hmi contains response from HMI
+ * @param out_info contain info for sending to application
+ */
+ void GetInfo(const smart_objects::SmartObject& response_from_hmi,
+ std::string& out_info) const;
+
+ /**
+ * @brief Prepare result code for sending to mobile application
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response.
+ * @return resulting code for sending to mobile application.
+ */
+ mobile_apis::Result::eType PrepareResultCodeForResponse(
+ const ResponseInfo& first, const ResponseInfo& second);
+
+ /**
+ * @brief Prepare result code for sending to mobile application
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response.
+ * @return resulting code for sending to mobile application.
+ */
+ mobile_apis::Result::eType PrepareResultCodeForResponse(
+ const ResponseInfo& first,
+ const ResponseInfo& second,
+ const ResponseInfo& third);
+
+ /**
+ * @brief Resolves if the return code must be
+ * UNSUPPORTED_RESOURCE
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response.
+ * @return True, if the communication return code must be
+ * UNSUPPORTED_RESOURCE, otherwise false.
+ */
+ bool IsResultCodeUnsupported(const ResponseInfo& first,
+ const ResponseInfo& second) const;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app.
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response
+ * @return true if result code complies successful result code
+ * otherwise returns false
+ */
+ bool CheckResultCode(const ResponseInfo& first,
+ const ResponseInfo& second) const;
+
+ /**
+ * @brief Returns policy parameters permissions
+ * @return Parameters permissions struct reference
+ */
+ const CommandParametersPermissions& parameters_permissions() const;
+
+ /**
+ * @brief hash_update_mode_ Defines whether request must update hash value of
+ * application or not
+ */
+ HashUpdateMode hash_update_mode_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestFromMobileImpl);
+
+ /**
+ * @brief Checks if HMI interface is available for the target function
+ * @param hmi_correlation_id HMI correlation id
+ * @param function_id Response message, which info should be extended
+ */
+ bool ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id);
+
+ /**
+ * @brief UpdateHash updates hash field for application and sends
+ * OnHashChanged notification to mobile side in case of approriate hash mode
+ * is set
+ */
+ void UpdateHash();
+
+ /**
+ * @brief Add information for the component of response in case of timeout
+ * @param response Response message, which info should be extended
+ */
+ void AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const;
+
+ /**
+ * @brief AddRequestToTimeoutHandler checks the request and adds it to
+ * request_timeout_handler map for tracking
+ * @param request_to_hmi request to HMI
+ */
+ void AddRequestToTimeoutHandler(
+ const smart_objects::SmartObject& request_to_hmi) const;
+
+ /**
+ * @brief is_success_result_ Defines whether request succeded, at the moment
+ * it is value of 'success' field of appropriate response sent to mobile
+ */
+ bool is_success_result_;
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_MOBILE_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
index 3057476937..78c8281a03 100644
--- a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
@@ -35,6 +35,7 @@
#include "application_manager/application_manager.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/command_request_impl.h"
namespace application_manager {
@@ -61,7 +62,7 @@ bool ChangeInterfaceState(ApplicationManager& application_manager,
const smart_objects::SmartObject& response_from_hmi,
HmiInterfaces::InterfaceID interface);
-class RequestToHMI : public CommandImpl {
+class RequestToHMI : public CommandRequestImpl {
public:
RequestToHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager,
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
index 0656372f47..b232875f43 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
@@ -64,6 +64,15 @@ class EventDispatcher {
/*
* @brief Unsubscribes the observer from specific event
*
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ */
+ virtual void remove_observer(const Event::EventID& event_id,
+ const int32_t hmi_correlation_id) = 0;
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
* @param event_id The event ID to unsubscribe from
* @param observer The observer to be unsubscribed
*/
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
index 3644299499..ffe659a07c 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
@@ -83,6 +83,9 @@ class EventDispatcherImpl : public EventDispatcher {
*/
void raise_event(const Event& event) OVERRIDE;
+ void remove_observer(const Event::EventID& event_id,
+ const int32_t hmi_correlation_id) OVERRIDE;
+
/*
* @brief Subscribe the observer to event
*
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
index 1f4eccaf46..0ebf90133e 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_observer.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
@@ -70,9 +70,23 @@ class EventObserver {
*
* @param event The received event
*/
- virtual void on_event(const Event& event) = 0;
+ virtual void HandleOnEvent(const Event& event) = 0;
- virtual void on_event(const MobileEvent& event);
+ virtual void HandleOnEvent(const MobileEvent& event);
+
+ /**
+ * @brief Increments reference count to avoid observer destruction while
+ * event dispatcher keeping pointer to that observer
+ * @return true if request reference was incremented, otherwise returns false
+ */
+ virtual bool IncrementReferenceCount() const;
+
+ /**
+ * @brief Decrements reference count to allow observer be safely destroyed
+ * as event dispatcher does not keep any pointers to it
+ * @return true if request reference was decremented, otherwise returns false
+ */
+ virtual bool DecrementReferenceCount() const;
protected:
/*
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 f646c66ca1..9a22b2a4aa 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
@@ -257,9 +257,6 @@ class HMICapabilitiesImpl : public HMICapabilities {
void Init(resumption::LastStateWrapperPtr last_state_wrapper) OVERRIDE;
- DEPRECATED
- void Init(resumption::LastState* last_state) OVERRIDE;
-
HMILanguageHandler& get_hmi_language_handler() OVERRIDE;
void set_handle_response_for(
diff --git a/src/components/application_manager/include/application_manager/hmi_language_handler.h b/src/components/application_manager/include/application_manager/hmi_language_handler.h
index 2ef034450d..10ae1f8967 100644
--- a/src/components/application_manager/include/application_manager/hmi_language_handler.h
+++ b/src/components/application_manager/include/application_manager/hmi_language_handler.h
@@ -78,7 +78,7 @@ class HMILanguageHandler : public event_engine::EventObserver {
*/
hmi_apis::Common_Language::eType get_language_for(Interface interface) const;
- void on_event(const event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(const event_engine::Event& event) OVERRIDE;
/**
* @brief Trigger waiting for response
@@ -96,9 +96,6 @@ class HMILanguageHandler : public event_engine::EventObserver {
hmi_apis::Common_Language::eType vr,
hmi_apis::Common_Language::eType tts);
- DEPRECATED
- void Init(resumption::LastState*);
-
void Init(resumption::LastStateWrapperPtr value);
/**
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 e3a9784346..8271edcbd8 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -434,13 +434,11 @@ class PhoneCallHmiState : public HmiState {
PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
- mobile_apis::HMILevel::eType max_hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType max_audio_streaming_state()
const OVERRIDE {
return audio_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 9797442e34..9cfb504b00 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -273,52 +273,46 @@ class MessageHelper {
const std::string& path_to_icon, uint32_t app_id);
/**
- * @brief Sends button subscription notification
- * @param app_id Application ID
- * @param button Enum with button name
- * @param is_subscribed true if subscribed, false otherwise
+ * @brief Creates button subscription requests for buttons
+ * that application is subscribed on
+ * @param app application to be subscribed for button
+ * @param button_subscriptions collection of subscribed buttons
+ * @param function_id function ID
* @param app_mngr reference to application manager
+ * @return list of all buttons subscription requests ready to be sent to hmi
+ * @note for every button separate request is created in the list
*/
- static void SendOnButtonSubscriptionNotification(
- const uint32_t app_id,
- const hmi_apis::Common_ButtonName::eType button,
- const bool is_subscribed,
+ static smart_objects::SmartObjectList
+ CreateButtonSubscriptionsHandlingRequestsList(
+ ApplicationConstSharedPtr app,
+ const ButtonSubscriptions& button_subscriptions,
+ const hmi_apis::FunctionID::eType function_id,
ApplicationManager& app_mngr);
/**
- * @brief Creates button subscription notification
- * @param app_id Application ID
- * @param button Enum with button name
- * @param is_subscribed true if subscribed, false otherwise
- * @return notification message in SmartObject format
- */
- static smart_objects::SmartObjectSPtr CreateOnButtonSubscriptionNotification(
- const uint32_t app_id,
- const hmi_apis::Common_ButtonName::eType button,
- const bool is_subscribed);
-
- /**
- * @brief Sends button subscription notifications for all buttons
- * that application is subscribed on
+ * @brief Creates button subscription request to mobile
* @param app shared pointer to application instance
- * @param app_mngr reference to application manager
+ * @param source_message source message
+ * @return Smart object with fulfilled request
*/
- static void SendAllOnButtonSubscriptionNotificationsForApp(
- ApplicationConstSharedPtr app, ApplicationManager& app_mngr);
+ static smart_objects::SmartObjectSPtr CreateButtonNotificationToMobile(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& source_message);
/**
- * @brief Creates button subscription notifications for buttons
- * that application is subscribed on
- * @param app shared pointer to application instance
+ * @brief Creates button subscription request to hmi
+ * @param app_id id of application for which request should be created
+ * @param button_name button to be subscribed
+ * @param function_id function ID
* @param app_mngr reference to application manager
- * @param button_subscriptions collection of subscribed buttons
- * @return list of notification messages in SmartObject format
+ * @return Smart object with fulfilled request
*/
- static smart_objects::SmartObjectList
- CreateOnButtonSubscriptionNotificationsForApp(
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr,
- const ButtonSubscriptions& button_subscriptions);
+ static smart_objects::SmartObjectSPtr
+ CreateButtonSubscriptionHandlingRequestToHmi(
+ const uint32_t app_id,
+ const hmi_apis::Common_ButtonName::eType button_name,
+ const hmi_apis::FunctionID::eType function_id,
+ ApplicationManager& app_mngr);
static void SendAppDataToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_man);
@@ -490,18 +484,22 @@ class MessageHelper {
* @param permissions Array of groups permissions
* @param external_consent_status External user consent status
* @param correlation_id Correlation id of request
+ * @param app_mngr ApplicationManager instance
+ * @param success_flag Indication that we were able to collect permissions
*/
#ifdef EXTERNAL_PROPRIETARY_MODE
static void SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
const policy::ExternalConsentStatus& external_consent_status,
const uint32_t correlation_id,
- ApplicationManager& app_mngr);
+ ApplicationManager& app_mngr,
+ const bool success_flag = true);
#else
static void SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
const uint32_t correlation_id,
- ApplicationManager& app_mngr);
+ ApplicationManager& app_mngr,
+ const bool success_flag = true);
#endif // EXTERNAL_PROPRIETARY_MODE
/**
@@ -989,18 +987,6 @@ class MessageHelper {
ApplicationManager& app_mngr);
/**
- * @brief SendUnsubscribeButtonNotification sends notification to HMI to
- * remove button subscription for application
- * @param button Button type
- * @param application Application to unsubscribe
- * @param app_mngr Application manager
- */
- static void SendUnsubscribeButtonNotification(
- mobile_apis::ButtonName::eType button,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr);
-
- /**
* @brief Sends HMI status notification to mobile
* @param application application with changed HMI status
* @param window_id id of affected window
@@ -1109,6 +1095,25 @@ class MessageHelper {
ApplicationManager& app_mngr,
const WindowID window_id);
+ /**
+ * @brief Recursively removes empty parameters of composite type from message
+ * @param msg_params smart object containing message params
+ * @return amount of empty parameters removed
+ */
+ static uint16_t RemoveEmptyMessageParams(
+ smart_objects::SmartObject& msg_params);
+
+ /**
+ * @brief AddDefaultParamsToTireStatus adds missing default sub-params to
+ * tirePressure param, if version of related application requires presence of
+ * all sub-params in response
+ * @param application shared pointer to related application
+ * @param response_from_hmi reference to response from HMI
+ */
+ static void AddDefaultParamsToTireStatus(
+ ApplicationSharedPtr application,
+ smart_objects::SmartObject& response_from_hmi);
+
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 88f91d14fc..4f143dc365 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
@@ -62,6 +62,7 @@ enum ApplicationEvent {
kApplicationUnregistered,
kDeleteApplicationData,
kGlobalPropertiesUpdated,
+ kAppHmiTypesChanged,
kRCStatusChanged
};
@@ -86,13 +87,6 @@ class RPCPlugin {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state) = 0;
- DEPRECATED
- virtual bool Init(ApplicationManager& app_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) = 0;
-
/**
* @brief IsAbleToProcess check if plugin is able to process function
* @param function_id RPC identifier
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 004d6418f5..a447034d86 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
@@ -59,13 +59,6 @@ class RPCPluginManagerImpl : public RPCPluginManager {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state);
- DEPRECATED
- RPCPluginManagerImpl(ApplicationManager& app_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state);
-
uint32_t LoadPlugins(const std::string& plugins_path) OVERRIDE;
utils::Optional<RPCPlugin> FindPluginToProcess(
diff --git a/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
index 7d71611a3c..93b35ff99d 100644
--- a/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
@@ -47,8 +47,10 @@ class PolicyEventObserver
policy::PolicyHandlerInterface* const policy_handler,
application_manager::event_engine::EventDispatcher& event_dispatcher);
void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler);
- void on_event(const application_manager::event_engine::Event& event);
- void on_event(const application_manager::event_engine::MobileEvent& event);
+ void HandleOnEvent(
+ const application_manager::event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(
+ const application_manager::event_engine::MobileEvent& event) OVERRIDE;
void subscribe_on_event(
const application_manager::event_engine::Event::EventID& event_id,
int32_t hmi_correlation_id = 0);
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 0a815b4c5b..662e255871 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
@@ -86,8 +86,6 @@ class PolicyHandler : public PolicyHandlerInterface,
bool InitPolicyTable() OVERRIDE;
bool ResetPolicyTable() OVERRIDE;
bool ClearUserConsent() OVERRIDE;
- DEPRECATED bool SendMessageToSDK(const BinaryMessage& pt_string,
- const std::string& url) OVERRIDE;
bool ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string) OVERRIDE;
bool UnloadPolicyLibrary() OVERRIDE;
@@ -880,19 +878,21 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Collects permissions for all currently registered applications on
* all devices
- * @return consolidated permissions list or empty list if no
- * applications/devices currently present
+ * @param out_permissions output ref on list of application permissions
+ * @return true if app connection information is valid, otherwise - false
*/
- std::vector<FunctionalGroupPermission> CollectRegisteredAppsPermissions();
+ bool CollectRegisteredAppsPermissions(
+ std::vector<FunctionalGroupPermission>& out_permissions);
/**
* @brief Collects permissions for application with certain connection key
* @param connection_key Connection key of application to look for
- * @return list of application permissions or empty list if no such
- * application found
+ * @param out_permissions output ref on list of application permissions
+ * @return true if app connection information is valid, otherwise - false
*/
- std::vector<FunctionalGroupPermission> CollectAppPermissions(
- const uint32_t connection_key);
+ bool CollectAppPermissions(
+ const uint32_t connection_key,
+ std::vector<policy::FunctionalGroupPermission>& out_permissions);
private:
static const std::string kLibrary;
diff --git a/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
deleted file mode 100644
index 334a7b3a2d..0000000000
--- a/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef EXTERNAL_PROPRIETARY_MODE
-#error "policy_handler_observer.h is not available in policy external"
-#else
-#include "application_manager/policies/regular/policy_handler_observer.h"
-#endif
diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h
index 4a104812a4..479d433d50 100644
--- a/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h
@@ -47,8 +47,10 @@ class PolicyEventObserver
policy::PolicyHandlerInterface* const policy_handler,
application_manager::event_engine::EventDispatcher& event_dispatcher);
void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler);
- void on_event(const application_manager::event_engine::Event& event);
- void on_event(const application_manager::event_engine::MobileEvent& event);
+ void HandleOnEvent(
+ const application_manager::event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(
+ const application_manager::event_engine::MobileEvent& event) OVERRIDE;
void subscribe_on_event(
const application_manager::event_engine::Event::EventID& event_id,
int32_t hmi_correlation_id = 0);
diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h b/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h
deleted file mode 100644
index f1a9ff55b8..0000000000
--- a/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright (c) 2013, 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_POLICY_RETRY_SEQUENCE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
-
-#include "utils/threads/thread_delegate.h"
-
-namespace policy {
-
-class PolicyHandler;
-
-class RetrySequence : public threads::ThreadDelegate {
- public:
- explicit RetrySequence(PolicyHandler* const policy_handler);
- void threadMain();
-
- private:
- PolicyHandler* const policy_handler_;
- void StartNextRetry();
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller_impl.h
index 8a3c90061e..41d2419ba6 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller_impl.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_IMPL_H_
#include <climits>
#include <list>
@@ -40,6 +40,7 @@
#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/threads/async_runner.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
#include "utils/timer.h"
@@ -47,6 +48,8 @@
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
+#include "application_manager/event_engine/event_dispatcher_impl.h"
+#include "application_manager/request_controller.h"
#include "application_manager/request_controller_settings.h"
#include "application_manager/request_info.h"
#include "application_manager/request_tracker.h"
@@ -55,85 +58,40 @@ namespace application_manager {
namespace request_controller {
-/**
- * @brief RequestController class is used to control currently active mobile
- * requests.
- */
-class RequestController {
+class RequestControllerImpl : public RequestController, threads::AsyncRunner {
public:
/**
- * @brief Result code for addRequest
+ * @brief Class constructor
+ *
*/
- enum TResult {
- SUCCESS = 0,
- TOO_MANY_REQUESTS,
- TOO_MANY_PENDING_REQUESTS,
- NONE_HMI_LEVEL_MANY_REQUESTS,
- INVALID_DATA
- };
+ RequestControllerImpl(const RequestControlerSettings& settings,
+ RequestTimeoutHandler& request_timeout_handler,
+ event_engine::EventDispatcher& event_disptacher);
- /**
- * @brief Thread pool state
- */
- enum TPoolState {
- UNDEFINED = 0,
- STARTED,
- STOPPED,
- };
+ ~RequestControllerImpl();
- // Methods
+ void Stop() OVERRIDE;
- /**
- * @brief Class constructor
- *
- */
- RequestController(const RequestControlerSettings& settings);
+ void InitializeThreadpool() OVERRIDE;
- /**
- * @brief Class destructor
- *
- */
- virtual ~RequestController();
+ void DestroyThreadpool() OVERRIDE;
- /**
- * @brief Initialize thread pool
- *
- */
- void InitializeThreadpool();
+ TResult AddMobileRequest(
+ const RequestPtr request,
+ const mobile_apis::HMILevel::eType& hmi_level) OVERRIDE;
- /**
- * @brief Destroy thread pool
- *
- */
- void DestroyThreadpool();
+ TResult AddHMIRequest(const RequestPtr request) OVERRIDE;
- /**
- * @brief Check if max request amount wasn't exceed and adds request to queue.
- *
- * @param request Active mobile request
- * @param hmi_level Current application hmi_level
- *
- * @return Result code
- *
- */
- TResult addMobileRequest(const RequestPtr request,
- const mobile_apis::HMILevel::eType& hmi_level);
+ void AddNotification(const RequestPtr ptr) OVERRIDE;
- /**
- * @brief Store HMI request until response or timeout won't remove it
- *
- * @param request Active hmi request
- * @return Result code
- *
- */
- TResult addHMIRequest(const RequestPtr request);
+ bool RetainRequestInstance(const uint32_t connection_key,
+ const uint32_t correlation_id) OVERRIDE;
- /**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
- void addNotification(const RequestPtr ptr);
+ bool RemoveRetainedRequest(const uint32_t connection_key,
+ const uint32_t correlation_id) OVERRIDE;
+
+ bool IsStillWaitingForResponse(const uint32_t connection_key,
+ const uint32_t correlation_id) const OVERRIDE;
/**
* @brief Removes request from queue
@@ -144,76 +102,36 @@ class RequestController {
* @param force_terminate if true, request controller will terminate
* even if not allowed by request
*/
+
void TerminateRequest(const uint32_t correlation_id,
const uint32_t connection_key,
const int32_t function_id,
- bool force_terminate = false);
+ const bool force_terminate = false) OVERRIDE;
- /**
- * @brief Removes request from queue
- *
- * @param mobile_correlation_id Active mobile request correlation ID
- *
- */
void OnMobileResponse(const uint32_t mobile_correlation_id,
const uint32_t connection_key,
- const int32_t function_id);
+ const int32_t function_id) OVERRIDE;
- /**
- * @brief Removes request from queue
- *
- * @param mobile_correlation_id Active mobile request correlation ID
- *
- */
- void OnHMIResponse(const uint32_t correlation_id, const int32_t function_id);
+ void OnHMIResponse(const uint32_t correlation_id,
+ const int32_t function_id) OVERRIDE;
- /**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
- void removeNotification(const commands::Command* notification);
+ void RemoveNotification(const commands::Command* notification) OVERRIDE;
- /**
- * @brief Removes all requests from queue for specified application
- *
- * @param app_id Mobile application ID (app_id)
- *
- */
- void terminateAppRequests(const uint32_t& app_id);
+ void TerminateAppRequests(const uint32_t app_id) OVERRIDE;
- /**
- * @brief Terminates all requests from HMI
- */
- void terminateAllHMIRequests();
+ void TerminateAllHMIRequests() OVERRIDE;
- /**
- * @brief Terminates all requests from Mobile
- */
- void terminateAllMobileRequests();
+ void TerminateAllMobileRequests() OVERRIDE;
- /**
- * @brief Updates request timeout
- *
- * @param app_id Connection key of application
- * @param mobile_correlation_id Correlation ID of the mobile request
- * @param new_timeout_value New timeout to be set in milliseconds
- */
- void updateRequestTimeout(const uint32_t& app_id,
- const uint32_t& mobile_correlation_id,
- const uint32_t& new_timeout);
+ void UpdateRequestTimeout(const uint32_t app_id,
+ const uint32_t mobile_correlation_id,
+ const uint32_t new_timeout) OVERRIDE;
- /*
- * @brief Function Should be called when Low Voltage is occured
- */
- void OnLowVoltage();
+ void OnLowVoltage() OVERRIDE;
- /*
- * @brief Function Should be called when Low Voltage is occured
- */
- void OnWakeUp();
+ void OnWakeUp() OVERRIDE;
- bool IsLowVoltage();
+ bool IsLowVoltage() OVERRIDE;
protected:
/**
@@ -226,8 +144,17 @@ class RequestController {
*/
void NotifyTimer();
- void terminateWaitingForExecutionAppRequests(const uint32_t& app_id);
- void terminateWaitingForResponseAppRequests(const uint32_t& app_id);
+ void TerminateWaitingForExecutionAppRequests(const uint32_t app_id);
+ void TerminateWaitingForResponseAppRequests(const uint32_t app_id);
+
+ /**
+ * @brief Starts a new async task for cleaning up the provided requests
+ * references
+ * and perform the rest of cleanup actions for each request
+ * @param requests list of requests to cleanup
+ */
+ typedef std::list<RequestInfoPtr> RequestInfoPtrs;
+ void scheduleRequestsCleanup(const RequestInfoPtrs& requests);
/**
* @brief Checks whether all constraints are met before adding of request into
@@ -246,23 +173,36 @@ class RequestController {
* allowed for all applications
* @return True if new request could be added, false otherwise
*/
- bool CheckPendingRequestsAmount(const uint32_t& pending_requests_amount);
+ bool CheckPendingRequestsAmount(const uint32_t pending_requests_amount);
private:
class Worker : public threads::ThreadDelegate {
public:
- explicit Worker(RequestController* requestController);
+ explicit Worker(RequestControllerImpl* request_controller);
virtual ~Worker();
virtual void threadMain();
virtual void exitThreadMain();
protected:
private:
- RequestController* request_controller_;
+ RequestControllerImpl* request_controller_;
sync_primitives::Lock thread_lock_;
volatile bool stop_flag_;
};
+ class RequestCleanerDelegate : public threads::ThreadDelegate {
+ public:
+ explicit RequestCleanerDelegate(const RequestInfoPtrs& requests);
+ ~RequestCleanerDelegate();
+ void threadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ sync_primitives::Lock state_lock_;
+ sync_primitives::ConditionalVariable state_cond_;
+ RequestInfoPtrs requests_;
+ };
+
std::vector<threads::Thread*> pool_;
volatile TPoolState pool_state_;
uint32_t pool_size_;
@@ -271,14 +211,20 @@ class RequestController {
std::list<RequestPtr> mobile_request_list_;
sync_primitives::Lock mobile_request_list_lock_;
- /*
- * Requests, that are waiting for responses
+ /**
+ * @brief Requests, that are waiting for responses
* RequestInfoSet provides correct processing of requests with thre same
* app_id and corr_id
*/
RequestInfoSet waiting_for_response_;
/**
+ * @brief Requests, that are retained to be not destroyed right after
+ * sending response to mobile request
+ */
+ HashSortedRequestInfoSet retained_mobile_requests_;
+
+ /**
* @brief Tracker verifying time scale and maximum requests amount in
* different HMI levels
*/
@@ -310,11 +256,14 @@ class RequestController {
bool is_low_voltage_;
const RequestControlerSettings& settings_;
- DISALLOW_COPY_AND_ASSIGN(RequestController);
+
+ RequestTimeoutHandler& request_timeout_handler_;
+ event_engine::EventDispatcher& event_dispatcher_;
+ DISALLOW_COPY_AND_ASSIGN(RequestControllerImpl);
};
} // namespace request_controller
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index c6cf00caea..3d9ecfa630 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -39,7 +39,7 @@
#include <stdint.h>
#include <set>
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "commands/request_to_hmi.h"
#include "utils/date_time.h"
@@ -127,7 +127,7 @@ struct RequestInfo {
}
uint64_t hash();
static uint64_t GenerateHash(uint32_t var1, uint32_t var2);
- static uint32_t HmiConnectionKey;
+ static constexpr uint32_t kHmiConnectionKey = 0;
protected:
RequestPtr request_;
@@ -199,7 +199,7 @@ class RequestInfoSet {
* @return founded request or shared_ptr with NULL
*/
RequestInfoPtr Find(const uint32_t connection_key,
- const uint32_t correlation_id);
+ const uint32_t correlation_id) const;
/*
* @brief Get request with smalest end_time_
@@ -213,6 +213,15 @@ class RequestInfoSet {
*/
RequestInfoPtr FrontWithNotNullTimeout();
+ /**
+ * @brief GetRequestsByConnectionKey gets all pending requests by provided
+ * connection key
+ * @param connection_key connection key for related requests
+ * @return list of all pending requests for a specified connection key
+ */
+ std::list<RequestInfoPtr> GetRequestsByConnectionKey(
+ const uint32_t connection_key);
+
/*
* @brief Erase request from colletion by log(n) time
* @param request_info - request to erase
@@ -269,7 +278,7 @@ class RequestInfoSet {
TimeSortedRequestInfoSet time_sorted_pending_requests_;
HashSortedRequestInfoSet hash_sorted_pending_requests_;
- sync_primitives::Lock pending_requests_lock_;
+ mutable sync_primitives::Lock pending_requests_lock_;
};
/**
diff --git a/src/components/application_manager/include/application_manager/request_timeout_handler_impl.h b/src/components/application_manager/include/application_manager/request_timeout_handler_impl.h
new file mode 100644
index 0000000000..207f19e0c5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/request_timeout_handler_impl.h
@@ -0,0 +1,75 @@
+/*
+ * 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_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_IMPL_H_
+
+#include <map>
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/request_timeout_handler.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+class RequestTimeoutHandlerImpl : public event_engine::EventObserver,
+ public RequestTimeoutHandler {
+ public:
+ RequestTimeoutHandlerImpl(ApplicationManager& application_manager);
+ void AddRequest(const uint32_t hmi_correlation_id,
+ const Request& request) OVERRIDE;
+ void RemoveRequest(const uint32_t hmi_correlation_id) OVERRIDE;
+ void HandleOnEvent(const event_engine::Event& event) OVERRIDE;
+
+ private:
+ /**
+ * @brief Checks whether specified request timeout should be updated or not
+ * @param request reference to request structure to check
+ * @param timeout new timeout to apply
+ * @param method_name name of method to check
+ * @return true if timeout update is required for this request, otherwise
+ * returns false
+ */
+ bool IsTimeoutUpdateRequired(const Request& request,
+ const uint32_t timeout,
+ const hmi_apis::FunctionID::eType method_name);
+
+ std::map<uint32_t, Request> requests_;
+ ApplicationManager& application_manager_;
+ mutable sync_primitives::Lock requests_lock_;
+};
+
+} // namespace request_controller
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_IMPL_H_
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 456eccd29c..4cc42699bc 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
@@ -276,9 +276,6 @@ class ResumeCtrl {
*/
virtual void RemoveFromResumption(uint32_t app_id) = 0;
- DEPRECATED
- virtual bool Init(resumption::LastState& last_state) = 0;
-
/**
* @brief Initialization data for Resume controller
* @return true if initialization is success otherwise
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 9c529b5f9a..b93b914a48 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
@@ -256,8 +256,6 @@ class ResumeCtrlImpl : public ResumeCtrl {
*/
void RemoveFromResumption(uint32_t app_id) OVERRIDE;
- DEPRECATED bool Init(resumption::LastState& last_state) FINAL;
-
/**
* @brief Initialization data for Resume controller
* @return true if initialization is success otherwise
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
index 2394fe00dc..f33ef83a9b 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
@@ -52,11 +52,6 @@ class ResumptionDataJson : public ResumptionData {
resumption::LastStateWrapperPtr last_state_wrapper,
const application_manager::ApplicationManager& application_manager);
- DEPRECATED
- ResumptionDataJson(
- LastState&,
- const application_manager::ApplicationManager& application_manager);
-
/**
* @brief allows to destroy ResumptionDataJson object
*/
@@ -180,9 +175,6 @@ class ResumptionDataJson : public ResumptionData {
*/
void Persist() OVERRIDE;
- DEPRECATED
- resumption::LastState& last_state() const;
-
private:
/**
* @brief GetFromSavedOrAppend allows to get existed record about application
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_processor_impl.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_processor_impl.h
index c2040852ca..312302d157 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_processor_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_processor_impl.h
@@ -79,7 +79,7 @@ class ResumptionDataProcessorImpl
smart_objects::SmartObject& saved_app,
ResumeCtrl::ResumptionCallBack callback) override;
- void on_event(const app_mngr::event_engine::Event& event) override;
+ void HandleOnEvent(const app_mngr::event_engine::Event& event) OVERRIDE;
void HandleOnTimeOut(const uint32_t correlation_id,
const hmi_apis::FunctionID::eType function_id) override;
@@ -367,6 +367,17 @@ class ResumptionDataProcessorImpl
const smart_objects::SmartObject& request,
const smart_objects::SmartObject& response) const;
+ /**
+ * @brief Checks whether SubscribeButton response successful or not and
+ * subscribes application if successful
+ * @param app_id application id
+ * @param request reference to request SO
+ * @param response reference to response SO
+ */
+ void ProcessSubscribeButtonResponse(
+ const uint32_t app_id,
+ const smart_objects::SmartObject& request,
+ const smart_objects::SmartObject& response);
app_mngr::ApplicationManager& application_manager_;
/**
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 5572dfd55d..b1b3c5f000 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
@@ -308,6 +308,13 @@ extern const char* vin;
extern const char* gearStatus;
extern const char* prndl;
extern const char* tire_pressure;
+extern const char* pressure_telltale;
+extern const char* left_front;
+extern const char* right_front;
+extern const char* left_rear;
+extern const char* right_rear;
+extern const char* inner_left_rear;
+extern const char* inner_right_rear;
extern const char* odometer;
extern const char* belt_status;
extern const char* electronic_park_brake_status;
@@ -494,6 +501,10 @@ extern const char* const rect;
extern const char* const x;
extern const char* const y;
extern const char* const preferred_fps;
+
+// OnResetTimeout
+extern const char* const request_id;
+extern const char* const reset_period;
} // namespace strings
namespace hmi_interface {
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 4dc4c1ad7d..6845851f97 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
@@ -103,6 +103,10 @@ class StateControllerImpl : public event_engine::EventObserver,
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level) OVERRIDE;
+ // EventObserver interface
+ void HandleOnEvent(const event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(const event_engine::MobileEvent& event) OVERRIDE;
+
void OnAppWindowAdded(
ApplicationSharedPtr app,
const WindowID window_id,
@@ -120,10 +124,6 @@ class StateControllerImpl : public event_engine::EventObserver,
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;
void DeactivateApp(ApplicationSharedPtr app,
@@ -139,6 +139,7 @@ class StateControllerImpl : public event_engine::EventObserver,
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
diff --git a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
index a8ba796a1b..23e140ff29 100644
--- a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
+++ b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
@@ -70,7 +70,8 @@ class SystemTimeHandlerImpl : public utils::SystemTimeHandler,
* in order to send system time query and GetSystemTimeResponse in order
* to retrieve utc time and notify all the listeners with new time value.
*/
- void on_event(const application_manager::event_engine::Event& event) FINAL;
+ void HandleOnEvent(
+ const application_manager::event_engine::Event& event) FINAL;
/**
* @brief DoSystemTimeQuery sends the appropriate request to the system
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 ef215cdd5a..98de75d6d2 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
@@ -62,7 +62,7 @@ set(LIBRARIES
sdl_rpc_plugin_static
)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h
index 8d307325fc..b7898709ab 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h
@@ -44,7 +44,6 @@ class AppServiceRpcPlugin;
namespace app_mngr = application_manager;
-typedef int AppExtensionUID;
typedef mobile_apis::VehicleDataType::eType VehicleDataType;
/**
* @brief Defines set of app service types
@@ -114,6 +113,8 @@ class AppServiceAppExtension : public app_mngr::AppExtension {
static AppServiceAppExtension& ExtractASExtension(
application_manager::Application& app);
+ static const app_mngr::AppExtensionUID AppServiceAppExtensionUID = 455;
+
private:
AppServiceSubscriptions subscribed_data_;
AppServiceRpcPlugin& plugin_;
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 444636ed75..bae4738524 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
@@ -50,13 +50,6 @@ class AppServiceRpcPlugin : public plugins::RPCPlugin {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state) OVERRIDE;
- DEPRECATED
- bool Init(app_mngr::ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state);
-
bool IsAbleToProcess(
const int32_t function_id,
const app_mngr::commands::Command::CommandSource source) OVERRIDE;
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h
index d9eb7528e4..dc8bfa4533 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h
@@ -71,7 +71,7 @@ class ASGetAppServiceDataRequestFromHMI
/**
* @brief onTimeOut from request controller
*/
- virtual void onTimeOut();
+ void OnTimeOut() FINAL;
/**
* @brief on_event allows to handle events
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h
index 36acf116f4..09b7829745 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h
@@ -86,7 +86,7 @@ class ASPerformAppServiceInteractionRequestFromHMI
/**
* @brief onTimeOut from request controller
*/
- virtual void onTimeOut();
+ void OnTimeOut() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionRequestFromHMI);
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
index 6971354806..f628b94cd1 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_
#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace app_service_rpc_plugin {
namespace app_mngr = application_manager;
@@ -44,7 +44,8 @@ namespace commands {
/**
* @brief GetAppServiceDataRequest command class
**/
-class GetAppServiceDataRequest : public app_mngr::commands::CommandRequestImpl {
+class GetAppServiceDataRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief GetAppServiceDataRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h
index 854ed3c6aa..e0665b9427 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_
#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace app_service_rpc_plugin {
namespace app_mngr = application_manager;
@@ -45,7 +45,7 @@ namespace commands {
* @brief PerformAppServiceInteractionRequest command class
**/
class PerformAppServiceInteractionRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief PerformAppServiceInteractionRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
index d70f279658..5145b42171 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_
#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace app_service_rpc_plugin {
namespace app_mngr = application_manager;
@@ -44,7 +44,8 @@ namespace commands {
/**
* @brief PublishAppServiceRequest command class
**/
-class PublishAppServiceRequest : public app_mngr::commands::CommandRequestImpl {
+class PublishAppServiceRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief PublishAppServiceRequest class constructor
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
index 4a883b92ee..6a85d10fd4 100644
--- 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
@@ -33,7 +33,7 @@
#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"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace app_service_rpc_plugin {
namespace app_mngr = application_manager;
@@ -44,7 +44,7 @@ namespace commands {
* @brief UnpublishAppServiceRequest command class
**/
class UnpublishAppServiceRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief UnpublishAppServiceRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
index 5a1815d974..1cd2fd690a 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
@@ -38,8 +38,6 @@ SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin")
namespace app_service_rpc_plugin {
-const AppExtensionUID AppServiceAppExtensionUID = 455;
-
AppServiceAppExtension::AppServiceAppExtension(
AppServiceRpcPlugin& plugin, application_manager::Application& app)
: app_mngr::AppExtension(AppServiceAppExtensionUID)
@@ -91,7 +89,7 @@ void AppServiceAppExtension::SaveResumptionData(
int i = 0;
for (const auto& subscription : subscribed_data_) {
resumption_data[app_mngr::hmi_interface::app_service][i] = subscription;
- i++;
+ ++i;
}
}
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 e03973614d..e842ea7276 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
@@ -58,18 +58,6 @@ bool AppServiceRpcPlugin::Init(
return true;
}
-bool AppServiceRpcPlugin::Init(app_mngr::ApplicationManager& app_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) {
- UNUSED(last_state);
- application_manager_ = &app_manager;
- command_factory_.reset(new app_service_rpc_plugin::AppServiceCommandFactory(
- app_manager, rpc_service, hmi_capabilities, policy_handler));
- return true;
-}
-
bool AppServiceRpcPlugin::IsAbleToProcess(
const int32_t function_id, const commands::Command::CommandSource source) {
return command_factory_->IsAbleToProcess(function_id, source);
@@ -88,11 +76,22 @@ void AppServiceRpcPlugin::OnPolicyEvent(plugins::PolicyEvent event) {}
void AppServiceRpcPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) {
- if (plugins::ApplicationEvent::kApplicationRegistered == event) {
- application->AddExtension(
- std::make_shared<AppServiceAppExtension>(*this, *application));
- } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
- DeleteSubscriptions(application);
+ switch (event) {
+ case plugins::ApplicationEvent::kApplicationRegistered: {
+ application->AddExtension(
+ std::make_shared<AppServiceAppExtension>(*this, *application));
+ break;
+ }
+
+ case plugins::ApplicationEvent::kApplicationUnregistered:
+ case plugins::ApplicationEvent::kDeleteApplicationData: {
+ DeleteSubscriptions(application);
+ break;
+ }
+
+ default: {
+ break;
+ }
}
}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc
index 32fccb0192..ff9d4e436a 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc
@@ -92,7 +92,7 @@ void ASGetAppServiceDataRequestFromHMI::GetWeatherImagePaths(
if (data.keyExists(strings::minute_forecast)) {
smart_objects::SmartObject& minute_forecast =
data[strings::minute_forecast];
- for (size_t i = 0; i < minute_forecast.length(); i++) {
+ for (size_t i = 0; i < minute_forecast.length(); ++i) {
if (minute_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon],
app,
@@ -104,7 +104,7 @@ void ASGetAppServiceDataRequestFromHMI::GetWeatherImagePaths(
if (data.keyExists(strings::hourly_forecast)) {
smart_objects::SmartObject& hourly_forecast =
data[strings::hourly_forecast];
- for (size_t i = 0; i < hourly_forecast.length(); i++) {
+ for (size_t i = 0; i < hourly_forecast.length(); ++i) {
if (hourly_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon],
app,
@@ -116,7 +116,7 @@ void ASGetAppServiceDataRequestFromHMI::GetWeatherImagePaths(
if (data.keyExists(strings::multiday_forecast)) {
smart_objects::SmartObject& multiday_forecast =
data[strings::multiday_forecast];
- for (size_t i = 0; i < multiday_forecast.length(); i++) {
+ for (size_t i = 0; i < multiday_forecast.length(); ++i) {
if (multiday_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon],
app,
@@ -145,7 +145,7 @@ void ASGetAppServiceDataRequestFromHMI::GetNavigationImagePaths(
if (data.keyExists(strings::instructions)) {
smart_objects::SmartObject& instructions = data[strings::instructions];
- for (size_t i = 0; i < instructions.length(); i++) {
+ for (size_t i = 0; i < instructions.length(); ++i) {
if (instructions[i].keyExists(strings::image)) {
MessageHelper::VerifyImage(
instructions[i][strings::image], app, application_manager_);
@@ -240,8 +240,8 @@ void ASGetAppServiceDataRequestFromHMI::on_event(
hmi_apis::Common_Result::eType result =
static_cast<hmi_apis::Common_Result::eType>(
event_message[strings::params][hmi_response::code].asInt());
- bool success =
- IsHMIResultSuccess(result, HmiInterfaces::HMI_INTERFACE_AppService);
+ bool success = CommandImpl::IsHMIResultSuccess(
+ result, HmiInterfaces::HMI_INTERFACE_AppService);
if (ValidateResponse(msg_params)) {
SendResponse(success,
correlation_id(),
@@ -263,7 +263,8 @@ void ASGetAppServiceDataRequestFromHMI::on_event(
msg_params[strings::result_code].asInt());
hmi_apis::Common_Result::eType result =
MessageHelper::MobileToHMIResult(mobile_result);
- bool success = IsMobileResultSuccess(mobile_result);
+ bool success =
+ application_manager::commands::IsMobileResultSuccess(mobile_result);
if (ValidateResponse(msg_params)) {
SendResponse(success,
@@ -275,7 +276,7 @@ void ASGetAppServiceDataRequestFromHMI::on_event(
}
}
-void ASGetAppServiceDataRequestFromHMI::onTimeOut() {
+void ASGetAppServiceDataRequestFromHMI::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
SendErrorResponse(correlation_id(),
hmi_apis::FunctionID::AppService_GetAppServiceData,
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
index ac3666bf2e..843971e16d 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
@@ -75,7 +75,7 @@ void ASGetAppServiceRecordsRequest::Run() {
continue;
}
records[index] = record;
- index++;
+ ++index;
}
if (!records.empty()) {
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
index f5a1aac05c..eafefa663f 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
@@ -140,7 +140,8 @@ void ASPerformAppServiceInteractionRequestFromHMI::on_event(
msg_params[strings::result_code].asInt());
hmi_apis::Common_Result::eType result =
MessageHelper::MobileToHMIResult(mobile_result);
- bool success = IsMobileResultSuccess(mobile_result);
+ bool success =
+ application_manager::commands::IsMobileResultSuccess(mobile_result);
SendResponse(success,
correlation_id(),
hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
@@ -149,7 +150,7 @@ void ASPerformAppServiceInteractionRequestFromHMI::on_event(
application_manager::commands::Command::SOURCE_SDL_TO_HMI);
}
-void ASPerformAppServiceInteractionRequestFromHMI::onTimeOut() {
+void ASPerformAppServiceInteractionRequestFromHMI::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
smart_objects::SmartObject response_params;
response_params[strings::info] =
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
index 0f1fbcf1ce..15b5e093a5 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
@@ -84,7 +84,7 @@ void OnASAppServiceDataNotification::GetWeatherImagePaths(
if (data.keyExists(strings::minute_forecast)) {
smart_objects::SmartObject& minute_forecast =
data[strings::minute_forecast];
- for (size_t i = 0; i < minute_forecast.length(); i++) {
+ for (size_t i = 0; i < minute_forecast.length(); ++i) {
if (minute_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon],
app,
@@ -96,7 +96,7 @@ void OnASAppServiceDataNotification::GetWeatherImagePaths(
if (data.keyExists(strings::hourly_forecast)) {
smart_objects::SmartObject& hourly_forecast =
data[strings::hourly_forecast];
- for (size_t i = 0; i < hourly_forecast.length(); i++) {
+ for (size_t i = 0; i < hourly_forecast.length(); ++i) {
if (hourly_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon],
app,
@@ -108,7 +108,7 @@ void OnASAppServiceDataNotification::GetWeatherImagePaths(
if (data.keyExists(strings::multiday_forecast)) {
smart_objects::SmartObject& multiday_forecast =
data[strings::multiday_forecast];
- for (size_t i = 0; i < multiday_forecast.length(); i++) {
+ for (size_t i = 0; i < multiday_forecast.length(); ++i) {
if (multiday_forecast[i].keyExists(strings::weather_icon)) {
MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon],
app,
@@ -137,7 +137,7 @@ void OnASAppServiceDataNotification::GetNavigationImagePaths(
if (data.keyExists(strings::instructions)) {
smart_objects::SmartObject& instructions = data[strings::instructions];
- for (size_t i = 0; i < instructions.length(); i++) {
+ for (size_t i = 0; i < instructions.length(); ++i) {
if (instructions[i].keyExists(strings::image)) {
MessageHelper::VerifyImage(
instructions[i][strings::image], app, application_manager_);
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
index 719856625d..8560112bf3 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
@@ -50,11 +50,11 @@ GetAppServiceDataRequest::GetAppServiceDataRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
GetAppServiceDataRequest::~GetAppServiceDataRequest() {}
@@ -96,7 +96,7 @@ void GetAppServiceDataRequest::on_event(
mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>(
msg_params[strings::result_code].asInt());
- bool success = IsMobileResultSuccess(result);
+ bool success = application_manager::commands::IsMobileResultSuccess(result);
if (success) {
HandleSubscribe();
}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
index c303e6d99f..35b7543a2c 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
@@ -49,11 +49,11 @@ PerformAppServiceInteractionRequest::PerformAppServiceInteractionRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
PerformAppServiceInteractionRequest::~PerformAppServiceInteractionRequest() {}
@@ -181,7 +181,7 @@ void PerformAppServiceInteractionRequest::on_event(
: NULL;
mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>(
msg_params[strings::result_code].asInt());
- bool success = IsMobileResultSuccess(result);
+ bool success = application_manager::commands::IsMobileResultSuccess(result);
SendResponse(success, result, info, &msg_params);
}
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 f2bc66520b..b2ae67610e 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
@@ -51,11 +51,11 @@ PublishAppServiceRequest::PublishAppServiceRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
PublishAppServiceRequest::~PublishAppServiceRequest() {}
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
index 200bae01d9..cba87d3173 100644
--- 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
@@ -49,11 +49,11 @@ UnpublishAppServiceRequest::UnpublishAppServiceRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
UnpublishAppServiceRequest::~UnpublishAppServiceRequest() {}
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 4236ac23f9..4e79bad899 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
@@ -92,14 +92,10 @@ class HMICommandsTest : public components::commands_test::CommandRequestTest<
typedef Command CommandType;
void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<kIsNice>::InitCommand(timeout);
+
stream_retry_.first = 0;
stream_retry_.second = 0;
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, start_stream_retry_amount())
.WillByDefault(ReturnRef(stream_retry_));
}
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 69bff3ad76..3c70028574 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
@@ -88,12 +88,8 @@ class MobileCommandsTest : public components::commands_test::CommandRequestTest<
typedef Command CommandType;
void InitCommand(const uint32_t& timeout) OVERRIDE {
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
+ CommandRequestTest<kIsNice>::InitCommand(timeout);
+
ON_CALL(app_mngr_settings_, app_icons_folder())
.WillByDefault(ReturnRef(kEmptyString_));
}
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 8129e1240d..f1cdab02c4 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
@@ -59,7 +59,7 @@ set(LIBRARIES
Utils
)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
index f81919f4fa..e10b794685 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
@@ -51,7 +51,7 @@ class RCGetInteriorVehicleDataRequest
const RCCommandParams& params);
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
~RCGetInteriorVehicleDataRequest();
};
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
index 82e0a8c13b..bb5e7a9b8f 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
@@ -76,6 +76,18 @@ class RCOnRemoteControlSettingsNotification
* notifications
*/
void DisallowRCFunctionality();
+
+ /**
+ * @brief Performs the set of actions depending on access mode param received
+ * in the message
+ */
+ void ProcessAccessModeParam();
+
+ /**
+ * @brief Performs the set of actions depending on allowed param received in
+ * the message
+ */
+ void ProcessAllowedParam();
};
} // namespace commands
} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
index 6bca1017e0..91f9b6564a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "rc_rpc_plugin/commands/rc_command_params.h"
#include "rc_rpc_plugin/interior_data_cache.h"
#include "rc_rpc_plugin/rc_app_extension.h"
@@ -48,7 +48,7 @@ enum TypeAccess { kDisallowed, kAllowed };
namespace commands {
-class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
+class RCCommandRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief RCCommandRequest class constructor
@@ -65,11 +65,11 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
virtual ~RCCommandRequest();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
void Run() OVERRIDE;
- virtual void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
protected:
bool is_subscribed;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
index 8b2162c9ab..031e89fd85 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
@@ -143,8 +143,7 @@ class RCRPCPlugin;
class RCAppExtension : public application_manager::AppExtension {
public:
- explicit RCAppExtension(application_manager::AppExtensionUID uid,
- RCRPCPlugin& plugin,
+ explicit RCAppExtension(RCRPCPlugin& plugin,
application_manager::Application& application);
~RCAppExtension();
@@ -232,6 +231,8 @@ class RCAppExtension : public application_manager::AppExtension {
*/
void SetUserLocation(const Grid& grid);
+ static const application_manager::AppExtensionUID RCAppExtensionID = 153;
+
private:
/**
* @brief Checks if the application's pointer is valid and update the
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h
index 5cbc4b977e..fd8c40405e 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h
@@ -50,12 +50,6 @@ class RCConsentManagerImpl : public RCConsentManager {
application_manager::ApplicationManager& application_manager,
const uint32_t period_of_consent_expired);
- DEPRECATED
- RCConsentManagerImpl(
- resumption::LastState& last_state,
- application_manager::ApplicationManager& application_manager,
- const uint32_t period_of_consent_expired);
-
void SaveModuleConsents(
const std::string& policy_app_id,
const std::string& mac_address,
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_pending_resumption_handler.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_pending_resumption_handler.h
index 944d47b052..eeeb9988d7 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_pending_resumption_handler.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_pending_resumption_handler.h
@@ -22,7 +22,8 @@ class RCPendingResumptionHandler : public resumption::PendingResumptionHandler {
application_manager::ApplicationManager& application_manager,
rc_rpc_plugin::InteriorDataCache& interior_data_cache);
- void on_event(const application_manager::event_engine::Event& event) override;
+ void HandleOnEvent(
+ const application_manager::event_engine::Event& event) override;
void HandleResumptionSubscriptionRequest(
application_manager::AppExtension& extension,
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 528e116403..e45d48d63a 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
@@ -65,12 +65,6 @@ class RCRPCPlugin : public plugins::RPCPlugin {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state) OVERRIDE;
- DEPRECATED
- bool Init(app_mngr::ApplicationManager& app_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) OVERRIDE;
/**
* @param int32_t command id
* @param CommandSource source
@@ -131,7 +125,17 @@ class RCRPCPlugin : public plugins::RPCPlugin {
bool IsOtherAppsSubscribed(const rc_rpc_types::ModuleUid& module,
const uint32_t app_id);
- static const uint32_t kRCPluginID = 153;
+ /**
+ * @brief Creates the RC extension for specified application
+ * @param application pointer to app to work with
+ */
+ void CreateRcExtension(application_manager::ApplicationSharedPtr application);
+
+ /**
+ * @brief Removes the RC extensions for specified application
+ * @param application pointer to app to work with
+ */
+ void RemoveRcExtension(application_manager::ApplicationSharedPtr application);
typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
static Apps GetRCApplications(
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
index ee0bd11885..db785e4a4f 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
@@ -130,6 +130,19 @@ class ResourceAllocationManager {
const std::string& module_id) const = 0;
/**
+ * @brief IsResourceAllocated check if module is allocated by certain
+ * application
+ * @param module_type module to be checked
+ * @param module_id uuid of a resource to be checked
+ * @param app_id app to be checked
+ * @return true if module_type is allocated by application with provided
+ * app_id
+ */
+ virtual bool IsResourceAllocated(const std::string& module_type,
+ const std::string& module_id,
+ const uint32_t app_id) = 0;
+
+ /**
* @brief AcquireResource forces acquiring resource by application
* @param module_type resource to acquire
* @param module_id uuid of a resource
@@ -196,8 +209,16 @@ class ResourceAllocationManager {
NotificationTrigger::eType event,
application_manager::ApplicationSharedPtr application) = 0;
+ /**
+ * @brief Returns current state of RC functionality
+ * @return current state of RC functionality
+ */
virtual bool is_rc_enabled() const = 0;
+ /**
+ * @brief Sets current state of RC functionality to a new one
+ * @param value new RC functionality state
+ */
virtual void set_rc_enabled(const bool value) = 0;
/**
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
index 0fd5449912..4361312dde 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
@@ -94,6 +94,10 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
bool IsResourceFree(const std::string& module_type,
const std::string& module_id) const FINAL;
+ bool IsResourceAllocated(const std::string& module_type,
+ const std::string& module_id,
+ const uint32_t app_id) FINAL;
+
void SetAccessMode(
const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
index fede1dbd11..0aaee81ad4 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
@@ -57,7 +57,7 @@ void RCGetInteriorVehicleDataRequest::Run() {
SendRequest();
}
-void RCGetInteriorVehicleDataRequest::onTimeOut() {
+void RCGetInteriorVehicleDataRequest::OnTimeOut() {
SDL_LOG_TRACE("function_id: " << function_id()
<< " correlation_id: " << correlation_id());
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
index 217258b086..580937bc8a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
@@ -87,42 +87,56 @@ void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() {
void RCOnRemoteControlSettingsNotification::Run() {
SDL_LOG_AUTO_TRACE();
+ if ((*message_)[app_mngr::strings::msg_params].empty()) {
+ SDL_LOG_DEBUG("Notification is ignored due to absence of any parameters");
+ SDL_LOG_DEBUG("RC Functionality remains unchanged");
+ return;
+ }
+
+ ProcessAccessModeParam();
+ ProcessAllowedParam();
+}
+
+void RCOnRemoteControlSettingsNotification::ProcessAccessModeParam() {
+ if (!(*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kAccessMode)) {
+ SDL_LOG_DEBUG(
+ "No access mode received. Using last known: "
+ << AccessModeToString(resource_allocation_manager_.GetAccessMode()));
+ return;
+ }
+
+ const auto access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
+ (*message_)[app_mngr::strings::msg_params][message_params::kAccessMode]
+ .asUInt());
+ SDL_LOG_DEBUG("Setting up access mode : " << AccessModeToString(access_mode));
+ resource_allocation_manager_.SetAccessMode(access_mode);
+}
+
+void RCOnRemoteControlSettingsNotification::ProcessAllowedParam() {
if (!(*message_)[app_mngr::strings::msg_params].keyExists(
message_params::kAllowed)) {
- SDL_LOG_DEBUG("Notification is ignored due to \"allow\" parameter absense");
- SDL_LOG_DEBUG("RC Functionality remains unchanged");
+ SDL_LOG_DEBUG("No allowed param received. Using last known: "
+ << std::boolalpha
+ << resource_allocation_manager_.is_rc_enabled());
return;
}
const bool is_allowed =
(*message_)[app_mngr::strings::msg_params][message_params::kAllowed]
.asBool();
+
if (is_allowed) {
- hmi_apis::Common_RCAccessMode::eType access_mode =
- hmi_apis::Common_RCAccessMode::INVALID_ENUM;
SDL_LOG_DEBUG("Allowing RC Functionality");
resource_allocation_manager_.set_rc_enabled(true);
- if ((*message_)[app_mngr::strings::msg_params].keyExists(
- message_params::kAccessMode)) {
- access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
- (*message_)[app_mngr::strings::msg_params]
- [message_params::kAccessMode]
- .asUInt());
- SDL_LOG_DEBUG(
- "Setting up access mode : " << AccessModeToString(access_mode));
- } else {
- access_mode = resource_allocation_manager_.GetAccessMode();
- SDL_LOG_DEBUG("No access mode received. Using last known: "
- << AccessModeToString(access_mode));
- }
- resource_allocation_manager_.SetAccessMode(access_mode);
- } else {
- SDL_LOG_DEBUG("Disallowing RC Functionality");
- DisallowRCFunctionality();
- resource_allocation_manager_.ResetAllAllocations();
- resource_allocation_manager_.set_rc_enabled(false);
- rc_consent_manager_.RemoveAllConsents();
+ return;
}
+
+ SDL_LOG_DEBUG("Disallowing RC Functionality");
+ DisallowRCFunctionality();
+ resource_allocation_manager_.ResetAllAllocations();
+ resource_allocation_manager_.set_rc_enabled(false);
+ rc_consent_manager_.RemoveAllConsents();
}
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
index 9bf7977bdf..297c4b70bb 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
@@ -125,7 +125,7 @@ AcquireResult::eType ButtonPressRequest::AcquireResource(
SDL_LOG_AUTO_TRACE();
const std::string module_type = ModuleType();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
return resource_allocation_manager_.AcquireResource(
module_type, ModuleId(), app->app_id());
@@ -141,8 +141,7 @@ void ButtonPressRequest::SetResourceState(const std::string& module_type,
const ResourceState::eType state) {
SDL_LOG_AUTO_TRACE();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
-
+ application_manager_.application(RequestFromMobileImpl::connection_key());
resource_allocation_manager_.SetResourceState(
module_type, ModuleId(), app->app_id(), state);
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc
index a13a7f2a9e..b2b164b9ad 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc
@@ -116,7 +116,7 @@ void GetInteriorVehicleDataConsentRequest::Execute() {
module_ids_for_consent->clear();
auto module_ids = msg_params[message_params::kModuleIds].asArray();
- for (uint32_t i = 0; i < module_ids->size(); i++) {
+ for (uint32_t i = 0; i < module_ids->size(); ++i) {
// Only add modules whose consent is unknown(needs to be sent to the hmi)
bool is_consent_undefined =
(*hmi_request_consents_.asArray())[i].getType() ==
@@ -207,7 +207,7 @@ void GetInteriorVehicleDataConsentRequest::on_event(
consent.getType() == smart_objects::SmartType::SmartType_Null;
if (is_consent_undefined) {
consent = (*response_consents)[response_consents_counter];
- response_consents_counter++;
+ ++response_consents_counter;
}
}
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 c3b0a7d4a5..f5c5c9278d 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
@@ -315,7 +315,7 @@ void GetInteriorVehicleDataRequest::ProccessSubscription(
const_cast<smart_objects::SmartObject&>(hmi_response);
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
const auto extension = RCHelpers::GetRCExtension(*app);
const char* module_type;
ns_smart_device_link::ns_smart_objects::
@@ -403,8 +403,8 @@ bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() {
message_params::kSubscribe);
if (is_subscribe_present_in_request) {
- app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ app_mngr::ApplicationSharedPtr app = application_manager_.application(
+ RequestFromMobileImpl::connection_key());
const auto extension = RCHelpers::GetRCExtension(*app);
const std::string module_type = ModuleType();
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 dea660b780..5b500dfa30 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
@@ -372,7 +372,7 @@ AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource(
SDL_LOG_AUTO_TRACE();
const std::string module_type = ModuleType();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
return resource_allocation_manager_.AcquireResource(
module_type, ModuleId(), app->app_id());
@@ -387,7 +387,7 @@ void SetInteriorVehicleDataRequest::SetResourceState(
const std::string& module_type, const ResourceState::eType state) {
SDL_LOG_AUTO_TRACE();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
resource_allocation_manager_.SetResourceState(
module_type, ModuleId(), app->app_id(), state);
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
index 12608d64c1..376723b964 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
@@ -31,7 +31,9 @@
*/
#include "rc_rpc_plugin/commands/rc_command_request.h"
+
#include <sstream>
+
#include "application_manager/hmi_interfaces.h"
#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
@@ -49,7 +51,7 @@ namespace commands {
RCCommandRequest::RCCommandRequest(
const app_mngr::commands::MessageSharedPtr& message,
const RCCommandParams& params)
- : application_manager::commands::CommandRequestImpl(
+ : application_manager::commands::RequestFromMobileImpl(
message,
params.application_manager_,
params.rpc_service_,
@@ -74,18 +76,18 @@ bool RCCommandRequest::IsInterfaceAvailable(
return app_mngr::HmiInterfaces::STATE_NOT_AVAILABLE != state;
}
-void RCCommandRequest::onTimeOut() {
+void RCCommandRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
const std::string module_type = ModuleType();
SetResourceState(module_type, ResourceState::FREE);
- SendResponse(
- false, mobile_apis::Result::GENERIC_ERROR, "Request timeout expired");
+
+ RequestFromMobileImpl::OnTimeOut();
}
bool RCCommandRequest::CheckDriverConsent() {
SDL_LOG_AUTO_TRACE();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(connection_key());
const std::string module_type = ModuleType();
rc_rpc_plugin::TypeAccess access = CheckModule(module_type, app);
@@ -131,7 +133,7 @@ void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) {
void RCCommandRequest::Run() {
SDL_LOG_AUTO_TRACE();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(connection_key());
if (!IsInterfaceAvailable(app_mngr::HmiInterfaces::HMI_INTERFACE_RC)) {
SDL_LOG_WARN("HMI interface RC is not available");
@@ -224,19 +226,19 @@ void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) {
void RCCommandRequest::ProcessAccessResponse(
const app_mngr::event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
- app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+
+ auto app = application_manager_.application(connection_key());
const std::string module_type = ModuleType();
const std::string module_id = ModuleId();
+
if (!app) {
SDL_LOG_ERROR("NULL pointer.");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED, "");
return;
}
- const smart_objects::SmartObject& message = event.smart_object();
-
- mobile_apis::Result::eType result_code =
+ const auto& message = event.smart_object();
+ const auto result_code =
GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
message[app_mngr::strings::params][app_mngr::hmi_response::code]
.asUInt()));
@@ -278,6 +280,11 @@ void RCCommandRequest::ProcessConsentResult(const bool is_allowed,
SDL_LOG_AUTO_TRACE();
if (is_allowed) {
SetResourceState(module_type, ResourceState::BUSY);
+ const auto default_timeout =
+ application_manager_.get_settings().default_timeout() +
+ application_manager_.get_settings().default_timeout_compensation();
+ application_manager_.UpdateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout);
Execute(); // run child's logic
} else {
resource_allocation_manager_.OnDriverDisallowed(
@@ -323,7 +330,7 @@ void RCCommandRequest::SendGetUserConsent(
const smart_objects::SmartObject& module_ids) {
SDL_LOG_AUTO_TRACE();
app_mngr::ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(connection_key());
DCHECK(app);
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
index b623350388..b38df8f985 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
@@ -71,10 +71,11 @@ std::set<rc_rpc_plugin::ModuleUid> ConvertSmartObjectToModuleCollection(
} // namespace
namespace rc_rpc_plugin {
-RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid,
- RCRPCPlugin& plugin,
+RCAppExtension::RCAppExtension(RCRPCPlugin& plugin,
application_manager::Application& application)
- : AppExtension(uid), plugin_(plugin), application_(application) {}
+ : AppExtension(RCAppExtensionID)
+ , plugin_(plugin)
+ , application_(application) {}
void RCAppExtension::SubscribeToInteriorVehicleData(const ModuleUid& module) {
subscribed_interior_vehicle_data_.insert(module);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
index c1743c8540..6e5d1b6e5c 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
@@ -217,7 +217,8 @@ CommandCreator& RCCommandFactory::get_mobile_command_creator(
: rc_factory.GetCreator<
commands::GetInteriorVehicleDataConsentResponse>();
}
- default: {}
+ default: {
+ }
}
return rc_factory.GetCreator<RCInvalidCommand>();
}
@@ -230,7 +231,8 @@ CommandCreator& RCCommandFactory::get_mobile_notification_creator(
return rc_factory
.GetCreator<commands::OnInteriorVehicleDataNotification>();
}
- default: {}
+ default: {
+ }
}
return rc_factory.GetCreator<RCInvalidCommand>();
}
@@ -259,7 +261,8 @@ CommandCreator& RCCommandFactory::get_mobile_creator_factory(
}
break;
}
- default: {}
+ default: {
+ }
}
return rc_factory.GetCreator<RCInvalidCommand>();
}
@@ -314,7 +317,9 @@ CommandCreator& RCCommandFactory::get_hmi_creator_factory(
: rc_factory
.GetCreator<commands::RCSetGlobalPropertiesResponse>();
}
- default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ default: {
+ return rc_factory.GetCreator<RCInvalidCommand>();
+ }
}
}
} // namespace rc_rpc_plugin
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 b2d1f1513b..7b6d5041c0 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
@@ -186,7 +186,8 @@ const std::vector<std::string> RCHelpers::GetModuleTypesList() {
RCAppExtensionPtr RCHelpers::GetRCExtension(
application_manager::Application& app) {
SDL_LOG_AUTO_TRACE();
- auto extension_interface = app.QueryInterface(RCRPCPlugin::kRCPluginID);
+ auto extension_interface =
+ app.QueryInterface(RCAppExtension::RCAppExtensionID);
auto extension =
std::static_pointer_cast<RCAppExtension>(extension_interface);
return extension;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_pending_resumption_handler.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_pending_resumption_handler.cc
index e66023f27a..ba681b0136 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_pending_resumption_handler.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_pending_resumption_handler.cc
@@ -14,7 +14,7 @@ RCPendingResumptionHandler::RCPendingResumptionHandler(
, rpc_service_(application_manager.GetRPCService())
, interior_data_cache_(interior_data_cache) {}
-void RCPendingResumptionHandler::on_event(
+void RCPendingResumptionHandler::HandleOnEvent(
const application_manager::event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
namespace am_strings = application_manager::strings;
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 87090405e7..b110d3157d 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
@@ -86,14 +86,6 @@ bool RCRPCPlugin::Init(
return true;
}
-bool RCRPCPlugin::Init(application_manager::ApplicationManager&,
- application_manager::rpc_service::RPCService&,
- application_manager::HMICapabilities&,
- policy::PolicyHandlerInterface&,
- resumption::LastState&) {
- return false;
-}
-
bool RCRPCPlugin::IsAbleToProcess(
const int32_t function_id,
const application_manager::commands::Command::CommandSource
@@ -119,42 +111,50 @@ void RCRPCPlugin::OnApplicationEvent(
application_manager::plugin_manager::ApplicationEvent event,
application_manager::ApplicationSharedPtr application) {
SDL_LOG_AUTO_TRACE();
- if (!application->is_remote_control_supported()) {
- SDL_LOG_DEBUG(
- "Remote control is not supported for application with app_id: "
- << application->app_id());
- return;
- }
+
switch (event) {
case plugins::kApplicationRegistered: {
- auto extension = std::shared_ptr<RCAppExtension>(
- new RCAppExtension(kRCPluginID, *this, *application));
- DCHECK_OR_RETURN_VOID(application->AddExtension(extension));
- const auto driver_location =
- rc_capabilities_manager_
- ->GetDriverLocationFromSeatLocationCapability();
- extension->SetUserLocation(driver_location);
+ if (application->is_remote_control_supported()) {
+ CreateRcExtension(application);
+ }
+
break;
}
+ case plugins::kApplicationUnregistered:
case plugins::kApplicationExit: {
- resource_allocation_manager_->OnApplicationEvent(event, application);
- interior_data_manager_->OnApplicationEvent(event, application);
- break;
- }
- case plugins::kApplicationUnregistered: {
- resource_allocation_manager_->OnApplicationEvent(event, application);
- interior_data_manager_->OnApplicationEvent(event, application);
+ if (application->is_remote_control_supported()) {
+ resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
+ }
+
break;
}
case plugins::kGlobalPropertiesUpdated: {
- const auto user_location = application->get_user_location();
- auto extension = RCHelpers::GetRCExtension(*application);
- extension->SetUserLocation(user_location);
+ if (application->is_remote_control_supported()) {
+ const auto user_location = application->get_user_location();
+ auto extension = RCHelpers::GetRCExtension(*application);
+ extension->SetUserLocation(user_location);
+ }
+
break;
}
case plugins::kRCStatusChanged: {
- resource_allocation_manager_->SendOnRCStatusNotifications(
- NotificationTrigger::APP_REGISTRATION, application);
+ if (application->is_remote_control_supported()) {
+ resource_allocation_manager_->SendOnRCStatusNotifications(
+ NotificationTrigger::APP_REGISTRATION, application);
+ }
+
+ break;
+ }
+ case plugins::kAppHmiTypesChanged: {
+ auto extension =
+ application->QueryInterface(RCAppExtension::RCAppExtensionID);
+ if (!application->is_remote_control_supported() && extension) {
+ RemoveRcExtension(application);
+ } else if (application->is_remote_control_supported() && !extension) {
+ CreateRcExtension(application);
+ }
+
break;
}
default:
@@ -162,6 +162,25 @@ void RCRPCPlugin::OnApplicationEvent(
}
}
+void RCRPCPlugin::CreateRcExtension(
+ application_manager::ApplicationSharedPtr application) {
+ auto extension =
+ std::shared_ptr<RCAppExtension>(new RCAppExtension(*this, *application));
+ DCHECK_OR_RETURN_VOID(application->AddExtension(extension));
+ const auto driver_location =
+ rc_capabilities_manager_->GetDriverLocationFromSeatLocationCapability();
+ extension->SetUserLocation(driver_location);
+}
+
+void RCRPCPlugin::RemoveRcExtension(
+ application_manager::ApplicationSharedPtr application) {
+ resource_allocation_manager_->OnApplicationEvent(
+ plugins::kApplicationUnregistered, application);
+ interior_data_manager_->OnApplicationEvent(plugins::kApplicationUnregistered,
+ application);
+ application->RemoveExtension(RCAppExtension::RCAppExtensionID);
+}
+
void RCRPCPlugin::ProcessResumptionSubscription(
application_manager::Application& app, RCAppExtension& ext) {
SDL_LOG_AUTO_TRACE();
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 fe9bb5eec3..0c513cb01e 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
@@ -140,7 +140,9 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
<< module_type << " " << module_id);
return AcquireResult::ALLOWED;
}
- default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); }
+ default: {
+ DCHECK_OR_RETURN(false, AcquireResult::IN_USE);
+ }
}
}
@@ -486,6 +488,28 @@ bool ResourceAllocationManagerImpl::IsResourceFree(
return ResourceState::FREE == resource->second;
}
+bool ResourceAllocationManagerImpl::IsResourceAllocated(
+ const std::string& module_type,
+ const std::string& module_id,
+ const uint32_t app_id) {
+ ModuleUid module(module_type, module_id);
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const auto allocation = allocated_resources_.find(module);
+ if (allocated_resources_.end() == allocation) {
+ SDL_LOG_DEBUG("Resource " << module_type << " is not allocated.");
+ return false;
+ }
+
+ if (app_id != allocation->second) {
+ SDL_LOG_DEBUG("Resource " << module_type
+ << " is allocated by different application "
+ << allocation->second);
+ return true;
+ }
+
+ return false;
+}
+
void ResourceAllocationManagerImpl::SetAccessMode(
const hmi_apis::Common_RCAccessMode::eType access_mode) {
if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) {
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 16e95bf599..b438943eca 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
@@ -63,7 +63,7 @@ set(LIBRARIES
gmock_main
)
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
index 6c0962a557..f4ef39f488 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
@@ -65,7 +65,6 @@ using ::testing::ReturnRef;
using ::testing::SaveArg;
namespace {
-const int kModuleId = 153u;
const uint32_t kConnectionKey = 1u;
const uint32_t kAppId = 0u;
const std::string kPolicyAppId = "Test";
@@ -83,13 +82,13 @@ class ButtonPressRequestTest
smart_objects::SmartType_Map))
, mock_app_(std::make_shared<NiceMock<MockApplication> >())
, rc_app_extension_(std::make_shared<rc_rpc_plugin::RCAppExtension>(
- kModuleId, rc_plugin_, *mock_app_)) {}
+ rc_plugin_, *mock_app_)) {}
void SetUp() OVERRIDE {
smart_objects::SmartObject control_caps((smart_objects::SmartType_Array));
(*rc_capabilities_)[strings::kradioControlCapabilities] = control_caps;
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ ON_CALL(*mock_app_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillByDefault(Return(rc_app_extension_));
ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
@@ -105,6 +104,8 @@ class ButtonPressRequestTest
.WillByDefault(Return(true));
ON_CALL(mock_allocation_manager_, is_rc_enabled())
.WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::AUTO_ALLOW));
ON_CALL(mock_rc_capabilities_manager_, CheckButtonName(_, _))
.WillByDefault(Return(true));
ON_CALL(mock_rc_capabilities_manager_, CheckIfModuleExistsInCapabilities(_))
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 fdfa3ea03a..5fa474c631 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
@@ -95,9 +95,9 @@ class GetInteriorVehicleDataRequestTest
: mock_app_(std::make_shared<NiceMock<MockApplication> >())
, mock_app2_(std::make_shared<NiceMock<MockApplication> >())
, rc_app_extension_(
- std::make_shared<RCAppExtension>(kModuleId, rc_plugin_, *mock_app_))
- , rc_app_extension2_(std::make_shared<RCAppExtension>(
- kModuleId, rc_plugin_, *mock_app2_))
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_))
+ , rc_app_extension2_(
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app2_))
, apps_lock_(std::make_shared<sync_primitives::Lock>())
, apps_da_(apps_, apps_lock_)
, rc_capabilities_(std::make_shared<smart_objects::SmartObject>(
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
index 6c7a7ba67e..9acfc084c5 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -62,7 +62,6 @@ const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "Test";
const std::string module_type = "CLIMATE";
const std::string module_id = "34045662-a9dc-4823-8435-91056d4c26cb";
-const int kModuleId = 153u;
} // namespace
namespace rc_rpc_plugin_test {
@@ -75,7 +74,7 @@ class OnInteriorVehicleDataNotificationTest
OnInteriorVehicleDataNotificationTest()
: mock_app_(std::make_shared<NiceMock<MockApplication> >())
, rc_app_extension_(
- std::make_shared<RCAppExtension>(kModuleId, rc_plugin_, *mock_app_))
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_))
, apps_lock_(std::make_shared<sync_primitives::Lock>())
, apps_da_(apps_, apps_lock_) {
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
index 62b726ac60..5d569e93d2 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
@@ -117,18 +117,61 @@ class RCOnRemoteControlSettingsNotificationTest
};
TEST_F(RCOnRemoteControlSettingsNotificationTest,
- Run_Allowed_SetAccessMode) { // Arrange
+ Run_Allowed_MissedAccessMode) { // Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
(*mobile_message)[application_manager::strings::msg_params]
[message_params::kAllowed] = true;
// Expectations
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(_)).Times(0);
+ EXPECT_CALL(mock_allocation_manager_, set_rc_enabled(true));
- ON_CALL(mock_allocation_manager_, GetAccessMode())
- .WillByDefault(Return(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+
+ command->Run();
+}
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_AccessMode_MissedAllowed) { // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAccessMode] =
+ hmi_apis::Common_RCAccessMode::ASK_DRIVER;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, set_rc_enabled(_)).Times(0);
+ EXPECT_CALL(mock_allocation_manager_,
+ SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+ command->Run();
+}
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_AccessModeAndAllowed_BothPresent) { // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = true;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAccessMode] =
+ hmi_apis::Common_RCAccessMode::ASK_DRIVER;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, set_rc_enabled(true));
EXPECT_CALL(mock_allocation_manager_,
SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+
// Act
std::shared_ptr<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>
@@ -145,9 +188,10 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest,
MessageSharedPtr mobile_message = CreateBasicMessage();
(*mobile_message)[application_manager::strings::msg_params]
[message_params::kAllowed] = false;
-
- EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations());
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
EXPECT_CALL(mock_interior_data_manager_, OnDisablingRC());
+ EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations());
EXPECT_CALL(mock_rc_consent_manger_, RemoveAllConsents());
// Act
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
index 8fbaeda2f2..82d1b128f0 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
@@ -39,10 +39,11 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/mock_request_timeout_handler.h"
#include "application_manager/mock_rpc_plugin.h"
#include "application_manager/mock_rpc_plugin_manager.h"
#include "application_manager/mock_rpc_protection_manager.h"
-#include "application_manager/request_controller.h"
+#include "application_manager/request_controller_impl.h"
#include "application_manager/rpc_service_impl.h"
#include "hmi_message_handler/mock_hmi_message_handler.h"
#include "include/test/protocol_handler/mock_protocol_handler.h"
@@ -81,6 +82,7 @@ using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockCommandFactory;
using test::components::application_manager_test::MockHMICapabilities;
using test::components::application_manager_test::MockRequestControlerSettings;
+using test::components::application_manager_test::MockRequestTimeoutHandler;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
using test::components::hmi_message_handler_test::MockHMIMessageHandler;
@@ -97,7 +99,6 @@ const std::string kResource = "CLIMATE";
const std::string kResourceId = "34045662-a9dc-4823-8435-91056d4c26cb";
const std::string kPolicyAppId = "policy_app_id";
const std::string kMacAddress = "device1";
-const uint32_t kPluginID = RCRPCPlugin::kRCPluginID;
} // namespace
class RCGetInteriorVehicleDataConsentTest
@@ -108,9 +109,11 @@ class RCGetInteriorVehicleDataConsentTest
, command_holder(app_mngr_)
, rc_capabilities_(std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType::SmartType_Array))
- , request_controller(mock_request_controler)
, rpc_protection_manager_(
std::make_shared<application_manager::MockRPCProtectionManager>())
+ , request_controller(mock_request_controler,
+ mock_request_timeout_handler_,
+ event_dispatcher_)
, rpc_service_(app_mngr_,
request_controller,
&mock_protocol_handler,
@@ -120,7 +123,7 @@ class RCGetInteriorVehicleDataConsentTest
hmi_so_factory_,
mobile_so_factoy_)
, rc_app_extension_(
- std::make_shared<RCAppExtension>(kPluginID, rc_plugin_, *mock_app_))
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_))
, mock_rpc_plugin_manager(
std::make_shared<NiceMock<MockRPCPluginManager> >())
, rpc_plugin(mock_rpc_plugin)
@@ -136,7 +139,7 @@ class RCGetInteriorVehicleDataConsentTest
.WillByDefault(Return(application_manager::HmiInterfaces::
InterfaceState::STATE_AVAILABLE));
ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ ON_CALL(*mock_app_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillByDefault(Return(rc_app_extension_));
testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
mock_interior_data_cache_;
@@ -214,9 +217,10 @@ class RCGetInteriorVehicleDataConsentTest
smart_objects::SmartObjectSPtr rc_capabilities_;
MockRPCPlugin mock_rpc_plugin;
MockCommandFactory mock_command_factory;
- am::request_controller::RequestController request_controller;
std::shared_ptr<application_manager::MockRPCProtectionManager>
rpc_protection_manager_;
+ MockRequestTimeoutHandler mock_request_timeout_handler_;
+ am::request_controller::RequestControllerImpl request_controller;
am::rpc_service::RPCServiceImpl rpc_service_;
RCRPCPlugin rc_plugin_;
std::shared_ptr<RCAppExtension> rc_app_extension_;
@@ -235,6 +239,8 @@ TEST_F(RCGetInteriorVehicleDataConsentTest,
Run_MobileSendButtonPressMessage_HMISendASKDRIVERModeToMobile) {
// Arrange
auto mobile_message = CreateBasicMessage();
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
// Expectations
EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _, _))
@@ -279,6 +285,9 @@ TEST_F(RCGetInteriorVehicleDataConsentTest,
.WillOnce(ReturnRef(mock_command_factory));
auto mobile_message = CreateBasicMessage();
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::AUTO_DENY));
+
auto rc_consent_response =
CreateRCCommand<commands::RCGetInteriorVehicleDataConsentResponse>(
mobile_message);
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 9b06ddb137..fe190a796f 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
@@ -74,7 +74,7 @@ class SetInteriorVehicleDataRequestTest
SetInteriorVehicleDataRequestTest()
: mock_app_(std::make_shared<NiceMock<MockApplication> >())
, rc_app_extension_(
- std::make_shared<RCAppExtension>(kModuleId, rc_plugin_, *mock_app_))
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_))
, rc_capabilities_(std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType::SmartType_Array)) {}
@@ -89,7 +89,7 @@ class SetInteriorVehicleDataRequestTest
.WillByDefault(Return(application_manager::HmiInterfaces::
InterfaceState::STATE_AVAILABLE));
ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ ON_CALL(*mock_app_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillByDefault(Return(rc_app_extension_));
ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
@@ -112,6 +112,8 @@ class SetInteriorVehicleDataRequestTest
ON_CALL(mock_rc_capabilities_manager_, GetModuleDataCapabilities(_, _))
.WillByDefault(
Return(std::make_pair("", capabilitiesStatus::kSuccess)));
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::AUTO_ALLOW));
}
MessageSharedPtr CreateBasicMessage() {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
index fca6c9c77e..2f128d64a8 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
@@ -70,6 +70,10 @@ class MockResourceAllocationManager
MOCK_CONST_METHOD2(IsResourceFree,
bool(const std::string& module_type,
const std::string& module_id));
+ MOCK_METHOD3(IsResourceAllocated,
+ bool(const std::string& module_type,
+ const std::string& module_id,
+ const uint32_t app_id));
MOCK_METHOD0(ResetAllAllocations, void());
MOCK_METHOD2(SendOnRCStatusNotifications,
void(rc_rpc_plugin::NotificationTrigger::eType,
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_app_extension_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_app_extension_test.cc
index 60c3fb9135..ea099ef901 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_app_extension_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_app_extension_test.cc
@@ -40,10 +40,6 @@
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
-namespace {
-const uint32_t kRCAppExtensionId = 1ull;
-} // namespace
-
namespace test {
namespace components {
namespace rc_rpc_plugin_test {
@@ -57,7 +53,7 @@ class RcAppExtensionTest : public testing::Test {
RcAppExtensionTest()
: mock_app_(new NiceMock<MockApplication>())
, rc_app_extension_(std::make_shared<rc_rpc_plugin::RCAppExtension>(
- kRCAppExtensionId, rc_plugin_, *mock_app_)) {}
+ rc_plugin_, *mock_app_)) {}
protected:
std::unique_ptr<MockApplication> mock_app_;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_pending_resumption_handler_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_pending_resumption_handler_test.cc
index fe8ade1e05..8ea478cd19 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_pending_resumption_handler_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_pending_resumption_handler_test.cc
@@ -78,7 +78,6 @@ const std::string kModuleType_1 = "CLIMATE";
const std::string kModuleId_1 = "9cb963f3-c5e8-41cb-b001-19421cc16552";
const std::string kModuleType_2 = "RADIO";
const std::string kModuleId_2 = "357a3918-9f35-4d86-a8b6-60cd4308d76f";
-const uint32_t kRCPluginID = rc_rpc_plugin::RCRPCPlugin::kRCPluginID;
const auto kSourceHMI = application_manager::commands::Command::SOURCE_HMI;
} // namespace
@@ -171,9 +170,11 @@ class RCPendingResumptionHandlerTest : public ::testing::Test {
}
rc_rpc_plugin::RCAppExtensionPtr CreateExtension(MockApplication& app) {
- auto rc_app_ext = std::make_shared<rc_rpc_plugin::RCAppExtension>(
- kRCPluginID, rc_plugin_, app);
- ON_CALL(app, QueryInterface(kRCPluginID)).WillByDefault(Return(rc_app_ext));
+ auto rc_app_ext =
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(rc_plugin_, app);
+ ON_CALL(app,
+ QueryInterface(rc_rpc_plugin::RCAppExtension::RCAppExtensionID))
+ .WillByDefault(Return(rc_app_ext));
return rc_app_ext;
}
@@ -369,7 +370,7 @@ TEST_F(RCPendingResumptionHandlerTest,
EXPECT_CALL(event_dispatcher_mock_, raise_event(EventCheck(kAppId_2)));
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
}
TEST_F(RCPendingResumptionHandlerTest,
@@ -415,7 +416,7 @@ TEST_F(RCPendingResumptionHandlerTest,
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(MessageCheck(kAppId_2), kSourceHMI));
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
}
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/CMakeLists.txt
index a22543ba09..adc0cec1b3 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/CMakeLists.txt
@@ -71,7 +71,7 @@ set(LIBRARIES
dl
)
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc
index 501fbc323d..bae6ed805c 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc
@@ -112,9 +112,8 @@ class RAManagerTest : public ::testing::Test {
, mock_rc_helpers_(MockRCHelpers::rc_helpers_mock()) {
ON_CALL(mock_app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
- auto plugin_id = rc_rpc_plugin::RCRPCPlugin::kRCPluginID;
app_ext_ptr_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(
- plugin_id, rc_plugin_, *mock_app_1_);
+ rc_plugin_, *mock_app_1_);
ON_CALL(*mock_app_1_, app_id()).WillByDefault(Return(kAppId1));
PrepareResources();
@@ -130,13 +129,12 @@ class RAManagerTest : public ::testing::Test {
ON_CALL(mock_app_mngr_, application(kAppId1))
.WillByDefault(Return(mock_app_1_));
ON_CALL(*mock_app_1_,
- QueryInterface(rc_rpc_plugin::RCRPCPlugin::kRCPluginID))
+ QueryInterface(rc_rpc_plugin::RCAppExtension::RCAppExtensionID))
.WillByDefault(Return(app_ext_ptr_));
ON_CALL(mock_app_mngr_, application(kAppId2))
.WillByDefault(Return(mock_app_2_));
- ON_CALL(*mock_app_2_,
- QueryInterface(rc_rpc_plugin::RCRPCPlugin::kRCPluginID))
+ ON_CALL(*mock_app_2_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillByDefault(Return(app_ext_ptr_));
OnRCStatusNotificationExpectations();
@@ -144,10 +142,7 @@ class RAManagerTest : public ::testing::Test {
void SetUp() OVERRIDE {
rc_app_extension_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(
- static_cast<application_manager::AppExtensionUID>(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID),
- rc_plugin_,
- *mock_app_1_);
+ rc_plugin_, *mock_app_1_);
ON_CALL(mock_rc_capabilities_manager_,
GetDriverLocationFromSeatLocationCapability())
.WillByDefault(Return(kDriverLocation));
@@ -407,11 +402,8 @@ TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
mock_app_mngr_, mock_rpc_service_, mock_rc_capabilities_manager_);
ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
- RCAppExtensionPtr rc_extension_ptr = std::make_shared<RCAppExtension>(
- application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID),
- rc_plugin_,
- *mock_app_1_);
+ RCAppExtensionPtr rc_extension_ptr =
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_1_);
EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
ra_manager.AcquireResource(kModuleType1, kModuleId, kAppId1));
@@ -483,13 +475,10 @@ TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
- RCAppExtensionPtr rc_extension_ptr = std::make_shared<RCAppExtension>(
- application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID),
- rc_plugin_,
- *mock_app_1_);
+ RCAppExtensionPtr rc_extension_ptr =
+ std::make_shared<RCAppExtension>(rc_plugin_, *mock_app_1_);
- EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillRepeatedly(Return(rc_extension_ptr));
// Act
@@ -517,13 +506,9 @@ TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
.WillRepeatedly(Return(mock_app_1_));
RCAppExtensionPtr rc_extension_ptr =
- std::make_shared<rc_rpc_plugin::RCAppExtension>(
- application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID),
- rc_plugin_,
- *mock_app_1_);
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(rc_plugin_, *mock_app_1_);
- EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCAppExtension::RCAppExtensionID))
.WillRepeatedly(Return(rc_extension_ptr));
ON_CALL(*mock_app_1_, is_remote_control_supported())
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 67a178893c..073359ce80 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
@@ -65,7 +65,7 @@ set(LIBRARIES
jsoncpp
)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
index 2208671e0b..b6406901be 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
@@ -61,12 +61,7 @@ class BasicCommunicationGetSystemTimeRequest
app_mngr::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler);
- /**
- * @brief onTimeOut allows to handle case when
- * system does not respond for certain request in
- * appropriate time window.
- */
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
};
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
index 62be7e8836..7b0e3f4590 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
@@ -64,7 +64,7 @@ class ButtonGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
index 0b82feb1c5..98f96c29c4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
@@ -67,9 +67,9 @@ class GetSystemInfoRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
/**
- * @brief onTimeOut from request controller
+ * @brief OnTimeOut from request controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
index ac6f1474e6..0cf1e0872e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
@@ -43,8 +43,7 @@ namespace commands {
/**
* @brief AudioStartStreamRequest command class
**/
-class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief AudioStartStreamRequest class constructor
@@ -62,10 +61,7 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
**/
virtual ~AudioStartStreamRequest();
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
+ void OnTimeOut() FINAL;
/**
* @brief Execute command
@@ -75,7 +71,7 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief On event callback
**/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
index d2bda320a3..7cc4181f6e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
@@ -43,8 +43,7 @@ namespace commands {
/**
* @brief NaviIsReadyRequest command class
**/
-class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief NaviIsReadyRequest class constructor
@@ -72,7 +71,7 @@ class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI,
**/
void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
index 437d58861c..8a62f31933 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
@@ -43,8 +43,7 @@ namespace commands {
/**
* @brief NaviSetVideoConfigRequest command class
**/
-class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief NaviSetVideoConfigRequest class constructor
@@ -76,7 +75,7 @@ class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut callback
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
index 76413cd55d..9527ae0a7d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
@@ -43,8 +43,7 @@ namespace commands {
/**
* @brief NaviStartStreamRequest command class
**/
-class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief NaviStartStreamRequest class constructor
@@ -70,12 +69,9 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief On event callback
**/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
+ void OnTimeOut() FINAL;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
index 898a2a8f67..c836ad3cc8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
@@ -65,7 +65,7 @@ class NaviSubscribeWayPointsRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h
index 1c87f82349..57c6f55e03 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_
#include "application_manager/commands/notification_from_hmi.h"
@@ -43,17 +43,17 @@ namespace commands {
namespace hmi {
/**
- * @brief OnUIResetTimeoutNotification command class
+ * @brief OnResetTimeoutNotification command class
**/
-class OnUIResetTimeoutNotification
+class OnResetTimeoutNotification
: public app_mngr::commands::NotificationFromHMI {
public:
/**
- * @brief OnUIResetTimeoutNotification class constructor
+ * @brief OnResetTimeoutNotification class constructor
*
* @param message Incoming SmartObject message
**/
- OnUIResetTimeoutNotification(
+ OnResetTimeoutNotification(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -61,9 +61,9 @@ class OnUIResetTimeoutNotification
policy::PolicyHandlerInterface& policy_handle);
/**
- * @brief OnUIResetTimeoutNotification class destructor
+ * @brief OnResetTimeoutNotification class destructor
**/
- virtual ~OnUIResetTimeoutNotification();
+ virtual ~OnResetTimeoutNotification();
/**
* @brief Execute command
@@ -71,7 +71,7 @@ class OnUIResetTimeoutNotification
virtual void Run();
private:
- DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
+ DISALLOW_COPY_AND_ASSIGN(OnResetTimeoutNotification);
};
} // namespace hmi
@@ -80,4 +80,4 @@ class OnUIResetTimeoutNotification
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h
deleted file mode 100644
index c8bd159064..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnTTSResetTimeoutNotification command class
- **/
-class OnTTSResetTimeoutNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnTTSResetTimeoutNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSResetTimeoutNotification(
- 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 OnTTSResetTimeoutNotification class destructor
- **/
- virtual ~OnTTSResetTimeoutNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
deleted file mode 100644
index c848233497..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIAccPedalPositionNotification command class
- **/
-class OnVIAccPedalPositionNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIAccPedalPositionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIAccPedalPositionNotification(
- 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 OnVIAccPedalPositionNotification class destructor
- **/
- virtual ~OnVIAccPedalPositionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
deleted file mode 100644
index 0cb3e04f4e..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_BELT_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIBeltStatusNotification command class
- **/
-class OnVIBeltStatusNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIBeltStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBeltStatusNotification(
- 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 OnVIBeltStatusNotification class destructor
- **/
- virtual ~OnVIBeltStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
deleted file mode 100644
index 6ab920204d..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIBodyInformationNotification command class
- **/
-class OnVIBodyInformationNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIBodyInformationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBodyInformationNotification(
- 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 OnVIBodyInformationNotification class destructor
- **/
- virtual ~OnVIBodyInformationNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
deleted file mode 100644
index b3afeb82b3..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIDeviceStatusNotification command class
- **/
-class OnVIDeviceStatusNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIDeviceStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDeviceStatusNotification(
- 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 OnVIDeviceStatusNotification class destructor
- **/
- virtual ~OnVIDeviceStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
deleted file mode 100644
index a1885c5e29..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIDriverBrakingNotification command class
- **/
-class OnVIDriverBrakingNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIDriverBrakingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDriverBrakingNotification(
- 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 OnVIDriverBrakingNotification class destructor
- **/
- virtual ~OnVIDriverBrakingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
deleted file mode 100644
index feb6cc6060..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIEngineTorqueNotification command class
- **/
-class OnVIEngineTorqueNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIEngineTorqueNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIEngineTorqueNotification(
- 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 OnVIEngineTorqueNotification class destructor
- **/
- virtual ~OnVIEngineTorqueNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
deleted file mode 100644
index 734420aaee..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIExternalTemperatureNotification command class
- **/
-class OnVIExternalTemperatureNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIExternalTemperatureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIExternalTemperatureNotification(
- 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 OnVIExternalTemperatureNotification class destructor
- **/
- virtual ~OnVIExternalTemperatureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
deleted file mode 100644
index 5ed661cdbf..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelStateNotification command class
- **/
-class OnVIFuelLevelStateNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelStateNotification(
- 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 OnVIFuelLevelStateNotification class destructor
- **/
- virtual ~OnVIFuelLevelStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
deleted file mode 100644
index 5ef1e3ed92..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIHeadLampStatusNotification command class
- **/
-class OnVIHeadLampStatusNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIHeadLampStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIHeadLampStatusNotification(
- 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 OnVIHeadLampStatusNotification class destructor
- **/
- virtual ~OnVIHeadLampStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
deleted file mode 100644
index 7bb7756fc5..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIInstantFuelConsumptionNotification command class
- **/
-class OnVIInstantFuelConsumptionNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIInstantFuelConsumptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIInstantFuelConsumptionNotification(
- 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 OnVIInstantFuelConsumptionNotification class destructor
- **/
- virtual ~OnVIInstantFuelConsumptionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
deleted file mode 100644
index cdebc99768..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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_ON_VI_MY_KEY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIMyKeyNotification command class
- **/
-class OnVIMyKeyNotification : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIMyKeyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIMyKeyNotification(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 OnVIMyKeyNotification class destructor
- **/
- virtual ~OnVIMyKeyNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
deleted file mode 100644
index 7d03c62633..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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_ON_VI_PRNDL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIPrndlNotification command class
- **/
-class OnVIPrndlNotification : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIPrndlNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIPrndlNotification(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 OnVIPrndlNotification class destructor
- **/
- virtual ~OnVIPrndlNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
deleted file mode 100644
index 60a0ce0782..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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_ON_VI_RPM_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIRpmNotification command class
- **/
-class OnVIRpmNotification : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIRpmNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIRpmNotification(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 OnVIRpmNotification class destructor
- **/
- virtual ~OnVIRpmNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
deleted file mode 100644
index 4920fbd661..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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_ON_VI_SPEED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVISpeedNotification command class
- **/
-class OnVISpeedNotification : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVISpeedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISpeedNotification(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 OnVISpeedNotification class destructor
- **/
- virtual ~OnVISpeedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
deleted file mode 100644
index cff99ecf8e..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVISteeringWheelAngleNotification command class
- **/
-class OnVISteeringWheelAngleNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVISteeringWheelAngleNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISteeringWheelAngleNotification(
- 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 OnVISteeringWheelAngleNotification class destructor
- **/
- virtual ~OnVISteeringWheelAngleNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
deleted file mode 100644
index 0399780869..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVITirePressureNotification command class
- **/
-class OnVITirePressureNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVITirePressureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVITirePressureNotification(
- 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 OnVITirePressureNotification class destructor
- **/
- virtual ~OnVITirePressureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
deleted file mode 100644
index 60b686683f..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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_ON_VI_VIN_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIVinNotification command class
- **/
-class OnVIVinNotification : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIVinNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIVinNotification(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 OnVIVinNotification class destructor
- **/
- virtual ~OnVIVinNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
deleted file mode 100644
index a6e1ba9921..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief OnVIWiperStatusNotification command class
- **/
-class OnVIWiperStatusNotification
- : public app_mngr::commands::NotificationFromHMI {
- public:
- /**
- * @brief OnVIWiperStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIWiperStatusNotification(
- 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 OnVIWiperStatusNotification class destructor
- **/
- virtual ~OnVIWiperStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
index 6dd06f283d..353b265908 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
@@ -63,7 +63,7 @@ class RCGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
index 15b2e13867..393442801c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
@@ -43,8 +43,7 @@ namespace commands {
/**
* @brief RCIsReadyRequest command class
**/
-class RCIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class RCIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief RCIsReadyRequest class constructor
@@ -75,7 +74,7 @@ class RCIsReadyRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut from requrst Controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
index 2751104486..21dc6a3bb2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
@@ -76,7 +76,7 @@ class SDLActivateAppRequest : public app_mngr::commands::RequestFromHMI {
* @brief onTimeOut allows to process case when timeout has appeared
* during request execution.
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
/**
* @brief on_event allows to handle events
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_request.h
index 0a0a8c3c5d..3d38e10525 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_request.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,54 +30,57 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_REQUEST_H_
-#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/event_engine/event.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
-
namespace hmi {
-
/**
- * @brief OnButtonSubscriptionNotification command class
+ * @brief SubscribeButtonRequest command class
**/
-class OnButtonSubscriptionNotification
- : public app_mngr::commands::NotificationToHMI {
+class SubscribeButtonRequest : public app_mngr::commands::RequestToHMI {
public:
/**
- * @brief OnButtonSubscriptionNotification class constructor
- *
+ * @brief SubscribeButtonRequest class constructor
* @param message Incoming SmartObject message
**/
- OnButtonSubscriptionNotification(
- 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);
+ SubscribeButtonRequest(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 OnButtonSubscriptionNotification class destructor
+ * @brief SubscribeButtonRequest class destructor
**/
- virtual ~OnButtonSubscriptionNotification();
+ ~SubscribeButtonRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
+
+ void OnTimeOut() OVERRIDE;
+
+ void on_event(const application_manager::event_engine::Event& event) OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonSubscriptionNotification);
+ app_mngr::ApplicationSharedPtr GetApplicationPtr();
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
+
+ hmi_apis::Common_ButtonName::eType button_name_;
};
} // namespace hmi
-
} // namespace commands
-
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_response.h
index 70ee5f6c00..14c9753d0c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/subscribe_button_response.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,49 +30,49 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_RESPONSE_H_
#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
-
+namespace hmi {
/**
- * @brief OnVIGpsDataNotification command class
+ * @brief SubscribeButtonResponse command class
**/
-class OnVIGpsDataNotification : public app_mngr::commands::NotificationFromHMI {
+class SubscribeButtonResponse : public app_mngr::commands::ResponseFromHMI {
public:
/**
- * @brief OnVIGpsDataNotification class constructor
- *
+ * @brief SubscribeButtonResponse class constructor
* @param message Incoming SmartObject message
**/
- OnVIGpsDataNotification(const app_mngr::commands::MessageSharedPtr& message,
+ SubscribeButtonResponse(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 OnVIGpsDataNotification class destructor
+ * @brief SubscribeButtonResponse class destructor
**/
- virtual ~OnVIGpsDataNotification();
+ ~SubscribeButtonResponse();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
};
+} // namespace hmi
} // namespace commands
-
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
index 4ddd6f25fc..6d87158e57 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
@@ -63,7 +63,7 @@ class TTSGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
index b00fc9cffa..c2c02e50ae 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
@@ -63,7 +63,7 @@ class TTSGetLanguageRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
index 802a196c46..e4a7ec5dee 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
@@ -65,7 +65,7 @@ class TTSGetSupportedLanguagesRequest
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
index 039df31972..97d8e02e59 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
@@ -45,8 +45,7 @@ namespace commands {
/**
* @brief TTSIsReadyRequest command class
**/
-class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief TTSIsReadyRequest class constructor
@@ -77,7 +76,7 @@ class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut from requrst Controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
index 2ac47ab013..536fe767bc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
@@ -67,7 +67,7 @@ class TTSSetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
index 20e9004503..a572aa53e8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
@@ -66,7 +66,7 @@ class UIAddCommandRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
index 660c81c4f8..0823e7e7b3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
@@ -66,7 +66,7 @@ class UIAddSubmenuRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
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
index baa181fb53..015dca8789 100644
--- 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
@@ -55,7 +55,7 @@ class UICreateWindowRequest : public app_mngr::commands::RequestToHMI {
void Run() FINAL;
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(UICreateWindowRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
index 32e878e733..bb4799c0d0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
@@ -63,7 +63,7 @@ class UIGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
index d642beb341..3b395dc685 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
@@ -63,7 +63,7 @@ class UIGetLanguageRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
index 9c2492b9fe..1422035a2c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
@@ -64,7 +64,7 @@ class UIGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
index 5c7f6d4cc8..168f961e50 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
@@ -45,8 +45,7 @@ namespace commands {
/**
* @brief UIIsReadyRequest command class
**/
-class UIIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class UIIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief UIIsReadyRequest class constructor
@@ -77,7 +76,7 @@ class UIIsReadyRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut from requrst Controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
index 145f1d7c07..6f8002ce78 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
@@ -67,7 +67,7 @@ class UISetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_request.h
index 1da26dd316..5a5f9228e0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_request.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,50 +30,45 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_REQUEST_H_
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/event_engine/event.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
-/**
- * @brief OnVIOdometerNotification command class
- **/
-class OnVIOdometerNotification
- : public app_mngr::commands::NotificationFromHMI {
+namespace hmi {
+
+class UnsubscribeButtonRequest : public app_mngr::commands::RequestToHMI {
public:
- /**
- * @brief OnVIOdometerNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIOdometerNotification(const app_mngr::commands::MessageSharedPtr& message,
+ UnsubscribeButtonRequest(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 OnVIOdometerNotification class destructor
- **/
- virtual ~OnVIOdometerNotification();
+ ~UnsubscribeButtonRequest();
+
+ void Run() OVERRIDE;
- /**
- * @brief Execute command
- **/
- virtual void Run();
+ void OnTimeOut() OVERRIDE;
+
+ void on_event(const application_manager::event_engine::Event& event) OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
+
+ hmi_apis::Common_ButtonName::eType button_name_;
};
+} // namespace hmi
} // namespace commands
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_response.h
index a5588901f7..5697fa0584 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/unsubscribe_button_response.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,50 +30,40 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_RESPONSE_H_
#include "application_manager/application_manager.h"
-#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
-/**
- * @brief OnVIFuelLevelNotification command class
- **/
-class OnVIFuelLevelNotification
- : public app_mngr::commands::NotificationFromHMI {
+namespace hmi {
+
+class UnsubscribeButtonResponse : public app_mngr::commands::ResponseFromHMI {
public:
- /**
- * @brief OnVIFuelLevelNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelNotification(const app_mngr::commands::MessageSharedPtr& message,
+ UnsubscribeButtonResponse(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 OnVIFuelLevelNotification class destructor
- **/
- virtual ~OnVIFuelLevelNotification();
+ ~UnsubscribeButtonResponse();
- /**
- * @brief Execute command
- **/
- virtual void Run();
+ void Run() OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
};
+} // namespace hmi
+
} // namespace commands
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
index ba4c49ab01..44cb779beb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
@@ -66,7 +66,7 @@ class VRAddCommandRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
index 7f8485ffa0..40e63651cd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
@@ -63,7 +63,7 @@ class VRGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
index abcaa35726..3e3976244e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
@@ -63,7 +63,7 @@ class VRGetLanguageRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
index fb6d05b0aa..4bf7d68e75 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
@@ -64,7 +64,7 @@ class VRGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
index cbd77087b2..651f318b9f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
@@ -45,8 +45,7 @@ namespace commands {
/**
* @brief VRIsReadyRequest command class
**/
-class VRIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class VRIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief VRIsReadyRequest class constructor
@@ -77,7 +76,7 @@ class VRIsReadyRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut from requrst Controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
index 6ccd57947c..d55b4f5af7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
@@ -37,7 +37,7 @@
#include <string>
#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -48,7 +48,7 @@ namespace commands {
/**
* @brief AddCommandRequest command class
**/
-class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
+class AddCommandRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief AddCommandRequest class constructor
@@ -71,18 +71,9 @@ class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
**/
void Run() FINAL;
- /**
- * @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) FINAL;
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
/**
* @brief Init sets hash update mode for request
@@ -117,13 +108,6 @@ class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
/**
* @brief Checks add command param
* When type is String there is a check on the contents \t\n \\t \\n
@@ -140,17 +124,14 @@ class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
* @return info for mobile response
*/
const std::string GenerateMobileResponseInfo();
- bool send_ui_;
- bool send_vr_;
-
- bool is_ui_received_;
- bool is_vr_received_;
std::string ui_info_;
std::string vr_info_;
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
+ bool ui_is_sent_;
+ bool vr_is_sent_;
};
} // namespace commands
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 d99c5dab38..943d634f70 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
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief AddSubMenuRequest command class
**/
-class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+class AddSubMenuRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief AddSubMenuRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
index 8b7e86fb3f..4abe7d4ece 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/pending.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -47,7 +47,7 @@ namespace commands {
/**
* @brief AlertManeuverRequest command class
**/
-class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl {
+class AlertManeuverRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief AlertManeuverRequest class constructor
@@ -70,12 +70,7 @@ class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl {
**/
virtual void Run();
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
index 2250d7a8de..5352148289 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
@@ -36,7 +36,7 @@
#include <string>
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -48,7 +48,7 @@ namespace commands {
/**
* @brief AlertRequest command class
**/
-class AlertRequest : public app_mngr::commands::CommandRequestImpl {
+class AlertRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief AlertRequest class constructor
@@ -76,12 +76,9 @@ class AlertRequest : public app_mngr::commands::CommandRequestImpl {
**/
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);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ void OnTimeOut() FINAL;
protected:
private:
@@ -116,7 +113,7 @@ class AlertRequest : public app_mngr::commands::CommandRequestImpl {
/*
* @brief Tells if there are sent requests without responses
*/
- bool HasHmiResponsesToWait();
+ bool IsPendingResponseExist();
/*
* @brief Check if all strings have valid syntax in request
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
index 0063c07512..f381317cf0 100644
--- 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
@@ -33,7 +33,7 @@
#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 "application_manager/commands/request_from_mobile_impl.h"
#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
namespace sdl_rpc_plugin {
@@ -44,7 +44,8 @@ namespace commands {
/**
* @brief CancelInteractionRequest command class
**/
-class CancelInteractionRequest : public app_mngr::commands::CommandRequestImpl {
+class CancelInteractionRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief CancelInteractionRequest class constructor
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 f9f780b84b..384b9da4ae 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
@@ -36,8 +36,8 @@
#include <strings.h>
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/pending.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/custom_string.h"
#include "utils/macro.h"
@@ -52,7 +52,7 @@ namespace custom_str = utils::custom_string;
* @brief ChangeRegistrationRequest command class
**/
class ChangeRegistrationRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ChangeRegistrationRequest class constructor
@@ -75,12 +75,7 @@ class ChangeRegistrationRequest
**/
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);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
private:
/*
@@ -104,13 +99,6 @@ class ChangeRegistrationRequest
*/
bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
/**
* @brief Checks change_registration params(ttsName, appname,
* ngnMediaScreenAppName, vrSynonyms) on invalid characters.
@@ -164,8 +152,6 @@ class ChangeRegistrationRequest
const custom_str::CustomString& newItem_;
};
- app_mngr::commands::Pending pending_requests_;
-
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
hmi_apis::Common_Result::eType tts_result_;
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
index b965e880b4..3f768c95e1 100644
--- 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
@@ -33,7 +33,7 @@
#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 "application_manager/commands/request_from_mobile_impl.h"
#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
namespace sdl_rpc_plugin {
@@ -44,7 +44,8 @@ namespace commands {
/**
* @brief CloseApplicationRequest command class
**/
-class CloseApplicationRequest : public app_mngr::commands::CommandRequestImpl {
+class CloseApplicationRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief CloseApplicationRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
index aba2ce3be5..82967b717b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
@@ -37,7 +37,7 @@
#include <string>
#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/event_engine/event_observer.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -53,7 +53,7 @@ namespace commands {
* @brief CreateInteractionChoiceSetRequest command class
**/
class CreateInteractionChoiceSetRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief CreateInteractionChoiceSetRequest class constructor
@@ -77,18 +77,9 @@ class CreateInteractionChoiceSetRequest
**/
void Run() FINAL;
- /**
- * @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) FINAL;
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
/**
* @brief Init sets hash update mode for request
@@ -137,12 +128,6 @@ class CreateInteractionChoiceSetRequest
volatile bool error_from_hmi_;
sync_primitives::Lock error_from_hmi_lock_;
- /**
- * @brief Flag shows if request already was expired by timeout
- */
- volatile bool is_timed_out_;
- sync_primitives::Lock is_timed_out_lock_;
-
sync_primitives::RecursiveLock vr_commands_lock_;
/*
* @brief Sends VR AddCommand request to HMI
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
index cfbfc460b7..3a3f84c0b7 100644
--- 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
@@ -33,7 +33,7 @@
#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/commands/request_from_mobile_impl.h"
#include "application_manager/hmi_state.h"
#include "utils/macro.h"
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief CreateWindow request command class
**/
-class CreateWindowRequest : public app_mngr::commands::CommandRequestImpl {
+class CreateWindowRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
CreateWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
index 45864ca3aa..0092b0c917 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
@@ -36,7 +36,7 @@
#include <string>
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -47,7 +47,7 @@ namespace commands {
/**
* @brief DeleteCommandRequest command class
**/
-class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
+class DeleteCommandRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief DeleteCommandRequest class constructor
@@ -70,11 +70,6 @@ class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
**/
void Run() FINAL;
- /**
- * @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) FINAL;
/**
@@ -86,13 +81,6 @@ class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
/*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /*
* @brief Prepare result code and result for sending to mobile application
* @param result_code contains result code for sending to mobile application
* @param info contains info for mobile app.
@@ -101,12 +89,6 @@ class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
std::string& info);
- bool is_ui_send_;
- bool is_vr_send_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType vr_result_;
std::string ui_info_;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
index 8e4d63df4a..60633cfbea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -47,7 +47,7 @@ namespace commands {
/**
* @brief DeleteFileRequest command class
**/
-class DeleteFileRequest : public app_mngr::commands::CommandRequestImpl {
+class DeleteFileRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief DeleteFileRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
index c1d8759962..ad478bc70d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
@@ -34,8 +34,12 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#include <cstdint>
+#include <set>
+
#include "application_manager/application.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -43,11 +47,13 @@ namespace app_mngr = application_manager;
namespace commands {
+typedef std::set<uint32_t> SentRequestsSet;
+
/**
* @brief DeleteInteractionChoiceSetRequest command class
**/
class DeleteInteractionChoiceSetRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief DeleteInteractionChoiceSetRequest class constructor
@@ -76,6 +82,14 @@ class DeleteInteractionChoiceSetRequest
*/
bool Init() FINAL;
+ /**
+ * @brief Interface method that is called whenever new event received
+ * Need to observe VR_DeleteCommand event, to send
+ * DeleteInteractionChoiceSetResponse when VR command was delete from HMI.
+ * @param event The received event.
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
private:
/*
* @brief Check if requested choice set ID in use by perform interaction
@@ -86,6 +100,24 @@ class DeleteInteractionChoiceSetRequest
void SendVrDeleteCommand(app_mngr::ApplicationSharedPtr app);
+ void SendDeleteInteractionChoiceSetResponse();
+
+ /**
+ * @brief Final result_code for sending to Mobile.
+ */
+ std::vector<hmi_apis::Common_Result::eType> response_result_codes_;
+
+ sync_primitives::Lock requests_lock_;
+
+ /**
+ * @brief Collection that contains sent request to HMI.
+ * When HMI response will start come, that collection will helps to control,
+ * when SDL should sends DeleteInteractionChoiceSetResponse to Mobile.
+ * Because, for send DeleteInteractionChoiceSetResponse SDL should will be saw
+ * all response results from HMI.
+ */
+ SentRequestsSet sent_requests_;
+
DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
index af2ba4a1ea..acb1565ec5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
@@ -36,6 +36,7 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -46,7 +47,7 @@ namespace commands {
/**
* @brief DeleteSubMenuRequest command class
**/
-class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+class DeleteSubMenuRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief DeleteSubMenuRequest class constructor
@@ -82,34 +83,45 @@ class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
bool Init() FINAL;
private:
- /*
- * @brief Deletes submenus that have a parentID that matches the parentID
- * parameter
+ /**
+ * @brief Creates and queues up delete requests for a submenus that have a
+ * parent ID which matches the parentID parameter
*
* @param app_id Application ID
* @param parentID Parent ID of a nested submenu
*/
void DeleteNestedSubMenus(app_mngr::ApplicationSharedPtr const app,
- uint32_t parentID,
+ const uint32_t parentID,
const app_mngr::SubMenuMap& subMenus);
- /*
- * @brief Deletes VR commands from SDL for corresponding submenu ID
+ /**
+ * @brief Creates and queues up delete requests for each VR command tied to
+ * the given submenu ID
*
* @param app_id Application ID
* @param parentID Parent ID of a nested submenu
*/
void DeleteSubMenuVRCommands(app_mngr::ApplicationConstSharedPtr app,
- uint32_t parentID);
+ const uint32_t parentID);
- /*
- * @brief Deletes UI commands from SDL for corresponding submenu ID
+ /**
+ * @brief Creates and queues up delete requests for each UI command tied to
+ * the given submenu ID
*
* @param app_id Application ID
* @param parentID Parent ID of a nested submenu
*/
void DeleteSubMenuUICommands(app_mngr::ApplicationSharedPtr const app,
- uint32_t parentID);
+ const uint32_t parentID);
+
+ /**
+ * @brief Takes the next request in the queue and sends it to HMI
+ */
+ void SendNextRequest();
+
+ typedef std::list<smart_objects::SmartObject> RequestsList;
+ RequestsList requests_list_;
+ uint32_t pending_request_corr_id_;
DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
};
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
index b837724d7b..8be513d9ba 100644
--- 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
@@ -33,7 +33,7 @@
#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/commands/request_from_mobile_impl.h"
#include "application_manager/hmi_state.h"
#include "utils/macro.h"
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief CreateWindow request command class
**/
-class DeleteWindowRequest : public app_mngr::commands::CommandRequestImpl {
+class DeleteWindowRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
DeleteWindowRequest(const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
index 750288f5e8..b7865122aa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -44,7 +44,7 @@ namespace commands {
/**
* @brief DialNumber request command class
**/
-class DialNumberRequest : public app_mngr::commands::CommandRequestImpl {
+class DialNumberRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief DialNumberRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
index 1c18de3237..4f56a1b5f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,8 @@ namespace commands {
/**
* @brief EndAudioPassThruRequest command class
**/
-class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl {
+class EndAudioPassThruRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief EndAudioPassThruRequest class constructor
@@ -73,7 +74,7 @@ class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h
index 3d74a80dc2..1166fead63 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h
@@ -1,7 +1,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -9,7 +9,7 @@ namespace app_mngr = application_manager;
namespace commands {
class GetCloudAppPropertiesRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
GetCloudAppPropertiesRequest(
const app_mngr::commands::MessageSharedPtr& message,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h
index d4182ea004..2f9f591c73 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/event_engine/event.h"
namespace sdl_rpc_plugin {
@@ -44,7 +44,7 @@ namespace commands {
/**
* @brief GetFileRequest command class
**/
-class GetFileRequest : public app_mngr::commands::CommandRequestImpl {
+class GetFileRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief GetFileRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
index a5d1611f02..deff991b9f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -42,7 +42,7 @@ namespace app_mngr = application_manager;
namespace commands {
class GetSystemCapabilityRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
GetSystemCapabilityRequest(
const app_mngr::commands::MessageSharedPtr& message,
@@ -55,7 +55,7 @@ class GetSystemCapabilityRequest
virtual void Run() OVERRIDE;
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
index ec656820e5..a4aa606bd4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -43,7 +43,7 @@ namespace commands {
/**
* @brief GetWayPointsRequest command class
**/
-class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl {
+class GetWayPointsRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief GetWayPointsRequest class constructor
@@ -63,12 +63,8 @@ class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl {
* @brief Execute command
**/
virtual void Run() OVERRIDE;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
index d98fa433b4..9435e80222 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief ListFilesRequest command class
**/
-class ListFilesRequest : public app_mngr::commands::CommandRequestImpl {
+class ListFilesRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ListFilesRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
index afde9bac92..f1ca0f546c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
@@ -35,6 +35,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
#include "application_manager/application.h"
+#include "application_manager/commands/button_notification_to_mobile.h"
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -50,7 +51,7 @@ namespace mobile {
* to mobile device that some button was pressed on HMI.
**/
class OnButtonEventNotification
- : public app_mngr::commands::CommandNotificationImpl {
+ : public app_mngr::commands::ButtonNotificationToMobile {
public:
/**
* @brief OnButtonEventNotification class constructor
@@ -68,18 +69,13 @@ class OnButtonEventNotification
**/
virtual ~OnButtonEventNotification();
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
+ protected:
/*
* @brief Sends button event notification to mobile device
*
* @param app Application to receive notification
*/
- void SendButtonEvent(app_mngr::ApplicationConstSharedPtr app);
+ void SendButtonNotification(app_mngr::ApplicationSharedPtr app) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
index 57fda49be7..89f5d48f1a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
@@ -35,6 +35,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
#include "application_manager/application.h"
+#include "application_manager/commands/button_notification_to_mobile.h"
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -50,7 +51,7 @@ namespace mobile {
* to mobile device that some button was pressed on HMI.
**/
class OnButtonPressNotification
- : public app_mngr::commands::CommandNotificationImpl {
+ : public app_mngr::commands::ButtonNotificationToMobile {
public:
/**
* @brief OnButtonPressNotification class constructor
@@ -66,12 +67,7 @@ class OnButtonPressNotification
/**
* @brief OnButtonEventCommand class destructor
**/
- virtual ~OnButtonPressNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
+ ~OnButtonPressNotification();
private:
/*
@@ -79,7 +75,7 @@ class OnButtonPressNotification
*
* @param app Application to receive notification
*/
- void SendButtonPress(app_mngr::ApplicationConstSharedPtr app);
+ void SendButtonNotification(app_mngr::ApplicationSharedPtr app) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
index 434b6de028..da8f13c5d7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -47,7 +47,7 @@ namespace commands {
* @brief PerformAudioPassThruRequest command class
**/
class PerformAudioPassThruRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief PerformAudioPassThruRequest class constructor
@@ -67,13 +67,6 @@ class PerformAudioPassThruRequest
virtual ~PerformAudioPassThruRequest();
/**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- /**
* @brief Init required by command resources
**/
bool Init();
@@ -83,12 +76,14 @@ class PerformAudioPassThruRequest
**/
virtual void Run();
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
/**
- * @brief Interface method that is called whenever new event received
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
*
- * @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void OnTimeOut() FINAL;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
index 88182a0b8e..8652464fba 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
@@ -38,6 +38,7 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -51,7 +52,7 @@ namespace commands {
* @brief PerformInteractionRequest command class
**/
class PerformInteractionRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief PerformInteractionRequest class constructor
@@ -79,19 +80,9 @@ class PerformInteractionRequest
**/
virtual void Run();
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
+ void OnTimeOut() FINAL;
protected:
/**
@@ -265,12 +256,11 @@ class PerformInteractionRequest
smart_objects::SmartObject& msg_param) const;
mobile_apis::InteractionMode::eType interaction_mode_;
+
std::int32_t ui_choice_id_received_;
std::int32_t vr_choice_id_received_;
std::string ui_text_entry_received_;
- bool ui_response_received_;
- bool vr_response_received_;
bool app_pi_was_active_before_;
static uint32_t pi_requests_count_;
hmi_apis::Common_Result::eType vr_result_code_;
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 b3e04f7796..f7aa0278a9 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
@@ -36,6 +36,7 @@
#include "application_manager/application_manager.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -46,7 +47,7 @@ namespace commands {
/**
* @brief PutFileRequest command class
**/
-class PutFileRequest : public app_mngr::commands::CommandRequestImpl {
+class PutFileRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief PutFileRequest class constructor
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 ae52caf0f7..d54f061228 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
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "utils/custom_string.h"
#include "utils/macro.h"
@@ -56,7 +56,7 @@ namespace custom_str = utils::custom_string;
* @brief Register app interface request command class
**/
class RegisterAppInterfaceRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief RegisterAppInterfaceRequest class constructor
@@ -210,10 +210,9 @@ class RegisterAppInterfaceRequest
const std::string& param,
const std::string& backup_value);
/**
- * @brief Sends ButtonSubscription notification at start up
- * to notify HMI that app subscribed on the custom button by default.
+ * @brief Sends ButtonSubscription request if approved by hmi_capabilities
*/
- void SendSubscribeCustomButtonNotification();
+ void SendSubscribeCustomButtonRequest();
/**
* @brief IsApplicationSwitched checks whether application is switched
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
index 7475520889..d156371ccd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
@@ -35,7 +35,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -47,7 +47,7 @@ namespace commands {
* @brief ResetGlobalPropertiesRequest command class
**/
class ResetGlobalPropertiesRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ResetGlobalPropertiesRequest class constructor
@@ -71,11 +71,6 @@ class ResetGlobalPropertiesRequest
**/
void Run() FINAL;
- /**
- * @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) FINAL;
/**
@@ -94,18 +89,13 @@ class ResetGlobalPropertiesRequest
bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
std::string& out_response_info);
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
hmi_apis::Common_Result::eType ui_result_;
hmi_apis::Common_Result::eType tts_result_;
+ hmi_apis::Common_Result::eType rc_result_;
std::string ui_response_info_;
+ std::string rc_response_info_;
std::string tts_response_info_;
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
index 58b7b4491a..fc7b8e0207 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -46,7 +46,8 @@ namespace commands {
/**
* @brief scrollable message request command class
**/
-class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl {
+class ScrollableMessageRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ScrollableMessageRequest class constructor
@@ -77,7 +78,7 @@ class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
index 2f00b58d9e..96f560bd9e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
@@ -34,8 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
#include <string>
+
#include "application_manager/application_manager.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/event_engine/event.h"
#include "smart_objects/smart_object.h"
@@ -47,7 +48,7 @@ namespace commands {
/**
* @brief SendHapticDataRequest command class
**/
-class SendHapticDataRequest : public app_mngr::commands::CommandRequestImpl {
+class SendHapticDataRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SendHapticDataRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
index 5a0dc67f35..c035ffca34 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
@@ -35,7 +35,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
#include <list>
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief send location request command class
*/
-class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
+class SendLocationRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SendLocationRquest class constructor
@@ -71,7 +71,7 @@ class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
index 520f27d8b9..aed482a8ab 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief SetIconRequest command class
**/
-class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl {
+class SetAppIconRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief Contains information about the type of image
@@ -73,7 +73,7 @@ class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
/**
* @brief Execute command
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h
index a3a3ea12f9..c05ba16684 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h
@@ -1,7 +1,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -9,7 +9,7 @@ namespace app_mngr = application_manager;
namespace commands {
class SetCloudAppPropertiesRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
SetCloudAppPropertiesRequest(
const app_mngr::commands::MessageSharedPtr& message,
@@ -28,4 +28,4 @@ class SetCloudAppPropertiesRequest
} // namespace commands
} // namespace sdl_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_ \ No newline at end of file
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
index 2f9c0946d3..0e0105c880 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,8 @@ namespace commands {
/**
* @brief SetDisplayLayoutRequest command class
**/
-class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl {
+class SetDisplayLayoutRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SetDisplayLayoutRequest class constructor
@@ -68,7 +69,7 @@ class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
**/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
/**
* @brief Execute command
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 fbf3056e58..37ad705930 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
@@ -33,8 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
#include <string>
+
#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -46,7 +47,7 @@ namespace commands {
* @brief Register app interface request command class
**/
class SetGlobalPropertiesRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SetGlobalPropertiesRequest class constructor
@@ -82,7 +83,7 @@ class SetGlobalPropertiesRequest
*/
bool Init() FINAL;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
/**
* @brief Prepares total result for mobile according to three results:
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
index 3023bf4fec..af7427b2a3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief SetMediaClockRequest request command class
**/
-class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl {
+class SetMediaClockRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief SetMediaClockRequest class constructor
@@ -71,7 +71,7 @@ class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
bool isDataValid(std::string& info);
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
index c9691a808f..3cc7c4d539 100644
--- 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
@@ -33,7 +33,7 @@
#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"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -43,7 +43,7 @@ namespace commands {
/**
* @brief ShowAppMenuRequest command class
**/
-class ShowAppMenuRequest : public app_mngr::commands::CommandRequestImpl {
+class ShowAppMenuRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ShowAppMenuRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
index 7694070a72..692cf4b137 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -46,7 +46,8 @@ namespace commands {
/**
* @brief ShowConstantTBTRequest command class
**/
-class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl {
+class ShowConstantTBTRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ShowConstantTBTRequest class constructor
@@ -74,7 +75,7 @@ class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
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 26612609a4..1d9988c765 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
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -46,7 +46,7 @@ namespace commands {
/**
* @brief show request command class
**/
-class ShowRequest : public app_mngr::commands::CommandRequestImpl {
+class ShowRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief ShowRequest class constructor
@@ -72,7 +72,7 @@ class ShowRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/*
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
index 5dbcbb7d41..f9cf401c7c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief slider request command class
**/
-class SliderRequest : public app_mngr::commands::CommandRequestImpl {
+class SliderRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief SliderRequest class constructor
@@ -76,7 +76,7 @@ class SliderRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
index 68e35fcd1d..f753c02990 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief speak request command class
**/
-class SpeakRequest : public app_mngr::commands::CommandRequestImpl {
+class SpeakRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief SpeakRequest class constructor
@@ -71,7 +71,7 @@ class SpeakRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/*
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
index 2b9887daad..332d622895 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
@@ -35,7 +35,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
#include "application_manager/application_impl.h"
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -46,7 +46,8 @@ namespace commands {
/**
* @brief SubscribeButtonRequest command class
**/
-class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+class SubscribeButtonRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SubscribeButtonRequest class constructor
@@ -74,6 +75,12 @@ class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
*/
bool Init() FINAL;
+ /**
+ * @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) FINAL;
+
private:
/**
* @brief Checks if button subscription allowed. In case non-media
@@ -88,12 +95,6 @@ class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
bool IsSubscriptionAllowed(app_mngr::ApplicationSharedPtr app,
const mobile_apis::ButtonName::eType btn_id);
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app subscribed on the button.
- */
- void SendSubscribeButtonNotification();
-
DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
index 69154d7669..fbda174553 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -44,7 +44,7 @@ namespace commands {
* @brief SubsribeWayPointsRequest command class
**/
class SubscribeWayPointsRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief SubscribeWayPointsRequest class constructor
@@ -76,7 +76,7 @@ class SubscribeWayPointsRequest
*/
bool Init() FINAL;
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subtle_alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subtle_alert_request.h
index 4789d35e60..c966be4dbe 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subtle_alert_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subtle_alert_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBTLE_ALERT_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBTLE_ALERT_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
namespace sdl_rpc_plugin {
@@ -44,7 +44,7 @@ namespace commands {
/**
* @brief SubtleAlertRequest command class
**/
-class SubtleAlertRequest : public app_mngr::commands::CommandRequestImpl {
+class SubtleAlertRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SubtleAlertRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
index eb2398f279..9b031859c3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
@@ -37,6 +37,7 @@
#include <string>
#include "application_manager/application_manager.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/event_engine/event.h"
#include "smart_objects/smart_object.h"
@@ -48,7 +49,7 @@ namespace commands {
/**
* @brief SystemRequest command class
**/
-class SystemRequest : public app_mngr::commands::CommandRequestImpl {
+class SystemRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SystemRequest class constructor
@@ -76,7 +77,7 @@ class SystemRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
index 0bc01f2aaa..90d0c24b88 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -46,7 +46,7 @@ namespace commands {
* @brief Unregister app interface request command class
**/
class UnregisterAppInterfaceRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief UnregisterAppInterfaceRequest class constructor
@@ -57,11 +57,11 @@ class UnregisterAppInterfaceRequest
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
/**
* \brief UnregisterAppInterfaceRequest class destructor
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
index 51c10642cf..42e2a7ffde 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -45,41 +45,24 @@ namespace commands {
/**
* @brief UnsubscribeButtonRequest command class
**/
-class UnsubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+class UnsubscribeButtonRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
- /**
- * @brief UnsubscribeButtonRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
UnsubscribeButtonRequest(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 UnsubscribeButtonRequest class destructor
- **/
~UnsubscribeButtonRequest() FINAL;
- /**
- * @brief Execute command
- **/
void Run() FINAL;
- /**
- * @brief Init sets hash update mode for request
- */
bool Init() FINAL;
- private:
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app unsubscribed from the button.
- */
- void SendUnsubscribeButtonNotification();
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+ private:
DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
index c4357d7529..33aa9f743a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
@@ -33,7 +33,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -41,7 +41,7 @@ namespace app_mngr = application_manager;
namespace commands {
class UnsubscribeWayPointsRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* \brief UnsubscribeWayPointsRequest class constructor
@@ -75,7 +75,7 @@ class UnsubscribeWayPointsRequest
*/
bool Init() FINAL;
- void onTimeOut() FINAL;
+ void OnTimeOut() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
index e1e5df2289..29bc269938 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -46,7 +46,7 @@ namespace commands {
/**
* @brief UpdateTurnListRequest command class
**/
-class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl {
+class UpdateTurnListRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief UpdateTurnListRequest class constructor
@@ -74,7 +74,7 @@ class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h
index 09fbc565c5..6b25bb7316 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h
@@ -69,7 +69,7 @@ class SystemCapabilityAppExtension : public app_mngr_::AppExtension {
void RevertResumption(
const smart_objects::SmartObject& subscriptions) OVERRIDE;
- static const app_mngr_::AppExtensionUID SystemCapabilityAppExtensionUID;
+ static const app_mngr_::AppExtensionUID SystemCapabilityAppExtensionUID = 200;
static SystemCapabilityAppExtension& ExtractExtension(
app_mngr_::Application& app);
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 b4ef7e6aed..ab74ed08fb 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
@@ -54,13 +54,6 @@ class SDLRPCPlugin : public plugins::RPCPlugin {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state) OVERRIDE;
- DEPRECATED
- bool Init(app_mngr::ApplicationManager& app_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) OVERRIDE;
-
/**
* @brief ProcessResumptionSubscription send appropriate subscribe requests
* to HMI
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_app_extension.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_app_extension.h
index 9243baedee..ce4f56bd84 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_app_extension.h
@@ -59,7 +59,7 @@ class WayPointsAppExtension : public app_mngr::AppExtension {
* @brief WayPointsAppExtensionUID unique identifier of waypoints
* aplication extension
*/
- static unsigned WayPointsAppExtensionUID;
+ static const app_mngr::AppExtensionUID WayPointsAppExtensionUID = 138;
private:
SDLRPCPlugin& plugin_;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_pending_resumption_handler.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_pending_resumption_handler.h
index 871359bc9a..17842c17ba 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_pending_resumption_handler.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/waypoints_pending_resumption_handler.h
@@ -47,7 +47,7 @@ class WayPointsPendingResumptionHandler
app_mngr::ApplicationManager& application_manager);
// EventObserver interface
- void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(const app_mngr::event_engine::Event& event) OVERRIDE;
void HandleResumptionSubscriptionRequest(
app_mngr::AppExtension& extension,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
index a6e95f9f72..3429bd6059 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
@@ -51,7 +51,7 @@ BasicCommunicationGetSystemTimeRequest::BasicCommunicationGetSystemTimeRequest(
hmi_capabilities,
policy_handler) {}
-void BasicCommunicationGetSystemTimeRequest::onTimeOut() {
+void BasicCommunicationGetSystemTimeRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
application_manager_.protocol_handler().NotifyOnGetSystemTimeFailed();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
index d9c7901c67..2cda09dadc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
@@ -31,6 +31,7 @@
*/
#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+
#include "utils/logger.h"
namespace sdl_rpc_plugin {
@@ -60,7 +61,7 @@ void ButtonGetCapabilitiesRequest::Run() {
SendRequest();
}
-void ButtonGetCapabilitiesRequest::onTimeOut() {
+void ButtonGetCapabilitiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::Buttons_GetCapabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
index 1b42abd055..33651426c9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
@@ -61,7 +61,7 @@ void GetSystemInfoRequest::Run() {
SendRequest();
}
-void GetSystemInfoRequest::onTimeOut() {
+void GetSystemInfoRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateCachedCapabilities();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
index 21d6282436..673e6570f5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -53,14 +53,15 @@ AudioStartStreamRequest::AudioStartStreamRequest(
rpc_service,
hmi_capabilities,
policy_handle)
- , EventObserver(application_manager.event_dispatcher())
, retry_number_(0) {
SDL_LOG_AUTO_TRACE();
std::pair<uint32_t, int32_t> stream_retry =
application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
+ default_timeout_ =
+ stream_retry.second +
+ application_manager_.get_settings().default_timeout_compensation();
retry_number_ = stream_retry.first;
- SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_
+ SDL_LOG_DEBUG("default_timeout_ = " << stream_retry.second
<< "; retry_number_ = " << retry_number_);
}
@@ -136,12 +137,13 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
}
}
-void AudioStartStreamRequest::onTimeOut() {
+void AudioStartStreamRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
RetryStartSession();
}
void AudioStartStreamRequest::RetryStartSession() {
+ using namespace protocol_handler;
SDL_LOG_AUTO_TRACE();
auto retry_start_session = [this](const uint32_t hmi_app_id) {
@@ -176,7 +178,7 @@ void AudioStartStreamRequest::RetryStartSession() {
SDL_LOG_DEBUG("Audio start stream retry sequence stopped. "
<< "Attempts expired.");
- application_manager_.EndNaviServices(app->app_id());
+ application_manager_.EndService(app->app_id(), ServiceType::kAudio);
}
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
index 850f292972..7eb2233202 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
@@ -49,8 +49,7 @@ NaviIsReadyRequest::NaviIsReadyRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handle)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handle) {}
NaviIsReadyRequest::~NaviIsReadyRequest() {}
@@ -86,7 +85,7 @@ void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void NaviIsReadyRequest::onTimeOut() {
+void NaviIsReadyRequest::OnTimeOut() {
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::Navigation_IsReady);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
index ff9d861def..a660887019 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
@@ -31,6 +31,7 @@
*/
#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+
#include <string>
#include <vector>
@@ -51,8 +52,7 @@ NaviSetVideoConfigRequest::NaviSetVideoConfigRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handle)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handle) {}
NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {}
@@ -106,7 +106,7 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartArray* list =
message[strings::msg_params][strings::rejected_params].asArray();
if (list != NULL) {
- for (unsigned int i = 0; i < list->size(); i++) {
+ for (unsigned int i = 0; i < list->size(); ++i) {
const std::string& param = (*list)[i].asString();
// Make sure that we actually sent the parameter in the request
if ((*message_)[strings::msg_params].keyExists(strings::config) &&
@@ -132,7 +132,7 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
}
}
-void NaviSetVideoConfigRequest::onTimeOut() {
+void NaviSetVideoConfigRequest::OnTimeOut() {
SDL_LOG_WARN("Timed out while waiting for SetVideoConfig response");
ApplicationSharedPtr app =
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
index 973c323ebe..f5d96d0ea8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
@@ -53,14 +53,15 @@ NaviStartStreamRequest::NaviStartStreamRequest(
rpc_service,
hmi_capabilities,
policy_handle)
- , EventObserver(application_manager.event_dispatcher())
, retry_number_(0) {
SDL_LOG_AUTO_TRACE();
std::pair<uint32_t, int32_t> stream_retry =
application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
+ default_timeout_ =
+ stream_retry.second +
+ application_manager_.get_settings().default_timeout_compensation();
retry_number_ = stream_retry.first;
- SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_
+ SDL_LOG_DEBUG("default_timeout_ = " << stream_retry.second
<< "; retry_number_ = " << retry_number_);
}
@@ -138,12 +139,13 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
}
}
-void NaviStartStreamRequest::onTimeOut() {
+void NaviStartStreamRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
RetryStartSession();
}
void NaviStartStreamRequest::RetryStartSession() {
+ using namespace protocol_handler;
SDL_LOG_AUTO_TRACE();
auto retry_start_session = [this](const uint32_t hmi_app_id) {
@@ -178,7 +180,7 @@ void NaviStartStreamRequest::RetryStartSession() {
SDL_LOG_DEBUG("NaviStartStream retry sequence stopped. "
<< "Attempts expired");
- application_manager_.EndNaviServices(app->app_id());
+ application_manager_.EndService(app->app_id(), ServiceType::kMobileNav);
}
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
index 7305ae37b1..63735d84db 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
@@ -60,7 +60,7 @@ void NaviSubscribeWayPointsRequest::Run() {
SendRequest();
}
-void NaviSubscribeWayPointsRequest::onTimeOut() {
+void NaviSubscribeWayPointsRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
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 9caec22bd2..ed2b36b413 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
@@ -134,7 +134,7 @@ void OnBCSystemCapabilityUpdatedNotification::Run() {
smart_objects::SmartObject& updated_capabilities =
msg_params[strings::system_capability]
[strings::app_services_capabilities][strings::app_services];
- for (size_t i = 0; i < updated_capabilities.length(); i++) {
+ for (size_t i = 0; i < updated_capabilities.length(); ++i) {
std::string service_id =
updated_capabilities[i][strings::updated_app_service_record]
[strings::service_id]
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
index 56ff20ecc5..77544fc132 100644
--- 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
@@ -191,7 +191,9 @@ void OnBCSystemCapabilityUpdatedNotificationFromHMI::Run() {
RemoveAppIdFromNotification();
break;
}
- default: { SDL_LOG_ERROR("Unknown system capability type received"); }
+ default: {
+ SDL_LOG_ERROR("Unknown system capability type received");
+ }
}
SendNotificationToMobile(message_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_reset_timeout_notification.cc
index 96f6c5cd5b..ff5b2709c0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_reset_timeout_notification.cc
@@ -29,7 +29,7 @@
* 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_tts_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h"
#include "application_manager/event_engine/event.h"
#include "interfaces/HMI_API.h"
@@ -42,7 +42,7 @@ namespace hmi {
SDL_CREATE_LOG_VARIABLE("Commands")
-OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
+OnResetTimeoutNotification::OnResetTimeoutNotification(
const application_manager::commands::MessageSharedPtr& message,
ApplicationManager& application_manager,
rpc_service::RPCService& rpc_service,
@@ -54,12 +54,13 @@ OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
hmi_capabilities,
policy_handle) {}
-OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {}
+OnResetTimeoutNotification::~OnResetTimeoutNotification() {}
-void OnTTSResetTimeoutNotification::Run() {
+void OnResetTimeoutNotification::Run() {
SDL_LOG_AUTO_TRACE();
- event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
event.set_smart_object(*message_);
event.raise(application_manager_.event_dispatcher());
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
index f652761178..d693c00ac3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
@@ -88,11 +88,15 @@ void OnTTSLanguageChangeNotification::Run() {
(*message_)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
- ApplicationSetIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
+ const auto applications = application_manager_.applications().GetData();
+ for (const auto& app : applications) {
+ if (!app->IsRegistered()) {
+ SDL_LOG_DEBUG("Skipping app "
+ << app->app_id()
+ << " which has not finished the registration process");
+ continue;
+ }
+
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
index 2f2cb2ddc6..7f6ffaa4eb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
@@ -85,7 +85,8 @@ void OnUILanguageChangeNotification::Run() {
ApplicationSetConstIt it = accessor.begin();
for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
+ ApplicationSharedPtr app = *it;
+ ++it;
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
deleted file mode 100644
index 9f4e707b83..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_acc_pedal_position_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
- 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) {}
-
-OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {}
-
-void OnVIAccPedalPositionNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
deleted file mode 100644
index 4227847153..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_belt_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIBeltStatusNotification::OnVIBeltStatusNotification(
- 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) {}
-
-OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {}
-
-void OnVIBeltStatusNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
deleted file mode 100644
index 663f9342f4..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_body_information_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIBodyInformationNotification::OnVIBodyInformationNotification(
- 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) {}
-
-OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {}
-
-void OnVIBodyInformationNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
deleted file mode 100644
index 722fddc5f1..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_driver_braking_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
- 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) {}
-
-OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {}
-
-void OnVIDriverBrakingNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
deleted file mode 100644
index 8c524a3f1d..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_engine_torque_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
- 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) {}
-
-OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {}
-
-void OnVIEngineTorqueNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
deleted file mode 100644
index 3cbd22eb97..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_external_temperature_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
- 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) {}
-
-OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {}
-
-void OnVIExternalTemperatureNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
deleted file mode 100644
index 8065434063..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_fuel_level_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIFuelLevelNotification::OnVIFuelLevelNotification(
- 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) {}
-
-OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {}
-
-void OnVIFuelLevelNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
deleted file mode 100644
index c0c60108f3..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_fuel_level_state_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
- 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) {}
-
-OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {}
-
-void OnVIFuelLevelStateNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
deleted file mode 100644
index 1e18d18eba..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_gps_data_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIGpsDataNotification::OnVIGpsDataNotification(
- 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) {}
-
-OnVIGpsDataNotification::~OnVIGpsDataNotification() {}
-
-void OnVIGpsDataNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
deleted file mode 100644
index 29906df43f..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_head_lamp_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
- 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) {}
-
-OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {}
-
-void OnVIHeadLampStatusNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
deleted file mode 100644
index c4bc32e825..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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/on_vi_instant_fuel_consumption_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
- 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) {}
-
-OnVIInstantFuelConsumptionNotification::
- ~OnVIInstantFuelConsumptionNotification() {}
-
-void OnVIInstantFuelConsumptionNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
deleted file mode 100644
index 6139d143f6..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_my_key_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIMyKeyNotification::OnVIMyKeyNotification(
- 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) {}
-
-OnVIMyKeyNotification::~OnVIMyKeyNotification() {}
-
-void OnVIMyKeyNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
deleted file mode 100644
index 92f4b47fcf..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_odometer_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIOdometerNotification::OnVIOdometerNotification(
- 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) {}
-
-OnVIOdometerNotification::~OnVIOdometerNotification() {}
-
-void OnVIOdometerNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
deleted file mode 100644
index c2afd7d697..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_prndl_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIPrndlNotification::OnVIPrndlNotification(
- 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) {}
-
-OnVIPrndlNotification::~OnVIPrndlNotification() {}
-
-void OnVIPrndlNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
deleted file mode 100644
index f41f5d3f56..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_rpm_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIRpmNotification::OnVIRpmNotification(
- 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) {}
-
-OnVIRpmNotification::~OnVIRpmNotification() {}
-
-void OnVIRpmNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
deleted file mode 100644
index 73313b6ea4..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_speed_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVISpeedNotification::OnVISpeedNotification(
- 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) {}
-
-OnVISpeedNotification::~OnVISpeedNotification() {}
-
-void OnVISpeedNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
deleted file mode 100644
index e04eaab3b4..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_steering_wheel_angle_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
- 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) {}
-
-OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {}
-
-void OnVISteeringWheelAngleNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
deleted file mode 100644
index bc013c2e2c..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_tire_pressure_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVITirePressureNotification::OnVITirePressureNotification(
- 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) {}
-
-OnVITirePressureNotification::~OnVITirePressureNotification() {}
-
-void OnVITirePressureNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
deleted file mode 100644
index 4b33c2d589..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_vin_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIVinNotification::OnVIVinNotification(
- 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) {}
-
-OnVIVinNotification::~OnVIVinNotification() {}
-
-void OnVIVinNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
deleted file mode 100644
index dde1e642c3..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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/on_vi_wiper_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnVIWiperStatusNotification::OnVIWiperStatusNotification(
- 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) {}
-
-OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {}
-
-void OnVIWiperStatusNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
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 bf00291c88..23c1ec1b80 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
@@ -79,10 +79,17 @@ void OnVRLanguageChangeNotification::Run() {
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
const auto applications = application_manager_.applications().GetData();
-
for (auto app : applications) {
+ if (!app->IsRegistered()) {
+ SDL_LOG_DEBUG("Skipping app "
+ << app->app_id()
+ << " which has not finished the registration process");
+ continue;
+ }
+
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
+
if (static_cast<int32_t>(app->language()) !=
(*message_)[strings::msg_params][strings::language].asInt()) {
application_manager_.state_controller().SetRegularState(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
index 774acf54f1..63aa4b11ef 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
@@ -59,7 +59,7 @@ void RCGetCapabilitiesRequest::Run() {
SendRequest();
}
-void RCGetCapabilitiesRequest::onTimeOut() {
+void RCGetCapabilitiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::RC_GetCapabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
index 3d31953474..725a55c2b5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
@@ -53,8 +53,7 @@ RCIsReadyRequest::RCIsReadyRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handle)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handle) {}
RCIsReadyRequest::~RCIsReadyRequest() {}
@@ -99,7 +98,7 @@ void RCIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void RCIsReadyRequest::onTimeOut() {
+void RCIsReadyRequest::OnTimeOut() {
// Note(dtrunov): According to new requirment APPLINK-27956
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::RC_IsReady);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
index 66ac9c458b..e25ee93400 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
@@ -136,18 +136,10 @@ void SDLActivateAppRequest::Run() {
static_cast<eType>(function_id()),
hmi_apis::Common_Result::REJECTED,
"HMIDeactivate is active");
- } else if (app && !app->IsRegistered() && app->is_cloud_app()) {
- SDL_LOG_DEBUG("Starting cloud application.");
- const ApplicationManagerSettings& settings =
- application_manager_.get_settings();
- uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() *
- settings.cloud_app_max_retry_attempts());
- application_manager_.updateRequestTimeout(
- 0, correlation_id(), default_timeout_ + total_retry_timeout);
- subscribe_on_event(BasicCommunication_OnAppRegistered);
- application_manager_.connection_handler().ConnectToDevice(app->device());
- } else {
- const uint32_t application_id = app_id();
+ return;
+ }
+
+ if (app->app_id() > 0 || app->IsRegistered()) {
auto main_state =
app->CurrentHmiState(mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
if (mobile_apis::HMILevel::INVALID_ENUM == main_state->hmi_level()) {
@@ -156,12 +148,40 @@ void SDLActivateAppRequest::Run() {
"yet, postpone activation");
auto& postponed_activation_ctrl = application_manager_.state_controller()
.GetPostponedActivationController();
- postponed_activation_ctrl.AddAppToActivate(application_id,
+ postponed_activation_ctrl.AddAppToActivate(app->app_id(),
correlation_id());
return;
}
+ }
+
+ const uint32_t application_id = app_id();
+ if (app->IsRegistered()) {
+ SDL_LOG_DEBUG("Application is registered. Activating.");
policy_handler_.OnActivateApp(application_id, correlation_id());
+ return;
}
+
+ if (app->is_cloud_app()) {
+ SDL_LOG_DEBUG("Starting cloud application.");
+ const ApplicationManagerSettings& settings =
+ application_manager_.get_settings();
+ uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() *
+ settings.cloud_app_max_retry_attempts());
+ application_manager_.UpdateRequestTimeout(
+ 0, correlation_id(), default_timeout_ + total_retry_timeout);
+ subscribe_on_event(BasicCommunication_OnAppRegistered);
+ application_manager_.connection_handler().ConnectToDevice(app->device());
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app->device();
+ SDL_LOG_ERROR(
+ "Can't find regular foreground app with the same connection id: "
+ << device_handle);
+ SendErrorResponse(correlation_id(),
+ SDL_ActivateApp,
+ hmi_apis::Common_Result::NO_APPS_REGISTERED,
+ "");
}
#else // EXTERNAL_PROPRIETARY_MODE
@@ -205,8 +225,7 @@ void SDLActivateAppRequest::Run() {
return;
}
- if (app_to_activate->IsRegistered()) {
- SDL_LOG_DEBUG("Application is registered. Activating.");
+ if (app_to_activate->app_id() > 0 || app_to_activate->IsRegistered()) {
auto main_state = app_to_activate->CurrentHmiState(
mobile_apis::PredefinedWindows::DEFAULT_WINDOW);
if (mobile_apis::HMILevel::INVALID_ENUM == main_state->hmi_level()) {
@@ -215,19 +234,25 @@ void SDLActivateAppRequest::Run() {
"yet, postpone activation");
auto& postponed_activation_ctrl = application_manager_.state_controller()
.GetPostponedActivationController();
- postponed_activation_ctrl.AddAppToActivate(application_id,
+ postponed_activation_ctrl.AddAppToActivate(app_to_activate->app_id(),
correlation_id());
return;
}
+ }
+
+ if (app_to_activate->IsRegistered()) {
+ SDL_LOG_DEBUG("Application is registered. Activating.");
policy_handler_.OnActivateApp(application_id, correlation_id());
return;
- } else if (app_to_activate->is_cloud_app()) {
+ }
+
+ if (app_to_activate->is_cloud_app()) {
SDL_LOG_DEBUG("Starting cloud application.");
const ApplicationManagerSettings& settings =
application_manager_.get_settings();
uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() *
settings.cloud_app_max_retry_attempts());
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
0, correlation_id(), default_timeout_ + total_retry_timeout);
subscribe_on_event(BasicCommunication_OnAppRegistered);
application_manager_.connection_handler().ConnectToDevice(
@@ -272,7 +297,7 @@ void SDLActivateAppRequest::Run() {
}
#endif // EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::onTimeOut() {
+void SDLActivateAppRequest::OnTimeOut() {
using namespace hmi_apis::FunctionID;
using namespace hmi_apis::Common_Result;
using namespace application_manager;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc
index 7478a40eeb..f366da82d6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc
@@ -144,7 +144,7 @@ smart_objects::SmartObject SDLGetPolicyConfigurationDataRequest::GetValueParam(
};
if (policy_property.type() == Json::arrayValue) {
- for (Json::ArrayIndex i = 0; i < policy_property.size(); i++) {
+ for (Json::ArrayIndex i = 0; i < policy_property.size(); ++i) {
put_element_in_value_array(policy_property[i], i);
}
return value;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_request.cc
new file mode 100644
index 0000000000..5a2420b223
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_request.cc
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2021, 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/subscribe_button_request.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDL_CREATE_LOG_VARIABLE("Commands")
+
+namespace hmi {
+
+SubscribeButtonRequest::SubscribeButtonRequest(
+ 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) {
+ hmi_apis::Common_ButtonName::eType button_name =
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [app_mngr::strings::button_name]
+ .asInt());
+
+ button_name_ = button_name;
+}
+
+SubscribeButtonRequest::~SubscribeButtonRequest() {}
+
+app_mngr::ApplicationSharedPtr SubscribeButtonRequest::GetApplicationPtr() {
+ const uint32_t app_id =
+ (*message_)[strings::msg_params][strings::app_id].asUInt();
+
+ return application_manager_.application_by_hmi_app(app_id);
+}
+
+void SubscribeButtonRequest::Run() {
+ SDL_LOG_AUTO_TRACE();
+
+ // Specific case when app subscribes to CUSTOM_BUTTON upon registration and no
+ // explicit mobile request exist when response arrives. In this case event
+ // should be catched by HMI request itself.
+ if (hmi_apis::Common_ButtonName::CUSTOM_BUTTON == button_name_) {
+ ApplicationSharedPtr app = GetApplicationPtr();
+ if (app) {
+ // Application should also be subscribed to CUSTOM_BUTTON even before
+ // response is received
+ app->SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
+ }
+
+ subscribe_on_event(hmi_apis::FunctionID::Buttons_SubscribeButton,
+ correlation_id());
+ }
+
+ SendRequest();
+}
+
+void SubscribeButtonRequest::on_event(const event_engine::Event& event) {
+ SDL_LOG_AUTO_TRACE();
+ using namespace helpers;
+
+ if (hmi_apis::FunctionID::Buttons_SubscribeButton != event.id()) {
+ SDL_LOG_ERROR("Unexpected event id received: " << event.id());
+ return;
+ }
+
+ unsubscribe_from_event(hmi_apis::FunctionID::Buttons_SubscribeButton);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ ApplicationSharedPtr app = GetApplicationPtr();
+
+ if (!app) {
+ SDL_LOG_ERROR("NULL pointer.");
+ return;
+ }
+
+ const auto hmi_result = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (CommandImpl::IsHMIResultSuccess(hmi_result,
+ HmiInterfaces::HMI_INTERFACE_Buttons)) {
+ SDL_LOG_DEBUG("Subscription to "
+ << button_name_ << " was successful. Subscribing internally");
+ app->SubscribeToButton(
+ static_cast<mobile_apis::ButtonName::eType>(button_name_));
+ } else if (hmi_apis::Common_ButtonName::CUSTOM_BUTTON == button_name_) {
+ // SDL should revert subscription in a specific case related to custom
+ // button because it was subscribed when the request is sent to HMI
+ SDL_LOG_ERROR(
+ "Subscription to custom button was failed. Revert the internal "
+ "subscription");
+ app->UnsubscribeFromButton(
+ static_cast<mobile_apis::ButtonName::eType>(button_name_));
+ }
+}
+
+void SubscribeButtonRequest::OnTimeOut() {
+ SDL_LOG_AUTO_TRACE();
+
+ application_manager_.AddExpiredButtonRequest(
+ application_id(), correlation_id(), button_name_);
+
+ if (hmi_apis::Common_ButtonName::CUSTOM_BUTTON == button_name_) {
+ ApplicationSharedPtr app = GetApplicationPtr();
+
+ if (app) {
+ // SDL should revert subscription in a specific case related to custom
+ // button because it was subscribed when the request is sent to HMI
+ SDL_LOG_ERROR(
+ "Subscription to custom button was timed out. Revert the internal "
+ "subscription");
+ app->UnsubscribeFromButton(
+ static_cast<mobile_apis::ButtonName::eType>(button_name_));
+ }
+ }
+
+ auto& resume_ctrl = application_manager_.resume_controller();
+ resume_ctrl.HandleOnTimeOut(
+ correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()));
+}
+
+} // namespace hmi
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_response.cc
index d8de31cfbc..202cde29c6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/subscribe_button_response.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,44 +29,69 @@
* 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_ui_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/subscribe_button_response.h"
#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
-
namespace commands {
-namespace hmi {
-
SDL_CREATE_LOG_VARIABLE("Commands")
-OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
+namespace hmi {
+SubscribeButtonResponse::SubscribeButtonResponse(
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) {}
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
-OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {}
+SubscribeButtonResponse::~SubscribeButtonResponse() {}
-void OnUIResetTimeoutNotification::Run() {
+void SubscribeButtonResponse::Run() {
SDL_LOG_AUTO_TRACE();
- event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)
+ .getElement(strings::params)
+ .getElement(hmi_response::code)
+ .asInt());
+
+ const auto expired_request_data =
+ application_manager_.GetExpiredButtonRequestData(correlation_id());
+ if (expired_request_data) {
+ const uint32_t app_id = (*expired_request_data).app_id_;
+ const auto button_name = (*expired_request_data).button_name_;
+ application_manager_.DeleteExpiredButtonRequest(correlation_id());
+
+ if (!CommandImpl::IsHMIResultSuccess(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_Buttons)) {
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr msg =
+ MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ app_id,
+ button_name,
+ hmi_apis::FunctionID::Buttons_UnsubscribeButton,
+ application_manager_);
+
+ rpc_service_.SendMessageToHMI(msg);
+ return;
+ }
+
+ event_engine::Event event(hmi_apis::FunctionID::Buttons_SubscribeButton);
event.set_smart_object(*message_);
event.raise(application_manager_.event_dispatcher());
}
} // namespace hmi
-
} // namespace commands
-
} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
index 3bca6c05c1..9b5eb6f14b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
@@ -59,7 +59,7 @@ void TTSGetCapabilitiesRequest::Run() {
SendRequest();
}
-void TTSGetCapabilitiesRequest::onTimeOut() {
+void TTSGetCapabilitiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::TTS_GetCapabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
index 2b409c68de..42de944da3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
@@ -59,7 +59,7 @@ void TTSGetLanguageRequest::Run() {
SendRequest();
}
-void TTSGetLanguageRequest::onTimeOut() {
+void TTSGetLanguageRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::TTS_GetLanguage);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
index 87df2402bb..2fb74fbb46 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
@@ -59,7 +59,7 @@ void TTSGetSupportedLanguagesRequest::Run() {
SendRequest();
}
-void TTSGetSupportedLanguagesRequest::onTimeOut() {
+void TTSGetSupportedLanguagesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::TTS_GetSupportedLanguages);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
index 5ff7bc5a50..6a09616926 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
@@ -50,8 +50,7 @@ TTSIsReadyRequest::TTSIsReadyRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handler) {}
TTSIsReadyRequest::~TTSIsReadyRequest() {}
@@ -92,7 +91,7 @@ void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void TTSIsReadyRequest::onTimeOut() {
+void TTSIsReadyRequest::OnTimeOut() {
// Note(dtrunov): According to new requirment APPLINK-27956
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::TTS_IsReady);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
index 35059bf48d..574230ee11 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
@@ -60,7 +60,7 @@ void TTSSetGlobalPropertiesRequest::Run() {
SendRequest();
}
-void TTSSetGlobalPropertiesRequest::onTimeOut() {
+void TTSSetGlobalPropertiesRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
correlation_id(),
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
index 067ada3153..2cd40b1705 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
@@ -60,7 +60,7 @@ void UIAddCommandRequest::Run() {
SendRequest();
}
-void UIAddCommandRequest::onTimeOut() {
+void UIAddCommandRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
index 275c411eae..8b9ecf4932 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
@@ -60,7 +60,7 @@ void UIAddSubmenuRequest::Run() {
SendRequest();
}
-void UIAddSubmenuRequest::onTimeOut() {
+void UIAddSubmenuRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
correlation_id(),
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
index e98ad5c45e..1acbb9e682 100644
--- 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
@@ -60,7 +60,7 @@ void UICreateWindowRequest::Run() {
SendRequest();
}
-void UICreateWindowRequest::onTimeOut() {
+void UICreateWindowRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
index 00a8ad761e..604f293c4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
@@ -59,7 +59,7 @@ void UIGetCapabilitiesRequest::Run() {
SendRequest();
}
-void UIGetCapabilitiesRequest::onTimeOut() {
+void UIGetCapabilitiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::UI_GetCapabilities);
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 45c5f59326..128f41e01f 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
@@ -151,11 +151,6 @@ void UIGetCapabilitiesResponse::Run() {
hmi_capabilities_.set_driver_distraction_supported(true);
}
}
- if (system_capabilities_so.keyExists(strings::display_capabilities)) {
- sections_to_update.push_back(strings::display_capabilities);
- hmi_capabilities_.set_system_display_capabilities(
- system_capabilities_so[strings::display_capabilities]);
- }
}
if (msg_params.keyExists(strings::pcm_stream_capabilities)) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
index bf91b7e294..597452a471 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
@@ -59,7 +59,7 @@ void UIGetLanguageRequest::Run() {
SendRequest();
}
-void UIGetLanguageRequest::onTimeOut() {
+void UIGetLanguageRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::UI_GetLanguage);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
index 480fa2499f..c67f552fe2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
@@ -59,7 +59,7 @@ void UIGetSupportedLanguagesRequest::Run() {
SendRequest();
}
-void UIGetSupportedLanguagesRequest::onTimeOut() {
+void UIGetSupportedLanguagesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::UI_GetSupportedLanguages);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
index f3da33c5b5..630a54e3cc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
@@ -50,8 +50,7 @@ UIIsReadyRequest::UIIsReadyRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handle)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handle) {}
UIIsReadyRequest::~UIIsReadyRequest() {}
@@ -91,7 +90,7 @@ void UIIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void UIIsReadyRequest::onTimeOut() {
+void UIIsReadyRequest::OnTimeOut() {
// Note(dtrunov): According to new requirment APPLINK-27956
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::UI_IsReady);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
index c82a4d2131..9b664bb81c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
@@ -60,7 +60,7 @@ void UISetGlobalPropertiesRequest::Run() {
SendRequest();
}
-void UISetGlobalPropertiesRequest::onTimeOut() {
+void UISetGlobalPropertiesRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
correlation_id(),
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_request.cc
new file mode 100644
index 0000000000..e2cbb4e467
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_request.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2021, 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/unsubscribe_button_request.h"
+#include "application_manager/event_engine/event_dispatcher_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+SDL_CREATE_LOG_VARIABLE("Commands")
+
+namespace hmi {
+
+UnsubscribeButtonRequest::UnsubscribeButtonRequest(
+ 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) {
+ hmi_apis::Common_ButtonName::eType button_name =
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [app_mngr::strings::button_name]
+ .asInt());
+
+ button_name_ = button_name;
+}
+
+UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
+
+void UnsubscribeButtonRequest::Run() {
+ SDL_LOG_AUTO_TRACE();
+
+ subscribe_on_event(hmi_apis::FunctionID::Buttons_UnsubscribeButton,
+ correlation_id());
+ SendRequest();
+}
+
+void UnsubscribeButtonRequest::OnTimeOut() {
+ SDL_LOG_AUTO_TRACE();
+
+ application_manager_.AddExpiredButtonRequest(
+ application_id(), correlation_id(), button_name_);
+
+ auto& resume_ctrl = application_manager_.resume_controller();
+ resume_ctrl.HandleOnTimeOut(
+ correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()));
+}
+
+void UnsubscribeButtonRequest::on_event(const event_engine::Event& event) {
+ SDL_LOG_AUTO_TRACE();
+
+ if (hmi_apis::FunctionID::Buttons_UnsubscribeButton != event.id()) {
+ SDL_LOG_ERROR("Unexpected event id received: " << event.id());
+ return;
+ }
+
+ unsubscribe_from_event(hmi_apis::FunctionID::Buttons_UnsubscribeButton);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (!app) {
+ SDL_LOG_ERROR("NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (CommandImpl::IsHMIResultSuccess(hmi_result,
+ HmiInterfaces::HMI_INTERFACE_Buttons)) {
+ const mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][strings::button_name].asInt());
+ app->UnsubscribeFromButton(
+ static_cast<mobile_apis::ButtonName::eType>(btn_id));
+ }
+}
+
+} // namespace hmi
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_response.cc
index 62bec16546..68b3663ca7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/unsubscribe_button_response.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2021, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,41 +29,70 @@
* 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_vi_device_status_notification.h"
-#include "interfaces/MOBILE_API.h"
+#include "sdl_rpc_plugin/commands/hmi/unsubscribe_button_response.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
-
namespace commands {
SDL_CREATE_LOG_VARIABLE("Commands")
-OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
+namespace hmi {
+
+UnsubscribeButtonResponse::UnsubscribeButtonResponse(
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) {}
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
-OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {}
+UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
-void OnVIDeviceStatusNotification::Run() {
+void UnsubscribeButtonResponse::Run() {
SDL_LOG_AUTO_TRACE();
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)
+ .getElement(strings::params)
+ .getElement(hmi_response::code)
+ .asInt());
+
+ const auto expired_request_data =
+ application_manager_.GetExpiredButtonRequestData(correlation_id());
+ if (expired_request_data) {
+ const uint32_t app_id = (*expired_request_data).app_id_;
+ const auto button_name = (*expired_request_data).button_name_;
+ application_manager_.DeleteExpiredButtonRequest(correlation_id());
- SendNotificationToMobile(message_);
+ if (!CommandImpl::IsHMIResultSuccess(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_Buttons)) {
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr msg =
+ MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ app_id,
+ button_name,
+ hmi_apis::FunctionID::Buttons_SubscribeButton,
+ application_manager_);
+
+ rpc_service_.SendMessageToHMI(msg);
+ return;
+ }
+
+ event_engine::Event event(hmi_apis::FunctionID::Buttons_UnsubscribeButton);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
}
+} // namespace hmi
} // namespace commands
-
} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
index c8979ca62b..69bc299c7e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
@@ -60,7 +60,7 @@ void VRAddCommandRequest::Run() {
SendRequest();
}
-void VRAddCommandRequest::onTimeOut() {
+void VRAddCommandRequest::OnTimeOut() {
auto& resume_ctrl = application_manager_.resume_controller();
resume_ctrl.HandleOnTimeOut(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
index 3f528f2f58..d26d91f701 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
@@ -59,7 +59,7 @@ void VRGetCapabilitiesRequest::Run() {
SendRequest();
}
-void VRGetCapabilitiesRequest::onTimeOut() {
+void VRGetCapabilitiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VR_GetCapabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
index f5e9b0e848..f15ed3017b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
@@ -59,7 +59,7 @@ void VRGetLanguageRequest::Run() {
SendRequest();
}
-void VRGetLanguageRequest::onTimeOut() {
+void VRGetLanguageRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VR_GetLanguage);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
index 73e68e8503..3f6a268e70 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
@@ -59,7 +59,7 @@ void VRGetSupportedLanguagesRequest::Run() {
SendRequest();
}
-void VRGetSupportedLanguagesRequest::onTimeOut() {
+void VRGetSupportedLanguagesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VR_GetSupportedLanguages);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
index 2efd227add..3e8fd0b4e3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
@@ -50,8 +50,7 @@ VRIsReadyRequest::VRIsReadyRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handle)
- , EventObserver(application_manager.event_dispatcher()) {}
+ policy_handle) {}
VRIsReadyRequest::~VRIsReadyRequest() {}
@@ -92,7 +91,7 @@ void VRIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void VRIsReadyRequest::onTimeOut() {
+void VRIsReadyRequest::OnTimeOut() {
// Note(dtrunov): According to new requirment APPLINK-27956
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VR_IsReady);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
index 03b0ee20fc..ddd2c9db35 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
@@ -32,6 +32,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+
#include <string>
#include "application_manager/application.h"
@@ -56,24 +57,22 @@ AddCommandRequest::AddCommandRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
- , send_ui_(false)
- , send_vr_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , ui_is_sent_(false)
+ , vr_is_sent_(false) {}
AddCommandRequest::~AddCommandRequest() {}
-void AddCommandRequest::onTimeOut() {
+void AddCommandRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
RemoveCommand();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
}
bool AddCommandRequest::Init() {
@@ -184,6 +183,7 @@ void AddCommandRequest::Run() {
smart_objects::SmartObject ui_msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
+
if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
ui_msg_params[strings::cmd_id] =
(*message_)[strings::msg_params][strings::cmd_id];
@@ -201,6 +201,9 @@ void AddCommandRequest::Run() {
(*message_)[strings::msg_params][strings::cmd_icon];
}
+ ui_is_sent_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
if (((*message_)[strings::msg_params].keyExists(
strings::secondary_image)) &&
((*message_)[strings::msg_params][strings::secondary_image].keyExists(
@@ -211,8 +214,6 @@ void AddCommandRequest::Run() {
ui_msg_params[strings::secondary_image] =
(*message_)[strings::msg_params][strings::secondary_image];
}
-
- send_ui_ = true;
}
smart_objects::SmartObject vr_msg_params =
@@ -227,16 +228,15 @@ void AddCommandRequest::Run() {
vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
vr_msg_params[strings::grammar_id] = app->get_grammar_id();
- send_vr_ = true;
+ vr_is_sent_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
}
- if (send_ui_) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI)) {
SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
}
- if (send_vr_) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR)) {
SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
}
}
@@ -322,7 +322,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::UI_AddCommand: {
SDL_LOG_INFO("Received UI_AddCommand event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, ui_info_);
@@ -334,7 +333,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::VR_AddCommand: {
SDL_LOG_INFO("Received VR_AddCommand event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, vr_info_);
@@ -350,6 +348,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
}
if (IsPendingResponseExist()) {
+ SDL_LOG_DEBUG("Command still wating for HMI response");
return;
}
@@ -505,10 +504,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
&(message[strings::msg_params]));
}
-bool AddCommandRequest::IsPendingResponseExist() {
- return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
-}
-
bool AddCommandRequest::IsWhiteSpaceExist() {
SDL_LOG_AUTO_TRACE();
const char* str = NULL;
@@ -559,7 +554,7 @@ bool AddCommandRequest::IsWhiteSpaceExist() {
}
bool AddCommandRequest::BothSend() const {
- return send_vr_ && send_ui_;
+ return ui_is_sent_ && vr_is_sent_;
}
const std::string AddCommandRequest::GenerateMobileResponseInfo() {
@@ -607,17 +602,18 @@ void AddCommandRequest::RemoveCommand() {
app->RemoveCommand(cmd_id);
- if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
+ if (BothSend() && (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR) &&
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI))) {
// in case we have send bth UI and VR and no one respond
// we have nothing to remove from HMI so no DeleteCommand expected
return;
}
- if (BothSend() && !is_vr_received_) {
+ if (BothSend() && IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR)) {
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
}
- if (BothSend() && !is_ui_received_) {
+ if (BothSend() && IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI)) {
msg_params[strings::grammar_id] = app->get_grammar_id();
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
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 309f07e443..635734a74d 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
@@ -50,11 +50,11 @@ AddSubMenuRequest::AddSubMenuRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
AddSubMenuRequest::~AddSubMenuRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
index 8728bb4403..89b305ae9d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
@@ -26,8 +26,10 @@
*/
#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
+
#include <cstring>
#include <string>
+
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler.h"
@@ -45,15 +47,13 @@ AlertManeuverRequest::AlertManeuverRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
- , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
+ , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {}
AlertManeuverRequest::~AlertManeuverRequest() {}
@@ -173,19 +173,14 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::TTS_Speak: {
SDL_LOG_INFO("Received TTS_Speak event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+
pending_requests_.Remove(event_id);
tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, info_tts_);
break;
}
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- SDL_LOG_INFO("Received TTS_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
default: {
SDL_LOG_ERROR("Received unknown event " << event.id());
SendResponse(
@@ -194,12 +189,11 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
}
}
- if (!pending_requests_.IsFinal(event_id)) {
- SDL_LOG_DEBUG(
- "There are some pending responses from HMI. "
- "AlertManeuverRequest still waiting.");
+ if (IsPendingResponseExist()) {
+ SDL_LOG_DEBUG("Command still wating for HMI response");
return;
}
+
std::string return_info;
mobile_apis::Result::eType result_code;
const bool result = PrepareResponseParameters(result_code, return_info);
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 9f04541b46..aab2c8c486 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
@@ -37,7 +37,6 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-
#include "application_manager/policies/policy_handler.h"
#include "smart_objects/smart_object.h"
#include "utils/helpers.h"
@@ -55,20 +54,17 @@ AlertRequest::AlertRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, awaiting_ui_alert_response_(false)
, awaiting_tts_speak_response_(false)
, awaiting_tts_stop_speaking_response_(false)
, is_ui_alert_sent_(false)
, alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
+ , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
AlertRequest::~AlertRequest() {}
@@ -124,23 +120,22 @@ void AlertRequest::Run() {
}
}
+void AlertRequest::OnTimeOut() {
+ SDL_LOG_AUTO_TRACE();
+ if (!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ RequestFromMobileImpl::OnTimeOut();
+ return;
+ }
+ SDL_LOG_INFO(
+ "Default timeout ignored. "
+ "AlertRequest with soft buttons wait timeout on HMI side");
+}
+
void AlertRequest::on_event(const event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::TTS_OnResetTimeout:
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- SDL_LOG_INFO(
- "Received UI_OnResetTimeout event "
- " or TTS_OnResetTimeout event "
- << awaiting_tts_speak_response_ << " "
- << awaiting_tts_stop_speaking_response_ << " "
- << awaiting_ui_alert_response_);
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
case hmi_apis::FunctionID::UI_Alert: {
SDL_LOG_INFO("Received UI_Alert event");
// Unsubscribe from event to avoid unwanted messages
@@ -190,9 +185,11 @@ void AlertRequest::on_event(const event_engine::Event& event) {
}
}
- if (HasHmiResponsesToWait()) {
+ if (IsPendingResponseExist()) {
+ SDL_LOG_DEBUG("Command is still waiting for HMI response");
return;
}
+
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
std::string info;
const bool result = PrepareResponseParameters(result_code, info);
@@ -325,14 +322,14 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
hmi_apis::Common_TextFieldName::alertText1;
msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::alert_text1];
- index++;
+ ++index;
}
if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
hmi_apis::Common_TextFieldName::alertText2;
msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::alert_text2];
- index++;
+ ++index;
}
if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
@@ -458,7 +455,7 @@ bool AlertRequest::CheckStrings() {
return true;
}
-bool AlertRequest::HasHmiResponsesToWait() {
+bool AlertRequest::IsPendingResponseExist() {
SDL_LOG_AUTO_TRACE();
return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ ||
awaiting_tts_stop_speaking_response_;
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
index 27020f2719..53511cb83f 100644
--- 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
@@ -49,11 +49,11 @@ CancelInteractionRequest::CancelInteractionRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CancelInteractionRequest::~CancelInteractionRequest() {}
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 13a57cf9a8..f7fc7d2284 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
@@ -32,8 +32,11 @@
*/
#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
+
#include <string.h>
+
#include <algorithm>
+
#include "application_manager/application_impl.h"
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
@@ -44,14 +47,14 @@
namespace {
namespace custom_str = utils::custom_string;
struct IsSameNickname {
- explicit IsSameNickname(const custom_str::CustomString& app_id)
- : app_id_(app_id) {}
+ explicit 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
@@ -68,11 +71,11 @@ ChangeRegistrationRequest::ChangeRegistrationRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
, vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
, tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
@@ -83,7 +86,6 @@ void ChangeRegistrationRequest::SendVRRequest(
ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
auto function = hmi_apis::FunctionID::VR_ChangeRegistration;
- pending_requests_.Add(function);
smart_objects::SmartObject vr_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -102,7 +104,6 @@ void ChangeRegistrationRequest::SendTTSRequest(
ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
auto function = hmi_apis::FunctionID::TTS_ChangeRegistration;
- pending_requests_.Add(function);
smart_objects::SmartObject tts_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -124,7 +125,6 @@ void ChangeRegistrationRequest::SendUIRequest(
const int32_t hmi_language) {
const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
auto function = hmi_apis::FunctionID::UI_ChangeRegistration;
- pending_requests_.Add(function);
// UI processing
smart_objects::SmartObject ui_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
@@ -230,18 +230,30 @@ void ChangeRegistrationRequest::Run() {
SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
return;
}
+
if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != vr_state) {
- // VR processing
- SendVRRequest(app, msg_params);
+ StartAwaitForInterface(HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
}
+
if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != tts_state) {
- // TTS processing
- SendTTSRequest(app, msg_params);
+ StartAwaitForInterface(HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
}
if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != ui_state) {
+ StartAwaitForInterface(HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+ }
+
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI)) {
SendUIRequest(app, msg_params, hmi_language);
}
+
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
+ SendTTSRequest(app, msg_params);
+ }
+
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR)) {
+ SendVRRequest(app, msg_params);
+ }
}
void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
@@ -254,7 +266,6 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::UI_ChangeRegistration: {
SDL_LOG_INFO("Received UI_ChangeRegistration event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- pending_requests_.Remove(event_id);
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, ui_response_info_);
@@ -263,7 +274,6 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::VR_ChangeRegistration: {
SDL_LOG_INFO("Received VR_ChangeRegistration event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- pending_requests_.Remove(event_id);
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, vr_response_info_);
@@ -272,7 +282,6 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::TTS_ChangeRegistration: {
SDL_LOG_INFO("Received TTS_ChangeRegistration event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- pending_requests_.Remove(event_id);
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, tts_response_info_);
@@ -284,43 +293,39 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
}
}
- if (pending_requests_.IsFinal(event_id)) {
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SDL_LOG_ERROR("NULL pointer");
- return;
- }
+ if (IsPendingResponseExist()) {
+ SDL_LOG_DEBUG("Command still wating for HMI response");
+ return;
+ }
- if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
- application->set_ui_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::hmi_display_language]
- .asInt()));
- }
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
- if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
- hmi_apis::Common_Result::SUCCESS == tts_result_) {
- application->set_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
+ if (!application) {
+ SDL_LOG_ERROR("NULL pointer");
+ return;
+ }
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::eType::ChangeRegistrationID;
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
+ application->set_ui_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::hmi_display_language]
+ .asInt()));
+ }
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- } else {
- SDL_LOG_INFO(
- "There are some pending responses from HMI."
- "ChangeRegistrationRequest still waiting.");
+ if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
+ hmi_apis::Common_Result::SUCCESS == tts_result_) {
+ application->set_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
}
-}
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ 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]));
+} // namespace commands
namespace {
void CheckInfo(std::string& str) {
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
index b4a09844f2..5154ace4ee 100644
--- 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
@@ -47,11 +47,11 @@ CloseApplicationRequest::CloseApplicationRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CloseApplicationRequest::~CloseApplicationRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
index 0d1d876497..98e26e1aa9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
@@ -32,6 +32,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
+
#include <algorithm>
#include <cstring>
#include <string>
@@ -58,17 +59,16 @@ CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, choice_set_id_(0)
, expected_chs_count_(0)
, received_chs_count_(0)
, should_send_warnings_(false)
- , error_from_hmi_(false)
- , is_timed_out_(false) {}
+ , error_from_hmi_(false) {}
CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
SDL_LOG_AUTO_TRACE();
@@ -364,12 +364,12 @@ bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
}
void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
- received_chs_count_++;
+ ++received_chs_count_;
SDL_LOG_DEBUG("Got VR.AddCommand response, there are "
<< expected_chs_count_ - received_chs_count_
<< " more to wait.");
if (received_chs_count_ < expected_chs_count_) {
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
connection_key(), correlation_id(), default_timeout());
SDL_LOG_DEBUG("Timeout for request was updated");
} else {
@@ -406,13 +406,13 @@ void CreateInteractionChoiceSetRequest::on_event(
}
}
-void CreateInteractionChoiceSetRequest::onTimeOut() {
+void CreateInteractionChoiceSetRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
if (!error_from_hmi_) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ RequestFromMobileImpl::OnTimeOut();
}
- CommandRequestImpl::onTimeOut();
+
DeleteChoices();
auto& resume_ctrl = application_manager_.resume_controller();
@@ -421,10 +421,6 @@ void CreateInteractionChoiceSetRequest::onTimeOut() {
correlation_id(),
static_cast<hmi_apis::FunctionID::eType>(function_id()));
- // We have to keep request alive until receive all responses from HMI
- // according to SDLAQ-CRS-2976
- sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
- is_timed_out_ = true;
application_manager_.TerminateRequest(
connection_key(), correlation_id(), function_id());
}
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
index 2a0ca4ddb3..81b8985cd5 100644
--- 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
@@ -53,11 +53,11 @@ CreateWindowRequest::CreateWindowRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CreateWindowRequest::~CreateWindowRequest() {}
@@ -214,11 +214,12 @@ void CreateWindowRequest::on_event(const event_engine::Event& event) {
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
const smart_objects::SmartObject& response_message = event.smart_object();
- const auto result_code = CommandRequestImpl::GetMobileResultCode(
+ const auto result_code = RequestFromMobileImpl::GetMobileResultCode(
static_cast<hmi_apis::Common_Result::eType>(
response_message[strings::params][hmi_response::code].asInt()));
- const bool is_success = IsMobileResultSuccess(result_code);
+ const bool is_success =
+ app_mngr::commands::IsMobileResultSuccess(result_code);
std::string response_info;
GetInfo(response_message, response_info);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
index 358a002606..dead764811 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
@@ -52,15 +52,11 @@ DeleteCommandRequest::DeleteCommandRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
- , is_ui_send_(false)
- , is_vr_send_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
, vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
@@ -99,17 +95,11 @@ void DeleteCommandRequest::Run() {
/* Need to set all flags before sending request to HMI
* for correct processing this flags in method on_event */
if (command.keyExists(strings::menu_params)) {
- is_ui_send_ = true;
- }
- // check vr params
- if (command.keyExists(strings::vr_commands)) {
- is_vr_send_ = true;
- }
- if (is_ui_send_) {
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
}
- if (is_vr_send_) {
+ // check vr params
+ if (command.keyExists(strings::vr_commands)) {
// VR params
msg_params[strings::grammar_id] = application->get_grammar_id();
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
@@ -151,7 +141,6 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_DeleteCommand: {
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
SDL_LOG_DEBUG("Received UI_DeleteCommand event with result "
@@ -161,7 +150,6 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::VR_DeleteCommand: {
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
SDL_LOG_DEBUG("Received VR_DeleteCommand event with result "
@@ -216,11 +204,6 @@ bool DeleteCommandRequest::Init() {
return true;
}
-bool DeleteCommandRequest::IsPendingResponseExist() {
- SDL_LOG_AUTO_TRACE();
- return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
-}
-
} // 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 127843813c..268d1fa0cd 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
@@ -50,11 +50,11 @@ DeleteFileRequest::DeleteFileRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
DeleteFileRequest::~DeleteFileRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
index 3ff95a6f41..eac43bb22b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
@@ -51,11 +51,12 @@ DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , response_result_codes_() {}
DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {}
@@ -89,18 +90,6 @@ void DeleteInteractionChoiceSetRequest::Run() {
return;
}
SendVrDeleteCommand(app);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::interaction_choice_set_id] = choice_set_id;
- msg_params[strings::app_id] = app->app_id();
-
- app->RemoveChoiceSet(choice_set_id);
-
- // Checking of HMI responses will be implemented with APPLINK-14600
- const bool result = true;
- SendResponse(result, mobile_apis::Result::SUCCESS);
}
bool DeleteInteractionChoiceSetRequest::Init() {
@@ -108,6 +97,39 @@ bool DeleteInteractionChoiceSetRequest::Init() {
return true;
}
+void DeleteInteractionChoiceSetRequest::on_event(
+ const event_engine::Event& event) {
+ using namespace helpers;
+ SDL_LOG_AUTO_TRACE();
+
+ if (event.id() == hmi_apis::FunctionID::VR_DeleteCommand) {
+ const smart_objects::SmartObject& message = event.smart_object();
+ const auto result_code = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ response_result_codes_.push_back(result_code);
+ const std::uint32_t correlation_id = static_cast<uint32_t>(
+ message[strings::params][strings::correlation_id].asUInt());
+
+ bool should_send_response = false;
+ {
+ sync_primitives::AutoLock auto_lock(requests_lock_);
+ auto found_request = sent_requests_.find(correlation_id);
+ if (sent_requests_.end() == found_request) {
+ SDL_LOG_WARN("Request with " << correlation_id
+ << " correlation_id is not found.");
+ return;
+ }
+
+ sent_requests_.erase(found_request);
+ should_send_response = sent_requests_.empty();
+ }
+
+ if (should_send_response) {
+ SendDeleteInteractionChoiceSetResponse();
+ }
+ }
+}
+
bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
ApplicationConstSharedPtr app) {
SDL_LOG_AUTO_TRACE();
@@ -157,10 +179,52 @@ void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
msg_params[strings::grammar_id] = choice_set[strings::grammar_id];
choice_set = choice_set[strings::choice_set];
+
+ sync_primitives::AutoLock auto_lock(requests_lock_);
for (uint32_t i = 0; i < choice_set.length(); ++i) {
msg_params[strings::cmd_id] = choice_set[i][strings::choice_id];
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ const uint32_t delte_cmd_hmi_corr_id = SendHMIRequest(
+ hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
+ sent_requests_.insert(delte_cmd_hmi_corr_id);
+ }
+}
+
+void DeleteInteractionChoiceSetRequest::
+ SendDeleteInteractionChoiceSetResponse() {
+ hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ for (const auto& code : response_result_codes_) {
+ if (result_code == hmi_apis::Common_Result::INVALID_ENUM) {
+ result_code = code;
+ continue;
+ }
+
+ if (!application_manager::commands::IsHMIResultSuccess(code)) {
+ result_code = code;
+ }
}
+
+ const bool response_result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+
+ if (response_result) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ if (!app) {
+ SDL_LOG_ERROR("Application with connection key " << connection_key()
+ << " did not find.");
+ return;
+ }
+ const uint32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asUInt();
+ app->RemoveChoiceSet(choice_set_id);
+ }
+
+ SDL_LOG_DEBUG("Response sent. Result code: " << result_code
+ << " sussess: " << std::boolalpha
+ << result_code);
+ SendResponse(response_result, MessageHelper::HMIToMobileResult(result_code));
}
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
index 19ec2dfb27..aa16c9b218 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
@@ -52,11 +52,13 @@ DeleteSubMenuRequest::DeleteSubMenuRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , requests_list_()
+ , pending_request_corr_id_(0) {}
DeleteSubMenuRequest::~DeleteSubMenuRequest() {}
@@ -82,19 +84,42 @@ void DeleteSubMenuRequest::Run() {
return;
}
+ {
+ const DataAccessor<SubMenuMap> accessor = app->sub_menu_map();
+ const SubMenuMap& sub_menus = accessor.GetData();
+ DeleteNestedSubMenus(app, menu_id, sub_menus);
+ }
+
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
-
msg_params[strings::menu_id] =
(*message_)[strings::msg_params][strings::menu_id];
msg_params[strings::app_id] = app->app_id();
+ requests_list_.push_back(msg_params);
+
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendNextRequest();
+}
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
+void DeleteSubMenuRequest::SendNextRequest() {
+ SDL_LOG_AUTO_TRACE();
+
+ const auto request_params = requests_list_.front();
+ auto function_id = hmi_apis::FunctionID::UI_DeleteSubMenu;
+
+ if (request_params.keyExists(strings::cmd_id)) {
+ function_id = request_params.keyExists(strings::grammar_id)
+ ? hmi_apis::FunctionID::VR_DeleteCommand
+ : hmi_apis::FunctionID::UI_DeleteCommand;
+ }
+
+ pending_request_corr_id_ = SendHMIRequest(function_id, &request_params, true);
+ SDL_LOG_DEBUG(
+ "Waiting for response for corr_id = " << pending_request_corr_id_);
}
void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app,
- uint32_t parentID,
+ const uint32_t parentID,
const SubMenuMap& subMenus) {
SDL_LOG_AUTO_TRACE();
@@ -108,26 +133,26 @@ void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app,
}
if (parentID == (*it->second)[strings::parent_id].asUInt()) {
- uint32_t menuID = (*it->second)[strings::menu_id].asUInt();
+ const uint32_t menuID = (*it->second)[strings::menu_id].asUInt();
DeleteNestedSubMenus(app, menuID, subMenus);
- DeleteSubMenuVRCommands(app, menuID);
- DeleteSubMenuUICommands(app, menuID);
+
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
msg_params[strings::menu_id] = menuID;
msg_params[strings::app_id] = app->app_id();
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params);
- ++it;
- SDL_LOG_DEBUG("Removing submenuID: " << menuID);
- app->RemoveSubMenu(menuID);
- } else {
- ++it;
+ requests_list_.push_back(msg_params);
}
+
+ ++it;
}
+
+ SDL_LOG_DEBUG("Delete commands with Parent ID: " << parentID);
+ DeleteSubMenuVRCommands(app, parentID);
+ DeleteSubMenuUICommands(app, parentID);
}
void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
- ApplicationConstSharedPtr app, uint32_t parentID) {
+ ApplicationConstSharedPtr app, const uint32_t parentID) {
SDL_LOG_AUTO_TRACE();
const DataAccessor<CommandsMap> accessor = app->commands_map();
@@ -148,7 +173,7 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
msg_params[strings::grammar_id] = app->get_grammar_id();
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ requests_list_.push_back(msg_params);
}
}
}
@@ -175,16 +200,11 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(
const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt();
msg_params[strings::app_id] = app->app_id();
msg_params[strings::cmd_id] = cmd_id;
- SDL_LOG_DEBUG("Removing UI Command: " << cmd_id);
- app->RemoveCommand(cmd_id);
- app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
- it = commands.begin(); // Can not relay on
- // iterators after erase was called
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- } else {
- ++it;
+
+ requests_list_.push_back(msg_params);
}
+
+ ++it;
}
}
@@ -193,48 +213,110 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::UI_DeleteSubMenu: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType 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 application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SDL_LOG_ERROR("NULL pointer");
- return;
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ SDL_LOG_DEBUG("Received UI_DeleteCommand response");
+
+ const auto corr_id =
+ message[strings::params][strings::correlation_id].asUInt();
+ if (pending_request_corr_id_ == corr_id) {
+ auto msg_params = requests_list_.front();
+
+ const auto result_code = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ auto app = application_manager_.application(connection_key());
+ if (!app) {
+ SDL_LOG_ERROR("Application not found");
+ return;
+ }
+
+ if (application_manager::commands::IsHMIResultSuccess(result_code)) {
+ const auto cmd_id = msg_params[strings::cmd_id].asUInt();
+ SDL_LOG_DEBUG("Removing UI Command: " << cmd_id);
+ app->RemoveCommand(cmd_id);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
+ }
+
+ requests_list_.pop_front();
}
- if (result) {
- // delete sub menu items from SDL and HMI
- uint32_t parentID =
- (*message_)[strings::msg_params][strings::menu_id].asUInt();
- const DataAccessor<SubMenuMap> accessor = application->sub_menu_map();
- const SubMenuMap& subMenus = accessor.GetData();
- DeleteNestedSubMenus(application, parentID, subMenus);
- DeleteSubMenuVRCommands(application, parentID);
- DeleteSubMenuUICommands(application, parentID);
- application->RemoveSubMenu(
- (*message_)[strings::msg_params][strings::menu_id].asInt());
+ break;
+ }
+
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ SDL_LOG_DEBUG("Received VR_DeleteCommand response");
+
+ const auto corr_id =
+ message[strings::params][strings::correlation_id].asUInt();
+
+ if (corr_id == pending_request_corr_id_) {
+ auto app = application_manager_.application(connection_key());
+ if (!app) {
+ SDL_LOG_ERROR("Application not found");
+ return;
+ }
+
+ requests_list_.pop_front();
}
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
break;
}
+
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ SDL_LOG_DEBUG("Received UI_DeleteSubMenu response");
+
+ const auto corr_id =
+ message[strings::params][strings::correlation_id].asUInt();
+ if (corr_id == pending_request_corr_id_) {
+ auto msg_params = requests_list_.front();
+
+ const auto result_code = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ auto app = application_manager_.application(connection_key());
+ if (!app) {
+ SDL_LOG_ERROR("Application not found");
+ return;
+ }
+
+ if (application_manager::commands::IsHMIResultSuccess(result_code)) {
+ const auto menu_id = msg_params[strings::menu_id].asUInt();
+ SDL_LOG_DEBUG("Removing submenuID: " << menu_id);
+ app->RemoveSubMenu(menu_id);
+ }
+
+ requests_list_.pop_front();
+ }
+
+ break;
+ }
+
default: {
SDL_LOG_ERROR("Received unknown event" << event.id());
return;
}
}
+
+ if (!requests_list_.empty()) {
+ SDL_LOG_DEBUG("Still waiting for another requests");
+ SendNextRequest();
+ return;
+ }
+
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ hmi_apis::Common_Result::eType 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);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
}
bool DeleteSubMenuRequest::Init() {
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
index 214a9c2bab..73fa7f4774 100644
--- 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
@@ -47,11 +47,11 @@ DeleteWindowRequest::DeleteWindowRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
DeleteWindowRequest::~DeleteWindowRequest() {}
@@ -130,11 +130,12 @@ void DeleteWindowRequest::on_event(const event_engine::Event& event) {
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
const smart_objects::SmartObject& response_message = event.smart_object();
- const auto result_code = CommandRequestImpl::GetMobileResultCode(
+ const auto result_code = RequestFromMobileImpl::GetMobileResultCode(
static_cast<hmi_apis::Common_Result::eType>(
response_message[strings::params][hmi_response::code].asInt()));
- const bool is_success = IsMobileResultSuccess(result_code);
+ const bool is_success =
+ app_mngr::commands::IsMobileResultSuccess(result_code);
std::string response_info;
GetInfo(response_message, response_info);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
index f0ef2e0028..c14eb02dae 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
@@ -49,11 +49,11 @@ DialNumberRequest::DialNumberRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
DialNumberRequest::~DialNumberRequest() {}
@@ -118,7 +118,7 @@ void DialNumberRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
SDL_LOG_INFO("Received DialNumber event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
- result_code = CommandRequestImpl::GetMobileResultCode(
+ result_code = RequestFromMobileImpl::GetMobileResultCode(
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt()));
break;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
index f5506503e9..00e75b0c26 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
@@ -47,11 +47,11 @@ EndAudioPassThruRequest::EndAudioPassThruRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc
index 585636bfa8..93da86f2be 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc
@@ -14,11 +14,11 @@ GetCloudAppPropertiesRequest::GetCloudAppPropertiesRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
GetCloudAppPropertiesRequest::~GetCloudAppPropertiesRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
index 620d901f3c..d9a592adfd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
@@ -67,11 +67,11 @@ GetFileRequest::GetFileRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, file_name_("")
, file_type_(mobile_apis::FileType::INVALID_ENUM)
, length_(0)
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 64eae885a8..b044556f64 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
@@ -50,11 +50,11 @@ GetSystemCapabilityRequest::GetSystemCapabilityRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
index 54b542d245..e371889574 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
@@ -31,6 +31,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
@@ -47,13 +48,11 @@ GetWayPointsRequest::GetWayPointsRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
GetWayPointsRequest::~GetWayPointsRequest() {}
@@ -81,12 +80,6 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- SDL_LOG_INFO("Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
case hmi_apis::FunctionID::Navigation_GetWayPoints: {
SDL_LOG_INFO("Received Navigation_GetWayPoints event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
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 9262466e34..9ab636aaf5 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
@@ -52,11 +52,11 @@ ListFilesRequest::ListFilesRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
ListFilesRequest::~ListFilesRequest() {}
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 14787d0a08..234c33214c 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
@@ -34,6 +34,7 @@
#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
@@ -51,146 +52,23 @@ OnButtonEventNotification::OnButtonEventNotification(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandNotificationImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : ButtonNotificationToMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
OnButtonEventNotification::~OnButtonEventNotification() {}
-void OnButtonEventNotification::Run() {
+void OnButtonEventNotification::SendButtonNotification(
+ ApplicationSharedPtr app) {
SDL_LOG_AUTO_TRACE();
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonEvent without app_id.");
- return;
- }
-
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false == (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
- return;
- }
-
- if (!app) {
- SDL_LOG_ERROR("Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- 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_NONE == window_hmi_level)) {
- SDL_LOG_WARN(
- "CUSTOM_BUTTON OnButtonEvent notification is not allowed in "
- "NONE hmi level");
- return;
- }
-
- SendButtonEvent(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- SDL_LOG_WARN("Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
- 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)) {
- SDL_LOG_WARN("OnButtonEvent notification is allowed only"
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if OK button and "app_id" absent send notification only in HMI_FULL mode
- // otherwise send to subscribed apps in limited
- if (is_app_id_exists || hmi_apis::Common_ButtonName::OK != btn_id ||
- subscribed_app->IsFullscreen()) {
- SendButtonEvent(subscribed_app);
- }
- }
-}
-
-void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
- if (!app) {
- SDL_LOG_ERROR("OnButtonEvent NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_event =
- std::make_shared<smart_objects::SmartObject>();
-
- if (!on_btn_event) {
- SDL_LOG_ERROR("OnButtonEvent NULL pointer");
- return;
- }
-
- (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_event)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
-
- mobile_apis::ButtonName::eType btn_id =
- static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
- app->msg_version() < utils::rpc_version_5) {
- btn_id = mobile_apis::ButtonName::OK;
- }
-
- (*on_btn_event)[strings::msg_params][strings::button_name] = btn_id;
- (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::eType::OnButtonEventID;
- 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_ = MessageHelper::CreateButtonNotificationToMobile(app, *message_);
- 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 4444f0d156..90bf618c35 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
@@ -34,6 +34,7 @@
#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
#include "utils/semantic_version.h"
@@ -52,155 +53,23 @@ OnButtonPressNotification::OnButtonPressNotification(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandNotificationImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : ButtonNotificationToMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
OnButtonPressNotification::~OnButtonPressNotification() {}
-void OnButtonPressNotification::Run() {
+void OnButtonPressNotification::SendButtonNotification(
+ ApplicationSharedPtr app) {
SDL_LOG_AUTO_TRACE();
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
- if (is_app_id_exists) {
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
- }
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without app_id.");
- return;
- }
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false == (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without custom_button_id.");
- return;
- }
-
- if (!app) {
- SDL_LOG_ERROR("Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- 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_NONE == window_hmi_level)) {
- SDL_LOG_WARN(
- "CUSTOM_BUTTON OnButtonPress notification is not allowed in "
- "NONE hmi level");
- return;
- }
-
- SendButtonPress(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- SDL_LOG_WARN("Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- 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)) {
- SDL_LOG_WARN("OnButtonPress notification is allowed only "
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if "appID" is present, send it to named app only if its FULL or
- // LIMITED
- if (app.use_count() != 0) {
- if (app->app_id() == subscribed_app->app_id()) {
- SendButtonPress(subscribed_app);
- }
- } else if (hmi_apis::Common_ButtonName::OK != btn_id ||
- subscribed_app->IsFullscreen()) {
- // if No "appID" and OK button - send it FULL apps only.
- // if not OK button, send to LIMITED subscribed apps
- SendButtonPress(subscribed_app);
- }
- }
-}
-
-void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
- if (!app) {
- SDL_LOG_ERROR("OnButtonPress NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_press =
- std::make_shared<smart_objects::SmartObject>();
-
- if (!on_btn_press) {
- SDL_LOG_ERROR("OnButtonPress NULL pointer");
- return;
- }
-
- (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_press)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
-
- mobile_apis::ButtonName::eType btn_id =
- static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
- app->msg_version() < utils::rpc_version_5) {
- btn_id = mobile_apis::ButtonName::OK;
- }
-
- (*on_btn_press)[strings::msg_params][strings::button_name] = btn_id;
- (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::eType::OnButtonPressID;
- 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_ = MessageHelper::CreateButtonNotificationToMobile(app, *message_);
- message_ = on_btn_press;
SendNotification();
}
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 1f15170ffe..4a28d262dc 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
@@ -96,7 +96,7 @@ void OnSystemCapabilityUpdatedNotification::Run() {
smart_objects::SmartObject& updated_capabilities =
msg_params[strings::system_capability]
[strings::app_services_capabilities][strings::app_services];
- for (size_t i = 0; i < updated_capabilities.length(); i++) {
+ for (size_t i = 0; i < updated_capabilities.length(); ++i) {
std::string service_id =
updated_capabilities[i][strings::updated_app_service_record]
[strings::service_id]
@@ -239,7 +239,9 @@ void OnSystemCapabilityUpdatedNotification::Run() {
msg_params[strings::system_capability][strings::display_capabilities] =
*capabilities;
} break;
- default: { SDL_LOG_ERROR("Unknown system capability type"); }
+ default: {
+ SDL_LOG_ERROR("Unknown system capability type");
+ }
}
SDL_LOG_INFO("Sending OnSystemCapabilityUpdated " << capability_type_string
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 40705491fc..af0a5a6539 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
@@ -228,7 +228,7 @@ size_t OnSystemRequestNotification::ParsePTString(
if (pt_string[i] == '\"' || pt_string[i] == '\\') {
result += '\\';
} else if (pt_string[i] == '\n') {
- result_length--; // contentLength is adjusted when this character is
+ --result_length; // contentLength is adjusted when this character is
// not copied to result.
continue;
}
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 0accdd1e76..a690c0bc9b 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
@@ -32,6 +32,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
+
#include <cstring>
#include "application_manager/application_impl.h"
@@ -53,23 +54,21 @@ PerformAudioPassThruRequest::PerformAudioPassThruRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
- , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
+ , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {}
PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {}
-void PerformAudioPassThruRequest::onTimeOut() {
+void PerformAudioPassThruRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
FinishTTSSpeak();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
}
bool PerformAudioPassThruRequest::Init() {
@@ -183,24 +182,19 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
StartMicrophoneRecording();
// update request timeout to get time for perform audio recording
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
connection_key(), correlation_id(), default_timeout());
}
break;
}
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- SDL_LOG_INFO("Received TTS_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
default: {
SDL_LOG_ERROR("Received unknown event " << event.id());
return;
}
}
- if (IsWaitingHMIResponse()) {
+ if (IsPendingResponseExist()) {
+ SDL_LOG_DEBUG("Command still wating for HMI response");
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 bb990574bd..bf0f05ba32 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
@@ -68,22 +68,19 @@ PerformInteractionRequest::PerformInteractionRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
, ui_choice_id_received_(INVALID_CHOICE_ID)
, vr_choice_id_received_(INVALID_CHOICE_ID)
- , ui_response_received_(false)
- , vr_response_received_(false)
, app_pi_was_active_before_(false)
, vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
, ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
response_msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
}
@@ -227,6 +224,10 @@ void PerformInteractionRequest::Run() {
app->set_perform_interaction_layout(interaction_layout);
// increment amount of active requests
++pi_requests_count_;
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
SendVRPerformInteractionRequest(app);
SendUIPerformInteractionRequest(app);
}
@@ -236,16 +237,9 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- SDL_LOG_DEBUG("Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
case hmi_apis::FunctionID::UI_PerformInteraction: {
SDL_LOG_DEBUG("Received UI_PerformInteraction event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- ui_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -257,7 +251,6 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::VR_PerformInteraction: {
SDL_LOG_DEBUG("Received VR_PerformInteraction");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- vr_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -288,19 +281,20 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
}
-void PerformInteractionRequest::onTimeOut() {
+void PerformInteractionRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
switch (interaction_mode_) {
case mobile_apis::InteractionMode::BOTH: {
SDL_LOG_DEBUG("Interaction Mode: BOTH");
- if (true == vr_response_received_) {
+ if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR)) {
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
} else {
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
connection_key(), correlation_id(), default_timeout_);
+ set_current_state(RequestState::kAwaitingResponse);
}
break;
}
@@ -308,14 +302,14 @@ void PerformInteractionRequest::onTimeOut() {
SDL_LOG_DEBUG("Interaction Mode: VR_ONLY");
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
break;
}
case mobile_apis::InteractionMode::MANUAL_ONLY: {
SDL_LOG_DEBUG("InteractionMode: MANUAL_ONLY");
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
break;
}
default: {
@@ -351,13 +345,15 @@ bool PerformInteractionRequest::ProcessVRResponse(
SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
return true;
}
+
SDL_LOG_DEBUG("Update timeout for UI");
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
+
connection_key(), correlation_id(), default_timeout_);
return false;
}
- if (!ui_response_received_ &&
+ if (IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI) &&
InteractionMode::MANUAL_ONLY != interaction_mode_) {
SendClosePopupRequestToHMI();
}
@@ -378,7 +374,7 @@ bool PerformInteractionRequest::ProcessVRResponse(
if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
SDL_LOG_DEBUG("Update timeout for UI");
- application_manager_.updateRequestTimeout(
+ application_manager_.UpdateRequestTimeout(
connection_key(), correlation_id(), default_timeout_);
}
@@ -995,7 +991,8 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest(
const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
SDL_LOG_AUTO_TRACE();
- return !ui_response_received_ || !vr_response_received_;
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_VR);
}
void PerformInteractionRequest::SendBothModeResponse(
@@ -1060,8 +1057,8 @@ PerformInteractionRequest::PrepareResultCodeForResponse(
return mobile_ui_result_code;
}
- return CommandRequestImpl::PrepareResultCodeForResponse(ui_response,
- vr_response);
+ return RequestFromMobileImpl::PrepareResultCodeForResponse(ui_response,
+ vr_response);
}
bool PerformInteractionRequest::PrepareResultForMobileResponse(
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 5263991716..1db62f0669 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
@@ -69,11 +69,11 @@ PutFileRequest::PutFileRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, offset_(0)
, sync_file_name_()
, length_(0)
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 920805be7c..9a9aa0c533 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
@@ -134,11 +134,11 @@ RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, are_tts_chunks_invalid_(false)
, are_hmi_types_invalid_(false)
, is_resumption_failed_(false)
@@ -224,7 +224,8 @@ void RegisterAppInterfaceRequest::FillApplicationParams(
application->set_webengine_projection_enabled(true);
break;
}
- default: {}
+ default: {
+ }
}
}
}
@@ -439,6 +440,8 @@ void FinishSendingResponseToMobile(const smart_objects::SmartObject& msg_params,
&(msg_params[strings::app_hmi_type]));
}
+ application->MarkRegistered();
+
// Default HMI level should be set before any permissions validation, since
// it relies on HMI level.
app_manager.OnApplicationRegistered(application);
@@ -702,8 +705,11 @@ void RegisterAppInterfaceRequest::Run() {
SendOnAppRegisteredNotificationToHMI(
application, is_resumption_required && !is_resumption_failed_);
- // By default app subscribed to CUSTOM_BUTTON
- SendSubscribeCustomButtonNotification();
+ if (CheckHMICapabilities(mobile_apis::ButtonName::CUSTOM_BUTTON)) {
+ SDL_LOG_DEBUG("CUSTOM_BUTTON available");
+ SendSubscribeCustomButtonRequest();
+ }
+
SendChangeRegistrationOnHMI(application);
if (is_resumption_required) {
@@ -728,7 +734,6 @@ void RegisterAppInterfaceRequest::Run() {
}
CheckLanguage();
-
SendRegisterAppInterfaceResponseToMobile(
ApplicationType::kNewApplication, status_notifier, add_info);
}
@@ -983,12 +988,13 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
file_system::FileExists(application->app_icon_path());
smart_objects::SmartObject msg_params_copy = msg_params;
+ ApplicationManager& app_manager = application_manager_;
const auto result_code = CalculateFinalResultCode();
SendResponse(true, result_code, response_info_.c_str(), &response_params);
FinishSendingResponseToMobile(
- msg_params_copy, application_manager_, key, status_notifier);
+ msg_params_copy, app_manager, key, status_notifier);
}
void RegisterAppInterfaceRequest::SendChangeRegistration(
@@ -1459,14 +1465,14 @@ void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
}
}
-void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
+void RegisterAppInterfaceRequest::SendSubscribeCustomButtonRequest() {
+ SDL_LOG_AUTO_TRACE();
using namespace smart_objects;
SmartObject msg_params = SmartObject(SmartType_Map);
msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- msg_params);
+ msg_params[strings::button_name] = hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
+ SendHMIRequest(
+ hmi_apis::FunctionID::Buttons_SubscribeButton, &msg_params, false);
}
bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
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 f4e07d4b78..92c5d19a05 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
@@ -35,7 +35,6 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
@@ -52,13 +51,14 @@ ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , rc_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {}
@@ -146,6 +146,14 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
GetInfo(message, tts_response_info_);
break;
}
+ case hmi_apis::FunctionID::RC_SetGlobalProperties: {
+ SDL_LOG_INFO("Received RC_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_RC);
+ rc_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, rc_response_info_);
+ break;
+ }
default: {
SDL_LOG_ERROR("Received unknown event " << event.id());
return;
@@ -183,6 +191,8 @@ bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
app_mngr::commands::ResponseInfo tts_properties_info(
tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+ app_mngr::commands::ResponseInfo rc_properties_info(
+ rc_result_, HmiInterfaces::HMI_INTERFACE_RC, application_manager_);
HmiInterfaces::InterfaceState tts_interface_state =
application_manager_.hmi_interfaces().GetInterfaceState(
@@ -195,24 +205,18 @@ bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
out_result_code = mobile_apis::Result::WARNINGS;
out_response_info = "Unsupported phoneme type sent in a prompt";
} else {
- result =
- PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
- out_result_code =
- PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
- out_response_info = app_mngr::commands::MergeInfos(tts_properties_info,
- tts_response_info_,
- ui_properties_info,
- ui_response_info_);
+ result = PrepareResultForMobileResponse(
+ ui_properties_info, tts_properties_info, rc_properties_info);
+ out_result_code = PrepareResultCodeForResponse(
+ ui_properties_info, tts_properties_info, rc_properties_info);
+
+ out_response_info = app_mngr::commands::MergeInfos(
+ tts_response_info_, ui_response_info_, rc_response_info_);
}
return result;
}
-bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
- return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
- IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
-}
-
} // namespace commands
} // namespace sdl_rpc_plugin
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 89e77d9d19..573c340201 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
@@ -54,13 +54,11 @@ ScrollableMessageRequest::ScrollableMessageRequest(
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) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
ScrollableMessageRequest::~ScrollableMessageRequest() {}
@@ -131,12 +129,6 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- SDL_LOG_INFO("Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
case hmi_apis::FunctionID::UI_ScrollableMessage: {
SDL_LOG_INFO("Received UI_ScrollableMessage event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
index 2b0a36cb9d..b5e629320a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
@@ -48,11 +48,11 @@ SendHapticDataRequest::SendHapticDataRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SendHapticDataRequest::~SendHapticDataRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
index fcc898b348..7cf226c968 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
@@ -48,11 +48,11 @@ SendLocationRequest::SendLocationRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SendLocationRequest::~SendLocationRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
index 9eb4c82721..8eb3b9e1ec 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
@@ -54,11 +54,11 @@ SetAppIconRequest::SetAppIconRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, is_icons_saving_enabled_(false) {
const std::string path =
application_manager_.get_settings().app_icons_folder();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc
index 45ff0078fb..98cae4856f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc
@@ -15,11 +15,11 @@ SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {}
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 b2ca3e6cfa..ba0a20b459 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
@@ -49,11 +49,11 @@ SetDisplayLayoutRequest::SetDisplayLayoutRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {}
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 bbce4d2bb3..b8f1e3d70f 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
@@ -73,11 +73,11 @@ SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, is_ui_send_(false)
, is_tts_send_(false)
, is_rc_send_(false)
@@ -186,6 +186,7 @@ void SetGlobalPropertiesRequest::Run() {
msg_params[strings::menu_layout].asUInt());
if (app->menu_layout_supported(menu_layout)) {
params[strings::menu_layout] = msg_params[strings::menu_layout];
+ app->set_menu_layout(msg_params[strings::menu_layout]);
} else {
is_menu_layout_available_ = false;
}
@@ -425,10 +426,10 @@ bool SetGlobalPropertiesRequest::Init() {
return true;
}
-void SetGlobalPropertiesRequest::onTimeOut() {
+void SetGlobalPropertiesRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
- CommandRequestImpl::onTimeOut();
+ RequestFromMobileImpl::OnTimeOut();
auto& resume_ctrl = application_manager_.resume_controller();
@@ -454,7 +455,7 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters(
bool result = false;
if (!is_rc_send_) {
- result = CommandRequestImpl::PrepareResultForMobileResponse(
+ result = RequestFromMobileImpl::PrepareResultForMobileResponse(
ui_properties_info, tts_properties_info);
} else {
result = PrepareResultForMobileResponse(
@@ -475,7 +476,7 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters(
}
if (!is_rc_send_) {
- result_code = CommandRequestImpl::PrepareResultCodeForResponse(
+ result_code = RequestFromMobileImpl::PrepareResultCodeForResponse(
ui_properties_info, tts_properties_info);
} else {
result_code = PrepareResultCodeForResponse(
@@ -516,8 +517,9 @@ bool SetGlobalPropertiesRequest::PrepareResultForMobileResponse(
(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == first.result_code) ||
(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == second.result_code);
- const bool final_result = CommandRequestImpl::CheckResult(both_info, third) ||
- CommandRequestImpl::CheckResult(third, both_info);
+ const bool final_result =
+ RequestFromMobileImpl::CheckResultCode(both_info, third) ||
+ RequestFromMobileImpl::CheckResultCode(third, both_info);
return final_result;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
index 285118749a..b2c9f46940 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
@@ -52,11 +52,11 @@ SetMediaClockRequest::SetMediaClockRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SetMediaClockRequest::~SetMediaClockRequest() {}
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
index fdcf9d2434..4f7a46d1e7 100644
--- 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
@@ -47,11 +47,11 @@ ShowAppMenuRequest::ShowAppMenuRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
ShowAppMenuRequest::~ShowAppMenuRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
index cfb9d5896e..6e21861e0a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
@@ -54,11 +54,11 @@ ShowConstantTBTRequest::ShowConstantTBTRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
ShowConstantTBTRequest::~ShowConstantTBTRequest() {}
@@ -132,8 +132,9 @@ void ShowConstantTBTRequest::Run() {
msg_params.erase(strings::navigation_text_1);
msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::navigation_text_1];
+ ++index;
}
if (msg_params.keyExists(strings::navigation_text_2)) {
@@ -141,8 +142,9 @@ void ShowConstantTBTRequest::Run() {
msg_params.erase(strings::navigation_text_2);
msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::navigation_text_2];
+ ++index;
}
if (msg_params.keyExists(strings::eta)) {
@@ -150,8 +152,9 @@ void ShowConstantTBTRequest::Run() {
msg_params.erase(strings::eta);
msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::eta];
+ ++index;
}
if (msg_params.keyExists(strings::total_distance)) {
@@ -159,8 +162,9 @@ void ShowConstantTBTRequest::Run() {
msg_params.erase(strings::total_distance);
msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::total_distance];
+ ++index;
}
if (msg_params.keyExists(strings::time_to_destination)) {
@@ -168,8 +172,9 @@ void ShowConstantTBTRequest::Run() {
msg_params.erase(strings::time_to_destination);
msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::time_to_destination];
+ ++index;
}
if (msg_params.keyExists(strings::soft_buttons)) {
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 910ab9ef23..7b7518f4d5 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
@@ -52,11 +52,11 @@ ShowRequest::ShowRequest(
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)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, core_result_code_(mobile_apis::Result::INVALID_ENUM)
, current_window_id_(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)
, template_config_(smart_objects::SmartType::SmartType_Null)
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 e46d3fd7f0..fb332970ab 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
@@ -51,13 +51,11 @@ SliderRequest::SliderRequest(
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) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SliderRequest::~SliderRequest() {}
@@ -65,8 +63,7 @@ bool SliderRequest::Init() {
/* Timeout in milliseconds.
If omitted a standard value of 10000 milliseconds is used.*/
if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- application_manager_.get_settings().default_timeout() +
+ default_timeout_ +=
(*message_)[strings::msg_params][strings::timeout].asUInt();
}
@@ -134,12 +131,6 @@ void SliderRequest::on_event(const event_engine::Event& event) {
const SmartObject& message = event.smart_object();
const event_engine::Event::EventID event_id = event.id();
- if (event_id == FunctionID::UI_OnResetTimeout) {
- SDL_LOG_INFO("Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- return;
- }
if (event_id != FunctionID::UI_Slider) {
SDL_LOG_ERROR("Received unknown event " << event.id());
@@ -153,21 +144,6 @@ void SliderRequest::on_event(const event_engine::Event& event) {
SmartObject response_msg_params = message[strings::msg_params];
- const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>(
- response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED);
-
- if (is_timeout_aborted) {
- if (message[strings::params][strings::data].keyExists(
- strings::slider_position)) {
- // Copy slider_position info to msg_params section
- response_msg_params[strings::slider_position] =
- message[strings::params][strings::data][strings::slider_position];
- } else {
- SDL_LOG_ERROR(strings::slider_position << " field is absent"
- " in response.");
- response_msg_params[strings::slider_position] = 0;
- }
- }
std::string response_info;
GetInfo(message, response_info);
const bool is_response_success = PrepareResultForMobileResponse(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
index b8de053853..593faf795e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
@@ -36,6 +36,7 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -51,13 +52,11 @@ SpeakRequest::SpeakRequest(
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) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SpeakRequest::~SpeakRequest() {}
@@ -112,13 +111,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) {
ProcessTTSSpeakResponse(event.smart_object());
break;
}
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- SDL_LOG_INFO("Received TTS_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
default: {
SDL_LOG_ERROR("Received unknown event " << event.id());
break;
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 42cb3c60c9..da48f193e6 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
@@ -32,6 +32,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "application_manager/message_helper.h"
#include "utils/semantic_version.h"
namespace sdl_rpc_plugin {
@@ -49,11 +50,11 @@ SubscribeButtonRequest::SubscribeButtonRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SubscribeButtonRequest::~SubscribeButtonRequest() {}
@@ -104,11 +105,11 @@ void SubscribeButtonRequest::Run() {
return;
}
- app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
- SendSubscribeButtonNotification();
-
- const bool is_succeeded = true;
- SendResponse(is_succeeded, mobile_apis::Result::SUCCESS);
+ (*message_)[str::msg_params][str::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Buttons);
+ SendHMIRequest(hmi_apis::FunctionID::Buttons_SubscribeButton,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
}
bool SubscribeButtonRequest::Init() {
@@ -116,6 +117,59 @@ bool SubscribeButtonRequest::Init() {
return true;
}
+void SubscribeButtonRequest::on_event(const event_engine::Event& event) {
+ SDL_LOG_AUTO_TRACE();
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::Buttons_SubscribeButton != event.id()) {
+ SDL_LOG_ERROR("Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Buttons);
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ SDL_LOG_ERROR("NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ 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(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_Buttons);
+
+ if (result) {
+ const auto btn_id = static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+ app->SubscribeToButton(btn_id);
+ }
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool IsPresetButton(const mobile_apis::ButtonName::eType btn_id) {
+ return (mobile_apis::ButtonName::PRESET_0 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_1 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_2 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_3 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_4 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_5 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_6 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_7 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_8 == btn_id) ||
+ (mobile_apis::ButtonName::PRESET_9 == btn_id);
+}
+
bool SubscribeButtonRequest::IsSubscriptionAllowed(
ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
if (!app->is_media_application() &&
@@ -123,7 +177,8 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed(
(mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
(mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
(mobile_apis::ButtonName::TUNEUP == btn_id) ||
- (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
+ (mobile_apis::ButtonName::TUNEDOWN == btn_id) ||
+ IsPresetButton(btn_id))) {
return false;
}
@@ -149,19 +204,6 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed(
return true;
}
-void SubscribeButtonRequest::SendSubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asUInt());
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
} // namespace commands
} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
index 11cbdac14a..da9a6e2adc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
@@ -49,11 +49,11 @@ SubscribeWayPointsRequest::SubscribeWayPointsRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {}
@@ -121,7 +121,7 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
}
}
-void SubscribeWayPointsRequest::onTimeOut() {
+void SubscribeWayPointsRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
if (application_manager_.GetAppServiceManager().FindWayPointsHandler() !=
nullptr) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc
index 1a54f7f106..eba1abd3ff 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc
@@ -48,21 +48,18 @@ SubtleAlertRequest::SubtleAlertRequest(
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, awaiting_ui_subtle_alert_response_(false)
, awaiting_tts_speak_response_(false)
, awaiting_tts_stop_speaking_response_(false)
, is_ui_subtle_alert_sent_(false)
, is_tts_stop_speaking_sent_(false)
, subtle_alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
+ , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
SubtleAlertRequest::~SubtleAlertRequest() {}
@@ -118,18 +115,6 @@ void SubtleAlertRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
- case hmi_apis::FunctionID::TTS_OnResetTimeout:
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- SDL_LOG_INFO(
- "Received UI_OnResetTimeout event "
- " or TTS_OnResetTimeout event"
- << awaiting_tts_speak_response_ << " "
- << awaiting_tts_stop_speaking_response_ << " "
- << awaiting_ui_subtle_alert_response_);
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
case hmi_apis::FunctionID::UI_SubtleAlert: {
SDL_LOG_INFO("Received UI_SubtleAlert event");
// Unsubscribe from event to avoid unwanted messages
@@ -336,7 +321,7 @@ void SubtleAlertRequest::SendSubtleAlertRequest(int32_t app_id) {
hmi_apis::Common_TextFieldName::subtleAlertText1;
msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::alert_text1];
- index++;
+ ++index;
}
if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
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 cca088ed2d..10be518409 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
@@ -411,11 +411,11 @@ SystemRequest::SystemRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
SystemRequest::~SystemRequest() {}
@@ -430,7 +430,6 @@ void SystemRequest::Run() {
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
-
const mobile_apis::RequestType::eType request_type =
static_cast<mobile_apis::RequestType::eType>(
(*message_)[strings::msg_params][strings::request_type].asInt());
@@ -479,6 +478,15 @@ void SystemRequest::Run() {
return;
}
+ const uint16_t query_apps_min_version = 4;
+
+ if (mobile_apis::RequestType::QUERY_APPS == request_type &&
+ application_manager_.get_settings().max_supported_protocol_version() <
+ query_apps_min_version) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
if (!file_system::IsFileNameValid(file_name) &&
mobile_apis::RequestType::ICON_URL != request_type) {
const std::string err_msg = "Sync file name contains forbidden symbols.";
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
index 69f85568eb..74eec08c46 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
@@ -1,6 +1,5 @@
/*
-
- Copyright (c) 2018, Ford Motor Company
+ Copyright (c) 2021, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,6 +33,8 @@
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
#include "utils/semantic_version.h"
namespace sdl_rpc_plugin {
@@ -51,11 +52,11 @@ UnsubscribeButtonRequest::UnsubscribeButtonRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
@@ -93,15 +94,59 @@ void UnsubscribeButtonRequest::Run() {
return;
}
- if (!app->UnsubscribeFromButton(
- static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
- SDL_LOG_ERROR("App doesn't subscribe to button " << btn_id);
+ if (!app->IsSubscribedToButton(btn_id)) {
+ SDL_LOG_ERROR("App is not subscribed to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ if (mobile_apis::ButtonName::CUSTOM_BUTTON == btn_id) {
+ SDL_LOG_ERROR("App cannot unsubscribe from CUSTOM_BUTTON");
SendResponse(false, mobile_apis::Result::IGNORED);
return;
}
- SendUnsubscribeButtonNotification();
- SendResponse(true, mobile_apis::Result::SUCCESS);
+ (*message_)[str::msg_params][str::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Buttons);
+ SendHMIRequest(hmi_apis::FunctionID::Buttons_UnsubscribeButton,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+}
+
+void UnsubscribeButtonRequest::on_event(const event_engine::Event& event) {
+ SDL_LOG_AUTO_TRACE();
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::Buttons_UnsubscribeButton != event.id()) {
+ SDL_LOG_ERROR("Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Buttons);
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ SDL_LOG_ERROR("NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ 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(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_Buttons);
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? nullptr : response_info.c_str(),
+ &(message[strings::msg_params]));
}
bool UnsubscribeButtonRequest::Init() {
@@ -109,19 +154,6 @@ bool UnsubscribeButtonRequest::Init() {
return true;
}
-void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asInt());
- msg_params[strings::is_suscribed] = false;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
} // namespace commands
} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
index 7aa6e2b40a..c715612ba5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
@@ -49,11 +49,11 @@ UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
UnsubscribeWayPointsRequest::~UnsubscribeWayPointsRequest() {}
@@ -127,7 +127,7 @@ void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
}
}
-void UnsubscribeWayPointsRequest::onTimeOut() {
+void UnsubscribeWayPointsRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
if (application_manager_.GetAppServiceManager().FindWayPointsHandler() !=
nullptr) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
index 3da9206184..3fbaad77b0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
@@ -56,11 +56,11 @@ UpdateTurnListRequest::UpdateTurnListRequest(
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) {}
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
UpdateTurnListRequest::~UpdateTurnListRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc
index 311ba5d4aa..0217c6f6a5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc
@@ -7,9 +7,6 @@ SDL_CREATE_LOG_VARIABLE("GetSystemCapabilitiesAppExtension")
namespace app_mngr_ = application_manager;
namespace strings = app_mngr::strings;
-const app_mngr_::AppExtensionUID
- SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID = 200;
-
SystemCapabilityAppExtension::SystemCapabilityAppExtension(
sdl_rpc_plugin::SDLRPCPlugin& plugin, app_mngr_::Application& app)
: app_mngr_::AppExtension(
@@ -63,7 +60,7 @@ void SystemCapabilityAppExtension::SaveResumptionData(
int i = 0;
for (const auto& subscription : subscribed_data_) {
resumption_data[strings::system_capability][i] = subscription;
- i++;
+ ++i;
}
}
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 2727c89673..c66e0b6950 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
@@ -77,6 +77,8 @@
#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "sdl_rpc_plugin/commands/hmi/subscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/hmi/subscribe_button_response.h"
#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h"
#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
@@ -137,6 +139,8 @@
#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_subtle_alert_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_subtle_alert_response.h"
+#include "sdl_rpc_plugin/commands/hmi/unsubscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/hmi/unsubscribe_button_response.h"
#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h"
#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h"
#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
@@ -207,7 +211,6 @@
#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
@@ -218,6 +221,7 @@
#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
@@ -225,13 +229,11 @@
#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_subtle_alert_pressed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_update_file_notification.h"
@@ -681,6 +683,19 @@ CommandCreator& HMICommandFactory::get_creator_factory(
: factory
.GetCreator<commands::ButtonGetCapabilitiesResponse>();
}
+ case hmi_apis::FunctionID::Buttons_SubscribeButton: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::hmi::SubscribeButtonRequest>()
+ : factory.GetCreator<commands::hmi::SubscribeButtonResponse>();
+ }
+
+ case hmi_apis::FunctionID::Buttons_UnsubscribeButton: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::hmi::UnsubscribeButtonRequest>()
+ : factory
+ .GetCreator<commands::hmi::UnsubscribeButtonResponse>();
+ }
+
case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
return factory
.GetCreator<commands::OnAllowSDLFunctionalityNotification>();
@@ -762,10 +777,6 @@ CommandCreator& HMICommandFactory::get_creator_factory(
case hmi_apis::FunctionID::Buttons_OnButtonPress: {
return factory.GetCreator<commands::hmi::OnButtonPressNotification>();
}
- case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
- return factory
- .GetCreator<commands::hmi::OnButtonSubscriptionNotification>();
- }
case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
return factory.GetCreator<commands::OnNaviTBTClientStateNotification>();
}
@@ -775,8 +786,8 @@ CommandCreator& HMICommandFactory::get_creator_factory(
case hmi_apis::FunctionID::UI_OnTouchEvent: {
return factory.GetCreator<commands::hmi::OnUITouchEventNotification>();
}
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- return factory.GetCreator<commands::hmi::OnUIResetTimeoutNotification>();
+ case hmi_apis::FunctionID::BasicCommunication_OnResetTimeout: {
+ return factory.GetCreator<commands::hmi::OnResetTimeoutNotification>();
}
case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
return hmi_apis::messageType::request == message_type
@@ -875,9 +886,6 @@ CommandCreator& HMICommandFactory::get_creator_factory(
case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
return factory.GetCreator<commands::OnDeviceStateChangedNotification>();
}
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- return factory.GetCreator<commands::hmi::OnTTSResetTimeoutNotification>();
- }
case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: {
return factory.GetCreator<commands::OnEventChangedNotification>();
}
@@ -947,7 +955,9 @@ CommandCreator& HMICommandFactory::get_creator_factory(
return factory
.GetCreator<commands::BCOnAppCapabilityUpdatedNotification>();
}
- default: { return factory.GetCreator<InvalidCommand>(); }
+ 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 0a8c342448..c70962dc4a 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
@@ -408,7 +408,8 @@ CommandCreator& MobileCommandFactory::get_command_creator(
using app_mngr::commands::Command;
return factory.GetCreator<commands::GenericResponse>();
}
- default: {}
+ default: {
+ }
}
return factory.GetCreator<InvalidCommand>();
}
@@ -480,7 +481,8 @@ CommandCreator& MobileCommandFactory::get_notification_creator(
case mobile_apis::FunctionID::OnSubtleAlertPressedID: {
return factory.GetCreator<commands::OnSubtleAlertPressedNotification>();
}
- default: {}
+ default: {
+ }
}
return factory.GetCreator<InvalidCommand>();
}
@@ -501,7 +503,8 @@ CommandCreator& MobileCommandFactory::get_notification_from_mobile_creator(
return factory
.GetCreator<commands::mobile::OnAppCapabilityUpdatedNotification>();
}
- default: {}
+ default: {
+ }
}
return factory.GetCreator<InvalidCommand>();
}
@@ -532,7 +535,8 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
}
break;
}
- default: {}
+ default: {
+ }
}
CommandCreatorFactory factory(
application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
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 c5bc79f09d..a0ad320cac 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
@@ -61,18 +61,6 @@ bool SDLRPCPlugin::Init(app_mngr::ApplicationManager& app_manager,
return true;
}
-bool SDLRPCPlugin::Init(
- application_manager::ApplicationManager& app_manager,
- application_manager::rpc_service::RPCService& rpc_service,
- application_manager::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) {
- UNUSED(last_state);
- command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory(
- app_manager, rpc_service, hmi_capabilities, policy_handler));
- return true;
-}
-
bool SDLRPCPlugin::IsAbleToProcess(
const int32_t function_id,
const app_mngr::commands::Command::CommandSource message_source) {
@@ -93,21 +81,32 @@ void SDLRPCPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) {
SDL_LOG_AUTO_TRACE();
- if (plugins::ApplicationEvent::kApplicationRegistered == event) {
- application->AddExtension(
- std::make_shared<WayPointsAppExtension>(*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;
- SDL_LOG_DEBUG("Subscription to DISPLAYS capability is enabled");
- sys_cap_ext_ptr->SubscribeTo(capability_type);
-
- } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
- ClearSubscriptions(application);
+ switch (event) {
+ case plugins::ApplicationEvent::kApplicationRegistered: {
+ application->AddExtension(
+ std::make_shared<WayPointsAppExtension>(*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;
+ SDL_LOG_DEBUG("Subscription to DISPLAYS capability is enabled");
+ sys_cap_ext_ptr->SubscribeTo(capability_type);
+ break;
+ }
+
+ case plugins::ApplicationEvent::kApplicationUnregistered:
+ case plugins::ApplicationEvent::kDeleteApplicationData: {
+ ClearSubscriptions(application);
+ break;
+ }
+
+ default: {
+ break;
+ }
}
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_app_extension.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_app_extension.cc
index ed8283e1f9..3c73a61f1b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_app_extension.cc
@@ -32,7 +32,6 @@ SDL_CREATE_LOG_VARIABLE("WayPointsAppExtension")
namespace sdl_rpc_plugin {
namespace strings = application_manager::strings;
-unsigned WayPointsAppExtension::WayPointsAppExtensionUID = 138;
WayPointsAppExtension::WayPointsAppExtension(
SDLRPCPlugin& plugin, application_manager::Application& app)
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_pending_resumption_handler.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_pending_resumption_handler.cc
index af6c7f3c1d..5c0a0d746b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_pending_resumption_handler.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/waypoints_pending_resumption_handler.cc
@@ -140,7 +140,7 @@ void WayPointsPendingResumptionHandler::RaiseFakeSuccessfulResponse(
event.raise(application_manager_.event_dispatcher());
}
-void WayPointsPendingResumptionHandler::on_event(
+void WayPointsPendingResumptionHandler::HandleOnEvent(
const application_manager::event_engine::Event& event) {
using namespace application_manager;
SDL_LOG_AUTO_TRACE();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
index 7dadad59fe..e841b4ae81 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
@@ -97,6 +97,8 @@ TEST_F(ActivateAppRequestTest, Run_SUCCESS) {
(*msg)[strings::msg_params][strings::activate_app_hmi_level] =
mobile_apis::HMILevel::HMI_FULL;
#endif
+ InitEventDispatcher();
+
ActivateAppRequestPtr command(CreateCommand<ActivateAppRequest>(msg));
EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
index 9cd87b053d..751eb84e53 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
@@ -62,7 +62,7 @@ TEST_F(BasicCommunicationGetSystemTimeRequestTest, OnTimeout) {
.WillByDefault(ReturnRef(mock_protocol_handler));
EXPECT_CALL(mock_protocol_handler, NotifyOnGetSystemTimeFailed());
- command->onTimeOut();
+ command->OnTimeOut();
}
} // namespace basic_communication_get_system_time_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_request_test.cc
index f3d8dd4f93..81a105f8e8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_request_test.cc
@@ -75,6 +75,9 @@ class ButtonGetCapabilitiesRequestTest
TEST_F(ButtonGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+
+ InitEventDispatcher();
+
RequestToHMIPtr command(
CreateCommand<ButtonGetCapabilitiesRequest>(command_msg));
@@ -92,6 +95,9 @@ TEST_F(ButtonGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(ButtonGetCapabilitiesRequestTest,
onTimeOut_ButtonsGetCapabilitiesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+
+ InitEventDispatcher();
+
RequestToHMIPtr command(
CreateCommand<ButtonGetCapabilitiesRequest>(command_msg));
@@ -101,7 +107,7 @@ TEST_F(ButtonGetCapabilitiesRequestTest,
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index 5fa910b2d9..2a0eda2b10 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -97,7 +97,6 @@
#include "hmi/on_audio_data_streaming_notification.h"
#include "hmi/on_button_event_notification.h"
#include "hmi/on_button_press_notification.h"
-#include "hmi/on_button_subscription_notification.h"
#include "hmi/on_device_chosen_notification.h"
#include "hmi/on_device_state_changed_notification.h"
#include "hmi/on_driver_distraction_notification.h"
@@ -114,6 +113,7 @@
#include "hmi/on_ready_notification.h"
#include "hmi/on_received_policy_update.h"
#include "hmi/on_record_start_notification.h"
+#include "hmi/on_reset_timeout_notification.h"
#include "hmi/on_resume_audio_source_notification.h"
#include "hmi/on_sdl_close_notification.h"
#include "hmi/on_sdl_consent_needed_notification.h"
@@ -125,13 +125,11 @@
#include "hmi/on_system_info_changed_notification.h"
#include "hmi/on_system_request_notification.h"
#include "hmi/on_tts_language_change_notification.h"
-#include "hmi/on_tts_reset_timeout_notification.h"
#include "hmi/on_tts_started_notification.h"
#include "hmi/on_tts_stopped_notification.h"
#include "hmi/on_ui_command_notification.h"
#include "hmi/on_ui_keyboard_input_notification.h"
#include "hmi/on_ui_language_change_notification.h"
-#include "hmi/on_ui_reset_timeout_notification.h"
#include "hmi/on_ui_touch_event_notification.h"
#include "hmi/on_update_device_list.h"
#include "hmi/on_video_data_streaming_notification.h"
@@ -149,6 +147,8 @@
#include "hmi/sdl_get_user_friendly_message_response.h"
#include "hmi/sdl_policy_update.h"
#include "hmi/sdl_policy_update_response.h"
+#include "hmi/subscribe_button_request.h"
+#include "hmi/subscribe_button_response.h"
#include "hmi/tts_change_registration_request.h"
#include "hmi/tts_change_registration_response.h"
#include "hmi/tts_get_capabilities_request.h"
@@ -207,6 +207,8 @@
#include "hmi/ui_slider_response.h"
#include "hmi/ui_subtle_alert_request.h"
#include "hmi/ui_subtle_alert_response.h"
+#include "hmi/unsubscribe_button_request.h"
+#include "hmi/unsubscribe_button_response.h"
#include "hmi/update_app_list_request.h"
#include "hmi/update_app_list_response.h"
#include "hmi/update_device_list_request.h"
@@ -258,14 +260,10 @@ class HMICommandsTest : public components::commands_test::CommandRequestTest<
typedef Command CommandType;
void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<kIsNice>::InitCommand(timeout);
+
stream_retry_.first = 0;
stream_retry_.second = 0;
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, start_stream_retry_amount())
.WillByDefault(ReturnRef(stream_retry_));
}
@@ -450,11 +448,9 @@ typedef Types<commands::NaviIsReadyResponse,
typedef Types<commands::hmi::OnButtonEventNotification,
commands::hmi::OnButtonPressNotification,
- commands::hmi::OnButtonSubscriptionNotification,
commands::OnNaviTBTClientStateNotification,
commands::hmi::OnUIKeyBoardInputNotification,
commands::hmi::OnUITouchEventNotification,
- commands::hmi::OnUIResetTimeoutNotification,
commands::NaviStartStreamResponse,
commands::NaviStartStreamRequest,
commands::NaviStopStreamResponse,
@@ -485,7 +481,7 @@ typedef Types<commands::hmi::OnButtonEventNotification,
commands::OnReceivedPolicyUpdate,
commands::OnPolicyUpdate,
commands::OnDeviceStateChangedNotification,
- commands::hmi::OnTTSResetTimeoutNotification,
+ commands::hmi::OnResetTimeoutNotification,
commands::hmi::DialNumberResponse,
commands::hmi::DialNumberRequest,
commands::OnEventChangedNotification,
@@ -501,8 +497,12 @@ typedef Types<commands::AllowAllAppsRequest,
commands::AllowAppResponse,
commands::BCGetFilePathRequest,
commands::BCGetFilePathResponse,
+ commands::hmi::SubscribeButtonRequest,
+ commands::hmi::SubscribeButtonResponse,
commands::UISubtleAlertResponse,
- commands::UISubtleAlertRequest>
+ commands::UISubtleAlertRequest,
+ commands::hmi::UnsubscribeButtonRequest,
+ commands::hmi::UnsubscribeButtonResponse>
HMICommandsListFifth;
TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
index 5b860499dd..0fa2edd9c3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
@@ -71,6 +71,8 @@ TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
(*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
(*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ InitEventDispatcher();
+
RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
const uint32_t kAppId = command->application_id();
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 5487da51a3..53b1fdfc67 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
@@ -45,7 +45,6 @@
#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
@@ -61,6 +60,7 @@
#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
@@ -72,13 +72,11 @@
#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_subtle_alert_pressed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
@@ -257,13 +255,9 @@ class HMICommandsNotificationsTest
MockAppServiceManager mock_app_service_manager_;
void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ CommandsTest<kIsNice>::InitCommand(default_timeout);
+
app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC);
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(default_timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .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_));
@@ -343,7 +337,6 @@ class HMIOnNotificationsEventDispatcher
typedef Types<OnAppPermissionChangedNotification,
OnAudioDataStreamingNotification,
- hmi::OnButtonSubscriptionNotification,
OnFileRemovedNotification,
OnPutFileNotification,
OnResumeAudioSourceNotification,
@@ -362,12 +355,10 @@ typedef Types<
hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>,
CommandPair<OnEventChangedNotification,
hmi_apis::FunctionID::BasicCommunication_OnEventChanged>,
- CommandPair<hmi::OnTTSResetTimeoutNotification,
- hmi_apis::FunctionID::TTS_OnResetTimeout>,
+ CommandPair<hmi::OnResetTimeoutNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnResetTimeout>,
CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>,
CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>,
- CommandPair<hmi::OnUIResetTimeoutNotification,
- hmi_apis::FunctionID::UI_OnResetTimeout>,
CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>,
CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> >
HMIOnNotificationsEventDispatcherTypes;
@@ -517,7 +508,8 @@ TEST_F(HMICommandsNotificationsTest,
std::shared_ptr<Command> command =
CreateCommand<OnAppRegisteredNotification>(message);
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
- EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
.WillOnce(GetEventId(&event_id));
command->Run();
@@ -539,7 +531,8 @@ TEST_F(HMICommandsNotificationsTest,
std::shared_ptr<Command> command =
CreateCommand<OnAppUnregisteredNotification>(message);
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
- EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
.WillOnce(GetEventId(&event_id));
command->Run();
@@ -561,7 +554,8 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
CreateCommand<hmi::OnButtonPressNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
- EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
.WillOnce(GetEventId(&event_id));
command->Run();
@@ -578,7 +572,8 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
CreateCommand<OnReadyNotification>(message);
EXPECT_CALL(app_mngr_, OnHMIReady());
- EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
.WillOnce(GetEventId(&event_id));
command->Run();
@@ -1298,11 +1293,10 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
.WillOnce(Return(kIsPerformInteractionActive));
- EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
.WillOnce(GetEventId(&event_id));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
@@ -1374,6 +1368,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, IsRegistered()).WillOnce(Return(true));
EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
@@ -1418,6 +1413,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, IsRegistered()).WillOnce(Return(true));
EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
EXPECT_CALL(app_mngr_, state_controller())
@@ -1703,6 +1699,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, IsRegistered()).WillOnce(Return(true));
EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
@@ -1748,6 +1745,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, IsRegistered()).WillOnce(Return(true));
EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
EXPECT_CALL(mock_message_helper_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
index 64bf167f83..babfb71756 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
@@ -70,6 +70,8 @@ TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
+ InitEventDispatcher();
+
RequestToHMIPtr command(
CreateCommand<MixingAudioSupportedRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
index 7ce3a353e9..9bf5257676 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
@@ -199,7 +199,7 @@ TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) {
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1);
- command->onTimeOut();
+ command->OnTimeOut();
}
} // namespace navi_set_video_config_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_request_test.cc
index f7da89df0b..56a6cd2e2f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_request_test.cc
@@ -73,6 +73,8 @@ TEST_F(RCGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
+ InitEventDispatcher();
+
RequestToHMIPtr command(CreateCommand<RCGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
ASSERT_TRUE(command->Init());
@@ -88,6 +90,7 @@ TEST_F(RCGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(RCGetCapabilitiesRequestTest,
onTimeOut_OnCapabilityInitialized_RemoveRCGetCapabilities) {
MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<RCGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -96,7 +99,7 @@ TEST_F(RCGetCapabilitiesRequestTest,
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
}
} // namespace rc_get_capabilities_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
index cb90859018..f4e3784642 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
@@ -217,7 +217,7 @@ TEST_F(RCIsReadyRequestTest, Run_ErrorMessage_StateNotAvailable) {
TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
HMICapabilitiesExpectations();
ExpectSendMessagesToHMI();
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace rc_is_ready_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
index 31285f5b17..b110d4bf9e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -59,6 +59,7 @@ namespace hmi_response = am::hmi_response;
using am::ApplicationSet;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using application_manager::event_engine::EventObserver;
using connection_handler_test::MockConnectionHandler;
using policy_test::MockPolicyHandlerInterface;
using sdl_rpc_plugin::commands::SDLActivateAppRequest;
@@ -113,8 +114,9 @@ class SDLActivateAppRequestTest
}
void InitCommand(const uint32_t& timeout) OVERRIDE {
- MockAppPtr mock_app = CreateMockApp();
CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+
+ MockAppPtr mock_app = CreateMockApp();
ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID));
ON_CALL(app_mngr_, application_by_hmi_app(kAppID))
.WillByDefault(Return(mock_app));
@@ -155,6 +157,9 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
CurrentHmiState(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
.WillOnce(Return(state));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
+
EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
command->Run();
@@ -200,8 +205,8 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
.WillOnce(Return(false));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false));
+ ON_CALL(*mock_app, IsRegistered()).WillByDefault(Return(false));
+ ON_CALL(*mock_app, is_cloud_app()).WillByDefault(Return(false));
ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
MockAppPtr mock_app_first(CreateMockApp());
@@ -262,8 +267,8 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
.WillOnce(Return(false));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false));
+ ON_CALL(*mock_app, IsRegistered()).WillByDefault(Return(false));
+ ON_CALL(*mock_app, is_cloud_app()).WillByDefault(Return(false));
ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
DataAccessor<ApplicationSet> accessor(app_list_, lock_);
@@ -325,10 +330,11 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotActiveNONE_SUCCESS) {
EXPECT_CALL(mock_state_controller_,
IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
.WillOnce(Return(false));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
+
+ ON_CALL(*mock_app, IsRegistered()).WillByDefault(Return(true));
+
am::HmiStatePtr state = std::make_shared<am::HmiState>(mock_app, app_mngr_);
state->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
-
EXPECT_CALL(*mock_app,
CurrentHmiState(mobile_apis::PredefinedWindows::DEFAULT_WINDOW))
.WillOnce(Return(state));
@@ -355,8 +361,9 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false));
+ ON_CALL(*mock_app, IsRegistered()).WillByDefault(Return(false));
+ ON_CALL(*mock_app, is_cloud_app()).WillByDefault(Return(false));
+
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
@@ -427,6 +434,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
EXPECT_CALL(mock_state_controller_,
IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
.WillOnce(Return(false));
+
DataAccessor<ApplicationSet> accessor(app_list_, lock_);
EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
@@ -458,8 +466,8 @@ TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(true));
+ ON_CALL(*mock_app, IsRegistered()).WillByDefault(Return(false));
+ ON_CALL(*mock_app, is_cloud_app()).WillByDefault(Return(true));
#ifndef EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(app_mngr_, application(kAppID))
@@ -486,7 +494,7 @@ TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) {
EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings));
EXPECT_CALL(app_mngr_,
- updateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout)));
+ UpdateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout)));
MockConnectionHandler connection_handler;
EXPECT_CALL(connection_handler, ConnectToDevice(kHandle));
@@ -503,10 +511,11 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
- ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ ON_CALL(mock_event_dispatcher_,
+ remove_observer(_, testing::Matcher<EventObserver&>(_)));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
- command->onTimeOut();
+ command->OnTimeOut();
}
TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
index 21260250ae..482ca93f3e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -114,6 +114,7 @@ using event_engine_test::MockEventDispatcher;
class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
+ InitEventDispatcher();
std::shared_ptr<am_commands::RequestToHMI> command(
CreateCommand<am_commands::RequestToHMI>());
@@ -124,6 +125,8 @@ TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
}
TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
+ InitEventDispatcher();
+
std::shared_ptr<am_commands::RequestToHMI> command(
CreateCommand<am_commands::RequestToHMI>());
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
@@ -222,6 +225,8 @@ TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
+ this->InitEventDispatcher();
+
std::shared_ptr<CommandType> command =
this->template CreateCommand<CommandType>();
@@ -233,6 +238,8 @@ TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
+ this->InitEventDispatcher();
+
std::shared_ptr<CommandType> command =
this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
@@ -243,6 +250,8 @@ TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
+ EXPECT_CALL(this->event_dispatcher_, remove_observer(_));
+
std::shared_ptr<CommandType> command =
this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_request_test.cc
new file mode 100644
index 0000000000..c518bdf9b2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_request_test.cc
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2021, 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/subscribe_button_request.h"
+#include <memory>
+#include <string>
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/resumption/resumption_data_processor.h"
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace subscribe_button_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+using am::commands::RequestToHMI;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::hmi::SubscribeButtonRequest;
+using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+typedef std::shared_ptr<SubscribeButtonRequest> SubscribeButtonRequestPtr;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 1u;
+const hmi_apis::Common_ButtonName::eType kCustomButtonName =
+ hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
+const hmi_apis::Common_ButtonName::eType kHmiButtonName =
+ hmi_apis::Common_ButtonName::SEEKLEFT;
+const mobile_apis::ButtonName::eType kMobileButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+const mobile_apis::ButtonName::eType kMobileCustomButtonName =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+const hmi_apis::FunctionID::eType kFunctionID =
+ hmi_apis::FunctionID::Buttons_SubscribeButton;
+} // namespace
+
+class HMISubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::app_id] = kAppId;
+ (*command_msg)[strings::msg_params][strings::button_name] = kHmiButtonName;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[strings::params][strings::function_id] = kFunctionID;
+
+ return command_msg;
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ mock_app_ = CreateMockApp();
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), hmi_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, application_by_hmi_app(kAppId))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(HMISubscribeButtonRequestTest, Run_SendRequest_SUCCESS) {
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ RequestToHMIPtr command(CreateCommand<SubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_event_dispatcher,
+ add_observer(kFunctionID, kCorrelationId, _))
+ .Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+ ASSERT_TRUE(command->Init());
+
+ command->Run();
+}
+
+TEST_F(HMISubscribeButtonRequestTest, Run_SendRequest_CUSTOM_BUTTON_SUCCESS) {
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::button_name] = kCustomButtonName;
+ RequestToHMIPtr command(CreateCommand<SubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_event_dispatcher,
+ add_observer(kFunctionID, kCorrelationId, _));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(HMISubscribeButtonRequestTest,
+ onTimeOut_RequestIsExpired_HandleOnTimeout) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ RequestToHMIPtr command(CreateCommand<SubscribeButtonRequest>(command_msg));
+
+ resumption_test::MockResumeCtrl mock_resume_ctrl;
+ ON_CALL(app_mngr_, resume_controller())
+ .WillByDefault(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(kCorrelationId, kFunctionID));
+
+ command->OnTimeOut();
+}
+
+TEST_F(HMISubscribeButtonRequestTest,
+ OnEvent_SuccessfulResponse_ButtonSubscribed) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::button_name] = kCustomButtonName;
+
+ SubscribeButtonRequestPtr command =
+ CreateCommand<SubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, SubscribeToButton(kMobileCustomButtonName))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(HMISubscribeButtonRequestTest,
+ OnEvent_UnsuccessfulResponse_ButtonNotSubscribed) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::button_name] = kCustomButtonName;
+
+ SubscribeButtonRequestPtr command =
+ CreateCommand<SubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, SubscribeToButton(kMobileCustomButtonName)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(HMISubscribeButtonRequestTest, onEvent_App_NULL) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ SubscribeButtonRequestPtr command =
+ CreateCommand<SubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr mock_app = NULL;
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppId))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app_, SubscribeToButton(kMobileButtonName)).Times(0);
+
+ command->on_event(event);
+}
+
+} // namespace subscribe_button_request
+} // 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/subscribe_button_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_response_test.cc
new file mode 100644
index 0000000000..490a3bc2e5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/subscribe_button_response_test.cc
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2021, 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 <string>
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/subscribe_button_response.h"
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace subscribe_button_response {
+
+namespace am = ::application_manager;
+using application_manager::ExpiredButtonRequestData;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::hmi::SubscribeButtonResponse;
+using ::test::components::event_engine_test::MockEventDispatcher;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 1u;
+const hmi_apis::Common_ButtonName::eType kButtonName =
+ hmi_apis::Common_ButtonName::SEEKLEFT;
+const hmi_apis::FunctionID::eType kFunctionID =
+ hmi_apis::FunctionID::Buttons_UnsubscribeButton;
+} // namespace
+
+class HMISubscribeButtonResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ HMISubscribeButtonResponseTest() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ return command_msg;
+ }
+
+ MockEventDispatcher event_dispatcher_;
+};
+
+TEST_F(HMISubscribeButtonResponseTest,
+ RUN_ProcessExpiredRequest_SendUnsubscribeRequestToHMI) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ ResponseFromHMIPtr command(
+ CreateCommand<SubscribeButtonResponse>(command_msg));
+
+ ExpiredButtonRequestData expired_data;
+ expired_data.app_id_ = kAppId;
+ expired_data.button_name_ = kButtonName;
+ utils::Optional<ExpiredButtonRequestData> expired_data_opt = expired_data;
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(expired_data_opt));
+ ON_CALL(mock_message_helper_,
+ CreateButtonSubscriptionHandlingRequestToHmi(
+ kAppId, kButtonName, kFunctionID, _))
+ .WillByDefault(Return(command_msg));
+ EXPECT_CALL(event_dispatcher_, raise_event(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+}
+
+TEST_F(
+ HMISubscribeButtonResponseTest,
+ RUN_ProcessUnsuccessfulExpiredRequest_EventNotRaisedUnsubscribeRequestNotSent) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<SubscribeButtonResponse>(command_msg));
+
+ ExpiredButtonRequestData expired_data;
+ expired_data.app_id_ = kAppId;
+ expired_data.button_name_ = kButtonName;
+ utils::Optional<ExpiredButtonRequestData> expired_data_opt = expired_data;
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(expired_data_opt));
+ EXPECT_CALL(event_dispatcher_, raise_event(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(HMISubscribeButtonResponseTest, RUN_NoExpiredRequests_EventRaised) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ ResponseFromHMIPtr command(
+ CreateCommand<SubscribeButtonResponse>(command_msg));
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(utils::Optional<ExpiredButtonRequestData>::EMPTY));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+ EXPECT_CALL(event_dispatcher_, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace subscribe_button_response
+} // 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/tts_get_capabilities_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_request_test.cc
index bae6b6082e..b3ba2d30a9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_request_test.cc
@@ -77,6 +77,7 @@ class TTSGetCapabilitiesRequestTest
TEST_F(TTSGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<TTSGetCapabilitiesRequest>(command_msg));
@@ -93,6 +94,7 @@ TEST_F(TTSGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(TTSGetCapabilitiesRequestTest, onTimeOut_TTSGetCapabilitiesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<TTSGetCapabilitiesRequest>(command_msg));
@@ -102,7 +104,7 @@ TEST_F(TTSGetCapabilitiesRequestTest, onTimeOut_TTSGetCapabilitiesUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_request_test.cc
index a0bf0887db..275f4a18ff 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_request_test.cc
@@ -77,6 +77,7 @@ class TTSGetLanguageRequestTest
TEST_F(TTSGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<TTSGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -92,6 +93,7 @@ TEST_F(TTSGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(TTSGetLanguageRequestTest, onTimeOut_TTSGetLanguageUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<TTSGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -100,7 +102,7 @@ TEST_F(TTSGetLanguageRequestTest, onTimeOut_TTSGetLanguageUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_request_test.cc
index 1561e1def5..373d217ee6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_request_test.cc
@@ -77,6 +77,7 @@ class TTSGetSupportedLanguagesRequestTest
TEST_F(TTSGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<TTSGetSupportedLanguagesRequest>(command_msg));
@@ -94,6 +95,7 @@ TEST_F(TTSGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(TTSGetSupportedLanguagesRequestTest,
onTimeOut_TTSGetSupportedLanguagesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<TTSGetSupportedLanguagesRequest>(command_msg));
@@ -103,7 +105,7 @@ TEST_F(TTSGetSupportedLanguagesRequestTest,
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc
index e758bfca1f..3428cc8923 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc
@@ -242,7 +242,7 @@ TEST_F(TTSIsReadyRequestTest,
ASSERT_TRUE(command_->Init());
command_->Run();
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace tts_is_ready_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_request_test.cc
index 1057a89cc6..ca568ba630 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_request_test.cc
@@ -77,6 +77,7 @@ class UIGetCapabilitiesRequestTest
TEST_F(UIGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<UIGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -92,6 +93,7 @@ TEST_F(UIGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(UIGetCapabilitiesRequestTest, onTimeOut_UIGetCapabilitiesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<UIGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -100,7 +102,7 @@ TEST_F(UIGetCapabilitiesRequestTest, onTimeOut_UIGetCapabilitiesUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
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 a1661dc247..37531b469a 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
@@ -356,25 +356,6 @@ 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();
-}
-
TEST_F(UIGetCapabilitiesResponseTest,
SaveCachedCapabilitiesToFileCall_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_request_test.cc
index c944f1b49b..6cdcd6eb00 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_request_test.cc
@@ -77,6 +77,7 @@ class UIGetLanguageRequestTest
TEST_F(UIGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<UIGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -92,6 +93,7 @@ TEST_F(UIGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(UIGetLanguageRequestTest, onTimeOut_UIGetLanguageUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<UIGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -100,7 +102,7 @@ TEST_F(UIGetLanguageRequestTest, onTimeOut_UIGetLanguageUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_request_test.cc
index 251b6b7d58..69d0f6d117 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_request_test.cc
@@ -77,6 +77,7 @@ class UIGetSupportedLanguagesRequestTest
TEST_F(UIGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<UIGetSupportedLanguagesRequest>(command_msg));
@@ -94,6 +95,7 @@ TEST_F(UIGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(UIGetSupportedLanguagesRequestTest,
onTimeOut_UIGetSupportedLanguagesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<UIGetSupportedLanguagesRequest>(command_msg));
@@ -103,7 +105,7 @@ TEST_F(UIGetSupportedLanguagesRequestTest,
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
index a82ad39d83..4db9f5cf62 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
@@ -208,7 +208,7 @@ TEST_F(UIIsReadyRequestTest,
TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS_CacheIsAbsent) {
HMICapabilitiesExpectations();
ExpectSendMessagesToHMI();
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace ui_is_ready_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_request_test.cc
new file mode 100644
index 0000000000..5a0790a5e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_request_test.cc
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2021, 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/unsubscribe_button_request.h"
+
+#include <memory>
+#include <string>
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/resumption/resumption_data_processor.h"
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace unsubscribe_button_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+using am::commands::RequestToHMI;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::hmi::UnsubscribeButtonRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+typedef std::shared_ptr<UnsubscribeButtonRequest> UnsubscribeButtonRequestPtr;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 1u;
+const hmi_apis::Common_ButtonName::eType kButtonName =
+ hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
+const hmi_apis::FunctionID::eType kFunctionID =
+ hmi_apis::FunctionID::Buttons_UnsubscribeButton;
+const mobile_apis::ButtonName::eType kMobileCustomButtonName =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+} // namespace
+
+class HMIUnsubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::app_id] = kAppId;
+ (*command_msg)[strings::msg_params][strings::button_name] = kButtonName;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[strings::params][strings::function_id] = kFunctionID;
+
+ return command_msg;
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ mock_app_ = CreateMockApp();
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), hmi_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, application_by_hmi_app(kAppId))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(HMIUnsubscribeButtonRequestTest, Run_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ RequestToHMIPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+ ASSERT_TRUE(command->Init());
+
+ command->Run();
+}
+
+TEST_F(HMIUnsubscribeButtonRequestTest,
+ onTimeOut_RequestIsExpired_HandleOnTimeout) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ RequestToHMIPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ resumption_test::MockResumeCtrl mock_resume_ctrl;
+ ON_CALL(app_mngr_, resume_controller())
+ .WillByDefault(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(_, _));
+
+ command->OnTimeOut();
+}
+
+TEST_F(HMIUnsubscribeButtonRequestTest,
+ OnEvent_SuccessfulResponse_ButtonUnsubscribed) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ UnsubscribeButtonRequestPtr command =
+ CreateCommand<UnsubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromButton(kMobileCustomButtonName))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(HMIUnsubscribeButtonRequestTest,
+ OnEvent_UnsuccessfulResponse_ButtonNotUnsubscribed) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ UnsubscribeButtonRequestPtr command =
+ CreateCommand<UnsubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromButton(kMobileCustomButtonName))
+ .Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(HMIUnsubscribeButtonRequestTest, onEvent_App_NULL) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ UnsubscribeButtonRequestPtr command =
+ CreateCommand<UnsubscribeButtonRequest>(command_msg);
+
+ MessageSharedPtr event_msg = CreateCommandMsg();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(kFunctionID);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr mock_app = NULL;
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppId))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromButton(kMobileCustomButtonName))
+ .Times(0);
+
+ command->on_event(event);
+}
+
+} // namespace unsubscribe_button_request
+} // 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/unsubscribe_button_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_response_test.cc
new file mode 100644
index 0000000000..1659081e69
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/unsubscribe_button_response_test.cc
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2021, 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 <string>
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/unsubscribe_button_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace unsubscribe_button_response {
+
+namespace am = ::application_manager;
+using application_manager::ExpiredButtonRequestData;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::hmi::UnsubscribeButtonResponse;
+using ::test::components::event_engine_test::MockEventDispatcher;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 1u;
+const hmi_apis::Common_ButtonName::eType kButtonName =
+ hmi_apis::Common_ButtonName::SEEKLEFT;
+const hmi_apis::FunctionID::eType kFunctionID =
+ hmi_apis::FunctionID::Buttons_SubscribeButton;
+} // namespace
+
+class HMIUnsubscribeButtonResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ HMIUnsubscribeButtonResponseTest() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ return command_msg;
+ }
+
+ MockEventDispatcher event_dispatcher_;
+};
+
+TEST_F(HMIUnsubscribeButtonResponseTest,
+ RUN_ProcessExpiredRequest_SendSubscribeRequestToHMI) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UnsubscribeButtonResponse>(command_msg));
+
+ ExpiredButtonRequestData expired_data;
+ expired_data.app_id_ = kAppId;
+ expired_data.button_name_ = kButtonName;
+ utils::Optional<ExpiredButtonRequestData> expired_data_opt = expired_data;
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(expired_data_opt));
+ ON_CALL(mock_message_helper_,
+ CreateButtonSubscriptionHandlingRequestToHmi(
+ kAppId, kButtonName, kFunctionID, _))
+ .WillByDefault(Return(command_msg));
+ EXPECT_CALL(event_dispatcher_, raise_event(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+}
+
+TEST_F(
+ HMIUnsubscribeButtonResponseTest,
+ RUN_ProcessUnsuccessfulExpiredRequest_EventNotRaisedSubscribeRequestNotSent) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UnsubscribeButtonResponse>(command_msg));
+
+ ExpiredButtonRequestData expired_data;
+ expired_data.app_id_ = kAppId;
+ expired_data.button_name_ = kButtonName;
+ utils::Optional<ExpiredButtonRequestData> expired_data_opt = expired_data;
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(expired_data_opt));
+ EXPECT_CALL(event_dispatcher_, raise_event(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(HMIUnsubscribeButtonResponseTest, RUN_NoExpiredRequests_EventRaised) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ ResponseFromHMIPtr command(
+ CreateCommand<UnsubscribeButtonResponse>(command_msg));
+
+ ON_CALL(app_mngr_, GetExpiredButtonRequestData(kCorrelationId))
+ .WillByDefault(Return(utils::Optional<ExpiredButtonRequestData>::EMPTY));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+ EXPECT_CALL(event_dispatcher_, raise_event(_));
+ command->Run();
+}
+
+} // namespace unsubscribe_button_response
+} // 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/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
index 9760462d05..0c95013964 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
@@ -64,6 +64,7 @@ namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
using am::commands::CommandImpl;
using am::event_engine::Event;
+using application_manager::event_engine::EventObserver;
using sdl_rpc_plugin::commands::UpdateDeviceListRequest;
typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
@@ -90,6 +91,8 @@ class UpdateDeviceListRequestTest
};
TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
+ InitEventDispatcher();
+
MessageSharedPtr command_msg = CreateCommandMsg();
UpdateDeviceListRequestPtr command(
@@ -111,6 +114,8 @@ TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
}
TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESS) {
+ InitEventDispatcher();
+
MessageSharedPtr command_msg = CreateCommandMsg();
UpdateDeviceListRequestPtr command(
@@ -132,6 +137,8 @@ TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESS) {
}
TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsFalse_UNSUCCESS) {
+ InitEventDispatcher();
+
MessageSharedPtr command_msg = CreateCommandMsg();
UpdateDeviceListRequestPtr command(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
index 92e3fa1187..b6aa134dfc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
@@ -69,6 +69,8 @@ TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
(*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
(*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ InitEventDispatcher();
+
UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
EXPECT_CALL(mock_policy_handler_, PTExchangeAtUserRequest(kCorrelationId));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_request_test.cc
index cef87f06b4..2933b6aa44 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_request_test.cc
@@ -77,6 +77,7 @@ class VRGetCapabilitiesRequestTest
TEST_F(VRGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<VRGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -92,6 +93,7 @@ TEST_F(VRGetCapabilitiesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(VRGetCapabilitiesRequestTest, onTimeOut_VRGetCapabilitiesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<VRGetCapabilitiesRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -100,7 +102,7 @@ TEST_F(VRGetCapabilitiesRequestTest, onTimeOut_VRGetCapabilitiesUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_request_test.cc
index 6235b41691..fffc56b979 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_request_test.cc
@@ -77,6 +77,7 @@ class VRGetLanguageRequestTest
TEST_F(VRGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<VRGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -92,6 +93,7 @@ TEST_F(VRGetLanguageRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(VRGetLanguageRequestTest, onTimeOut_VRGetLanguageUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(CreateCommand<VRGetLanguageRequest>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
@@ -100,7 +102,7 @@ TEST_F(VRGetLanguageRequestTest, onTimeOut_VRGetLanguageUpdated) {
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_request_test.cc
index 73657528e9..af2faa12e6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_request_test.cc
@@ -77,7 +77,7 @@ class VRGetSupportedLanguagesRequestTest
TEST_F(VRGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
MessageSharedPtr command_msg = CreateCommandMsg();
-
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<VRGetSupportedLanguagesRequest>(command_msg));
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
@@ -94,6 +94,7 @@ TEST_F(VRGetSupportedLanguagesRequestTest, RUN_SendRequest_SUCCESS) {
TEST_F(VRGetSupportedLanguagesRequestTest,
onTimeOut_VRGetSupportedLanguagesUpdated) {
MessageSharedPtr command_msg = CreateCommandMsg();
+ InitEventDispatcher();
RequestToHMIPtr command(
CreateCommand<VRGetSupportedLanguagesRequest>(command_msg));
@@ -103,7 +104,7 @@ TEST_F(VRGetSupportedLanguagesRequestTest,
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(CommandImpl::hmi_protocol_type_,
(*command_msg)[strings::params][strings::protocol_type].asInt());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
index 3d2a46707e..ea1b90598e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
@@ -192,7 +192,7 @@ TEST_F(VRIsReadyRequestTest,
Run_HMIDoestRespond_SendMessageToHMIByTimeout_CacheIsAbsent) {
HMICapabilitiesExpectations();
ExpectSendMessagesToHMI();
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace vr_is_ready_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
index 93ae813535..b4795dae21 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
@@ -74,6 +74,7 @@ using ::testing::_;
using ::testing::InSequence;
using ::testing::Return;
using namespace smart_objects;
+using app_mngr::commands::RequestFromMobileImpl;
namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
@@ -222,10 +223,9 @@ class AddCommandRequestTest
mock_rpc_service_,
ManageMobileCommand(response,
am::commands::Command::CommandSource::SOURCE_SDL));
-
- std::shared_ptr<CommandRequestImpl> base_class_request =
- static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
- base_class_request->onTimeOut();
+ std::shared_ptr<RequestFromMobileImpl> base_class_request =
+ static_cast<std::shared_ptr<RequestFromMobileImpl> >(request_ptr);
+ base_class_request->OnTimeOut();
}
MessageSharedPtr msg_;
@@ -608,22 +608,41 @@ TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
}
TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
- MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
- (*command_msg)[params][connection_key] = kConnectionKey;
- MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
- (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- (*event_msg)[msg_params][cmd_id] = kCmdId;
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*event_msg);
-
+ event_ui.set_smart_object(*msg_);
Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*event_msg);
+ event_vr.set_smart_object(*msg_);
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, _, false));
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
std::shared_ptr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(command_msg);
+ CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
request_ptr->on_event(event_ui);
request_ptr->on_event(event_vr);
@@ -1097,11 +1116,10 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
response, am::commands::Command::CommandSource::SOURCE_SDL));
-
- std::shared_ptr<CommandRequestImpl> base_class_request =
- static_cast<std::shared_ptr<CommandRequestImpl> >(
+ std::shared_ptr<RequestFromMobileImpl> base_class_request =
+ static_cast<std::shared_ptr<RequestFromMobileImpl> >(
CreateCommand<AddCommandRequest>(msg_));
- base_class_request->onTimeOut();
+ base_class_request->OnTimeOut();
}
TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
@@ -1148,10 +1166,9 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
response, am::commands::Command::CommandSource::SOURCE_SDL));
-
- std::shared_ptr<CommandRequestImpl> base_class_request =
- static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
- base_class_request->onTimeOut();
+ std::shared_ptr<RequestFromMobileImpl> base_class_request =
+ static_cast<std::shared_ptr<RequestFromMobileImpl> >(request_ptr);
+ base_class_request->OnTimeOut();
}
} // namespace add_command_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
index e726616345..e7a6c43fe4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
@@ -215,7 +215,7 @@ TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
MessageSharedPtr result_msg(
CatchMobileCommandResult(CallOnEvent(*command, event)));
- EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
+ EXPECT_EQ(mobile_apis::Result::GENERIC_ERROR,
static_cast<mobile_apis::Result::eType>(
(*result_msg)[am::strings::msg_params][am::strings::result_code]
.asInt()));
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 dc7731bfc8..233a99a8cd 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
@@ -56,6 +56,7 @@ using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using app_mngr::commands::RequestFromMobileImpl;
using policy_test::MockPolicyHandlerInterface;
using sdl_rpc_plugin::commands::AlertRequest;
using ::testing::_;
@@ -207,7 +208,7 @@ TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
.asBool(),
false);
@@ -259,13 +260,13 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
class CallOnTimeOut {
public:
- CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+ CallOnTimeOut(RequestFromMobileImpl& command) : command_(command) {}
void operator()() {
- command_.onTimeOut();
+ command_.OnTimeOut();
}
- CommandRequestImpl& command_;
+ RequestFromMobileImpl& command_;
};
TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
@@ -335,7 +336,7 @@ TEST_F(AlertRequestTest, Run_FailToProcessSoftButtons_UNSUCCESS) {
CommandPtr command(CreateCommand<AlertRequest>(msg_));
MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(result_code,
+ EXPECT_EQ(mobile_apis::Result::GENERIC_ERROR,
static_cast<mobile_apis::Result::eType>(
(*result_msg)[am::strings::msg_params][am::strings::result_code]
.asInt()));
@@ -403,27 +404,6 @@ TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
command->on_event(event);
}
-TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) {
- PreConditions();
- Expectations();
- AddAlertTextsToMsg();
-
- (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- EXPECT_TRUE(command->Init());
-
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM);
-
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
Expectations();
AddAlertTextsToMsg();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
index 80abfec61d..3f8ac0028b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -165,11 +165,6 @@ class CreateInteractionChoiceSetResponseTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
- MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
- (*msg_vr)[strings::msg_params][strings::result_code] =
- am::mobile_api::Result::GENERIC_ERROR;
- (*msg_vr)[strings::msg_params][strings::success] = false;
-
std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
CreateCommand<CreateInteractionChoiceSetRequest>();
@@ -179,6 +174,8 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
ON_CALL(*mock_app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
ON_CALL(*mock_app, RemoveCommand(_)).WillByDefault(Return());
+ InitNegativeResponse();
+
MessageSharedPtr vr_command_result;
EXPECT_CALL(
@@ -191,7 +188,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
.WillOnce(ReturnRef(mock_resume_ctrl));
EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(_, _));
- req_vr->onTimeOut();
+ req_vr->OnTimeOut();
EXPECT_EQ(
(*vr_command_result)[strings::msg_params][strings::success].asBool(),
false);
@@ -619,7 +616,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
command_->Run();
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _));
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
event.set_smart_object(*message_);
@@ -655,7 +652,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
.WillByDefault(Return(kCorrelationId));
command_->Run();
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _));
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
event.set_smart_object(*message_);
@@ -696,7 +693,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
event.set_smart_object(*message_);
command_->on_event(event);
@@ -706,6 +703,8 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) {
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ InitNegativeResponse();
+
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
@@ -716,8 +715,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
.WillOnce(ReturnRef(mock_resume_ctrl));
EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(_, _));
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
-
- command_->onTimeOut();
+ command_->OnTimeOut();
}
TEST_F(CreateInteractionChoiceSetRequestTest,
@@ -751,7 +749,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
command_->Run();
FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
Event event(hmi_apis::FunctionID::VR_AddCommand);
event.set_smart_object(*message_);
@@ -766,7 +764,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(_, _));
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- command_->onTimeOut();
+ command_->OnTimeOut();
}
TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
@@ -801,7 +799,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
command_->Run();
FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2);
Event event(hmi_apis::FunctionID::VR_AddCommand);
event.set_smart_object(*message_);
@@ -811,12 +809,13 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(invalid_app));
EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0);
+
resumption_test::MockResumeCtrl mock_resume_ctrl;
EXPECT_CALL(app_mngr_, resume_controller())
.WillOnce(ReturnRef(mock_resume_ctrl));
EXPECT_CALL(mock_resume_ctrl, HandleOnTimeOut(_, _));
- command_->onTimeOut();
+ command_->OnTimeOut();
}
TEST_F(CreateInteractionChoiceSetRequestTest,
@@ -854,7 +853,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
resumption_test::MockResumeCtrl mock_resume_ctrl;
EXPECT_CALL(app_mngr_, resume_controller())
.WillOnce(ReturnRef(mock_resume_ctrl));
@@ -871,7 +870,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, RemoveChoiceSet(_));
- command_->onTimeOut();
+ InitNegativeResponse();
+
+ command_->OnTimeOut();
}
TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
@@ -935,7 +936,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
am::commands::Command::SOURCE_SDL));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
event.set_smart_object(*message_);
command_->on_event(event);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
index dd4c6fd526..bd4c5c1ec6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -209,9 +209,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest,
EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(invalid_choice_set_id));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
- EXPECT_CALL(*app_, UpdateHash());
+ EXPECT_CALL(*app_, app_id()).Times(0);
}
DeleteInteractionChoiceSetRequestPtr command =
@@ -222,8 +220,13 @@ TEST_F(DeleteInteractionChoiceSetRequestTest,
}
TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
+ using namespace application_manager;
+ using namespace event_engine;
+
(*message_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
+ (*message_)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
(*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
kChoiceSetId;
(*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
@@ -232,6 +235,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
smart_objects::SmartObject choice_set_id =
(*message_)[am::strings::msg_params];
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::VR_DeleteCommand);
+ event.set_smart_object(*message_);
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(app_));
@@ -246,21 +253,27 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
- EXPECT_CALL(*app_, app_id())
- .WillOnce(Return(kConnectionKey))
- .WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ {
+ InSequence seq;
EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
EXPECT_CALL(*app_, UpdateHash());
}
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(Return(true));
DeleteInteractionChoiceSetRequestPtr command =
CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
command->Init();
command->Run();
+
+ command->on_event(event);
}
TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
index f5856a8eda..975cba89a1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
@@ -67,6 +67,7 @@ using sdl_rpc_plugin::commands::DeleteSubMenuResponse;
typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
typedef std::shared_ptr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+typedef std::shared_ptr<Event> EventPtr;
MATCHER_P(CheckMessageResultCode, result_code, "") {
return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
@@ -89,8 +90,9 @@ namespace {
const uint32_t kConnectionKey = 2u;
const uint32_t kCorrelationId = 10u;
const uint32_t kMenuId = 100u;
+const uint32_t kMenuIdChild = 101u;
const uint32_t kGrammarId = 101u;
-const int32_t kCmdId = 102;
+const int32_t kCmdId = 102u;
} // namespace
class DeleteSubMenuRequestTest
@@ -107,6 +109,224 @@ class DeleteSubMenuRequestTest
std::make_shared<am_test::MockHelpPromptManager>())
, app_(CreateMockApp()) {}
+ /**
+ * @brief Generates submenu smart object with specified params
+ * @param menu_id id of the menu
+ * @param parent_id id of parent menu
+ * @return generated smart object
+ */
+ smart_objects::SmartObjectSPtr GenerateSubMenuMap(const uint32_t menu_id,
+ const uint32_t parent_id) {
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ std::make_shared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[am::strings::position] = 1;
+ object[am::strings::menu_name] = "SubMenu " + std::to_string(menu_id);
+ object[am::strings::menu_id] = menu_id;
+ object[am::strings::parent_id] = parent_id;
+
+ return smartObjectPtr;
+ }
+
+ /**
+ * @brief Generates UI & VR commands smart object with specified params
+ * @param cmd_id id of the command
+ * @param parent_id id of parent command
+ * @return generated smart object
+ */
+ smart_objects::SmartObjectSPtr GenerateUiVrCommandMapChild(
+ const uint32_t cmd_id, const uint32_t parent_id) {
+ smart_objects::SmartObjectSPtr smartObjectPtr =
+ std::make_shared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& object = *smartObjectPtr;
+
+ object[am::strings::cmd_id] = cmd_id;
+ object[am::strings::grammar_id] = kGrammarId;
+ object[am::strings::vr_commands] = "VR commands";
+ object[am::strings::type] = hmi_apis::Common_VRCommandType::Command;
+ object[am::strings::menu_params][am::hmi_request::parent_id] = parent_id;
+
+ return smartObjectPtr;
+ }
+
+ /**
+ * @brief Sets up expectations for a successful execution of submenu request
+ * @param next_function_id function id of the next request
+ */
+ void SetUpSubMenuRequestExpectations(
+ const hmi_apis::FunctionID::eType next_function_id) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::strings::function_id] =
+ next_function_id;
+
+ smart_objects::SmartObject sub_menu =
+ (*message_)[am::strings::msg_params][am::strings::menu_id];
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
+
+ ON_CALL(*app_, sub_menu_map()).WillByDefault(Return(sub_menu_accessor_));
+ ON_CALL(*app_, commands_map()).WillByDefault(Return(accessor_));
+
+ EXPECT_CALL(*app_, app_id()).WillRepeatedly(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(next_function_id), _))
+ .WillOnce(Return(true));
+ }
+
+ /**
+ * @brief Prepares submenu response event with the specified params
+ * @param correlation_id correlation id
+ * @param menu_id id of the menu
+ * @return pointer to prepared event
+ */
+ EventPtr PrepareSubMenuResponseEvent(const uint32_t correlation_id,
+ const uint32_t menu_id) {
+ EventPtr menu_event =
+ std::make_shared<Event>(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ correlation_id;
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = menu_id;
+ menu_event->set_smart_object(*message_);
+
+ return menu_event;
+ }
+
+ /**
+ * @brief Sets up expectations for a successful execution of submenu
+ * subsequent response
+ * @param event pointer to event representing the response message
+ * @param next_function_id function id of the next request
+ */
+ void SetUpSubMenuSubsequentResponseExpectations(
+ EventPtr event, hmi_apis::FunctionID::eType next_function_id) {
+ const auto& event_so_ref = event->smart_object();
+ const auto correlation_id = event->smart_object_correlation_id();
+ const auto menu_id =
+ event_so_ref[am::strings::msg_params][am::strings::menu_id].asUInt();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, RemoveSubMenu(menu_id));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id + 1));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(next_function_id), _))
+ .WillOnce(Return(true));
+ }
+
+ /**
+ * @brief Prepares VR command response event with the specified params
+ * @param correlation_id correlation id
+ * @return pointer to prepared event
+ */
+ EventPtr PrepareVrCommandResponseEvent(const uint32_t correlation_id) {
+ EventPtr vr_event =
+ std::make_shared<Event>(hmi_apis::FunctionID::VR_DeleteCommand);
+ (*message_)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ correlation_id;
+ vr_event->set_smart_object(*message_);
+
+ return vr_event;
+ }
+
+ /**
+ * @brief Sets up expectations for a successful execution of VR command
+ * subsequent response
+ * @param event pointer to event representing the response message
+ * @param next_function_id function id of the next request
+ */
+ void SetUpVrCommandSubsequentResponseExpectations(
+ EventPtr event, hmi_apis::FunctionID::eType next_function_id) {
+ const auto correlation_id = event->smart_object_correlation_id();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id + 1));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(next_function_id), _))
+ .WillOnce(Return(true));
+ }
+
+ /**
+ * @brief Prepares UI command response event with the specified params
+ * @param correlation_id correlation id
+ * @param cmd_id id of the command
+ * @return pointer to prepared event
+ */
+ EventPtr PrepareUiCommandResponseEvent(const uint32_t correlation_id,
+ const uint32_t cmd_id) {
+ EventPtr ui_event =
+ std::make_shared<Event>(hmi_apis::FunctionID::UI_DeleteCommand);
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ correlation_id;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
+ ui_event->set_smart_object(*message_);
+
+ return ui_event;
+ }
+
+ /**
+ * @brief Sets up expectations for a successful execution of UI command
+ * subsequent response
+ * @param event pointer to event representing the response message
+ * @param next_function_id function id of the next request
+ */
+ void SetUpUiCommandSubsequentResponseExpectations(
+ EventPtr event, hmi_apis::FunctionID::eType next_function_id) {
+ const auto correlation_id = event->smart_object_correlation_id();
+ const auto& event_so_ref = event->smart_object();
+ const auto cmd_id =
+ event_so_ref[am::strings::msg_params][am::strings::cmd_id].asUInt();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, RemoveCommand(cmd_id))
+ .WillOnce(DeleteCommand(&commands_map_));
+ EXPECT_CALL(*app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(cmd_id, false));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id + 1));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(next_function_id), _))
+ .WillOnce(Return(true));
+ }
+
+ /**
+ * @brief Sets up expectations for a successful execution of submenu final
+ * response
+ * @param event pointer to event representing the response message
+ */
+ void SetUpSubMenuFinalResponseExpectations(EventPtr event) {
+ const auto& event_so_ref = event->smart_object();
+ const auto menu_id =
+ event_so_ref[am::strings::msg_params][am::strings::menu_id].asUInt();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, RemoveSubMenu(menu_id));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ }
+
am::CommandsMap commands_map_;
am::SubMenuMap sub_menu_map_;
mutable std::shared_ptr<sync_primitives::Lock> commands_lock_;
@@ -215,175 +435,187 @@ TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
command_->Run();
}
-TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- smart_objects::SmartObject sub_menu =
- (*message_)[am::strings::msg_params][am::strings::menu_id];
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
- EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
-
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId));
-
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu), _))
- .WillOnce(Return(true));
- command_->Run();
-}
-
TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
Event event(hmi_apis::FunctionID::INVALID_ENUM);
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(0);
command_->on_event(event);
}
TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
- event.set_smart_object(*message_);
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
+
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->Run();
+
MockAppPtr invalid_app;
+ EventPtr event = PrepareSubMenuResponseEvent(kCorrelationId, kMenuId);
+
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
- command_->on_event(event);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(0);
+
+ command_->on_event(*event);
}
-TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::vr_commands] =
- "vr_commands";
- (*message_)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- (*message_)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = kMenuId;
- const hmi_apis::Common_Result::eType result_code =
- hmi_apis::Common_Result::SUCCESS;
- (*message_)[am::strings::params][am::hmi_response::code] = result_code;
- event.set_smart_object(*message_);
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenuOnly_SUCCESS) {
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->Run();
- smart_objects::SmartObjectSPtr smartObjectPtr =
- std::make_shared<smart_objects::SmartObject>();
+ EventPtr event = PrepareSubMenuResponseEvent(kCorrelationId, kMenuId);
+ SetUpSubMenuFinalResponseExpectations(event);
+ command_->on_event(*event);
+}
- smart_objects::SmartObject& object = *smartObjectPtr;
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenuWithChildMenu_SUCCESS) {
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
- object[am::strings::position] = 1;
- object[am::strings::menu_name] = "SubMenu";
+ auto sub_menu_child_ptr = GenerateSubMenuMap(kMenuIdChild, kMenuId);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuIdChild, sub_menu_child_ptr.get()));
- sub_menu_map_.insert(
- std::pair<uint32_t, smart_objects::SmartObject*>(5, &object));
- EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->Run();
- InSequence seq;
- EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
+ EventPtr event = PrepareSubMenuResponseEvent(kCorrelationId, kMenuIdChild);
+ SetUpSubMenuSubsequentResponseExpectations(
+ event, hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->on_event(*event);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand), _))
- .WillOnce(Return(true));
-
- EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
- EXPECT_CALL(*app_, help_prompt_manager())
- .WillOnce(ReturnRef(*mock_help_prompt_manager_));
- EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(kCmdId, false));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand), _))
- .WillOnce(Return(true));
+ EventPtr event_final =
+ PrepareSubMenuResponseEvent(kCorrelationId + 1, kMenuId);
+ SetUpSubMenuFinalResponseExpectations(event_final);
+ command_->on_event(*event_final);
+}
- EXPECT_CALL(*app_, RemoveSubMenu(_));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- am::commands::Command::SOURCE_SDL));
- EXPECT_CALL(*app_, UpdateHash());
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenuWithVrAndUi_SUCCESS) {
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
- DeleteSubMenuRequestPtr command =
- CreateCommand<DeleteSubMenuRequest>(message_);
+ auto command_ptr = GenerateUiVrCommandMapChild(kCmdId, kMenuId);
+ commands_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kCmdId, command_ptr.get()));
- command->Init();
- command->on_event(event);
-}
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::VR_DeleteCommand);
+ command_->Run();
-TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
- MessageSharedPtr message(CreateMessage());
- (*message)[am::strings::msg_params][am::strings::connection_key] =
- kConnectionKey;
- DeleteSubMenuResponsePtr command(
- CreateCommand<DeleteSubMenuResponse>(message));
+ EventPtr event_vr = PrepareVrCommandResponseEvent(kCorrelationId);
+ SetUpVrCommandSubsequentResponseExpectations(
+ event_vr, hmi_apis::FunctionID::UI_DeleteCommand);
+ command_->on_event(*event_vr);
- EXPECT_CALL(
- mock_rpc_service_,
- SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
- command->Run();
+ EventPtr event_ui = PrepareUiCommandResponseEvent(kCorrelationId + 1, kCmdId);
+ SetUpUiCommandSubsequentResponseExpectations(
+ event_ui, hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->on_event(*event_ui);
+
+ EventPtr event_final =
+ PrepareSubMenuResponseEvent(kCorrelationId + 2, kMenuId);
+ SetUpSubMenuFinalResponseExpectations(event_final);
+ command_->on_event(*event_final);
}
TEST_F(DeleteSubMenuRequestTest,
- DeleteSubmenu_CommandhaventVrCommadsAndMenuParams_DontSendHMIRequest) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- am::mobile_api::Result::SUCCESS;
- event.set_smart_object(*message_);
+ OnEvent_DeleteSubmenuWithChildVrAndUi_SUCCESS) {
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
+ auto sub_menu_child_ptr = GenerateSubMenuMap(kMenuIdChild, kMenuId);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuIdChild, sub_menu_child_ptr.get()));
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
- EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
- EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+ auto command_ptr = GenerateUiVrCommandMapChild(kCmdId, kMenuIdChild);
+ commands_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kCmdId, command_ptr.get()));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- am::commands::Command::SOURCE_SDL));
- command_->on_event(event);
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::VR_DeleteCommand);
+ command_->Run();
+
+ EventPtr event_vr = PrepareVrCommandResponseEvent(kCorrelationId);
+ SetUpVrCommandSubsequentResponseExpectations(
+ event_vr, hmi_apis::FunctionID::UI_DeleteCommand);
+ command_->on_event(*event_vr);
+
+ EventPtr event_ui = PrepareUiCommandResponseEvent(kCorrelationId + 1, kCmdId);
+ SetUpUiCommandSubsequentResponseExpectations(
+ event_ui, hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->on_event(*event_ui);
+
+ EventPtr event_submenu =
+ PrepareSubMenuResponseEvent(kCorrelationId + 2, kMenuIdChild);
+ SetUpSubMenuSubsequentResponseExpectations(
+ event_submenu, hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->on_event(*event_submenu);
+
+ EventPtr event_final =
+ PrepareSubMenuResponseEvent(kCorrelationId + 3, kMenuId);
+ SetUpSubMenuFinalResponseExpectations(event_final);
+ command_->on_event(*event_final);
}
TEST_F(DeleteSubMenuRequestTest,
- DeleteSubmenu_NotAChildOfMenupartam_DontSendHMIRequest) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = kMenuId + 1;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- am::mobile_api::Result::SUCCESS;
- event.set_smart_object(*message_);
+ OnEvent_DeleteSubmenuVrAndUiWithChild_SUCCESS) {
+ auto sub_menu_ptr = GenerateSubMenuMap(kMenuId, 0);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuId, sub_menu_ptr.get()));
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
+ auto command_ptr = GenerateUiVrCommandMapChild(kCmdId, kMenuId);
+ commands_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kCmdId, command_ptr.get()));
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(*app_, sub_menu_map()).WillRepeatedly(Return(sub_menu_accessor_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
- EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
- EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+ auto sub_menu_child_ptr = GenerateSubMenuMap(kMenuIdChild, kMenuId);
+ sub_menu_map_.insert(std::pair<uint32_t, smart_objects::SmartObject*>(
+ kMenuIdChild, sub_menu_child_ptr.get()));
+
+ SetUpSubMenuRequestExpectations(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->Run();
+
+ EventPtr event_submenu =
+ PrepareSubMenuResponseEvent(kCorrelationId, kMenuIdChild);
+ SetUpSubMenuSubsequentResponseExpectations(
+ event_submenu, hmi_apis::FunctionID::VR_DeleteCommand);
+ command_->on_event(*event_submenu);
+
+ EventPtr event_vr = PrepareVrCommandResponseEvent(kCorrelationId + 1);
+ SetUpVrCommandSubsequentResponseExpectations(
+ event_vr, hmi_apis::FunctionID::UI_DeleteCommand);
+ command_->on_event(*event_vr);
+
+ EventPtr event_ui = PrepareUiCommandResponseEvent(kCorrelationId + 2, kCmdId);
+ SetUpUiCommandSubsequentResponseExpectations(
+ event_ui, hmi_apis::FunctionID::UI_DeleteSubMenu);
+ command_->on_event(*event_ui);
+
+ EventPtr event_final =
+ PrepareSubMenuResponseEvent(kCorrelationId + 3, kMenuId);
+ SetUpSubMenuFinalResponseExpectations(event_final);
+ command_->on_event(*event_final);
+}
+
+TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::connection_key] =
+ kConnectionKey;
+ DeleteSubMenuResponsePtr command(
+ CreateCommand<DeleteSubMenuResponse>(message));
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- am::commands::Command::SOURCE_SDL));
- command_->on_event(event);
+ SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
+ command->Run();
}
} // namespace delete_sub_menu_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
index 8f83a2dd10..201118eec0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -165,12 +165,8 @@ class MobileCommandsTest : public components::commands_test::CommandRequestTest<
typedef Command CommandType;
void InitCommand(const uint32_t& timeout) OVERRIDE {
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+
ON_CALL(app_mngr_settings_, app_icons_folder())
.WillByDefault(ReturnRef(kEmptyString_));
}
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
index 74c61410e8..f783df387a 100644
--- 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
@@ -33,8 +33,12 @@
#include "mobile/get_system_capability_request.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_app_service_manager.h"
#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
+#include "resumption/last_state_impl.h"
+#include "resumption/last_state_wrapper_impl.h"
#include "smart_objects/smart_object.h"
namespace test {
@@ -44,8 +48,11 @@ namespace mobile_commands_test {
namespace get_system_capability_request_test {
using sdl_rpc_plugin::commands::GetSystemCapabilityRequest;
+using ::test::components::application_manager_test::MockAppServiceManager;
using ::testing::_;
using ::testing::Return;
+using ::testing::ReturnPointee;
+
typedef std::shared_ptr<GetSystemCapabilityRequest>
GetSystemCapabilityRequestPtr;
@@ -64,6 +71,12 @@ class GetSystemCapabilityRequestTest
command_ = CreateCommand<GetSystemCapabilityRequest>(message_);
mock_app_ = CreateMockApp();
+ last_state_ = std::make_shared<resumption::LastStateWrapperImpl>(
+ std::make_shared<resumption::LastStateImpl>("app_storage_folder",
+ "app_info_storage"));
+ mock_app_service_mngr_ =
+ std::make_shared<MockAppServiceManager>(app_mngr_, last_state_);
+
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
}
@@ -71,6 +84,8 @@ class GetSystemCapabilityRequestTest
GetSystemCapabilityRequestPtr command_;
MessageSharedPtr message_;
MockAppPtr mock_app_;
+ std::shared_ptr<MockAppServiceManager> mock_app_service_mngr_;
+ resumption::LastStateWrapperPtr last_state_;
};
TEST_F(
@@ -117,6 +132,186 @@ TEST_F(
command_->Run();
}
+TEST_F(GetSystemCapabilityRequestTest,
+ Run_GetSystemDisplayCapabilities_AppNotRegistered) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(nullptr));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ Command::CommandSource::SOURCE_SDL));
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(GetSystemCapabilityRequestTest,
+ Run_GetSystemDisplayCapabilities_NAVIGATION_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::NAVIGATION;
+
+ smart_objects::SmartObjectSPtr system_navigation_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, navigation_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_navigation_capabilities));
+
+ ON_CALL(app_mngr_, GetAppServiceManager())
+ .WillByDefault(ReturnPointee(mock_app_service_mngr_));
+
+ 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_PHONECALL_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::PHONE_CALL;
+
+ smart_objects::SmartObjectSPtr system_phonecall_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, phone_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_phonecall_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_VIDEOSTREAMING_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::VIDEO_STREAMING;
+
+ smart_objects::SmartObjectSPtr system_videostreaming_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, video_streaming_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_videostreaming_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_REMOTECONTROL_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::REMOTE_CONTROL;
+
+ EXPECT_CALL(*mock_app_, is_remote_control_supported()).WillOnce(Return(true));
+ EXPECT_CALL(mock_hmi_capabilities_, is_rc_cooperating())
+ .WillOnce(Return(true));
+
+ smart_objects::SmartObjectSPtr system_remotecontrol_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_remotecontrol_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_REMOTECONTROL_DISALLOWEDResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::REMOTE_CONTROL;
+
+ EXPECT_CALL(*mock_app_, is_remote_control_supported())
+ .WillOnce(Return(false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::DISALLOWED),
+ Command::CommandSource::SOURCE_SDL));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
+TEST_F(GetSystemCapabilityRequestTest,
+ Run_GetSystemDisplayCapabilities_APPSERVICES_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+
+ ON_CALL(app_mngr_, GetAppServiceManager())
+ .WillByDefault(ReturnPointee(mock_app_service_mngr_));
+
+ std::vector<smart_objects::SmartObject> app_services;
+ EXPECT_CALL(*mock_app_service_mngr_, GetAllServiceRecords())
+ .WillOnce(Return(app_services));
+
+ ON_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateAppServiceCapabilities(app_services))
+ .WillByDefault(Return(smart_objects::SmartObject()));
+
+ 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_SEATLOCATION_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::SEAT_LOCATION;
+
+ smart_objects::SmartObjectSPtr system_seatlocation_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, seat_location_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_seatlocation_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_DRIVERDISTRACTION_SUCCESSResultCode) {
+ (*message_)[strings::msg_params][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::DRIVER_DISTRACTION;
+
+ smart_objects::SmartObjectSPtr system_driverdistraction_capabilities(
+ std::make_shared<smart_objects::SmartObject>());
+ EXPECT_CALL(mock_hmi_capabilities_, driver_distraction_capability())
+ .Times(2)
+ .WillRepeatedly(Return(system_driverdistraction_capabilities));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ Command::CommandSource::SOURCE_SDL));
+
+ ASSERT_TRUE(command_->Init());
+ command_->Run();
+}
+
} // namespace get_system_capability_request_test
} // namespace mobile_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
index 7f7a8b55bd..fd2bc2e51a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
@@ -202,7 +202,7 @@ TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
event.set_smart_object(*message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
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 e4536ddeea..dbab9e1833 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
@@ -197,6 +197,9 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app,
+ IsSubscribedToButton(mobile_apis::ButtonName::CUSTOM_BUTTON))
+ .WillOnce(Return(true));
EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
.WillOnce(Return(false));
@@ -215,6 +218,13 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
(*notification_msg)[am::strings::msg_params]
[am::hmi_response::custom_button_id] = kCustomButtonId;
+ auto mock_message_helper = am::MockMessageHelper::message_helper_mock();
+ smart_objects::SmartObjectSPtr msg =
+ std::make_shared<smart_objects::SmartObject>();
+ (*msg)[strings::params][strings::function_id] = TestFixture::kFunctionId;
+ EXPECT_CALL(*mock_message_helper, CreateButtonNotificationToMobile(_, _))
+ .WillRepeatedly(Return(msg));
+
std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
@@ -222,6 +232,9 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
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,
+ IsSubscribedToButton(mobile_apis::ButtonName::CUSTOM_BUTTON))
+ .WillOnce(Return(true));
EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
.WillOnce(Return(true));
EXPECT_CALL(this->mock_rpc_service_,
@@ -244,18 +257,30 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
(*notification_msg)[am::strings::msg_params]
[am::hmi_response::custom_button_id] = kCustomButtonId;
+ auto mock_message_helper = am::MockMessageHelper::message_helper_mock();
+ smart_objects::SmartObjectSPtr msg =
+ std::make_shared<smart_objects::SmartObject>();
+ EXPECT_CALL(*mock_message_helper, CreateButtonNotificationToMobile(_, _))
+ .WillRepeatedly(Return(msg));
+
std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- ON_CALL(*mock_app, hmi_level(kDefaultWindowId))
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+
+ EXPECT_CALL(*mock_app, GetSoftButtonWindowID(kCustomButtonId))
+ .WillOnce(Return(kDefaultWindowId));
+
+ EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+
EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app,
+ IsSubscribedToButton(mobile_apis::ButtonName::CUSTOM_BUTTON))
+ .WillOnce(Return(true));
EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
.WillOnce(Return(true));
- EXPECT_CALL(this->mock_rpc_service_,
- SendMessageToMobile(
- CheckNotificationMessage(TestFixture::kFunctionId), _));
command->Run();
}
@@ -343,22 +368,27 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
+ auto mock_message_helper = am::MockMessageHelper::message_helper_mock();
+ smart_objects::SmartObjectSPtr msg =
+ std::make_shared<smart_objects::SmartObject>();
+ (*msg)[strings::params][strings::function_id] = TestFixture::kFunctionId;
+ EXPECT_CALL(*mock_message_helper, CreateButtonNotificationToMobile(_, _))
+ .WillRepeatedly(Return(msg));
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(*mock_app, IsSubscribedToButton(kButtonName))
+ .WillOnce(Return(true));
EXPECT_CALL(*mock_app, hmi_level(kDefaultWindowId))
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
ON_CALL(this->app_mngr_, application(kAppId)).WillByDefault(Return(mock_app));
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
EXPECT_CALL(this->mock_rpc_service_,
SendMessageToMobile(
CheckNotificationMessage(TestFixture::kFunctionId), _));
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
command->Run();
}
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 2915418d43..b23e8eefeb 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
@@ -184,7 +184,7 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
.asBool(),
false);
@@ -626,7 +626,7 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
@@ -654,7 +654,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
// First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _));
CallOnEvent caller_speak(*command_sptr_, event_speak);
caller_speak();
@@ -691,31 +691,7 @@ TEST_F(PerformAudioPassThruRequestTest,
app_mngr_,
StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- CallOnEvent caller(*command_sptr_, event);
- caller();
-
- EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
- EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) {
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-
- msg_params_[am::strings::connection_key] = kConnectionKey;
- msg_params_[am::strings::function_id] = kFunctionId;
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
CallOnEvent caller(*command_sptr_, event);
@@ -729,7 +705,7 @@ TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0);
CallOnEvent caller(*command_sptr_, event);
@@ -756,10 +732,20 @@ TEST_F(PerformAudioPassThruRequestTest,
// For setting current_state_ -> kCompleted
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
- command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
- command_sptr_->onTimeOut();
+ MessageSharedPtr timeout_response =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*timeout_response)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*timeout_response)[am::strings::msg_params][am::strings::success] = false;
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(timeout_response));
+
+ command_sptr_->OnTimeOut();
}
TEST_F(PerformAudioPassThruRequestTest,
@@ -830,7 +816,7 @@ TEST_F(PerformAudioPassThruRequestTest,
HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(false));
- command_sptr_->onTimeOut();
+ command_sptr_->OnTimeOut();
}
} // namespace perform_audio_pass_thru_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
index 193229eeb0..196c83d144 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
@@ -173,6 +173,26 @@ class PerformInteractionRequestTest
performinteraction_choice_set_lock_ptr_;
};
+class PerformInteractionRequestTestClass : public PerformInteractionRequest {
+ public:
+ PerformInteractionRequestTestClass(
+ 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)
+ : PerformInteractionRequest(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ void StartAwaitForInterfaces() {
+ StartAwaitForInterface(am::HmiInterfaces::HMI_INTERFACE_VR);
+ StartAwaitForInterface(am::HmiInterfaces::HMI_INTERFACE_UI);
+ }
+};
+
TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
MessageSharedPtr response_msg_vr =
CreateMessage(smart_objects::SmartType_Map);
@@ -182,8 +202,8 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
(*request_msg)[strings::msg_params][strings::interaction_mode] =
mobile_apis::InteractionMode::BOTH;
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(request_msg);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(request_msg);
MockAppPtr mock_app;
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
@@ -192,6 +212,7 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
event.set_smart_object(*response_msg_vr);
command->Init();
+ command->StartAwaitForInterfaces();
command->on_event(event);
MessageSharedPtr response_to_mobile =
CreateMessage(smart_objects::SmartType_Map);
@@ -208,7 +229,7 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
- command->onTimeOut();
+ command->OnTimeOut();
EXPECT_EQ(
(*vr_command_result)[strings::msg_params][strings::success].asBool(),
@@ -222,8 +243,8 @@ TEST_F(PerformInteractionRequestTest,
OnEvent_BOTHMode_UIChoiceIdReceivedFirst) {
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
@@ -244,6 +265,8 @@ TEST_F(PerformInteractionRequestTest,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->StartAwaitForInterfaces();
+
command->on_event(event_ui);
command->on_event(event_vr);
@@ -256,8 +279,8 @@ TEST_F(PerformInteractionRequestTest,
OnEvent_BOTHMode_VRChoiceIdReceivedFirst) {
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
@@ -278,6 +301,8 @@ TEST_F(PerformInteractionRequestTest,
_, am::commands::Command::CommandSource::SOURCE_SDL_TO_HMI))
.WillOnce(DoAll(SaveArg<0>(&request_to_hmi), Return(true)));
+ command->StartAwaitForInterfaces();
+
command->on_event(event_vr);
EXPECT_EQ(hmi_apis::FunctionID::UI_ClosePopUp,
(*request_to_hmi)[strings::params][strings::function_id].asInt());
@@ -298,11 +323,13 @@ TEST_F(PerformInteractionRequestTest,
OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::VR_ONLY);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MockAppPtr mock_app;
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
@@ -344,11 +371,13 @@ TEST_F(PerformInteractionRequestTest,
OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::VR_ONLY);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MockAppPtr mock_app;
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
@@ -387,11 +416,13 @@ TEST_F(
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::VR_ONLY);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MockAppPtr mock_app;
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
@@ -429,11 +460,13 @@ TEST_F(
auto msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MessageSharedPtr response_msg_vr =
CreateHMIResponseMessage(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
"VR is not supported by system");
@@ -478,11 +511,13 @@ TEST_F(
MessageSharedPtr msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MessageSharedPtr response_msg_vr = CreateHMIResponseMessageWithChoiceID(
hmi_apis::Common_Result::SUCCESS, "", kVrChoiceID);
MessageSharedPtr response_msg_ui = CreateHMIResponseMessageWithChoiceID(
@@ -526,11 +561,13 @@ TEST_F(
auto msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::VR_ONLY);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MessageSharedPtr response_msg_vr = CreateHMIResponseMessage(
hmi_apis::Common_Result::WARNINGS, "WARNING MESSAGE");
am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
@@ -574,11 +611,13 @@ TEST_F(
auto msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MessageSharedPtr response_msg_vr =
CreateHMIResponseMessage(hmi_apis::Common_Result::SUCCESS, "");
am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
@@ -622,11 +661,13 @@ TEST_F(
auto msg_from_mobile =
CreateRequestMessage(mobile_apis::InteractionMode::BOTH);
- std::shared_ptr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ std::shared_ptr<PerformInteractionRequestTestClass> command =
+ CreateCommand<PerformInteractionRequestTestClass>(msg_from_mobile);
ASSERT_TRUE(command->Init());
+ command->StartAwaitForInterfaces();
+
MessageSharedPtr response_msg_vr = CreateHMIResponseMessage(
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, "VR error message");
am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
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 4572a6d907..0624c873fa 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
@@ -289,8 +289,7 @@ class RegisterAppInterfaceRequestTest
EXPECT_CALL(
mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
- _))
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_SubscribeButton), _))
.Times(0);
EXPECT_CALL(
@@ -350,12 +349,6 @@ class RegisterAppInterfaceRequestTest
hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
_))
.WillByDefault(Return(true));
- ON_CALL(
- mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
- _))
- .WillByDefault(Return(true));
}
void SetCommonPreconditionsToCheckWithPolicyData(MockAppPtr mock_app) {
@@ -416,6 +409,7 @@ TEST_F(RegisterAppInterfaceRequestTest, DefaultTimeout_CheckIfZero_SUCCESS) {
TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
InitBasicMessage();
(*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId1;
+
EXPECT_CALL(app_mngr_, WaitForHmiIsReady()).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
@@ -455,11 +449,33 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
_))
.WillOnce(Return(true));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(
+ application_manager::HmiInterfaces::HMI_INTERFACE_Buttons))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::Buttons_SubscribeButton))
+ .WillByDefault(
+ Return(application_manager::HmiInterfaces::HMI_INTERFACE_Buttons));
+
+ 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] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr));
+
EXPECT_CALL(
mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
- _))
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_SubscribeButton), _))
.WillOnce(Return(true));
application_manager::DisplayCapabilitiesBuilder builder(*mock_app);
@@ -501,6 +517,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
InitBasicMessage();
ON_CALL(app_mngr_, WaitForHmiIsReady()).WillByDefault(Return(true));
+
EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
ON_CALL(mock_connection_handler_,
@@ -581,12 +598,6 @@ TEST_F(RegisterAppInterfaceRequestTest,
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(
@@ -802,6 +813,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey2;
ON_CALL(app_mngr_, WaitForHmiIsReady()).WillByDefault(Return(true));
+
EXPECT_CALL(app_mngr_, IsApplicationForbidden(kConnectionKey2, kAppId1))
.WillOnce(Return(false));
@@ -845,12 +857,6 @@ TEST_F(RegisterAppInterfaceRequestTest,
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(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
index 8ca15f39fe..f1bb7b64ca 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
@@ -282,6 +282,42 @@ TEST_F(ResetGlobalPropertiesRequestTest,
command_->on_event(event);
}
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_RC_SetGlobalProperties_SUCCESS) {
+ am::ResetGlobalPropertiesResult result;
+ result.user_location = true;
+
+ EXPECT_CALL(app_mngr_, ResetGlobalProperties(_, _)).WillOnce(Return(result));
+
+ smart_objects::SmartObjectSPtr msg_params =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+
+ EXPECT_CALL(mock_message_helper_, CreateRCResetGlobalPropertiesRequest(_, _))
+ .WillOnce(Return(msg_params));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetGlobalProperties), _))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(hmi_apis::FunctionID::RC_SetGlobalProperties);
+ event.set_smart_object(*msg_);
+
+ command_->on_event(event);
+}
+
TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) {
MessageSharedPtr message(CreateMessage());
ResetGlobalPropertiesResponsePtr command(
@@ -404,7 +440,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
ManageMobileCommand(
MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
am::commands::Command::SOURCE_SDL));
- command->onTimeOut();
+ command->OnTimeOut();
}
TEST_F(ResetGlobalPropertiesRequestTest,
@@ -471,7 +507,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
ManageMobileCommand(
MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
am::commands::Command::SOURCE_SDL));
- command_->onTimeOut();
+ command_->OnTimeOut();
}
TEST_F(ResetGlobalPropertiesRequestTest,
@@ -528,7 +564,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
ManageMobileCommand(
MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
am::commands::Command::SOURCE_SDL));
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace reset_global_properties
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
index 6b17aa238d..443868168d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
@@ -173,17 +173,21 @@ TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) {
(*msg_)[msg_params][timeout] = kTimeOut;
(*msg_)[msg_params][interaction_mode] =
mobile_apis::InteractionMode::MANUAL_ONLY;
- EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ const uint32_t initial_timeout =
+ kDefaultTimeout_ + kDefaultTimeoutCompensation_;
+ EXPECT_EQ(initial_timeout, command_->default_timeout());
command_->Init();
- EXPECT_EQ(kTimeOut + kDefaultTimeout_, command_->default_timeout());
+ EXPECT_EQ(kTimeOut + initial_timeout, command_->default_timeout());
}
TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) {
(*msg_)[msg_params][interaction_mode] =
mobile_apis::InteractionMode::MANUAL_ONLY;
- EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ const uint32_t initial_timeout =
+ kDefaultTimeout_ + kDefaultTimeoutCompensation_;
+ EXPECT_EQ(initial_timeout, command_->default_timeout());
command_->Init();
- EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ EXPECT_EQ(initial_timeout, command_->default_timeout());
}
TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
@@ -241,18 +245,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
}
TEST_F(ScrollableMessageRequestTest,
- OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) {
- (*msg_)[params][connection_key] = kConnectionKey;
- (*msg_)[params][correlation_id] = kCorrelationId;
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_));
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command_->on_event(event);
-}
-
-TEST_F(ScrollableMessageRequestTest,
DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) {
(*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
index 0450f06ee1..e9077cb7f5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
@@ -55,6 +55,7 @@ namespace am = application_manager;
using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
+using app_mngr::commands::RequestFromMobileImpl;
using policy_test::MockPolicyHandlerInterface;
using sdl_rpc_plugin::commands::SliderRequest;
using ::testing::_;
@@ -182,13 +183,13 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
class CallOnTimeOut {
public:
- CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+ CallOnTimeOut(RequestFromMobileImpl& command) : command_(command) {}
void operator()() {
- command_.onTimeOut();
+ command_.OnTimeOut();
}
- CommandRequestImpl& command_;
+ RequestFromMobileImpl& command_;
};
TEST_F(SliderRequestTest, Init_SUCCESS) {
@@ -274,22 +275,6 @@ TEST_F(SliderRequestTest, Run_SUCCESS) {
command->Run();
}
-TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
- (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- EXPECT_TRUE(command->Init());
-
- EXPECT_CALL(app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, _));
-
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) {
PreConditions();
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
index 87320d3a7a..dd082a52a7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
@@ -366,18 +366,6 @@ TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) {
command->on_event(event);
}
-TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) {
- Event event(Event::EventID::TTS_OnResetTimeout);
- (*request_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*request_)[am::strings::params][am::strings::correlation_id] = kAppId;
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _));
-
- command->on_event(event);
-}
-
TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
const hmi_apis::Common_Result::eType hmi_result =
hmi_apis::Common_Result::SUCCESS;
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 f3bfe12ab1..56e0766184 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
@@ -202,22 +202,19 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
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,
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_SubscribeButton,
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()));
+ EXPECT_EQ(
+ hmi_apis::Common_ButtonName::eType::SEEKLEFT,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::button_name]
+ .asInt()));
}
TEST_F(SubscribeButtonRequestTest, Run_NAV_SUCCESS) {
@@ -249,30 +246,30 @@ TEST_F(SubscribeButtonRequestTest, Run_NAV_SUCCESS) {
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,
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_SubscribeButton,
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()));
+ EXPECT_EQ(
+ hmi_apis::Common_ButtonName::eType::NAV_CENTER_LOCATION,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::button_name]
+ .asInt()));
}
-TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
- const mobile_apis::ButtonName::eType kButtonName =
- mobile_apis::ButtonName::OK;
+TEST_F(SubscribeButtonRequestTest,
+ Run_App_Version_4_5_and_OK_btn_Expect_PlayPause_btn_sent_to_HMI) {
+ const mobile_apis::ButtonName::eType button_ok = mobile_apis::ButtonName::OK;
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ const mobile_apis::ButtonName::eType button_play_pause =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::msg_params][am::strings::button_name] = button_ok;
CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
MockAppPtr app(CreateMockApp());
@@ -284,41 +281,33 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
.WillByDefault(Return(true));
MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
- (*button_caps_ptr)[1][am::hmi_response::button_name] =
- mobile_apis::ButtonName::PLAY_PAUSE;
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = button_ok;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] = button_play_pause;
ON_CALL(mock_hmi_capabilities_, button_capabilities())
.WillByDefault(Return(button_caps_ptr));
- ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+ ON_CALL(*app, IsSubscribedToButton(button_play_pause))
+ .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,
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_SubscribeButton,
static_cast<hmi_apis::FunctionID::eType>(
(*hmi_result_msg)[am::strings::params][am::strings::function_id]
.asInt()));
- EXPECT_EQ(hmi_apis::Common_ButtonName::PLAY_PAUSE,
- static_cast<hmi_apis::Common_ButtonName::eType>(
- (*hmi_result_msg)[am::strings::msg_params][am::strings::name]
- .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()));
+ EXPECT_EQ(
+ hmi_apis::Common_ButtonName::PLAY_PAUSE,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::button_name]
+ .asInt()));
}
} // namespace subscribe_button_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
index 5735610051..15795fa1e6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -77,8 +77,6 @@ TEST_F(UnsubscribeButtonRequestTest,
.WillOnce(Return(mock_app));
ON_CALL(*mock_app, msg_version())
.WillByDefault(ReturnRef(mock_semantic_version));
- EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
- .WillOnce(Return(false));
EXPECT_CALL(
mock_rpc_service_,
@@ -137,18 +135,6 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
ON_CALL(*mock_app, msg_version())
.WillByDefault(ReturnRef(mock_semantic_version));
- EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
- .WillOnce(Return(true));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
- _));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- EXPECT_CALL(*mock_app, UpdateHash());
command->Init();
command->Run();
}
@@ -181,19 +167,6 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Base_RPC_Version) {
.WillByDefault(ReturnRef(mock_base_rpc_version));
ON_CALL(*mock_app, is_media_application()).WillByDefault(Return(true));
- EXPECT_CALL(*mock_app,
- UnsubscribeFromButton(mobile_apis::ButtonName::PLAY_PAUSE))
- .WillOnce(Return(true));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
- _));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- EXPECT_CALL(*mock_app, UpdateHash());
command->Init();
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
index 44628a8e89..8fbc37e0bd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
@@ -148,7 +148,7 @@ TEST_F(UpdateTurnListRequestTest,
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
- const mobile_result::eType kExpectedResult = mobile_result::INVALID_ENUM;
+ const mobile_result::eType kExpectedResult = mobile_result::GENERIC_ERROR;
EXPECT_CALL(mock_message_helper_,
ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
Eq(mock_app),
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 8c29cccfff..e858967619 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,7 +45,6 @@ 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
@@ -54,7 +53,7 @@ set(LIBRARIES
connectionHandler
)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
@@ -63,6 +62,7 @@ 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)
+target_link_libraries(vehicle_info_plugin MessageHelper)
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
index 74f12c07d4..2edf9358c4 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
@@ -61,7 +61,7 @@ class VIGetVehicleTypeRequest : public app_mngr::commands::RequestToHMI {
void Run() OVERRIDE;
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
index 96f8c8ecb8..3a835caa5c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
@@ -44,8 +44,7 @@ namespace commands {
/**
* @brief VIIsReadyRequest command class
**/
-class VIIsReadyRequest : public app_mngr::commands::RequestToHMI,
- public app_mngr::event_engine::EventObserver {
+class VIIsReadyRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief VIIsReadyRequest class constructor
@@ -73,7 +72,7 @@ class VIIsReadyRequest : public app_mngr::commands::RequestToHMI,
/**
* @brief onTimeOut from requrst Controller
*/
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
index 7fc84b7986..b066fa9654 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -66,7 +66,7 @@ class VISubscribeVehicleDataRequest : public app_mngr::commands::RequestToHMI {
**/
virtual void Run();
- void onTimeOut() OVERRIDE;
+ void OnTimeOut() OVERRIDE;
private:
CustomVehicleDataManager& custom_vehicle_data_manager_;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
index 56f0e39621..2c78086cfd 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_command_params.h"
@@ -46,7 +46,8 @@ namespace commands {
/**
* @brief DiagnosticMessageRequest command class
**/
-class DiagnosticMessageRequest : public app_mngr::commands::CommandRequestImpl {
+class DiagnosticMessageRequest
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief DiagnosticMessageRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
index 562d7f236b..6643c1e158 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_command_params.h"
@@ -46,7 +46,7 @@ namespace commands {
/**
* @brief GetDTCsRequest command class
**/
-class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl {
+class GetDTCsRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief GetDTCsRequest class constructor
@@ -71,7 +71,7 @@ class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
index 8a594b0647..5e6e4c0227 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_command_params.h"
@@ -46,7 +46,7 @@ namespace commands {
/**
* @brief GetVehicleDataRequest command class
**/
-class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
+class GetVehicleDataRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief GetVehicleDataRequest class constructor
@@ -67,7 +67,7 @@ class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
virtual void Run();
protected:
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
private:
/**
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
index 8566075504..0e27e7402d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
@@ -34,7 +34,7 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_command_params.h"
namespace vehicle_info_plugin {
@@ -45,7 +45,7 @@ namespace commands {
/**
* @brief ReadDIDRequest command class
**/
-class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl {
+class ReadDIDRequest : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief ReadDIDRequest class constructor
@@ -65,7 +65,7 @@ class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl {
*
* @param event The received event
*/
- void on_event(const app_mngr::event_engine::Event& event);
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
/**
* @brief Execute command
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
index 663e64f2a0..4a92d736a3 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
@@ -39,6 +39,7 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/custom_vehicle_data_manager.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
@@ -53,7 +54,7 @@ namespace commands {
* @brief SubscribeVehicleDataRequest command class
**/
class SubscribeVehicleDataRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief SubscribeVehicleDataRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
index 4f2a01244f..f728c44753 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -36,6 +36,7 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/custom_vehicle_data_manager.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
@@ -50,7 +51,7 @@ namespace commands {
* @brief UnsubscribeVehicleDataRequest command class
**/
class UnsubscribeVehicleDataRequest
- : public app_mngr::commands::CommandRequestImpl {
+ : public app_mngr::commands::RequestFromMobileImpl {
public:
/**
* @brief UnsubscribeVehicleDataRequest class constructor
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
index 7e3eabb6a1..1d3fcd1e74 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
@@ -152,7 +152,7 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension {
* @brief VehicleInfoAppExtensionUID unique identifier of VehicleInfo
* aplication extension
*/
- static unsigned VehicleInfoAppExtensionUID;
+ static const app_mngr::AppExtensionUID VehicleInfoAppExtensionUID = 146;
/**
* @brief ExtractVIExtension utility function to extract application extension
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_pending_resumption_handler.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_pending_resumption_handler.h
index 78f8f685cc..271f950d03 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_pending_resumption_handler.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_pending_resumption_handler.h
@@ -52,7 +52,7 @@ class VehicleInfoPendingResumptionHandler
app_mngr::ApplicationManager& application_manager,
CustomVehicleDataManager& custom_vehicle_data_manager);
- void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+ void HandleOnEvent(const app_mngr::event_engine::Event& event) OVERRIDE;
void HandleResumptionSubscriptionRequest(app_mngr::AppExtension& extension,
app_mngr::Application& app) OVERRIDE;
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 1910a9efdf..8c67bc1d10 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
@@ -55,13 +55,6 @@ class VehicleInfoPlugin : public plugins::RPCPlugin {
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state) OVERRIDE;
- DEPRECATED
- bool Init(app_mngr::ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) OVERRIDE;
-
bool IsAbleToProcess(
const int32_t function_id,
const app_mngr::commands::Command::CommandSource source) OVERRIDE;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
index 26a9990079..808b8c85c2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
@@ -56,7 +56,7 @@ void VIGetVehicleTypeRequest::Run() {
SendRequest();
}
-void VIGetVehicleTypeRequest::onTimeOut() {
+void VIGetVehicleTypeRequest::OnTimeOut() {
SDL_LOG_AUTO_TRACE();
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VehicleInfo_GetVehicleType);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
index 2c9ac78523..cbbf8a2a3f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
@@ -51,8 +51,7 @@ VIIsReadyRequest::VIIsReadyRequest(
params.application_manager_,
params.rpc_service_,
params.hmi_capabilities_,
- params.policy_handler_)
- , EventObserver(application_manager_.event_dispatcher()) {}
+ params.policy_handler_) {}
VIIsReadyRequest::~VIIsReadyRequest() {}
@@ -99,7 +98,7 @@ void VIIsReadyRequest::on_event(const event_engine::Event& event) {
}
}
-void VIIsReadyRequest::onTimeOut() {
+void VIIsReadyRequest::OnTimeOut() {
// Note(dtrunov): According to new requirment APPLINK-27956
hmi_capabilities_.UpdateRequestsRequiredForCapabilities(
hmi_apis::FunctionID::VehicleInfo_IsReady);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
index da925e68e7..ee0fac65e7 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
@@ -77,7 +77,7 @@ void VISubscribeVehicleDataRequest::Run() {
SendRequest();
}
-void VISubscribeVehicleDataRequest::onTimeOut() {
+void VISubscribeVehicleDataRequest::OnTimeOut() {
event_engine::Event timeout_event(
hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
SDL_LOG_AUTO_TRACE();
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
index 762528c51b..37f99857e2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
@@ -49,11 +49,11 @@ SDL_CREATE_LOG_VARIABLE("Commands")
DiagnosticMessageRequest::DiagnosticMessageRequest(
const application_manager::commands::MessageSharedPtr& message,
const VehicleInfoCommandParams& params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_) {}
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
DiagnosticMessageRequest::~DiagnosticMessageRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
index 2f236dd8b2..9044e0a1aa 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
@@ -47,11 +47,11 @@ SDL_CREATE_LOG_VARIABLE("Commands")
GetDTCsRequest::GetDTCsRequest(
const application_manager::commands::MessageSharedPtr& message,
const VehicleInfoCommandParams& params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_) {}
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
GetDTCsRequest::~GetDTCsRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
index e5656d60c5..3cc1645825 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
@@ -54,11 +54,11 @@ namespace str = strings;
GetVehicleDataRequest::GetVehicleDataRequest(
const application_manager::commands::MessageSharedPtr& message,
const VehicleInfoCommandParams& params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_)
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
, custom_vehicle_data_manager_(params.custom_vehicle_data_manager_) {}
GetVehicleDataRequest::~GetVehicleDataRequest() {}
@@ -91,7 +91,7 @@ void GetVehicleDataRequest::Run() {
continue;
}
hmi_msg_params[name] = msg_params[name];
- params_count++;
+ ++params_count;
}
const int minimal_params_count = 1;
@@ -126,6 +126,12 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
std::string response_info;
GetInfo(message, response_info);
+ if (message[strings::msg_params].keyExists(strings::tire_pressure)) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ MessageHelper::AddDefaultParamsToTireStatus(app, message);
+ }
+
auto data_not_available_with_params = [this, &result_code, &message]() {
if (hmi_apis::Common_Result::DATA_NOT_AVAILABLE != result_code) {
return false;
@@ -164,6 +170,13 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
}
}
+ if (MessageHelper::RemoveEmptyMessageParams(
+ message[strings::msg_params]) > 0) {
+ mobile_result_code = mobile_apis::Result::WARNINGS;
+ response_info = app_mngr::commands::MergeInfos(
+ response_info, "Some vehicle data items could not be retrieved");
+ }
+
if (message[strings::msg_params].empty() &&
hmi_apis::Common_Result::DATA_NOT_AVAILABLE != result_code) {
response_info = "Failed to retrieve data from vehicle";
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 60dea0a24b..71a6289d9c 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
@@ -70,6 +70,8 @@ void OnVehicleDataNotification::Run() {
custom_vehicle_data_manager_.CreateMobileMessageParams(
(*message_)[strings::msg_params]);
+ MessageHelper::RemoveEmptyMessageParams((*message_)[strings::msg_params]);
+
const auto& param_names = (*message_)[strings::msg_params].enumerate();
for (const auto& name : param_names) {
SDL_LOG_DEBUG("vehicle_data name: " << name);
@@ -89,21 +91,27 @@ void OnVehicleDataNotification::Run() {
SDL_LOG_ERROR("NULL pointer");
continue;
}
+
+ smart_objects::SmartObject output_message = *message_;
+ if (strings::tire_pressure == name) {
+ MessageHelper::AddDefaultParamsToTireStatus(app, output_message);
+ }
+
notified_app_it = find(notify_apps.begin(), notify_apps.end(), app);
if (notified_app_it == notify_apps.end()) {
notify_apps.push_back(app);
smart_objects::SmartObject msg_param =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_param[name] = (*message_)[strings::msg_params][name];
+ msg_param[name] = output_message[strings::msg_params][name];
appSO.push_back(msg_param);
} else {
size_t idx = std::distance(notify_apps.begin(), notified_app_it);
- appSO[idx][name] = (*message_)[strings::msg_params][name];
+ appSO[idx][name] = output_message[strings::msg_params][name];
}
}
}
- for (size_t idx = 0; idx < notify_apps.size(); idx++) {
+ for (size_t idx = 0; idx < notify_apps.size(); ++idx) {
CommandParametersPermissions params_permissions;
application_manager_.CheckPolicyPermissions(
notify_apps[idx],
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
index c718d18965..443bcd3e8c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
@@ -48,11 +48,11 @@ SDL_CREATE_LOG_VARIABLE("Commands")
ReadDIDRequest::ReadDIDRequest(
const application_manager::commands::MessageSharedPtr& message,
const VehicleInfoCommandParams& params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_) {}
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
ReadDIDRequest::~ReadDIDRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
index 9e35e96ce3..db3922e1a2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -47,11 +47,11 @@ SDL_CREATE_LOG_VARIABLE("Commands")
SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
const application_manager::commands::MessageSharedPtr& message,
VehicleInfoCommandParams params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_)
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
, custom_vehicle_data_manager_(params.custom_vehicle_data_manager_) {}
SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
@@ -103,7 +103,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
}
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
if (!app) {
SDL_LOG_ERROR("NULL pointer.");
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
index 7d81701a64..e04e529a67 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -52,11 +52,11 @@ SDL_CREATE_LOG_VARIABLE("Commands")
UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
const application_manager::commands::MessageSharedPtr& message,
const VehicleInfoCommandParams& params)
- : CommandRequestImpl(message,
- params.application_manager_,
- params.rpc_service_,
- params.hmi_capabilities_,
- params.policy_handler_)
+ : RequestFromMobileImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
, custom_vehicle_data_manager_(params.custom_vehicle_data_manager_) {}
UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
@@ -189,7 +189,7 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
+ application_manager_.application(RequestFromMobileImpl::connection_key());
if (!app) {
SDL_LOG_ERROR("NULL pointer.");
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc
index af9d605ff0..39d20cf67d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc
@@ -114,7 +114,7 @@ void CustomVehicleDataManagerImpl::CreateMobileMessageParams(
auto& input_param = input_params[key];
if (*schema->array &&
input_param.getType() == smart_objects::SmartType_Array) {
- for (size_t i = 0; i < input_param.length(); i++) {
+ for (size_t i = 0; i < input_param.length(); ++i) {
const auto param =
fill_mobile_msg(input_param[i], SearchMethod::RECURSIVE);
out_params[item_name][i] = param;
@@ -294,10 +294,8 @@ void CustomVehicleDataManagerImpl::UpdateVehicleDataItems() {
case SMemberType::SMEMBER_VDR_MOBILE: {
// valid since struct_schema_items is not used in
// InitStructSchemaItem_VehicleDataResult
- mobile_apis::MOBILE_API::TStructsSchemaItems mobile_struct_schema_items;
auto member_schema =
- mobile_apis::MOBILE_API::InitStructSchemaItem_VehicleDataResult(
- mobile_struct_schema_items);
+ mobile_apis::MOBILE_API::InitStructSchemaItem_VehicleDataResult();
return SMember(
member_schema,
false, // root level items should not be mandatory
@@ -330,10 +328,8 @@ void CustomVehicleDataManagerImpl::UpdateVehicleDataItems() {
case SMemberType::SMEMBER_VDR_HMI: {
// valid since struct_schema_items is not used in
// InitStructSchemaItem_Common_VehicleDataResult
- hmi_apis::HMI_API::TStructsSchemaItems hmi_struct_schema_items;
auto member_schema =
- hmi_apis::HMI_API::InitStructSchemaItem_Common_VehicleDataResult(
- hmi_struct_schema_items);
+ hmi_apis::HMI_API::InitStructSchemaItem_Common_VehicleDataResult();
return SMember(
member_schema, false // root level items should not be mandatory
);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
index dd6d797e39..cff5d294ad 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
@@ -38,8 +38,6 @@ SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin")
namespace vehicle_info_plugin {
namespace strings = application_manager::strings;
-unsigned VehicleInfoAppExtension::VehicleInfoAppExtensionUID = 146;
-
VehicleInfoAppExtension::VehicleInfoAppExtension(
VehicleInfoPlugin& plugin, application_manager::Application& app)
: app_mngr::AppExtension(
@@ -138,7 +136,8 @@ void VehicleInfoAppExtension::SaveResumptionData(
int i = 0;
sync_primitives::AutoLock lock(*subscribed_data_lock_);
for (const auto& subscription : subscribed_data_) {
- resumption_data[strings::application_vehicle_info][i++] = subscription;
+ resumption_data[strings::application_vehicle_info][i] = subscription;
+ ++i;
}
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
index 77cb5e71d7..7511cb7364 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
@@ -208,7 +208,8 @@ app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_command_creator(
? factory.GetCreator<commands::DiagnosticMessageRequest>()
: factory.GetCreator<commands::DiagnosticMessageResponse>();
}
- default: {}
+ default: {
+ }
}
return factory.GetCreator<VehicleInfoInvalidCommand>();
}
@@ -226,7 +227,8 @@ VehicleInfoMobileCommandFactory::get_notification_creator(
case mobile_apis::FunctionID::OnVehicleDataID: {
return factory.GetCreator<commands::OnVehicleDataNotification>();
}
- default: {}
+ default: {
+ }
}
return factory.GetCreator<VehicleInfoInvalidCommand>();
}
@@ -254,7 +256,8 @@ app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_creator_factory(
}
break;
}
- default: {}
+ default: {
+ }
}
VehicleInfoCommandParams params = {application_manager_,
rpc_service_,
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_pending_resumption_handler.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_pending_resumption_handler.cc
index 6721d93658..c9affa5760 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_pending_resumption_handler.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_pending_resumption_handler.cc
@@ -205,7 +205,7 @@ void VehicleInfoPendingResumptionHandler::TriggerPendingResumption() {
}
}
-void VehicleInfoPendingResumptionHandler::on_event(
+void VehicleInfoPendingResumptionHandler::HandleOnEvent(
const application_manager::event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
sync_primitives::AutoLock lock(pending_resumption_lock_);
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 1a357a86ee..84bd9f6b04 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
@@ -88,25 +88,6 @@ bool VehicleInfoPlugin::Init(
return true;
}
-bool VehicleInfoPlugin::Init(
- application_manager::ApplicationManager& application_manager,
- application_manager::rpc_service::RPCService& rpc_service,
- application_manager::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state) {
- UNUSED(last_state);
- application_manager_ = &application_manager;
- custom_vehicle_data_manager_.reset(
- new CustomVehicleDataManagerImpl(policy_handler, rpc_service));
- command_factory_.reset(new vehicle_info_plugin::VehicleInfoCommandFactory(
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler,
- *(custom_vehicle_data_manager_.get())));
- return true;
-}
-
bool VehicleInfoPlugin::IsAbleToProcess(
const int32_t function_id, const commands::Command::CommandSource source) {
return command_factory_->IsAbleToProcess(function_id, source);
@@ -129,12 +110,22 @@ void VehicleInfoPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) {
SDL_LOG_AUTO_TRACE();
- if (plugins::ApplicationEvent::kApplicationRegistered == event) {
- application->AddExtension(
- std::make_shared<VehicleInfoAppExtension>(*this, *application));
- } else if ((plugins::ApplicationEvent::kDeleteApplicationData == event) ||
- (plugins::ApplicationEvent::kApplicationUnregistered == event)) {
- DeleteSubscriptions(application);
+ switch (event) {
+ case plugins::ApplicationEvent::kApplicationRegistered: {
+ application->AddExtension(
+ std::make_shared<VehicleInfoAppExtension>(*this, *application));
+ break;
+ }
+
+ case plugins::ApplicationEvent::kApplicationUnregistered:
+ case plugins::ApplicationEvent::kDeleteApplicationData: {
+ DeleteSubscriptions(application);
+ break;
+ }
+
+ default: {
+ break;
+ }
}
}
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 c9697d71f2..1073974324 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
@@ -64,7 +64,7 @@ set(LIBRARIES
HMI_API
MOBILE_API
connectionHandler
- vehicle_info_plugin
+ vehicle_info_plugin_static
SmartObjects
formatters
jsoncpp
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_type_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_type_request_test.cc
index 20bf34f2ca..75f5ea3b83 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_type_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_type_request_test.cc
@@ -99,7 +99,7 @@ TEST_F(
ASSERT_TRUE(command->Init());
command->Run();
- command->onTimeOut();
+ command->OnTimeOut();
}
} // namespace vi_get_vehicle_type_request
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
index f207faad77..5828630f24 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
@@ -210,7 +210,7 @@ TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
ASSERT_TRUE(command_->Init());
command_->Run();
- command_->onTimeOut();
+ command_->OnTimeOut();
}
} // namespace vi_is_ready_request
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/include/vehicle_info_plugin/commands/vi_commands_test.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/include/vehicle_info_plugin/commands/vi_commands_test.h
index ae25acea87..e7d73fc4f0 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/include/vehicle_info_plugin/commands/vi_commands_test.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/include/vehicle_info_plugin/commands/vi_commands_test.h
@@ -66,7 +66,7 @@ using ::smart_objects::SmartObject;
template <const CommandsTestMocks kIsNice = CommandsTestMocks::kNotNice>
class VICommandsTest : public CommandsTest<kIsNice> {
public:
- enum { kDefaultTimeout_ = 100 };
+ enum { kDefaultTimeout_ = 100, kDefaultTimeoutCompensation_ = 10 };
template <class Command>
std::shared_ptr<Command> CreateCommandVI() {
@@ -76,7 +76,7 @@ class VICommandsTest : public CommandsTest<kIsNice> {
template <class Command>
std::shared_ptr<Command> CreateCommandVI(MessageSharedPtr& msg) {
- InitCommandVI(kDefaultTimeout_);
+ InitCommandVI(kDefaultTimeout_, kDefaultTimeoutCompensation_);
vehicle_info_plugin::VehicleInfoCommandParams params = {
CommandsTest<kIsNice>::app_mngr_,
CommandsTest<kIsNice>::mock_rpc_service_,
@@ -90,11 +90,14 @@ class VICommandsTest : public CommandsTest<kIsNice> {
mock_custom_vehicle_data_manager_;
protected:
- void InitCommandVI(const uint32_t& timeout) {
+ void InitCommandVI(const uint32_t timeout, const uint32_t compensation) {
ON_CALL(CommandsTest<kIsNice>::app_mngr_, get_settings())
.WillByDefault(ReturnRef(CommandsTest<kIsNice>::app_mngr_settings_));
ON_CALL(CommandsTest<kIsNice>::app_mngr_settings_, default_timeout())
.WillByDefault(ReturnRef(timeout));
+ ON_CALL(CommandsTest<kIsNice>::app_mngr_settings_,
+ default_timeout_compensation())
+ .WillByDefault(ReturnRef(compensation));
}
};
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_info_pending_resumption_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_info_pending_resumption_test.cc
index 5b2f4d5e25..82c5aaeafa 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_info_pending_resumption_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_info_pending_resumption_test.cc
@@ -380,7 +380,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
raise_event(EventCheck(subscribed_correlation_id,
expected_data_in_event)));
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("speed"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
@@ -427,7 +427,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
expected_data_in_event)));
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("speed"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
@@ -469,7 +469,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
resumption_handler_->HandleResumptionSubscriptionRequest(*ext, *mock_app);
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("speed"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
@@ -506,7 +506,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
resumption_handler_->HandleResumptionSubscriptionRequest(*ext, *mock_app);
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("speed"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
@@ -550,7 +550,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest, TwoAppsOneSharedDataSuccess) {
resumption_handler_->HandleResumptionSubscriptionRequest(*ext, *mock_app);
resumption_handler_->HandleResumptionSubscriptionRequest(*ext2, *mock_app2);
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_TRUE(ext2->isSubscribedToVehicleInfo("gps"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
@@ -599,7 +599,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
resumption_handler_->HandleResumptionSubscriptionRequest(*ext, *mock_app);
resumption_handler_->HandleResumptionSubscriptionRequest(*ext2, *mock_app2);
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_TRUE(ext->isSubscribedToVehicleInfo("speed"));
EXPECT_TRUE(ext2->isSubscribedToVehicleInfo("gps"));
@@ -648,7 +648,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
resumption_handler_->HandleResumptionSubscriptionRequest(*ext, *mock_app);
resumption_handler_->HandleResumptionSubscriptionRequest(*ext2, *mock_app2);
// TODO check that raized the same fid and cid as subscribed
- resumption_handler_->on_event(event);
+ resumption_handler_->HandleOnEvent(event);
const std::map<std::string, hmi_apis::Common_VehicleDataResultCode::eType>
second_subscriptions_result = {
@@ -661,7 +661,7 @@ TEST_F(VehicleInfoPendingResumptionHandlerTest,
VehicleInfo_SubscribeVehicleData);
second_event.set_smart_object(second_response);
- resumption_handler_->on_event(second_event);
+ resumption_handler_->HandleOnEvent(second_event);
EXPECT_FALSE(ext->isSubscribedToVehicleInfo("gps"));
EXPECT_TRUE(ext2->isSubscribedToVehicleInfo("gps"));
EXPECT_EQ(ext->PendingSubscriptions().GetData().size(), 0u);
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
index d618e63e15..ed0fc37974 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -257,7 +257,7 @@ bool AppLaunchDataJson::DeleteOldestAppData() {
// Copy in temporary vector Json list without oldest record
int32_t i = 0;
- for (auto it = apps_list.begin(); it != apps_list.end(); ++it, i++) {
+ for (auto it = apps_list.begin(); it != apps_list.end(); ++it, ++i) {
if ((*it).isMember(strings::device_id) &&
(*it).isMember(strings::bundle_id) && (*it).isMember(strings::app_id) &&
(*it).isMember(strings::app_launch_last_session)) {
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index 8f7a1e2815..1d6ea8afe8 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -201,6 +201,7 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, keyboard_props_(nullptr)
, menu_title_(nullptr)
, menu_icon_(nullptr)
+ , menu_layout_(nullptr)
, tbt_show_command_(nullptr)
, commands_()
, commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
@@ -349,6 +350,11 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon()
return menu_icon_;
}
+const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_layout()
+ const {
+ return menu_layout_;
+}
+
smart_objects::SmartObject DynamicApplicationDataImpl::day_color_scheme()
const {
using namespace mobile_apis::PredefinedWindows;
@@ -467,6 +473,8 @@ void DynamicApplicationDataImpl::load_global_properties(
SetGlobalProperties(properties_so.getElement(strings::menu_icon),
&DynamicApplicationData::set_menu_icon);
+ SetGlobalProperties(properties_so.getElement(strings::menu_layout),
+ &DynamicApplicationData::set_menu_layout);
}
void DynamicApplicationDataImpl::set_help_prompt(
@@ -560,6 +568,14 @@ void DynamicApplicationDataImpl::set_menu_icon(
menu_icon_ = new smart_objects::SmartObject(menu_icon);
}
+void DynamicApplicationDataImpl::set_menu_layout(
+ const smart_objects::SmartObject& menu_layout) {
+ if (menu_layout_) {
+ delete menu_layout_;
+ }
+ menu_layout_ = new smart_objects::SmartObject(menu_layout);
+}
+
void DynamicApplicationDataImpl::set_day_color_scheme(
const smart_objects::SmartObject& color_scheme) {
using namespace mobile_apis::PredefinedWindows;
@@ -611,7 +627,7 @@ void DynamicApplicationDataImpl::set_display_capabilities(
} else if (window_id == 0) {
return index;
}
- index++;
+ ++index;
}
return -1;
};
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 2952fd5481..42afd93459 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -159,8 +159,7 @@ ApplicationImpl::ApplicationImpl(
set_name(app_name);
MarkUnregistered();
- // subscribe application to custom button by default
- SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
+
// load persistent files
LoadPersistentFiles();
@@ -205,6 +204,7 @@ void ApplicationImpl::ChangeSupportingAppHMIType() {
set_voice_communication_supported(false);
set_mobile_projection_enabled(false);
set_webengine_projection_enabled(false);
+ set_remote_control_supported(false);
const smart_objects::SmartObject& array_app_types = *app_types_;
uint32_t lenght_app_types = array_app_types.length();
@@ -225,6 +225,9 @@ void ApplicationImpl::ChangeSupportingAppHMIType() {
case mobile_apis::AppHMIType::WEB_VIEW:
set_webengine_projection_enabled(true);
break;
+ case mobile_apis::AppHMIType::REMOTE_CONTROL:
+ set_remote_control_supported(true);
+ break;
default:
break;
}
@@ -1303,6 +1306,7 @@ AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) {
}
bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
+ SDL_LOG_AUTO_TRACE();
if (!QueryInterface(extension->uid())) {
SDL_LOG_TRACE("Add extenstion to add id" << app_id() << " with uid "
<< extension->uid());
@@ -1313,12 +1317,18 @@ bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
}
bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) {
+ SDL_LOG_AUTO_TRACE();
auto it = std::find_if(
extensions_.begin(), extensions_.end(), [uid](AppExtensionPtr extension) {
return extension->uid() == uid;
});
- return it != extensions_.end();
+ if (extensions_.end() != it) {
+ extensions_.erase(it);
+ return true;
+ }
+
+ return false;
}
const std::list<AppExtensionPtr>& ApplicationImpl::Extensions() const {
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 948f7944d4..7a5d5fc0dc 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -51,6 +51,8 @@
#include "application_manager/mobile_message_handler.h"
#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/request_controller_impl.h"
+#include "application_manager/request_timeout_handler_impl.h"
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/rpc_handler_impl.h"
#include "application_manager/rpc_protection_manager_impl.h"
@@ -170,7 +172,10 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, connection_handler_(NULL)
, policy_handler_(new policy::PolicyHandler(policy_settings, *this))
, protocol_handler_(NULL)
- , request_ctrl_(am_settings)
+ , request_timeout_handler_(
+ new request_controller::RequestTimeoutHandlerImpl(*this))
+ , request_ctrl_(new request_controller::RequestControllerImpl(
+ am_settings, *request_timeout_handler_, event_dispatcher_))
, mobile_correlation_id_(0)
, correlation_id_(0)
, max_correlation_id_(UINT_MAX)
@@ -215,7 +220,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
std::make_shared<RPCProtectionManagerImpl>(*policy_handler_);
policy_handler_->add_listener(rpc_protection_manager.get());
rpc_service_.reset(new rpc_service::RPCServiceImpl(*this,
- request_ctrl_,
+ *request_ctrl_,
protocol_handler_,
hmi_handler_,
*commands_holder_,
@@ -237,22 +242,21 @@ ApplicationManagerImpl::~ApplicationManagerImpl() {
RemovePolicyObserver(this);
{
- sync_primitives::AutoLock lock(close_app_timer_pool_lock_);
- close_app_timer_pool_.clear();
+ sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
+ navi_app_to_stop_.clear();
}
{
- sync_primitives::AutoLock lock(end_stream_timer_pool_lock_);
- end_stream_timer_pool_.clear();
+ sync_primitives::AutoLock lock(navi_app_to_end_stream_lock_);
+ navi_app_to_end_stream_.clear();
}
{
- sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- navi_app_to_stop_.clear();
+ sync_primitives::AutoLock lock(streaming_timer_pool_lock_);
+ streaming_timer_pool_.clear();
}
- navi_app_to_end_stream_.clear();
-
+ clear_pool_timer_.Stop();
secondary_transport_devices_cache_.clear();
}
@@ -304,13 +308,6 @@ ApplicationSharedPtr ApplicationManagerImpl::pending_application_by_policy_id(
return FindPendingApp(accessor, finder);
}
-ApplicationSharedPtr ApplicationManagerImpl::application_by_name(
- const std::string& app_name) const {
- AppNamePredicate finder(app_name);
- DataAccessor<ApplicationSet> accessor = applications();
- return FindApp(accessor, finder);
-}
-
ApplicationSharedPtr
ApplicationManagerImpl::reregister_application_by_policy_id(
const std::string& policy_app_id) const {
@@ -458,6 +455,7 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
sync_primitives::AutoLock lock(applications_list_lock_ptr_);
const mobile_apis::HMILevel::eType default_level = GetDefaultHmiLevel(app);
state_ctrl_.OnApplicationRegistered(app, default_level);
+ commands_holder_->Resume(app, CommandHolder::CommandType::kMobileCommand);
}
void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
@@ -614,7 +612,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
}
HmiStatePtr initial_state =
- CreateRegularState(std::shared_ptr<Application>(application),
+ CreateRegularState(ApplicationSharedPtr(application),
mobile_apis::WindowType::MAIN,
mobile_apis::HMILevel::INVALID_ENUM,
mobile_apis::AudioStreamingState::INVALID_ENUM,
@@ -1119,7 +1117,7 @@ void ApplicationManagerImpl::RefreshCloudAppInformation() {
}
// Delete the cloud device
connection_handler().RemoveCloudAppDevice(app->device());
- removed_app_count++;
+ ++removed_app_count;
}
// Update app list if disabled apps were removed
@@ -1202,6 +1200,19 @@ void ApplicationManagerImpl::CreatePendingApplication(
application->set_hybrid_app_preference(hybrid_app_preference_enum);
application->set_cloud_app_certificate(app_properties.certificate);
+ HmiStatePtr initial_state =
+ CreateRegularState(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(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ std::string(), // should not be tracked for main window
+ initial_state);
+
{
sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
SDL_LOG_DEBUG(
@@ -1286,6 +1297,19 @@ void ApplicationManagerImpl::CreatePendingLocalApplication(
application->set_hybrid_app_preference(hybrid_app_preference_enum);
application->set_cloud_app_certificate(app_properties.certificate);
+ HmiStatePtr initial_state =
+ CreateRegularState(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(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
+ std::string(), // should not be tracked for main window
+ initial_state);
+
sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
apps_to_register_.insert(application);
SDL_LOG_DEBUG("Insert " << application->name().c_str()
@@ -1364,7 +1388,7 @@ ApplicationManagerImpl::GetCloudAppConnectionStatus(
uint32_t ApplicationManagerImpl::GetNextMobileCorrelationID() {
if (mobile_correlation_id_ < max_correlation_id_) {
- mobile_correlation_id_++;
+ ++mobile_correlation_id_;
} else {
mobile_correlation_id_ = 0;
}
@@ -1374,7 +1398,7 @@ uint32_t ApplicationManagerImpl::GetNextMobileCorrelationID() {
uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
if (correlation_id_ < max_correlation_id_) {
- correlation_id_++;
+ ++correlation_id_;
} else {
correlation_id_ = 0;
}
@@ -1720,7 +1744,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
}
for (const auto& app : wait_list) {
- request_ctrl_.terminateAppRequests(app->app_id());
+ request_ctrl_->TerminateAppRequests(app->app_id());
resume_ctrl_->SaveApplication(app);
}
@@ -1848,7 +1872,7 @@ bool ApplicationManagerImpl::CheckResumptionRequiredTransportAvailable(
return false;
} else {
// check all AppHMITypes that the app has
- for (size_t i = 0; i < app_types_array->length(); i++) {
+ for (size_t i = 0; i < app_types_array->length(); ++i) {
std::string app_type_string =
EnumToString(static_cast<mobile_apis::AppHMIType::eType>(
app_types_array->getElement(i).asUInt()));
@@ -1915,10 +1939,11 @@ bool ApplicationManagerImpl::StartNaviService(
NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
if (navi_service_status_.end() == it) {
- std::pair<NaviServiceStatusMap::iterator, bool> res =
- navi_service_status_.insert(
- std::pair<uint32_t, std::pair<bool, bool> >(
- app_id, std::make_pair(false, false)));
+ NaviServiceStatusDescriptor descriptor({false, false});
+ auto res = navi_service_status_.insert(
+ std::pair<uint32_t, NaviServiceStatusDescriptor>(app_id,
+ descriptor));
+
if (!res.second) {
SDL_LOG_WARN("Navi service refused");
return false;
@@ -2007,19 +2032,27 @@ void ApplicationManagerImpl::OnStreamingConfigurationSuccessful(
// Fill NaviServices map. Set true to first value of pair if
// we've started video service or to second value if we've
// started audio service
- service_type == protocol_handler::ServiceType::kMobileNav
- ? it->second.first = true
- : it->second.second = true;
+ if (protocol_handler::ServiceType::kMobileNav == service_type) {
+ it->second.is_video_service_active_ = true;
+ }
+
+ if (protocol_handler::ServiceType::kAudio == service_type) {
+ it->second.is_audio_service_active_ = true;
+ }
{
sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- for (size_t i = 0; i < navi_app_to_stop_.size(); ++i) {
- if (app_id == navi_app_to_stop_[i]) {
- sync_primitives::AutoLock lock(close_app_timer_pool_lock_);
- close_app_timer_pool_.erase(close_app_timer_pool_.begin() + i);
- navi_app_to_stop_.erase(navi_app_to_stop_.begin() + i);
- break;
- }
+ auto it = std::find_if(
+ navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(),
+ [&app_id, &service_type](const NaviServiceDescriptor& desc) {
+ return app_id == desc.app_id_ && service_type == desc.service_type_;
+ });
+
+ if (it != navi_app_to_stop_.end()) {
+ SDL_LOG_DEBUG("Removing app descriptor for service "
+ << service_type << " from map to stop");
+ navi_app_to_stop_.erase(it);
}
}
}
@@ -2029,10 +2062,18 @@ void ApplicationManagerImpl::OnStreamingConfigurationSuccessful(
// Fix: For wifi Secondary
// Should erase appid from deque of ForbidStreaming() push in the last time
- std::deque<uint32_t>::const_iterator iter = std::find(
- navi_app_to_end_stream_.begin(), navi_app_to_end_stream_.end(), app_id);
- if (navi_app_to_end_stream_.end() != iter) {
- navi_app_to_end_stream_.erase(iter);
+ {
+ sync_primitives::AutoLock lock(navi_app_to_end_stream_lock_);
+ auto it = std::find_if(
+ navi_app_to_end_stream_.begin(),
+ navi_app_to_end_stream_.end(),
+ [&app_id, &service_type](const NaviServiceDescriptor& desc) {
+ return app_id == desc.app_id_ && service_type == desc.service_type_;
+ });
+
+ if (navi_app_to_end_stream_.end() != it) {
+ navi_app_to_end_stream_.erase(it);
+ }
}
}
@@ -2063,14 +2104,15 @@ void ApplicationManagerImpl::StopNaviService(
return;
} else {
// Fix: Repeated tests are not executed after they have stopped for Navi
- if (false == it->second.first &&
+ if (false == it->second.is_video_service_active_ &&
ServiceType::kMobileNav == service_type) {
SDL_LOG_DEBUG("appId: " << app_id << "Navi had stopped");
return;
}
// Fix: Repeated tests are not executed after they have stopped for Audio
- if (false == it->second.second && ServiceType::kAudio == service_type) {
+ if (false == it->second.is_audio_service_active_ &&
+ ServiceType::kAudio == service_type) {
SDL_LOG_DEBUG("appId: " << app_id << "Audio had stopped");
return;
}
@@ -2079,8 +2121,13 @@ void ApplicationManagerImpl::StopNaviService(
// stopped audio service
SDL_LOG_DEBUG("appId: " << app_id << " service_type: " << service_type
<< " to stopped");
- service_type == ServiceType::kMobileNav ? it->second.first = false
- : it->second.second = false;
+ if (service_type == ServiceType::kMobileNav) {
+ it->second.is_video_service_active_ = false;
+ }
+
+ if (service_type == ServiceType::kAudio) {
+ it->second.is_audio_service_active_ = false;
+ }
}
// Fix: For wifi Secondary
// undisposed data active the VPMService restart again,
@@ -2097,7 +2144,7 @@ void ApplicationManagerImpl::StopNaviService(
app->set_audio_streaming_allowed(false);
}
// push_back for judge in ForbidStreaming(),
- StartEndStreamTimer(app_id);
+ StartEndStreamTimer(app_id, service_type);
}
ApplicationSharedPtr app = application(app_id);
@@ -2289,12 +2336,32 @@ bool ApplicationManagerImpl::HandleRejectedServiceStatus(
sync_primitives::AutoLock lock(navi_service_status_lock_);
auto app_services = navi_service_status_.find(app->app_id());
if (navi_service_status_.end() != app_services) {
- navi_service_status_.erase(app_services);
+ if (hmi_apis::Common_ServiceType::VIDEO == service_type) {
+ app_services->second.is_video_service_active_ = false;
+ }
+
+ if (hmi_apis::Common_ServiceType::AUDIO == service_type) {
+ app_services->second.is_audio_service_active_ = false;
+ }
+
+ if (!app_services->second.is_audio_service_active_ &&
+ !app_services->second.is_video_service_active_) {
+ SDL_LOG_DEBUG("The start of service"
+ << service_type << " for appID: " << app
+ << " is failed. Service info has been removed");
+ navi_service_status_.erase(app_services);
+ return true;
+ } else {
+ SDL_LOG_WARN(
+ "Another streaming session is still active. Don't stop the "
+ "app");
+ return false;
+ }
}
}
- SDL_LOG_DEBUG("The start of service"
- << service_type << " for appID: " << app
- << " is failed. Service info has been removed");
+
+ SDL_LOG_DEBUG("The start of service" << service_type << " for appID: "
+ << app << " is failed. Rejecting");
return true;
}
case hmi_apis::Common_ServiceType::RPC: {
@@ -2406,7 +2473,6 @@ bool ApplicationManagerImpl::OnHandshakeDone(
SSLContext::Handshake_Result_CertExpired,
SSLContext::Handshake_Result_CertNotSigned,
SSLContext::Handshake_Result_AppIDMismatch,
- SSLContext::Handshake_Result_AppNameMismatch,
SSLContext::Handshake_Result_NotYetValid)) {
app->usage_report().RecordTLSError();
}
@@ -2482,7 +2548,7 @@ void ApplicationManagerImpl::StartDevicesDiscovery() {
void ApplicationManagerImpl::TerminateRequest(const uint32_t connection_key,
const uint32_t corr_id,
const int32_t function_id) {
- request_ctrl_.TerminateRequest(corr_id, connection_key, function_id, true);
+ request_ctrl_->TerminateRequest(corr_id, connection_key, function_id, true);
}
void ApplicationManagerImpl::RemoveHMIFakeParameters(
@@ -2502,11 +2568,6 @@ void ApplicationManagerImpl::RemoveHMIFakeParameters(
(*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = mobile_function_id;
}
-bool ApplicationManagerImpl::Init(resumption::LastState&,
- media_manager::MediaManager*) {
- return false;
-}
-
bool ApplicationManagerImpl::Init(
resumption::LastStateWrapperPtr last_state_wrapper,
media_manager::MediaManager* media_manager) {
@@ -2601,7 +2662,7 @@ bool ApplicationManagerImpl::Stop() {
} catch (...) {
SDL_LOG_ERROR("An error occurred during unregistering applications.");
}
- request_ctrl_.DestroyThreadpool();
+ request_ctrl_->Stop();
// for PASA customer policy backup should happen :AllApp(SUSPEND)
SDL_LOG_DEBUG("Unloading policy library.");
@@ -2772,8 +2833,16 @@ void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data,
if (app_data[json::languages][specific_idx][cur_vr_lang].keyExists(
json::ttsName)) {
SDL_LOG_DEBUG("Get ttsName from " << cur_vr_lang << " language");
- ttsName =
+ ttsName = SmartObject(SmartType_Array);
+ ttsName[0] =
app_data[json::languages][specific_idx][cur_vr_lang][json::ttsName];
+
+ } else if (app_data[json::languages][default_idx][json::default_].keyExists(
+ json::ttsName)) {
+ SDL_LOG_DEBUG("Get ttsName from default language");
+ ttsName = SmartObject(SmartType_Array);
+ ttsName[0] =
+ app_data[json::languages][default_idx][json::default_][json::ttsName];
} else {
SDL_LOG_DEBUG("No data for ttsName for " << cur_vr_lang << " language");
}
@@ -2783,6 +2852,11 @@ void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data,
SDL_LOG_DEBUG("Get vrSynonyms from " << cur_vr_lang << " language");
vrSynonym =
app_data[json::languages][specific_idx][cur_vr_lang][json::vrSynonyms];
+ } else if (app_data[json::languages][default_idx][json::default_].keyExists(
+ json::vrSynonyms)) {
+ SDL_LOG_DEBUG("Get vrSynonyms from default language");
+ vrSynonym = app_data[json::languages][default_idx][json::default_]
+ [json::vrSynonyms];
} else {
SDL_LOG_DEBUG("No data for vrSynonyms for " << cur_vr_lang << " language");
}
@@ -2928,21 +3002,21 @@ void ApplicationManagerImpl::SetTelemetryObserver(
}
#endif // TELEMETRY_MONITOR
-void ApplicationManagerImpl::addNotification(const CommandSharedPtr ptr) {
- request_ctrl_.addNotification(ptr);
+void ApplicationManagerImpl::AddNotification(const CommandSharedPtr ptr) {
+ request_ctrl_->AddNotification(ptr);
}
-void ApplicationManagerImpl::removeNotification(
+void ApplicationManagerImpl::RemoveNotification(
const commands::Command* notification) {
- request_ctrl_.removeNotification(notification);
+ request_ctrl_->RemoveNotification(notification);
}
-void ApplicationManagerImpl::updateRequestTimeout(
+void ApplicationManagerImpl::UpdateRequestTimeout(
uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value) {
SDL_LOG_AUTO_TRACE();
- request_ctrl_.updateRequestTimeout(
+ request_ctrl_->UpdateRequestTimeout(
connection_key, mobile_correlation_id, new_timeout_value);
}
@@ -2952,7 +3026,7 @@ void ApplicationManagerImpl::IncreaseForwardedRequestTimeout(
<< get_settings().rpc_pass_through_timeout());
uint32_t new_timeout_value = get_settings().default_timeout() +
get_settings().rpc_pass_through_timeout();
- request_ctrl_.updateRequestTimeout(
+ request_ctrl_->UpdateRequestTimeout(
connection_key, mobile_correlation_id, new_timeout_value);
}
@@ -3041,11 +3115,14 @@ void ApplicationManagerImpl::HeadUnitReset(
void ApplicationManagerImpl::ClearAppsPersistentData() {
SDL_LOG_AUTO_TRACE();
typedef std::vector<std::string> FilesList;
- const std::string apps_info_storage_file = get_settings().app_info_storage();
- file_system::DeleteFile(apps_info_storage_file);
-
const std::string storage_folder = get_settings().app_storage_folder();
+ const std::string apps_info_storage_file =
+ !storage_folder.empty()
+ ? storage_folder + "/" + get_settings().app_info_storage()
+ : get_settings().app_info_storage();
+ file_system::DeleteFile(apps_info_storage_file);
+
FilesList files = file_system::ListFiles(storage_folder);
FilesList::iterator element_to_skip =
std::find(files.begin(), files.end(), "policy.sqlite");
@@ -3171,7 +3248,12 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
if (is_ignition_off) {
resume_controller().OnIgnitionOff();
}
- request_ctrl_.terminateAllHMIRequests();
+ request_ctrl_->TerminateAllHMIRequests();
+
+ {
+ sync_primitives::AutoLock lock(expired_button_requests_lock_);
+ expired_button_requests_.clear();
+ }
}
void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
@@ -3271,11 +3353,10 @@ void ApplicationManagerImpl::UnregisterApplication(
}
if (!app_to_remove) {
SDL_LOG_ERROR("Cant find application with app_id = " << app_id);
-
// Just to terminate RAI in case of connection is dropped (rare case)
// App won't be unregistered since RAI has not been started yet
SDL_LOG_DEBUG("Trying to terminate possible RAI request.");
- request_ctrl_.terminateAppRequests(app_id);
+ request_ctrl_->TerminateAppRequests(app_id);
return;
}
@@ -3339,7 +3420,8 @@ void ApplicationManagerImpl::UnregisterApplication(
};
plugin_manager_->ForEachPlugin(on_app_unregistered);
- request_ctrl_.terminateAppRequests(app_id);
+
+ request_ctrl_->TerminateAppRequests(app_id);
const bool is_applications_list_empty = applications().GetData().empty();
if (is_applications_list_empty) {
@@ -3424,7 +3506,7 @@ void ApplicationManagerImpl::OnLowVoltage() {
is_low_voltage_ = true;
resume_ctrl_->SaveLowVoltageTime();
resume_ctrl_->StopSavePersistentDataTimer();
- request_ctrl_.OnLowVoltage();
+ request_ctrl_->OnLowVoltage();
}
bool ApplicationManagerImpl::IsLowVoltage() const {
@@ -3436,7 +3518,7 @@ void ApplicationManagerImpl::OnWakeUp() {
SDL_LOG_AUTO_TRACE();
resume_ctrl_->SaveWakeUpTime();
resume_ctrl_->StartSavePersistentDataTimer();
- request_ctrl_.OnWakeUp();
+ request_ctrl_->OnWakeUp();
is_low_voltage_ = false;
}
@@ -3458,6 +3540,7 @@ bool ApplicationManagerImpl::HMIStateAllowsStreaming(
using namespace mobile_apis::HMILevel;
using namespace mobile_apis::PredefinedWindows;
using namespace mobile_apis::VideoStreamingState;
+ using namespace mobile_apis::AudioStreamingState;
using namespace helpers;
ApplicationSharedPtr app = application(app_id);
@@ -3471,7 +3554,10 @@ bool ApplicationManagerImpl::HMIStateAllowsStreaming(
Compare<mobile_apis::HMILevel::eType, EQ, ONE>(
hmi_state->hmi_level(), HMI_FULL, HMI_LIMITED);
const bool allow_streaming_by_streaming_state =
- hmi_state->video_streaming_state() == STREAMABLE;
+ (service_type == protocol_handler::SERVICE_TYPE_NAVI &&
+ hmi_state->video_streaming_state() == STREAMABLE) ||
+ (service_type == protocol_handler::SERVICE_TYPE_AUDIO &&
+ hmi_state->audio_streaming_state() != NOT_AUDIBLE);
return allow_streaming_by_hmi_level && allow_streaming_by_streaming_state;
}
@@ -3499,9 +3585,11 @@ bool ApplicationManagerImpl::CanAppStream(
return HMIStateAllowsStreaming(app_id, service_type) && is_allowed;
}
-void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
+void ApplicationManagerImpl::ForbidStreaming(
+ uint32_t app_id, protocol_handler::ServiceType service_type) {
using namespace mobile_apis::AppInterfaceUnregisteredReason;
using namespace mobile_apis::Result;
+ using namespace protocol_handler;
SDL_LOG_AUTO_TRACE();
@@ -3512,67 +3600,37 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
return;
}
+ bool app_to_stop_found = false;
+ bool app_to_end_stream_found = false;
{
sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- if (navi_app_to_stop_.end() != std::find(navi_app_to_stop_.begin(),
- navi_app_to_stop_.end(),
- app_id) ||
- navi_app_to_end_stream_.end() !=
- std::find(navi_app_to_end_stream_.begin(),
- navi_app_to_end_stream_.end(),
- app_id)) {
- return;
- }
- }
- bool unregister = false;
- {
- sync_primitives::AutoLock lock(navi_service_status_lock_);
+ auto it = std::find_if(
+ navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(),
+ [&app_id, &service_type](const NaviServiceDescriptor& desc) {
+ return app_id == desc.app_id_ && service_type == desc.service_type_;
+ });
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it ||
- (!it->second.first && !it->second.second)) {
- unregister = true;
- }
- }
- if (unregister) {
- rpc_service_->ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, PROTOCOL_VIOLATION),
- commands::Command::SOURCE_SDL);
- UnregisterApplication(app_id, ABORTED);
- return;
+ app_to_stop_found = navi_app_to_stop_.end() != it;
}
- EndNaviServices(app_id);
-}
-void ApplicationManagerImpl::ForbidStreaming(
- uint32_t app_id, protocol_handler::ServiceType service_type) {
- using namespace mobile_apis::AppInterfaceUnregisteredReason;
- using namespace mobile_apis::Result;
- using namespace protocol_handler;
-
- SDL_LOG_AUTO_TRACE();
+ {
+ sync_primitives::AutoLock lock(navi_app_to_end_stream_lock_);
+ auto it_stream = std::find_if(
+ navi_app_to_end_stream_.begin(),
+ navi_app_to_end_stream_.end(),
+ [&app_id, &service_type](const NaviServiceDescriptor& desc) {
+ return app_id == desc.app_id_ && service_type == desc.service_type_;
+ });
- ApplicationSharedPtr app = application(app_id);
- if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
- SDL_LOG_DEBUG(
- "There is no navi or projection application with id: " << app_id);
- return;
+ app_to_end_stream_found = navi_app_to_end_stream_.end() != it_stream;
}
- {
- sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
-
- if (navi_app_to_stop_.end() != std::find(navi_app_to_stop_.begin(),
- navi_app_to_stop_.end(),
- app_id) ||
- navi_app_to_end_stream_.end() !=
- std::find(navi_app_to_end_stream_.begin(),
- navi_app_to_end_stream_.end(),
- app_id)) {
- return;
- }
+ if (app_to_stop_found || app_to_end_stream_found) {
+ SDL_LOG_DEBUG("App " << app_id << " service " << service_type
+ << " is about to stop. Ignored");
+ return;
}
bool unregister = false;
@@ -3580,8 +3638,12 @@ void ApplicationManagerImpl::ForbidStreaming(
sync_primitives::AutoLock lock(navi_service_status_lock_);
NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+
if (navi_service_status_.end() == it ||
- (!it->second.first && !it->second.second)) {
+ (protocol_handler::ServiceType::kAudio == service_type &&
+ !it->second.is_audio_service_active_) ||
+ (protocol_handler::ServiceType::kMobileNav == service_type &&
+ !it->second.is_video_service_active_)) {
unregister = true;
}
}
@@ -3605,7 +3667,7 @@ void ApplicationManagerImpl::ForbidStreaming(
return;
}
- EndNaviServices(app_id);
+ EndService(app_id, service_type);
}
void ApplicationManagerImpl::OnAppStreaming(
@@ -3629,49 +3691,8 @@ void ApplicationManagerImpl::OnAppStreaming(
}
}
-void ApplicationManagerImpl::OnAppStreaming(
- uint32_t app_id,
- protocol_handler::ServiceType service_type,
- const Application::StreamingState new_state) {
- SDL_LOG_AUTO_TRACE();
-
- ApplicationSharedPtr app = application(app_id);
- if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
- SDL_LOG_DEBUG(
- " There is no navi or projection application with id: " << app_id);
- return;
- }
- DCHECK_OR_RETURN_VOID(media_manager_);
-
- SDL_LOG_DEBUG("New state for service " << static_cast<int32_t>(service_type)
- << " is "
- << static_cast<int32_t>(new_state));
- switch (new_state) {
- case Application::StreamingState::kStopped: {
- // Stop activity in media_manager_ when service is stopped
- // State controller has been already notified by kSuspended event
- // received before
- media_manager_->StopStreaming(app_id, service_type);
- break;
- }
-
- case Application::StreamingState::kStarted: {
- // Apply temporary streaming state and start activity in media_manager_
- state_ctrl_.OnVideoStreamingStarted(app);
- media_manager_->StartStreaming(app_id, service_type);
- break;
- }
-
- case Application::StreamingState::kSuspended: {
- // Don't stop activity in media_manager_ in that case
- // Just cancel the temporary streaming state
- state_ctrl_.OnVideoStreamingStopped(app);
- break;
- }
- }
-}
-
-void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
+void ApplicationManagerImpl::EndService(
+ const uint32_t app_id, const protocol_handler::ServiceType service_type) {
using namespace protocol_handler;
SDL_LOG_AUTO_TRACE();
@@ -3684,6 +3705,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
bool end_video = false;
bool end_audio = false;
+
{
sync_primitives::AutoLock lock(navi_service_status_lock_);
@@ -3692,8 +3714,11 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
SDL_LOG_ERROR("No info about navi servicies for app");
return;
}
- end_video = it->second.first;
- end_audio = it->second.second;
+
+ end_video = service_type == ServiceType::kMobileNav &&
+ it->second.is_video_service_active_;
+ end_audio = service_type == ServiceType::kAudio &&
+ it->second.is_audio_service_active_;
}
if (connection_handler_) {
@@ -3707,25 +3732,41 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
connection_handler().SendEndService(app_id, ServiceType::kAudio);
app->StopStreamingForce(ServiceType::kAudio);
}
+ }
- DisallowStreaming(app_id);
+ DisallowStreaming(app_id, service_type);
- {
- sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- navi_app_to_stop_.push_back(app_id);
- }
+ {
+ sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- TimerSPtr close_timer(std::make_shared<timer::Timer>(
- "CloseNaviAppTimer",
- new TimerTaskImpl<ApplicationManagerImpl>(
- this, &ApplicationManagerImpl::CloseNaviApp)));
- close_timer->Start(navi_close_app_timeout_, timer::kSingleShot);
+ auto it = std::find_if(
+ navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(),
+ [&app_id, &service_type](const NaviServiceDescriptor& desc) {
+ return app_id == desc.app_id_ && service_type == desc.service_type_;
+ });
+
+ if (navi_app_to_stop_.end() == it) {
+ TimerSPtr close_timer(std::make_shared<timer::Timer>(
+ "CloseNaviAppTimer",
+ new TimerTaskImpl<ApplicationManagerImpl>(
+ this, &ApplicationManagerImpl::CloseNaviApp)));
+ NaviServiceDescriptor descriptor({app_id, service_type, close_timer});
+ navi_app_to_stop_.push_back(descriptor);
- sync_primitives::AutoLock lock(close_app_timer_pool_lock_);
- close_app_timer_pool_.push_back(close_timer);
+ close_timer->Start(navi_close_app_timeout_, timer::kSingleShot);
+ }
}
}
+void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
+ using namespace protocol_handler;
+ SDL_LOG_AUTO_TRACE();
+
+ EndService(app_id, ServiceType::kAudio);
+ EndService(app_id, ServiceType::kMobileNav);
+}
+
void ApplicationManagerImpl::OnHMIStateChanged(const uint32_t app_id,
const HmiStatePtr from,
const HmiStatePtr to) {
@@ -3858,7 +3899,8 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
<< std::boolalpha << end_streaming_by_streaming_state
<< "; by hmi level: " << std::boolalpha
<< start_timer_by_hmi_level);
- StartEndStreamTimer(app_id);
+ StartEndStreamTimer(app_id, protocol_handler::ServiceType::kAudio);
+ StartEndStreamTimer(app_id, protocol_handler::ServiceType::kMobileNav);
return;
}
@@ -3939,38 +3981,32 @@ bool ApplicationManagerImpl::ResetVrHelpTitleItems(
return true;
}
-void ApplicationManagerImpl::StartEndStreamTimer(const uint32_t app_id) {
+void ApplicationManagerImpl::ClearTimerPool() {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(streaming_timer_pool_lock_);
+ streaming_timer_pool_.clear();
+}
+
+void ApplicationManagerImpl::StartEndStreamTimer(
+ const uint32_t app_id, const protocol_handler::ServiceType service_type) {
SDL_LOG_DEBUG("Start end stream timer for app " << app_id);
- navi_app_to_end_stream_.push_back(app_id);
- TimerSPtr end_stream_timer(std::make_shared<timer::Timer>(
- "DisallowAppStreamTimer",
- new TimerTaskImpl<ApplicationManagerImpl>(
- this, &ApplicationManagerImpl::EndNaviStreaming)));
- end_stream_timer->Start(navi_end_stream_timeout_, timer::kSingleShot);
- sync_primitives::AutoLock lock(end_stream_timer_pool_lock_);
- end_stream_timer_pool_.push_back(end_stream_timer);
-}
+ if (helpers::
+ Compare<protocol_handler::ServiceType, helpers::EQ, helpers::ONE>(
+ service_type,
+ protocol_handler::ServiceType::kAudio,
+ protocol_handler::ServiceType::kMobileNav)) {
+ TimerSPtr end_stream_timer = std::make_shared<timer::Timer>(
+ "DisallowAppStreamTimer",
+ new TimerTaskImpl<ApplicationManagerImpl>(
+ this, &ApplicationManagerImpl::EndStreaming));
-void ApplicationManagerImpl::ClearTimerPool() {
- SDL_LOG_AUTO_TRACE();
- {
- sync_primitives::AutoLock lock(close_app_timer_pool_lock_);
+ sync_primitives::AutoLock lock(navi_app_to_end_stream_lock_);
- close_app_timer_pool_.erase(
- std::remove_if(close_app_timer_pool_.begin(),
- close_app_timer_pool_.end(),
- [](TimerSPtr timer) { return !timer->is_running(); }),
- close_app_timer_pool_.end());
- }
+ NaviServiceDescriptor descriptor({app_id, service_type, end_stream_timer});
+ navi_app_to_end_stream_.push_back(descriptor);
- {
- sync_primitives::AutoLock lock(end_stream_timer_pool_lock_);
- end_stream_timer_pool_.erase(
- std::remove_if(end_stream_timer_pool_.begin(),
- end_stream_timer_pool_.end(),
- [](TimerSPtr timer) { return !timer->is_running(); }),
- end_stream_timer_pool_.end());
+ end_stream_timer->Start(navi_end_stream_timeout_, timer::kSingleShot);
}
}
@@ -3978,58 +4014,88 @@ void ApplicationManagerImpl::CloseNaviApp() {
SDL_LOG_AUTO_TRACE();
using namespace mobile_apis::AppInterfaceUnregisteredReason;
using namespace mobile_apis::Result;
- uint32_t app_id;
+ NaviServiceDescriptor descriptor(
+ {0, protocol_handler::ServiceType::kInvalidServiceType, nullptr});
{
sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
DCHECK_OR_RETURN_VOID(!navi_app_to_stop_.empty());
- app_id = navi_app_to_stop_.front();
+ descriptor = navi_app_to_stop_.front();
navi_app_to_stop_.pop_front();
}
- bool unregister = false;
- {
- sync_primitives::AutoLock lock(navi_service_status_lock_);
+ if (descriptor.app_id_ > 0) {
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- if (it->second.first || it->second.second) {
- unregister = true;
- navi_service_status_.erase(it);
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(descriptor.app_id_);
+ if (navi_service_status_.end() != it) {
+ if (protocol_handler::ServiceType::kMobileNav ==
+ descriptor.service_type_ &&
+ it->second.is_video_service_active_) {
+ it->second.is_video_service_active_ = false;
+ }
+
+ if (protocol_handler::ServiceType::kAudio == descriptor.service_type_ &&
+ it->second.is_audio_service_active_) {
+ it->second.is_audio_service_active_ = false;
+ }
+
+ if (!it->second.is_audio_service_active_ &&
+ !it->second.is_video_service_active_) {
+ navi_service_status_.erase(it);
+ }
}
}
- }
- if (unregister) {
- SDL_LOG_INFO("App haven't answered for EndService. Unregister it.");
- rpc_service_->ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, PROTOCOL_VIOLATION),
- commands::Command::SOURCE_SDL);
- UnregisterApplication(app_id, ABORTED);
+
+ {
+ sync_primitives::AutoLock lock(streaming_timer_pool_lock_);
+ streaming_timer_pool_.push_back(descriptor.timer_to_stop_service_);
+ }
}
}
-void ApplicationManagerImpl::EndNaviStreaming() {
+void ApplicationManagerImpl::EndStreaming() {
SDL_LOG_AUTO_TRACE();
using namespace mobile_apis::AppInterfaceUnregisteredReason;
using namespace mobile_apis::Result;
+ using namespace protocol_handler;
- if (!navi_app_to_end_stream_.empty()) {
- const uint32_t app_id = navi_app_to_end_stream_.front();
+ NaviServiceDescriptor descriptor(
+ {0, protocol_handler::ServiceType::kInvalidServiceType, nullptr});
+ {
+ sync_primitives::AutoLock lock(navi_app_to_end_stream_lock_);
+ DCHECK_OR_RETURN_VOID(!navi_app_to_end_stream_.empty());
+ descriptor = navi_app_to_end_stream_.front();
navi_app_to_end_stream_.pop_front();
+ }
+ if (descriptor.app_id_ > 0) {
{
sync_primitives::AutoLock lock(navi_app_to_stop_lock_);
- if (navi_app_to_stop_.end() == std::find(navi_app_to_stop_.begin(),
- navi_app_to_stop_.end(),
- app_id)) {
- DisallowStreaming(app_id);
+ auto it =
+ std::find_if(navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(),
+ [&descriptor](const NaviServiceDescriptor& desc) {
+ return descriptor.app_id_ == desc.app_id_ &&
+ descriptor.service_type_ == desc.service_type_;
+ });
+
+ if (navi_app_to_stop_.end() == it) {
+ DisallowStreaming(descriptor.app_id_, descriptor.service_type_);
}
}
+
+ {
+ sync_primitives::AutoLock lock(streaming_timer_pool_lock_);
+ streaming_timer_pool_.push_back(descriptor.timer_to_stop_service_);
+ }
}
}
-void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
+void ApplicationManagerImpl::DisallowStreaming(
+ const uint32_t app_id, const protocol_handler::ServiceType service_type) {
using namespace protocol_handler;
SDL_LOG_AUTO_TRACE();
@@ -4044,10 +4110,12 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
if (navi_service_status_.end() != it) {
- if (it->second.first) {
+ if (it->second.is_video_service_active_ &&
+ service_type == ServiceType::kMobileNav) {
app->set_video_streaming_allowed(false);
}
- if (it->second.second) {
+ if (it->second.is_audio_service_active_ &&
+ service_type == ServiceType::kAudio) {
app->set_audio_streaming_allowed(false);
}
}
@@ -4069,10 +4137,10 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
if (navi_service_status_.end() != it) {
- if (it->second.first) {
+ if (it->second.is_video_service_active_) {
app->set_video_streaming_allowed(true);
}
- if (it->second.second) {
+ if (it->second.is_audio_service_active_) {
app->set_audio_streaming_allowed(true);
}
}
@@ -4451,8 +4519,17 @@ void ApplicationManagerImpl::OnUpdateHMIAppType(
}
if (flag_diffirence_app_hmi_type) {
- (*it)->set_app_types(transform_app_hmi_types);
- (*it)->ChangeSupportingAppHMIType();
+ ApplicationSharedPtr app = *it;
+
+ app->set_app_types(transform_app_hmi_types);
+ app->ChangeSupportingAppHMIType();
+
+ auto on_app_hmi_types_changed = [app](
+ plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kAppHmiTypesChanged, app);
+ };
+ ApplyFunctorForEachPlugin(on_app_hmi_types_changed);
+
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) {
@@ -4693,9 +4770,6 @@ void ApplicationManagerImpl::AddAppToRegisteredAppList(
SDL_LOG_AUTO_TRACE();
DCHECK_OR_RETURN_VOID(application);
sync_primitives::AutoLock lock(applications_list_lock_ptr_);
-
- // Add application to registered app list and set appropriate mark.
- application->MarkRegistered();
applications_.insert(application);
SDL_LOG_DEBUG("App with app_id: "
<< application->app_id()
@@ -5103,4 +5177,52 @@ void ApplicationManagerImpl::ChangeAppsHMILevel(
}
}
+bool ApplicationManagerImpl::RetainRequestInstance(
+ const uint32_t connection_key, const uint32_t correlation_id) {
+ return request_ctrl_->RetainRequestInstance(connection_key, correlation_id);
+}
+
+bool ApplicationManagerImpl::RemoveRetainedRequest(
+ const uint32_t connection_key, const uint32_t correlation_id) {
+ return request_ctrl_->RemoveRetainedRequest(connection_key, correlation_id);
+}
+
+bool ApplicationManagerImpl::IsStillWaitingForResponse(
+ const uint32_t connection_key, const uint32_t correlation_id) const {
+ return request_ctrl_->IsStillWaitingForResponse(connection_key,
+ correlation_id);
+}
+
+void ApplicationManagerImpl::AddExpiredButtonRequest(
+ const uint32_t app_id,
+ const int32_t corr_id,
+ const hmi_apis::Common_ButtonName::eType button_name) {
+ SDL_LOG_AUTO_TRACE();
+
+ sync_primitives::AutoLock lock(expired_button_requests_lock_);
+ expired_button_requests_[corr_id] = {app_id, button_name};
+}
+
+utils::Optional<ExpiredButtonRequestData>
+ApplicationManagerImpl::GetExpiredButtonRequestData(
+ const int32_t corr_id) const {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(expired_button_requests_lock_);
+
+ auto found_subscription = expired_button_requests_.find(corr_id);
+ if (found_subscription == expired_button_requests_.end()) {
+ return utils::Optional<ExpiredButtonRequestData>::EMPTY;
+ }
+
+ return utils::Optional<ExpiredButtonRequestData>(found_subscription->second);
+}
+
+void ApplicationManagerImpl::DeleteExpiredButtonRequest(const int32_t corr_id) {
+ SDL_LOG_AUTO_TRACE();
+
+ sync_primitives::AutoLock lock(expired_button_requests_lock_);
+ auto found_subscription = expired_button_requests_.find(corr_id);
+ expired_button_requests_.erase(found_subscription);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc
index 1ec4abaed7..ee43d32b0a 100644
--- a/src/components/application_manager/src/application_state.cc
+++ b/src/components/application_manager/src/application_state.cc
@@ -127,7 +127,7 @@ HmiStatePtr ApplicationState::GetState(const WindowID window_id,
SDL_LOG_DEBUG("Getting postponed state for window " << window_id);
return PostponedHmiState(window_id);
default:
- SDL_LOG_DEBUG("Getting current state for window " << window_id);
+ SDL_LOG_TRACE("Getting current state for window " << window_id);
return CurrentHmiState(window_id);
}
}
@@ -205,7 +205,12 @@ void ApplicationState::RemoveHMIState(const WindowID window_id,
void ApplicationState::EraseHMIState(HmiStates& hmi_states,
HmiStates::iterator it) {
if (hmi_states.begin() == it) {
- (*it)->set_parent(nullptr);
+ HmiStates::iterator next = it;
+ ++next;
+ if (hmi_states.end() != next) {
+ HmiStatePtr next_state = *next;
+ next_state->set_parent(nullptr);
+ }
} else {
HmiStates::iterator next = it;
HmiStates::iterator prev = it;
diff --git a/src/components/application_manager/src/commands/button_notification_to_mobile.cc b/src/components/application_manager/src/commands/button_notification_to_mobile.cc
new file mode 100644
index 0000000000..a94f4ef6ab
--- /dev/null
+++ b/src/components/application_manager/src/commands/button_notification_to_mobile.cc
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2021, 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/commands/button_notification_to_mobile.h"
+#include "interfaces/MOBILE_API.h"
+namespace application_manager {
+
+namespace commands {
+namespace app_mngr = application_manager;
+
+SDL_CREATE_LOG_VARIABLE("ButtonNotificationToMobile")
+
+ButtonNotificationToMobile::ButtonNotificationToMobile(
+ 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)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ButtonNotificationToMobile::~ButtonNotificationToMobile() {}
+
+bool ButtonNotificationToMobile::DoesParamExist(
+ const std::string& param_name) const {
+ SDL_LOG_AUTO_TRACE();
+ using namespace application_manager::strings;
+ return (*message_)[msg_params].keyExists(param_name);
+}
+
+void ButtonNotificationToMobile::HandleCustomButton(
+ app_mngr::ApplicationSharedPtr app) {
+ SDL_LOG_AUTO_TRACE();
+ using namespace application_manager::strings;
+
+ if (!app) {
+ SDL_LOG_ERROR("Application doesn't exist.");
+ return;
+ }
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (!DoesParamExist(hmi_response::custom_button_id)) {
+ SDL_LOG_ERROR(
+ "CUSTOM_BUTTON mobile notification without custom_button_id.");
+ return;
+ }
+
+ if (!app->IsSubscribedToButton(mobile_apis::ButtonName::CUSTOM_BUTTON)) {
+ SDL_LOG_ERROR("Application " << app->app_id()
+ << " is not subscribed on custom buttons");
+ return;
+ }
+
+ const uint32_t custom_btn_id =
+ (*message_)[msg_params][hmi_response::custom_button_id].asUInt();
+
+ if (!app->IsSubscribedToSoftButton(custom_btn_id)) {
+ SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ const auto window_id = app->GetSoftButtonWindowID(custom_btn_id);
+ (*message_)[strings::msg_params][strings::window_id] = window_id;
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level(window_id)) {
+ SDL_LOG_WARN("CUSTOM_BUTTON mobile notification is allowed only "
+ << "in FULL, LIMITED or BACKGROUND hmi level");
+ return;
+ }
+
+ SendButtonNotification(app);
+ return;
+}
+
+void ButtonNotificationToMobile::HandleOKButton(
+ app_mngr::ApplicationSharedPtr app) {
+ SDL_LOG_AUTO_TRACE();
+ using namespace application_manager;
+ SDL_LOG_DEBUG("OK button received");
+
+ if (app) {
+ const auto btn_id = static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (app->IsSubscribedToButton(btn_id)) {
+ SendButtonNotification(app);
+ } else {
+ SDL_LOG_ERROR("Application " << app->app_id()
+ << " is not subscribed to button "
+ << btn_id);
+ }
+
+ return;
+ }
+
+ const auto subscribed_apps = SubscribedApps();
+ const auto app_ptr =
+ std::find_if(subscribed_apps.begin(),
+ subscribed_apps.end(),
+ [](const ApplicationSharedPtr subscribed_app) {
+ return subscribed_app->IsFullscreen();
+ });
+
+ if (app_ptr != subscribed_apps.end()) {
+ SDL_LOG_DEBUG("Sending button press for app in FULL with app id: "
+ << (*app_ptr)->app_id());
+ SendButtonNotification(*app_ptr);
+ } else {
+ SDL_LOG_ERROR("No application found");
+ }
+}
+
+std::vector<ApplicationSharedPtr> ButtonNotificationToMobile::SubscribedApps()
+ const {
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+ return application_manager_.applications_by_button(btn_id);
+}
+
+void ButtonNotificationToMobile::HandleMediaButton(
+ app_mngr::ApplicationSharedPtr app) {
+ SDL_LOG_AUTO_TRACE();
+ using namespace application_manager;
+
+ if (app) {
+ const auto btn_id = static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (app->IsSubscribedToButton(btn_id)) {
+ SendButtonNotification(app);
+ } else {
+ SDL_LOG_ERROR("Application " << app->app_id()
+ << " is not subscribed to button "
+ << btn_id);
+ }
+
+ return;
+ }
+
+ const auto subscribed_apps = SubscribedApps();
+ const auto app_ptr =
+ std::find_if(subscribed_apps.begin(),
+ subscribed_apps.end(),
+ [](const ApplicationSharedPtr subscribed_app) {
+ return helpers::Compare<mobile_api::HMILevel::eType,
+ helpers::EQ,
+ helpers::ONE>(
+ subscribed_app->hmi_level(
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW),
+ mobile_api::HMILevel::HMI_FULL,
+ mobile_api::HMILevel::HMI_LIMITED);
+ });
+
+ if (app_ptr != subscribed_apps.end()) {
+ SendButtonNotification(*app_ptr);
+ } else {
+ SDL_LOG_ERROR("No application found");
+ }
+}
+
+void ButtonNotificationToMobile::Run() {
+ SDL_LOG_AUTO_TRACE();
+ using namespace application_manager::strings;
+
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[msg_params][hmi_response::button_name].asInt());
+
+ SDL_LOG_DEBUG("Received button id: " << btn_id);
+
+ ApplicationSharedPtr app;
+
+ if (DoesParamExist(strings::app_id)) {
+ app = application_manager_.application(
+ (*message_)[msg_params][app_id].asUInt());
+ }
+
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ HandleCustomButton(app);
+ } else if (static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) {
+ HandleOKButton(app);
+ } else {
+ HandleMediaButton(app);
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 47659e52ca..8eb7171274 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -39,18 +39,56 @@
namespace application_manager {
namespace {
-struct AppExtensionPredicate {
- AppExtensionUID uid;
- bool operator()(const ApplicationSharedPtr app) {
- return app ? (app->QueryInterface(uid).use_count() != 0) : false;
+
+/**
+ * @brief Functor for build info string
+ */
+struct InfoAppender {
+ explicit InfoAppender(std::string& info) : info_(info) {}
+
+ void operator()(const RPCParams::value_type& parameter) {
+ if (info_.empty()) {
+ info_ = "\'" + parameter + "\'";
+ return;
+ }
+
+ info_ = info_ + ", \'" + parameter + "\'";
}
+
+ private:
+ std::string& info_;
};
+
} // namespace
namespace commands {
SDL_CREATE_LOG_VARIABLE("Commands")
+bool IsMobileResultSuccess(const mobile_apis::Result::eType result_code) {
+ using namespace helpers;
+ return Compare<mobile_apis::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS,
+ mobile_apis::Result::WRONG_LANGUAGE,
+ mobile_apis::Result::RETRY,
+ mobile_apis::Result::SAVED,
+ mobile_apis::Result::TRUNCATED_DATA);
+}
+
+bool IsHMIResultSuccess(const hmi_apis::Common_Result::eType result_code) {
+ using namespace helpers;
+ return Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_code,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::TRUNCATED_DATA);
+}
+
const int32_t CommandImpl::hmi_protocol_type_ = 1;
const int32_t CommandImpl::mobile_protocol_type_ = 0;
const int32_t CommandImpl::protocol_version_ = 3;
@@ -61,7 +99,9 @@ CommandImpl::CommandImpl(const MessageSharedPtr& message,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
: message_(message)
- , default_timeout_(application_manager.get_settings().default_timeout())
+ , default_timeout_(
+ application_manager.get_settings().default_timeout() +
+ application_manager.get_settings().default_timeout_compensation())
, allowed_to_terminate_(true)
, application_manager_(application_manager)
, rpc_service_(rpc_service)
@@ -86,6 +126,8 @@ bool CommandImpl::CleanUp() {
void CommandImpl::Run() {}
+void CommandImpl::OnUpdateTimeOut() {}
+
uint32_t CommandImpl::default_timeout() const {
return default_timeout_;
}
@@ -111,6 +153,8 @@ uint32_t CommandImpl::connection_key() const {
return (*message_)[strings::params][strings::connection_key].asUInt();
}
+void CommandImpl::HandleTimeOut() {}
+
void CommandImpl::set_warning_info(const std::string info) {
warning_info_ = info;
}
@@ -119,8 +163,6 @@ std::string CommandImpl::warning_info() const {
return warning_info_;
}
-void CommandImpl::onTimeOut() {}
-
bool CommandImpl::AllowedToTerminate() {
return allowed_to_terminate_;
}
@@ -139,6 +181,12 @@ bool CommandImpl::CheckAllowedParameters(const Command::CommandSource source) {
"There is no registered application with "
"connection key '"
<< connection_key() << "'");
+
+ rpc_service_.SendMessageToMobile(MessageHelper::CreateNegativeResponse(
+ connection_key(),
+ function_id(),
+ correlation_id(),
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED));
return false;
}
@@ -179,6 +227,25 @@ bool CommandImpl::CheckAllowedParameters(const Command::CommandSource source) {
check_result,
correlation_id(),
app->app_id());
+
+ if (!params.empty()) {
+ if (parameters_permissions_.AreDisallowedParamsIncluded(params)) {
+ const std::string info = "RPC is disallowed by the user";
+ SDL_LOG_DEBUG(info);
+ (*response)[strings::msg_params][strings::info] = info;
+ AddDisallowedParameters(*response);
+ } else if (parameters_permissions_.AreUndefinedParamsIncluded(params)) {
+ const std::string info =
+ "Requested parameters are disallowed by Policies";
+
+ SDL_LOG_DEBUG(info);
+ (*response)[strings::msg_params][strings::info] = info;
+ AddDisallowedParameters(*response);
+ } else {
+ FormatResponse(*response);
+ }
+ }
+
rpc_service_.SendMessageToMobile(response);
}
@@ -198,6 +265,143 @@ bool CommandImpl::CheckAllowedParameters(const Command::CommandSource source) {
return true;
}
+struct DisallowedParamsInserter {
+ DisallowedParamsInserter(smart_objects::SmartObject& response,
+ mobile_apis::VehicleDataResultCode::eType code)
+ : response_(response), code_(code) {}
+
+ bool operator()(const std::string& param) {
+ smart_objects::SmartObjectSPtr disallowed_param =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+
+ auto rpc_spec_vehicle_data = MessageHelper::vehicle_data();
+ auto vehicle_data = rpc_spec_vehicle_data.find(param);
+ auto vehicle_data_type =
+ vehicle_data == rpc_spec_vehicle_data.end()
+ ? mobile_apis::VehicleDataType::VEHICLEDATA_OEM_CUSTOM_DATA
+ : vehicle_data->second;
+
+ (*disallowed_param)[strings::data_type] = vehicle_data_type;
+ (*disallowed_param)[strings::result_code] = code_;
+ response_[strings::msg_params][param.c_str()] = *disallowed_param;
+ return true;
+ }
+
+ private:
+ smart_objects::SmartObject& response_;
+ mobile_apis::VehicleDataResultCode::eType code_;
+};
+
+void CommandImpl::AddDisallowedParameters(
+ smart_objects::SmartObject& response) {
+ const mobile_apis::FunctionID::eType id =
+ static_cast<mobile_apis::FunctionID::eType>(function_id());
+
+ if (!helpers::
+ Compare<mobile_apis::FunctionID::eType, helpers::EQ, helpers::ONE>(
+ id,
+ mobile_apis::FunctionID::SubscribeVehicleDataID,
+ mobile_apis::FunctionID::UnsubscribeVehicleDataID)) {
+ SDL_LOG_INFO("The function id: " << id << " is not supported.");
+ return;
+ }
+
+ DisallowedParamsInserter disallowed_inserter(
+ response, mobile_apis::VehicleDataResultCode::VDRC_USER_DISALLOWED);
+ std::for_each(removed_parameters_permissions_.disallowed_params.begin(),
+ removed_parameters_permissions_.disallowed_params.end(),
+ disallowed_inserter);
+
+ DisallowedParamsInserter undefined_inserter(
+ response, mobile_apis::VehicleDataResultCode::VDRC_DISALLOWED);
+ std::for_each(removed_parameters_permissions_.undefined_params.begin(),
+ removed_parameters_permissions_.undefined_params.end(),
+ undefined_inserter);
+}
+
+void CommandImpl::AddDisallowedParameterToInfoString(
+ std::string& info, const std::string& param) const {
+ // prepare disallowed params enumeration for response info string
+ if (info.empty()) {
+ info = "\'" + param + "\'";
+ } else {
+ info = info + "," + " " + "\'" + param + "\'";
+ }
+}
+
+void CommandImpl::AddDisallowedParametersToInfo(
+ smart_objects::SmartObject& response) const {
+ SDL_LOG_AUTO_TRACE();
+ const mobile_apis::FunctionID::eType id =
+ static_cast<mobile_apis::FunctionID::eType>(function_id());
+
+ if (!helpers::
+ Compare<mobile_apis::FunctionID::eType, helpers::EQ, helpers::ONE>(
+ id,
+ mobile_apis::FunctionID::SubscribeVehicleDataID,
+ mobile_apis::FunctionID::UnsubscribeVehicleDataID,
+ mobile_apis::FunctionID::GetVehicleDataID,
+ mobile_apis::FunctionID::SendLocationID)) {
+ SDL_LOG_INFO("The function id: " << id << " is not supported.");
+ return;
+ }
+
+ std::string disallowed_by_user_info;
+ InfoAppender user_info_appender(disallowed_by_user_info);
+
+ std::for_each(removed_parameters_permissions_.disallowed_params.begin(),
+ removed_parameters_permissions_.disallowed_params.end(),
+ user_info_appender);
+
+ const size_t min_number_of_disallowed_params = 1;
+ if (!disallowed_by_user_info.empty()) {
+ disallowed_by_user_info +=
+ min_number_of_disallowed_params <
+ removed_parameters_permissions_.disallowed_params.size()
+ ? " are"
+ : " is";
+ disallowed_by_user_info += " disallowed by user";
+ }
+
+ std::string disallowed_by_policy_info;
+ InfoAppender policy_info_appender(disallowed_by_policy_info);
+
+ std::for_each(removed_parameters_permissions_.undefined_params.begin(),
+ removed_parameters_permissions_.undefined_params.end(),
+ policy_info_appender);
+
+ const size_t min_number_of_undefined_params = 1;
+ if (!disallowed_by_policy_info.empty()) {
+ disallowed_by_policy_info +=
+ min_number_of_undefined_params <
+ removed_parameters_permissions_.undefined_params.size()
+ ? " are"
+ : " is";
+ disallowed_by_policy_info += " disallowed by policies";
+ }
+
+ if (disallowed_by_user_info.empty() && disallowed_by_policy_info.empty()) {
+ SDL_LOG_INFO("There are not disallowed by user or by policy parameters.");
+ return;
+ }
+
+ smart_objects::SmartObject& info =
+ response[strings::msg_params][strings::info];
+
+ std::string summary;
+ if (!disallowed_by_policy_info.empty()) {
+ summary += disallowed_by_policy_info;
+ }
+
+ if (!disallowed_by_user_info.empty()) {
+ summary = summary.empty() ? disallowed_by_user_info
+ : summary + ", " + disallowed_by_user_info;
+ }
+
+ info = info.asString().empty() ? summary : info.asString() + " " + summary;
+}
+
void CommandImpl::RemoveDisallowedParameters() {
SDL_LOG_AUTO_TRACE();
@@ -268,13 +472,20 @@ bool CommandImpl::ReplaceMobileWithHMIAppId(
}
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
return true;
}
+void CommandImpl::FormatResponse(smart_objects::SmartObject& response) {
+ AddDisallowedParametersToInfo(response);
+ AddDisallowedParameters(response);
+}
+
bool CommandImpl::ReplaceHMIWithMobileAppId(
ns_smart_device_link::ns_smart_objects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
@@ -312,7 +523,9 @@ bool CommandImpl::ReplaceHMIWithMobileAppId(
}
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
@@ -352,5 +565,19 @@ bool CommandImpl::CheckSyntax(const std::string& str,
return true;
}
+bool CommandImpl::IsHMIResultSuccess(
+ hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const {
+ SDL_LOG_AUTO_TRACE();
+ if (application_manager::commands::IsHMIResultSuccess(result_code)) {
+ return true;
+ }
+
+ const HmiInterfaces::InterfaceState state =
+ application_manager_.hmi_interfaces().GetInterfaceState(interface);
+ return hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
} // namespace commands
} // namespace application_manager
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 08bf25de54..2929144883 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -30,171 +30,18 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
-#include <numeric>
-#include <string>
-#include "utils/macro.h"
-
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/app_service_manager.h"
-#include "application_manager/application_manager.h"
+#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
-#include "smart_objects/smart_object.h"
-
#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
-
namespace commands {
-SDL_CREATE_LOG_VARIABLE("Commands");
-
-std::string MergeInfos(const ResponseInfo& first_info,
- const std::string& first_str,
- const ResponseInfo& second_info,
- const std::string& second_str) {
- if ((first_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (second_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !second_str.empty()) {
- return second_str;
- }
-
- if ((second_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (first_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !first_str.empty()) {
- return first_str;
- }
-
- return MergeInfos(first_str, second_str);
-}
-
-std::string MergeInfos(const std::string& first, const std::string& second) {
- return first + ((!first.empty() && !second.empty()) ? ", " : "") + second;
-}
-
-std::string MergeInfos(const std::string& first,
- const std::string& second,
- const std::string& third) {
- std::string result = MergeInfos(first, second);
- return MergeInfos(result, third);
-}
-
-const std::string CreateInfoForUnsupportedResult(
- HmiInterfaces::InterfaceID interface) {
- switch (interface) {
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VR): {
- return "VR is not supported by system";
- }
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS): {
- return "TTS is not supported by system";
- }
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_UI): {
- return "UI is not supported by system";
- }
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_Navigation): {
- return "Navigation is not supported by system";
- }
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
- return "VehicleInfo is not supported by system";
- }
- case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): {
- return "RC is not supported by system";
- }
- default:
- SDL_LOG_WARN(
- "Could not create info because"
- " interface isn't valid. Interface is:"
- << static_cast<int32_t>(interface));
- return "";
- }
-}
-
-bool CommandRequestImpl::CheckResult(const ResponseInfo& first,
- const ResponseInfo& second) const {
- if (first.is_ok && second.is_unsupported_resource) {
- return true;
- }
- if (first.is_ok && second.is_not_used) {
- return true;
- }
- if (first.is_ok && second.is_ok) {
- return true;
- }
- return false;
-}
-
-bool IsResultCodeWarning(const ResponseInfo& first,
- const ResponseInfo& second) {
- const bool first_is_ok_second_is_warn =
- (first.is_ok || first.is_not_used) &&
- hmi_apis::Common_Result::WARNINGS == second.result_code;
-
- const bool both_warnings =
- hmi_apis::Common_Result::WARNINGS == first.result_code &&
- hmi_apis::Common_Result::WARNINGS == second.result_code;
-
- return first_is_ok_second_is_warn || both_warnings;
-}
-
-struct DisallowedParamsInserter {
- DisallowedParamsInserter(smart_objects::SmartObject& response,
- mobile_apis::VehicleDataResultCode::eType code)
- : response_(response), code_(code) {}
-
- bool operator()(const std::string& param) {
- smart_objects::SmartObjectSPtr disallowed_param =
- std::make_shared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
-
- auto rpc_spec_vehicle_data = MessageHelper::vehicle_data();
- auto vehicle_data = rpc_spec_vehicle_data.find(param);
- auto vehicle_data_type =
- vehicle_data == rpc_spec_vehicle_data.end()
- ? mobile_apis::VehicleDataType::VEHICLEDATA_OEM_CUSTOM_DATA
- : vehicle_data->second;
-
- (*disallowed_param)[strings::data_type] = vehicle_data_type;
- (*disallowed_param)[strings::result_code] = code_;
- response_[strings::msg_params][param.c_str()] = *disallowed_param;
- return true;
- }
-
- private:
- smart_objects::SmartObject& response_;
- mobile_apis::VehicleDataResultCode::eType code_;
-};
-
-ResponseInfo::ResponseInfo()
- : result_code(hmi_apis::Common_Result::INVALID_ENUM)
- , interface(HmiInterfaces::HMI_INTERFACE_INVALID_ENUM)
- , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
- , is_ok(false)
- , is_unsupported_resource(false)
- , is_not_used(false) {}
-
-ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result,
- const HmiInterfaces::InterfaceID hmi_interface,
- ApplicationManager& application_manager)
- : result_code(result)
- , interface(hmi_interface)
- , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
- , is_ok(false)
- , is_unsupported_resource(false)
- , is_not_used(false) {
- using namespace helpers;
-
- interface_state =
- application_manager.hmi_interfaces().GetInterfaceState(hmi_interface);
-
- is_ok = CommandRequestImpl::IsHMIResultSuccess(result_code);
-
- is_not_used = hmi_apis::Common_Result::INVALID_ENUM == result_code;
-
- is_unsupported_resource =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
-}
+SDL_CREATE_LOG_VARIABLE("Commands")
CommandRequestImpl::CommandRequestImpl(
const MessageSharedPtr& message,
@@ -208,269 +55,25 @@ CommandRequestImpl::CommandRequestImpl(
hmi_capabilities,
policy_handler)
, EventObserver(application_manager.event_dispatcher())
- , current_state_(kAwaitingHMIResponse)
- , hash_update_mode_(kSkipHashUpdate)
- , is_success_result_(false) {}
+ , current_state_(RequestState::kAwaitingResponse) {}
CommandRequestImpl::~CommandRequestImpl() {
- UpdateHash();
-}
-
-bool CommandRequestImpl::Init() {
- return true;
-}
-
-bool CommandRequestImpl::CheckPermissions() {
- return CheckAllowedParameters(Command::CommandSource::SOURCE_MOBILE);
-}
-
-bool CommandRequestImpl::CleanUp() {
- return true;
+ CleanUp();
}
void CommandRequestImpl::Run() {}
-void CommandRequestImpl::onTimeOut() {
- SDL_LOG_AUTO_TRACE();
-
- unsubscribe_from_all_hmi_events();
- unsubscribe_from_all_mobile_events();
- {
- // FIXME (dchmerev@luxoft.com): atomic_xchg fits better
- sync_primitives::AutoLock auto_lock(state_lock_);
- if (kCompleted == current_state_) {
- SDL_LOG_DEBUG("current_state_ = kCompleted");
- // don't send timeout if request completed
- return;
- }
-
- current_state_ = kTimedOut;
- }
-
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateNegativeResponse(connection_key(),
- function_id(),
- correlation_id(),
- mobile_api::Result::GENERIC_ERROR);
- AddTimeOutComponentInfoToMessage(*response);
- rpc_service_.ManageMobileCommand(response, SOURCE_SDL);
-}
-
-void CommandRequestImpl::on_event(const event_engine::Event& event) {}
-
-void CommandRequestImpl::on_event(const event_engine::MobileEvent& event) {}
-
-void CommandRequestImpl::SendResponse(
- const bool success,
- const mobile_apis::Result::eType& result_code,
- const char* info,
- const smart_objects::SmartObject* response_params,
- const std::vector<uint8_t> binary_data) {
- SDL_LOG_AUTO_TRACE();
- {
- sync_primitives::AutoLock auto_lock(state_lock_);
- if (kTimedOut == current_state_) {
- // don't send response if request timeout expired
- return;
- }
-
- current_state_ = kCompleted;
- }
-
- smart_objects::SmartObjectSPtr result =
- std::make_shared<smart_objects::SmartObject>();
-
- smart_objects::SmartObject& response = *result;
-
- response[strings::params][strings::message_type] = MessageType::kResponse;
- response[strings::params][strings::correlation_id] = correlation_id();
- response[strings::params][strings::protocol_type] =
- CommandImpl::mobile_protocol_type_;
- response[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- response[strings::params][strings::connection_key] = connection_key();
- response[strings::params][strings::function_id] = function_id();
- if (!binary_data.empty()) {
- response[strings::params][strings::binary_data] = binary_data;
- }
- if (response_params) {
- response[strings::msg_params] = *response_params;
- }
-
- if (info && *info != '\0') {
- response[strings::msg_params][strings::info] = std::string(info);
- }
-
- // Add disallowed parameters and info from request back to response with
- // appropriate reasons (VehicleData result codes)
- if (result_code != mobile_apis::Result::APPLICATION_NOT_REGISTERED &&
- result_code != mobile_apis::Result::INVALID_DATA) {
- const mobile_apis::FunctionID::eType& id =
- static_cast<mobile_apis::FunctionID::eType>(function_id());
- if ((id == mobile_apis::FunctionID::SubscribeVehicleDataID) ||
- (id == mobile_apis::FunctionID::UnsubscribeVehicleDataID)) {
- AddDisallowedParameters(response);
- AddDisallowedParametersToInfo(response);
- } else if (id == mobile_apis::FunctionID::GetVehicleDataID) {
- AddDisallowedParametersToInfo(response);
- }
- }
-
- response[strings::msg_params][strings::success] = success;
- if ((result_code == mobile_apis::Result::SUCCESS ||
- result_code == mobile_apis::Result::WARNINGS) &&
- !warning_info().empty()) {
- response[strings::msg_params][strings::info] =
- (info && *info != '\0') ? std::string(info) + "\n" + warning_info()
- : warning_info();
- response[strings::msg_params][strings::result_code] =
- mobile_apis::Result::WARNINGS;
- } else {
- response[strings::msg_params][strings::result_code] = result_code;
- }
-
- is_success_result_ = success;
-
- rpc_service_.ManageMobileCommand(result, SOURCE_SDL);
-}
-
-smart_objects::SmartObject CreateUnsupportedResourceResponse(
- const hmi_apis::FunctionID::eType function_id,
- const uint32_t hmi_correlation_id,
- HmiInterfaces::InterfaceID interface) {
- smart_objects::SmartObject response(smart_objects::SmartType_Map);
- smart_objects::SmartObject& params = response[strings::params];
- params[strings::message_type] = MessageType::kResponse;
- params[strings::correlation_id] = hmi_correlation_id;
- params[strings::protocol_type] = CommandImpl::hmi_protocol_type_;
- params[strings::protocol_version] = CommandImpl::protocol_version_;
- params[strings::function_id] = function_id;
- params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- smart_objects::SmartObject& msg_params = response[strings::msg_params];
- msg_params[strings::info] = CreateInfoForUnsupportedResult(interface);
- return response;
-}
-
-bool CommandRequestImpl::ProcessHMIInterfacesAvailability(
- const uint32_t hmi_correlation_id,
- const hmi_apis::FunctionID::eType& function_id) {
- SDL_LOG_AUTO_TRACE();
- HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- HmiInterfaces::InterfaceID interface =
- hmi_interfaces.GetInterfaceFromFunction(function_id);
- DCHECK(interface != HmiInterfaces::HMI_INTERFACE_INVALID_ENUM);
- const HmiInterfaces::InterfaceState state =
- hmi_interfaces.GetInterfaceState(interface);
- if (HmiInterfaces::STATE_NOT_AVAILABLE == state) {
- event_engine::Event event(function_id);
- event.set_smart_object(CreateUnsupportedResourceResponse(
- function_id, hmi_correlation_id, interface));
- event.raise(application_manager_.event_dispatcher());
- return false;
- }
- return true;
-}
-
-void CommandRequestImpl::UpdateHash() {
- SDL_LOG_AUTO_TRACE();
- if (hash_update_mode_ == kSkipHashUpdate) {
- SDL_LOG_DEBUG("Hash update is disabled for " << function_id());
- return;
- }
-
- if (HmiInterfaces::InterfaceState::STATE_NOT_RESPONSE ==
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_UI)) {
- SDL_LOG_ERROR("UI interface has not responded. Hash won't be updated.");
- return;
- }
-
- if (!is_success_result_) {
- SDL_LOG_WARN("Command is not succeeded. Hash won't be updated.");
- return;
- }
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- SDL_LOG_ERROR("Application with connection key "
- << connection_key()
- << " not found. Not able to update hash.");
- return;
- }
-
- SDL_LOG_DEBUG(
- "Updating hash for application with connection key "
- << connection_key() << " while processing function id "
- << MessageHelper::StringifiedFunctionID(
- static_cast<mobile_api::FunctionID::eType>(function_id())));
-
- application->UpdateHash();
-}
-
-void CommandRequestImpl::SendProviderRequest(
- const mobile_apis::FunctionID::eType& mobile_function_id,
- const hmi_apis::FunctionID::eType& hmi_function_id,
- const smart_objects::SmartObject* msg,
- bool use_events) {
+bool CommandRequestImpl::CheckAllowedParameters(
+ const Command::CommandSource source) {
SDL_LOG_AUTO_TRACE();
- bool hmi_destination = false;
- ApplicationSharedPtr app;
- // Default error code and error message
- std::string error_msg = "No app service provider available";
- mobile_apis::Result::eType error_code =
- mobile_apis::Result::DATA_NOT_AVAILABLE;
-
- if ((*msg)[strings::msg_params].keyExists(strings::service_type)) {
- std::string service_type =
- (*msg)[strings::msg_params][strings::service_type].asString();
- application_manager_.GetAppServiceManager().GetProviderByType(
- service_type, true, app, hmi_destination);
- error_msg = "No app service provider with serviceType: " + service_type +
- " is available";
- error_code = mobile_apis::Result::DATA_NOT_AVAILABLE;
- } else if ((*msg)[strings::msg_params].keyExists(strings::service_id)) {
- std::string service_id =
- (*msg)[strings::msg_params][strings::service_id].asString();
- application_manager_.GetAppServiceManager().GetProviderByID(
- service_id, true, app, hmi_destination);
- error_msg = "No app service provider with serviceId: " + service_id +
- " is available";
- error_code = mobile_apis::Result::INVALID_ID;
- }
-
- if (hmi_destination) {
- SDL_LOG_DEBUG("Sending Request to HMI Provider");
- application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
- correlation_id());
- SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events);
- return;
- }
- if (!app) {
- SDL_LOG_DEBUG("Invalid App Provider pointer");
- SendResponse(false, error_code, error_msg.c_str());
- return;
- }
-
- if (connection_key() == app->app_id()) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Consumer app is same as producer app");
- return;
+ // RegisterAppInterface should always be allowed
+ if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
+ static_cast<mobile_apis::FunctionID::eType>(function_id())) {
+ return true;
}
- smart_objects::SmartObjectSPtr new_msg =
- std::make_shared<smart_objects::SmartObject>();
- smart_objects::SmartObject& request = *new_msg;
-
- request[strings::params] = (*msg)[strings::params];
- request[strings::msg_params] = (*msg)[strings::msg_params];
- request[strings::params][strings::connection_key] = app->app_id();
-
- application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
- correlation_id());
- SendMobileRequest(mobile_function_id, new_msg, use_events);
+ return CommandImpl::CheckAllowedParameters(source);
}
void CommandRequestImpl::SendMobileRequest(
@@ -495,389 +98,91 @@ void CommandRequestImpl::SendMobileRequest(
}
}
-uint32_t CommandRequestImpl::SendHMIRequest(
- const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject* msg_params,
- bool use_events) {
- smart_objects::SmartObjectSPtr result =
- std::make_shared<smart_objects::SmartObject>();
-
- const uint32_t hmi_correlation_id =
- application_manager_.GetNextHMICorrelationID();
-
- smart_objects::SmartObject& request = *result;
- request[strings::params][strings::message_type] = MessageType::kRequest;
- request[strings::params][strings::function_id] = function_id;
- request[strings::params][strings::correlation_id] = hmi_correlation_id;
- request[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- request[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
-
- if (msg_params) {
- request[strings::msg_params] = *msg_params;
- }
-
- if (use_events) {
- SDL_LOG_DEBUG("SendHMIRequest subscribe_on_event " << function_id << " "
- << hmi_correlation_id);
- subscribe_on_event(function_id, hmi_correlation_id);
- }
- if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) {
- if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
- SDL_LOG_ERROR("Unable to send request");
- SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
- }
- } else {
- SDL_LOG_DEBUG("Interface is not available");
- }
- return hmi_correlation_id;
-}
-
-void CommandRequestImpl::CreateHMINotification(
- const hmi_apis::FunctionID::eType& function_id,
- const ns_smart::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result =
- std::make_shared<smart_objects::SmartObject>();
- if (!result) {
- SDL_LOG_ERROR("Memory allocation failed.");
- return;
- }
- smart_objects::SmartObject& notify = *result;
-
- notify[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- notify[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- notify[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
- notify[strings::params][strings::function_id] = function_id;
- notify[strings::msg_params] = msg_params;
-
- if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
- SDL_LOG_ERROR("Unable to send HMI notification");
- }
-}
-
-mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode(
- const hmi_apis::Common_Result::eType& hmi_code) const {
- mobile_apis::Result::eType mobile_result = mobile_apis::Result::GENERIC_ERROR;
- switch (hmi_code) {
- case hmi_apis::Common_Result::SUCCESS: {
- mobile_result = mobile_apis::Result::SUCCESS;
- break;
- }
- case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: {
- mobile_result = mobile_apis::Result::UNSUPPORTED_REQUEST;
- break;
- }
- case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: {
- mobile_result = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- break;
- }
- case hmi_apis::Common_Result::DISALLOWED: {
- mobile_result = mobile_apis::Result::DISALLOWED;
- break;
- }
- case hmi_apis::Common_Result::REJECTED: {
- mobile_result = mobile_apis::Result::REJECTED;
- break;
- }
- case hmi_apis::Common_Result::ABORTED: {
- mobile_result = mobile_apis::Result::ABORTED;
- break;
- }
- case hmi_apis::Common_Result::IGNORED: {
- mobile_result = mobile_apis::Result::IGNORED;
- break;
- }
- case hmi_apis::Common_Result::RETRY: {
- mobile_result = mobile_apis::Result::RETRY;
- break;
- }
- case hmi_apis::Common_Result::IN_USE: {
- mobile_result = mobile_apis::Result::IN_USE;
- break;
- }
- case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: {
- mobile_result = mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE;
- break;
- }
- case hmi_apis::Common_Result::TIMED_OUT: {
- mobile_result = mobile_apis::Result::TIMED_OUT;
- break;
- }
- case hmi_apis::Common_Result::INVALID_DATA: {
- mobile_result = mobile_apis::Result::INVALID_DATA;
- break;
- }
- case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: {
- mobile_result = mobile_apis::Result::CHAR_LIMIT_EXCEEDED;
- break;
- }
- case hmi_apis::Common_Result::INVALID_ID: {
- mobile_result = mobile_apis::Result::INVALID_ID;
- break;
- }
- case hmi_apis::Common_Result::DUPLICATE_NAME: {
- mobile_result = mobile_apis::Result::DUPLICATE_NAME;
- break;
- }
- case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: {
- mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
- break;
- }
- case hmi_apis::Common_Result::WRONG_LANGUAGE: {
- mobile_result = mobile_apis::Result::WRONG_LANGUAGE;
- break;
- }
- case hmi_apis::Common_Result::OUT_OF_MEMORY: {
- mobile_result = mobile_apis::Result::OUT_OF_MEMORY;
- break;
- }
- case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: {
- mobile_result = mobile_apis::Result::TOO_MANY_PENDING_REQUESTS;
- break;
- }
- case hmi_apis::Common_Result::NO_APPS_REGISTERED: {
- mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
- break;
- }
- case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: {
- mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
- break;
- }
- case hmi_apis::Common_Result::WARNINGS: {
- mobile_result = mobile_apis::Result::WARNINGS;
- break;
- }
- case hmi_apis::Common_Result::GENERIC_ERROR: {
- mobile_result = mobile_apis::Result::GENERIC_ERROR;
- break;
- }
- case hmi_apis::Common_Result::USER_DISALLOWED: {
- mobile_result = mobile_apis::Result::USER_DISALLOWED;
- break;
- }
- case hmi_apis::Common_Result::SAVED: {
- mobile_result = mobile_apis::Result::SAVED;
- break;
- }
- case hmi_apis::Common_Result::READ_ONLY: {
- mobile_result = mobile_apis::Result::READ_ONLY;
- break;
- }
- default: {
- SDL_LOG_ERROR("Unknown HMI result code " << hmi_code);
- break;
- }
- }
+void CommandRequestImpl::OnTimeOut() {}
- return mobile_result;
-}
+void CommandRequestImpl::on_event(const event_engine::Event&) {}
+void CommandRequestImpl::on_event(const event_engine::MobileEvent&) {}
-bool CommandRequestImpl::CheckAllowedParameters(
- const Command::CommandSource source) {
+void CommandRequestImpl::HandleTimeOut() {
SDL_LOG_AUTO_TRACE();
-
- // RegisterAppInterface should always be allowed
- if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
- static_cast<mobile_apis::FunctionID::eType>(function_id())) {
- return true;
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ if (RequestState::kProcessEvent == current_state()) {
+ SDL_LOG_DEBUG("Current request state is: "
+ << current_state() << ". Timeout request ignored");
+ return;
+ }
+ set_current_state(RequestState::kTimedOut);
}
- return CommandImpl::CheckAllowedParameters(source);
+ OnTimeOut();
}
-bool CommandRequestImpl::CheckHMICapabilities(
- const mobile_apis::ButtonName::eType button) const {
+bool CommandRequestImpl::StartOnEventHandling() {
SDL_LOG_AUTO_TRACE();
- using namespace smart_objects;
- using namespace mobile_apis;
-
- if (!hmi_capabilities_.is_ui_cooperating()) {
- SDL_LOG_ERROR("UI is not supported by HMI");
- return false;
- }
-
- auto button_capabilities = hmi_capabilities_.button_capabilities();
- if (!button_capabilities) {
- SDL_LOG_ERROR("Invalid button capabilities object");
- return false;
- }
-
- for (size_t i = 0; i < button_capabilities->length(); ++i) {
- const SmartObject& capabilities = (*button_capabilities)[i];
- const ButtonName::eType current_button = static_cast<ButtonName::eType>(
- capabilities.getElement(hmi_response::button_name).asInt());
- if (current_button == button) {
- SDL_LOG_DEBUG("Button capabilities for " << button << " was found");
- return true;
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ if (RequestState::kTimedOut == current_state()) {
+ SDL_LOG_DEBUG("current_state_ = kTimedOut");
+ return false;
}
+ set_current_state(RequestState::kProcessEvent);
}
- SDL_LOG_DEBUG("Button capabilities for " << button << " was not found");
- return false;
-}
-
-void CommandRequestImpl::AddDisallowedParameterToInfoString(
- std::string& info, const std::string& param) const {
- // prepare disallowed params enumeration for response info string
- if (info.empty()) {
- info = "\'" + param + "\'";
- } else {
- info = info + "," + " " + "\'" + param + "\'";
- }
+ return true;
}
-void CommandRequestImpl::AddDisallowedParametersToInfo(
- smart_objects::SmartObject& response) const {
- std::string info;
-
- RPCParams::const_iterator it =
- removed_parameters_permissions_.disallowed_params.begin();
- for (; it != removed_parameters_permissions_.disallowed_params.end(); ++it) {
- AddDisallowedParameterToInfoString(info, (*it));
- }
-
- it = removed_parameters_permissions_.undefined_params.begin();
- for (; it != removed_parameters_permissions_.undefined_params.end(); ++it) {
- AddDisallowedParameterToInfoString(info, (*it));
- }
-
- if (!info.empty()) {
- info += " disallowed by policies.";
+void CommandRequestImpl::FinalizeOnEventHandling() {
+ const auto conn_key = connection_key();
+ const auto corr_id = correlation_id();
- if (!response[strings::msg_params][strings::info].asString().empty()) {
- // If we already have info add info about disallowed params to it
- response[strings::msg_params][strings::info] =
- response[strings::msg_params][strings::info].asString() + " " + info;
- } else {
- response[strings::msg_params][strings::info] = info;
- }
+ if (application_manager_.IsStillWaitingForResponse(conn_key, corr_id)) {
+ SDL_LOG_DEBUG("Request (" << conn_key << ", " << corr_id
+ << ") is still waiting for repsonse");
+ set_current_state(RequestState::kAwaitingResponse);
}
}
-void CommandRequestImpl::AddDisallowedParameters(
- smart_objects::SmartObject& response) {
- DisallowedParamsInserter disallowed_inserter(
- response, mobile_apis::VehicleDataResultCode::VDRC_USER_DISALLOWED);
- std::for_each(removed_parameters_permissions_.disallowed_params.begin(),
- removed_parameters_permissions_.disallowed_params.end(),
- disallowed_inserter);
-
- DisallowedParamsInserter undefined_inserter(
- response, mobile_apis::VehicleDataResultCode::VDRC_DISALLOWED);
- std::for_each(removed_parameters_permissions_.undefined_params.begin(),
- removed_parameters_permissions_.undefined_params.end(),
- undefined_inserter);
-}
-
-bool CommandRequestImpl::HasDisallowedParams() const {
- return ((!removed_parameters_permissions_.disallowed_params.empty()) ||
- (!removed_parameters_permissions_.undefined_params.empty()));
-}
-
-bool CommandRequestImpl::IsMobileResultSuccess(
- const mobile_apis::Result::eType result_code) {
+void CommandRequestImpl::HandleOnEvent(const event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
- using namespace helpers;
- return Compare<mobile_apis::Result::eType, EQ, ONE>(
- result_code,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS,
- mobile_apis::Result::WRONG_LANGUAGE,
- mobile_apis::Result::RETRY,
- mobile_apis::Result::SAVED,
- mobile_apis::Result::TRUNCATED_DATA);
-}
-bool CommandRequestImpl::IsHMIResultSuccess(
- const hmi_apis::Common_Result::eType result_code) {
- SDL_LOG_AUTO_TRACE();
- using namespace helpers;
- return Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::TRUNCATED_DATA);
+ if (StartOnEventHandling()) {
+ on_event(event);
+ FinalizeOnEventHandling();
+ }
}
-bool CommandRequestImpl::PrepareResultForMobileResponse(
- hmi_apis::Common_Result::eType result_code,
- HmiInterfaces::InterfaceID interface) const {
+void CommandRequestImpl::HandleOnEvent(const event_engine::MobileEvent& event) {
SDL_LOG_AUTO_TRACE();
- if (IsHMIResultSuccess(result_code)) {
- return true;
- }
- const HmiInterfaces::InterfaceState state =
- application_manager_.hmi_interfaces().GetInterfaceState(interface);
- if ((hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code) &&
- (HmiInterfaces::STATE_NOT_AVAILABLE != state)) {
- return true;
+ if (StartOnEventHandling()) {
+ on_event(event);
+ FinalizeOnEventHandling();
}
- return false;
}
-bool CommandRequestImpl::PrepareResultForMobileResponse(
- ResponseInfo& out_first, ResponseInfo& out_second) const {
+bool CommandRequestImpl::IncrementReferenceCount() const {
SDL_LOG_AUTO_TRACE();
- bool result =
- CheckResult(out_first, out_second) || CheckResult(out_second, out_first);
- return result;
-}
-
-void CommandRequestImpl::GetInfo(
- const smart_objects::SmartObject& response_from_hmi,
- std::string& out_info) {
- if (response_from_hmi[strings::msg_params].keyExists(strings::info)) {
- if (!response_from_hmi[strings::msg_params][strings::info].empty()) {
- out_info =
- response_from_hmi[strings::msg_params][strings::info].asString();
- }
- }
+ const auto conn_key = connection_key();
+ const auto corr_id = correlation_id();
+ return application_manager_.RetainRequestInstance(conn_key, corr_id);
}
-mobile_apis::Result::eType CommandRequestImpl::PrepareResultCodeForResponse(
- const ResponseInfo& first, const ResponseInfo& second) {
+bool CommandRequestImpl::DecrementReferenceCount() const {
SDL_LOG_AUTO_TRACE();
- if (IsResultCodeUnsupported(first, second) ||
- IsResultCodeUnsupported(second, first)) {
- return mobile_apis::Result::UNSUPPORTED_RESOURCE;
- }
- if (IsResultCodeWarning(first, second) ||
- IsResultCodeWarning(second, first)) {
- return mobile_apis::Result::WARNINGS;
- }
- // If response contains erroneous result code SDL need return erroneus
- // result code.
- hmi_apis::Common_Result::eType first_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- hmi_apis::Common_Result::eType second_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- if (!first.is_unsupported_resource) {
- first_result = first.result_code;
- }
- if (!second.is_unsupported_resource) {
- second_result = second.result_code;
- }
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
- return result_code;
+ const auto conn_key = connection_key();
+ const auto corr_id = correlation_id();
+ return application_manager_.RemoveRetainedRequest(conn_key, corr_id);
}
-const CommandParametersPermissions& CommandRequestImpl::parameters_permissions()
- const {
- return parameters_permissions_;
+void CommandRequestImpl::OnUpdateTimeOut() {
+ SDL_LOG_AUTO_TRACE();
+ set_current_state(RequestState::kAwaitingResponse);
}
void CommandRequestImpl::StartAwaitForInterface(
- const HmiInterfaces::InterfaceID interface_id) {
+ const HmiInterfaces::InterfaceID& interface_id) {
sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
awaiting_response_interfaces_.insert(interface_id);
}
@@ -885,94 +190,31 @@ void CommandRequestImpl::StartAwaitForInterface(
bool CommandRequestImpl::IsInterfaceAwaited(
const HmiInterfaces::InterfaceID& interface_id) const {
sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
- std::set<HmiInterfaces::InterfaceID>::const_iterator it =
- awaiting_response_interfaces_.find(interface_id);
- return (it != awaiting_response_interfaces_.end());
+
+ return helpers::in_range(awaiting_response_interfaces_, interface_id);
}
void CommandRequestImpl::EndAwaitForInterface(
const HmiInterfaces::InterfaceID& interface_id) {
sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
- std::set<HmiInterfaces::InterfaceID>::const_iterator it =
- awaiting_response_interfaces_.find(interface_id);
- if (it != awaiting_response_interfaces_.end()) {
- awaiting_response_interfaces_.erase(it);
- } else {
- SDL_LOG_WARN(
- "EndAwaitForInterface called on interface \
- which was not put into await state: "
- << interface_id);
- }
+ awaiting_response_interfaces_.erase(interface_id);
}
-bool CommandRequestImpl::IsResultCodeUnsupported(
- const ResponseInfo& first, const ResponseInfo& second) const {
- const bool first_ok_second_unsupported =
- (first.is_ok || first.is_not_used) && second.is_unsupported_resource;
- const bool both_unsupported =
- first.is_unsupported_resource && second.is_unsupported_resource;
- return first_ok_second_unsupported || both_unsupported;
+bool CommandRequestImpl::IsPendingResponseExist() const {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ return !awaiting_response_interfaces_.empty();
}
-std::string GetComponentNameFromInterface(
- const HmiInterfaces::InterfaceID& interface) {
- switch (interface) {
- case HmiInterfaces::HMI_INTERFACE_Buttons:
- return hmi_interface::buttons;
- case HmiInterfaces::HMI_INTERFACE_BasicCommunication:
- return hmi_interface::basic_communication;
- case HmiInterfaces::HMI_INTERFACE_VR:
- return hmi_interface::vr;
- case HmiInterfaces::HMI_INTERFACE_TTS:
- return hmi_interface::tts;
- case HmiInterfaces::HMI_INTERFACE_UI:
- return hmi_interface::ui;
- case HmiInterfaces::HMI_INTERFACE_Navigation:
- return hmi_interface::navigation;
- case HmiInterfaces::HMI_INTERFACE_VehicleInfo:
- return hmi_interface::vehicle_info;
- case HmiInterfaces::HMI_INTERFACE_SDL:
- return hmi_interface::sdl;
- case HmiInterfaces::HMI_INTERFACE_RC:
- return hmi_interface::rc;
- case HmiInterfaces::HMI_INTERFACE_AppService:
- return hmi_interface::app_service;
- default:
- return "Unknown type";
- }
+CommandRequestImpl::RequestState CommandRequestImpl::current_state() const {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ return current_state_;
}
-const std::string InfoInterfaceSeparator(
- const std::string& sum, const HmiInterfaces::InterfaceID container_value) {
- return sum.empty()
- ? GetComponentNameFromInterface(container_value)
- : sum + ", " + GetComponentNameFromInterface(container_value);
-}
-
-void CommandRequestImpl::AddTimeOutComponentInfoToMessage(
- smart_objects::SmartObject& response) const {
- using ns_smart_device_link::ns_smart_objects::SmartObject;
- SDL_LOG_AUTO_TRACE();
- sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
- if (awaiting_response_interfaces_.empty()) {
- SDL_LOG_ERROR("No interfaces awaiting, info param is empty");
- return;
- }
-
- const std::string not_responding_interfaces_string =
- std::accumulate(awaiting_response_interfaces_.begin(),
- awaiting_response_interfaces_.end(),
- std::string(""),
- InfoInterfaceSeparator);
- SDL_LOG_DEBUG(
- "Not responding interfaces string: " << not_responding_interfaces_string);
- if (!not_responding_interfaces_string.empty()) {
- const std::string component_info =
- not_responding_interfaces_string + " component does not respond";
- response[strings::msg_params][strings::info] = component_info;
- }
+void CommandRequestImpl::set_current_state(
+ const CommandRequestImpl::RequestState state) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ current_state_ = state;
}
} // namespace commands
-
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc
index 835df70202..5a2e9f0730 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -53,12 +53,11 @@ RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message,
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
- , EventObserver(application_manager.event_dispatcher()) {
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
// Replace HMI app id with Mobile connection id
ReplaceHMIWithMobileAppId(*message);
}
@@ -79,6 +78,8 @@ void RequestFromHMI::on_event(const event_engine::Event& event) {}
void RequestFromHMI::on_event(const event_engine::MobileEvent& event) {}
+void RequestFromHMI::OnTimeOut() {}
+
void RequestFromHMI::SendResponse(
const bool success,
const uint32_t correlation_id,
@@ -143,43 +144,6 @@ void RequestFromHMI::FillCommonParametersOfSO(
(message)[strings::params][strings::correlation_id] = correlation_id;
}
-bool RequestFromHMI::IsMobileResultSuccess(
- mobile_apis::Result::eType result_code) const {
- SDL_LOG_AUTO_TRACE();
- using namespace helpers;
- return Compare<mobile_apis::Result::eType, EQ, ONE>(
- result_code,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS,
- mobile_apis::Result::WRONG_LANGUAGE,
- mobile_apis::Result::RETRY,
- mobile_apis::Result::SAVED);
-}
-
-bool RequestFromHMI::IsHMIResultSuccess(
- hmi_apis::Common_Result::eType result_code,
- HmiInterfaces::InterfaceID interface) const {
- SDL_LOG_AUTO_TRACE();
- using namespace helpers;
- if (Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED)) {
- return true;
- }
-
- const HmiInterfaces::InterfaceState state =
- application_manager_.hmi_interfaces().GetInterfaceState(interface);
- if ((hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code) &&
- (HmiInterfaces::STATE_NOT_AVAILABLE != state)) {
- return true;
- }
- return false;
-}
-
void RequestFromHMI::SendProviderRequest(
const mobile_apis::FunctionID::eType& mobile_function_id,
const hmi_apis::FunctionID::eType& hmi_function_id,
@@ -214,7 +178,7 @@ void RequestFromHMI::SendProviderRequest(
if (hmi_destination) {
SDL_LOG_DEBUG("Sending Request to HMI Provider");
application_manager_.IncreaseForwardedRequestTimeout(
- application_manager::request_controller::RequestInfo::HmiConnectionKey,
+ application_manager::request_controller::RequestInfo::kHmiConnectionKey,
correlation_id());
SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events);
return;
@@ -232,7 +196,7 @@ void RequestFromHMI::SendProviderRequest(
SDL_LOG_DEBUG("Sending Request to Mobile Provider");
application_manager_.IncreaseForwardedRequestTimeout(
- application_manager::request_controller::RequestInfo::HmiConnectionKey,
+ application_manager::request_controller::RequestInfo::kHmiConnectionKey,
correlation_id());
SendMobileRequest(
mobile_function_id, app, &(*msg)[strings::msg_params], use_events);
diff --git a/src/components/application_manager/src/commands/request_from_mobile_impl.cc b/src/components/application_manager/src/commands/request_from_mobile_impl.cc
new file mode 100644
index 0000000000..42df13f034
--- /dev/null
+++ b/src/components/application_manager/src/commands/request_from_mobile_impl.cc
@@ -0,0 +1,906 @@
+/*
+ Copyright (c) 2020, 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/commands/request_from_mobile_impl.h"
+
+#include <algorithm>
+#include <numeric>
+#include <string>
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+#include "utils/helpers.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDL_CREATE_LOG_VARIABLE("Commands")
+
+namespace smart_objects = ns_smart_device_link::ns_smart_objects;
+
+std::string MergeInfos(const ResponseInfo& first_info,
+ const std::string& first_str,
+ const ResponseInfo& second_info,
+ const std::string& second_str) {
+ if ((first_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (second_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !second_str.empty()) {
+ return second_str;
+ }
+
+ if ((second_info.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (first_info.interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !first_str.empty()) {
+ return first_str;
+ }
+
+ return MergeInfos(first_str, second_str);
+}
+
+std::string MergeInfos(const std::string& first, const std::string& second) {
+ return first + ((!first.empty() && !second.empty()) ? ", " : "") + second;
+}
+
+std::string MergeInfos(const std::string& first,
+ const std::string& second,
+ const std::string& third) {
+ std::string result = MergeInfos(first, second);
+ return MergeInfos(result, third);
+}
+
+const std::string CreateInfoForUnsupportedResult(
+ HmiInterfaces::InterfaceID interface) {
+ switch (interface) {
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VR): {
+ return "VR is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS): {
+ return "TTS is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_UI): {
+ return "UI is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_Navigation): {
+ return "Navigation is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
+ return "VehicleInfo is not supported by system";
+ }
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): {
+ return "Remote control is not supported by system";
+ }
+ default:
+ SDL_LOG_WARN(
+ "Could not create info because"
+ " interface isn't valid. Interface is:"
+ << static_cast<int32_t>(interface));
+ return "";
+ }
+}
+
+bool RequestFromMobileImpl::CheckResultCode(const ResponseInfo& first,
+ const ResponseInfo& second) const {
+ if (first.is_ok && second.is_unsupported_resource) {
+ return true;
+ }
+ if (first.is_ok && second.is_not_used) {
+ return true;
+ }
+ if (first.is_ok && second.is_ok) {
+ return true;
+ }
+ return false;
+}
+
+bool IsResultCodeWarning(const ResponseInfo& first,
+ const ResponseInfo& second) {
+ const bool first_is_ok_second_is_warn =
+ (first.is_ok || first.is_not_used) &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ const bool both_warnings =
+ hmi_apis::Common_Result::WARNINGS == first.result_code &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ return first_is_ok_second_is_warn || both_warnings;
+}
+
+ResponseInfo::ResponseInfo()
+ : result_code(hmi_apis::Common_Result::INVALID_ENUM)
+ , interface(HmiInterfaces::HMI_INTERFACE_INVALID_ENUM)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {}
+
+ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager)
+ : result_code(result)
+ , interface(hmi_interface)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {
+ using namespace helpers;
+
+ interface_state =
+ application_manager.hmi_interfaces().GetInterfaceState(hmi_interface);
+
+ is_ok = IsHMIResultSuccess(result_code);
+
+ is_not_used = hmi_apis::Common_Result::INVALID_ENUM == result_code;
+
+ is_unsupported_resource =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
+}
+
+RequestFromMobileImpl::RequestFromMobileImpl(
+ const 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)
+ , hash_update_mode_(kSkipHashUpdate)
+ , is_success_result_(false) {}
+
+RequestFromMobileImpl::~RequestFromMobileImpl() {
+ UpdateHash();
+}
+
+bool RequestFromMobileImpl::Init() {
+ return true;
+}
+
+bool RequestFromMobileImpl::CheckPermissions() {
+ return CheckAllowedParameters(Command::CommandSource::SOURCE_MOBILE);
+}
+
+bool RequestFromMobileImpl::CleanUp() {
+ unsubscribe_from_all_mobile_events();
+ unsubscribe_from_all_hmi_events(); // To prevent on_event calls
+
+ // Cleanup for mobile requests can be done only if OnEvent/OnTimeout events
+ // are not processed at that moment
+ return kAwaitingResponse == current_state();
+}
+
+void RequestFromMobileImpl::Run() {}
+
+void RequestFromMobileImpl::OnTimeOut() {
+ SDL_LOG_AUTO_TRACE();
+
+ unsubscribe_from_all_mobile_events();
+ unsubscribe_from_all_hmi_events();
+
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(connection_key(),
+ function_id(),
+ correlation_id(),
+ mobile_api::Result::GENERIC_ERROR);
+
+ AddTimeOutComponentInfoToMessage(*response);
+
+ rpc_service_.ManageMobileCommand(response, SOURCE_SDL);
+}
+
+void RequestFromMobileImpl::on_event(const event_engine::Event& event) {}
+
+void RequestFromMobileImpl::on_event(const event_engine::MobileEvent& event) {}
+
+void RequestFromMobileImpl::SendResponse(
+ const bool success,
+ const mobile_apis::Result::eType& result_code,
+ const char* info,
+ const smart_objects::SmartObject* response_params,
+ const std::vector<uint8_t> binary_data) {
+ SDL_LOG_AUTO_TRACE();
+
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
+ smart_objects::SmartObject& response = *result;
+
+ response[strings::params][strings::message_type] = MessageType::kResponse;
+ response[strings::params][strings::correlation_id] = correlation_id();
+ response[strings::params][strings::protocol_type] =
+ CommandImpl::mobile_protocol_type_;
+ response[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ response[strings::params][strings::connection_key] = connection_key();
+ response[strings::params][strings::function_id] = function_id();
+ if (!binary_data.empty()) {
+ response[strings::params][strings::binary_data] = binary_data;
+ }
+ if (response_params) {
+ response[strings::msg_params] = *response_params;
+ }
+
+ if (info && *info != '\0') {
+ response[strings::msg_params][strings::info] = std::string(info);
+ }
+
+ // Add disallowed parameters and info from request back to response with
+ // appropriate reasons (VehicleData result codes)
+ if (result_code != mobile_apis::Result::APPLICATION_NOT_REGISTERED &&
+ result_code != mobile_apis::Result::INVALID_DATA) {
+ FormatResponse(response);
+ }
+
+ response[strings::msg_params][strings::success] = success;
+ if ((result_code == mobile_apis::Result::SUCCESS ||
+ result_code == mobile_apis::Result::WARNINGS) &&
+ !warning_info().empty()) {
+ response[strings::msg_params][strings::info] =
+ (info && *info != '\0') ? std::string(info) + "\n" + warning_info()
+ : warning_info();
+ response[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::WARNINGS;
+ } else if (mobile_apis::Result::INVALID_ENUM == result_code) {
+ response[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ response[strings::msg_params][strings::info] =
+ "Invalid result received from vehicle";
+ } else {
+ response[strings::msg_params][strings::result_code] = result_code;
+ }
+
+ is_success_result_ = success;
+
+ rpc_service_.ManageMobileCommand(result, SOURCE_SDL);
+}
+
+smart_objects::SmartObject CreateUnsupportedResourceResponse(
+ const hmi_apis::FunctionID::eType function_id,
+ const uint32_t hmi_correlation_id,
+ HmiInterfaces::InterfaceID interface) {
+ smart_objects::SmartObject response(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& params = response[strings::params];
+ params[strings::message_type] = MessageType::kResponse;
+ params[strings::correlation_id] = hmi_correlation_id;
+ params[strings::protocol_type] = CommandImpl::hmi_protocol_type_;
+ params[strings::protocol_version] = CommandImpl::protocol_version_;
+ params[strings::function_id] = function_id;
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ smart_objects::SmartObject& msg_params = response[strings::msg_params];
+ msg_params[strings::info] = CreateInfoForUnsupportedResult(interface);
+ return response;
+}
+
+bool RequestFromMobileImpl::ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id) {
+ SDL_LOG_AUTO_TRACE();
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ HmiInterfaces::InterfaceID interface =
+ hmi_interfaces.GetInterfaceFromFunction(function_id);
+ DCHECK(interface != HmiInterfaces::HMI_INTERFACE_INVALID_ENUM);
+ const HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ if (HmiInterfaces::STATE_NOT_AVAILABLE == state) {
+ event_engine::Event event(function_id);
+ event.set_smart_object(CreateUnsupportedResourceResponse(
+ function_id, hmi_correlation_id, interface));
+ event.raise(application_manager_.event_dispatcher());
+ return false;
+ }
+ return true;
+}
+
+void RequestFromMobileImpl::UpdateHash() {
+ SDL_LOG_AUTO_TRACE();
+ if (hash_update_mode_ == kSkipHashUpdate) {
+ SDL_LOG_DEBUG("Hash update is disabled for " << function_id());
+ return;
+ }
+
+ if (HmiInterfaces::InterfaceState::STATE_NOT_RESPONSE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI)) {
+ SDL_LOG_ERROR("UI interface has not responded. Hash won't be updated.");
+ return;
+ }
+
+ if (!is_success_result_) {
+ SDL_LOG_WARN("Command is not succeeded. Hash won't be updated.");
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ if (!application) {
+ SDL_LOG_ERROR("Application with connection key "
+ << connection_key()
+ << " not found. Not able to update hash.");
+ return;
+ }
+
+ SDL_LOG_DEBUG(
+ "Updating hash for application with connection key "
+ << connection_key() << " while processing function id "
+ << MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())));
+
+ application->UpdateHash();
+}
+
+uint32_t RequestFromMobileImpl::SendHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params,
+ bool use_events) {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
+ const uint32_t hmi_correlation_id =
+ application_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ if (msg_params) {
+ request[strings::msg_params] = *msg_params;
+ }
+
+ if (use_events) {
+ SDL_LOG_DEBUG("SendHMIRequest subscribe_on_event " << function_id << " "
+ << hmi_correlation_id);
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+ if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) {
+ if (rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
+ AddRequestToTimeoutHandler(request);
+ } else {
+ SDL_LOG_ERROR("Unable to send request");
+ SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
+ }
+ } else {
+ SDL_LOG_DEBUG("Interface is not available");
+ }
+ return hmi_correlation_id;
+}
+
+void RequestFromMobileImpl::CreateHMINotification(
+ const hmi_apis::FunctionID::eType& function_id,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& msg_params)
+ const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+ if (!result) {
+ SDL_LOG_ERROR("Memory allocation failed.");
+ return;
+ }
+ smart_objects::SmartObject& notify = *result;
+
+ notify[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ notify[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ notify[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+ notify[strings::params][strings::function_id] = function_id;
+ notify[strings::msg_params] = msg_params;
+
+ if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
+ SDL_LOG_ERROR("Unable to send HMI notification");
+ }
+}
+
+mobile_apis::Result::eType RequestFromMobileImpl::GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const {
+ mobile_apis::Result::eType mobile_result = mobile_apis::Result::GENERIC_ERROR;
+ switch (hmi_code) {
+ case hmi_apis::Common_Result::SUCCESS: {
+ mobile_result = mobile_apis::Result::SUCCESS;
+ break;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: {
+ mobile_result = mobile_apis::Result::UNSUPPORTED_REQUEST;
+ break;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: {
+ mobile_result = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ break;
+ }
+ case hmi_apis::Common_Result::DISALLOWED: {
+ mobile_result = mobile_apis::Result::DISALLOWED;
+ break;
+ }
+ case hmi_apis::Common_Result::REJECTED: {
+ mobile_result = mobile_apis::Result::REJECTED;
+ break;
+ }
+ case hmi_apis::Common_Result::ABORTED: {
+ mobile_result = mobile_apis::Result::ABORTED;
+ break;
+ }
+ case hmi_apis::Common_Result::IGNORED: {
+ mobile_result = mobile_apis::Result::IGNORED;
+ break;
+ }
+ case hmi_apis::Common_Result::RETRY: {
+ mobile_result = mobile_apis::Result::RETRY;
+ break;
+ }
+ case hmi_apis::Common_Result::IN_USE: {
+ mobile_result = mobile_apis::Result::IN_USE;
+ break;
+ }
+ case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: {
+ mobile_result = mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE;
+ break;
+ }
+ case hmi_apis::Common_Result::TIMED_OUT: {
+ mobile_result = mobile_apis::Result::TIMED_OUT;
+ break;
+ }
+ case hmi_apis::Common_Result::INVALID_DATA: {
+ mobile_result = mobile_apis::Result::INVALID_DATA;
+ break;
+ }
+ case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: {
+ mobile_result = mobile_apis::Result::CHAR_LIMIT_EXCEEDED;
+ break;
+ }
+ case hmi_apis::Common_Result::INVALID_ID: {
+ mobile_result = mobile_apis::Result::INVALID_ID;
+ break;
+ }
+ case hmi_apis::Common_Result::DUPLICATE_NAME: {
+ mobile_result = mobile_apis::Result::DUPLICATE_NAME;
+ break;
+ }
+ case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::WRONG_LANGUAGE: {
+ mobile_result = mobile_apis::Result::WRONG_LANGUAGE;
+ break;
+ }
+ case hmi_apis::Common_Result::OUT_OF_MEMORY: {
+ mobile_result = mobile_apis::Result::OUT_OF_MEMORY;
+ break;
+ }
+ case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: {
+ mobile_result = mobile_apis::Result::TOO_MANY_PENDING_REQUESTS;
+ break;
+ }
+ case hmi_apis::Common_Result::NO_APPS_REGISTERED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::WARNINGS: {
+ mobile_result = mobile_apis::Result::WARNINGS;
+ break;
+ }
+ case hmi_apis::Common_Result::GENERIC_ERROR: {
+ mobile_result = mobile_apis::Result::GENERIC_ERROR;
+ break;
+ }
+ case hmi_apis::Common_Result::USER_DISALLOWED: {
+ mobile_result = mobile_apis::Result::USER_DISALLOWED;
+ break;
+ }
+ case hmi_apis::Common_Result::SAVED: {
+ mobile_result = mobile_apis::Result::SAVED;
+ break;
+ }
+ case hmi_apis::Common_Result::READ_ONLY: {
+ mobile_result = mobile_apis::Result::READ_ONLY;
+ break;
+ }
+ default: {
+ SDL_LOG_ERROR("Unknown HMI result code " << hmi_code);
+ break;
+ }
+ }
+
+ return mobile_result;
+}
+
+bool RequestFromMobileImpl::CheckHMICapabilities(
+ const mobile_apis::ButtonName::eType button) const {
+ SDL_LOG_AUTO_TRACE();
+
+ using namespace smart_objects;
+ using namespace mobile_apis;
+
+ if (!hmi_capabilities_.is_ui_cooperating()) {
+ SDL_LOG_ERROR("UI is not supported by HMI");
+ return false;
+ }
+
+ const auto button_capabilities_so = hmi_capabilities_.button_capabilities();
+ if (!button_capabilities_so) {
+ SDL_LOG_ERROR("Invalid button capabilities object");
+ return false;
+ }
+
+ const SmartObject& button_capabilities = *button_capabilities_so;
+ for (size_t i = 0; i < button_capabilities.length(); ++i) {
+ const SmartObject& capabilities = button_capabilities[i];
+ const ButtonName::eType current_button = static_cast<ButtonName::eType>(
+ capabilities.getElement(hmi_response::button_name).asInt());
+ if (current_button == button) {
+ SDL_LOG_DEBUG("Button capabilities for " << button << " was found");
+ return true;
+ }
+ }
+
+ SDL_LOG_DEBUG("Button capabilities for " << button << " was not found");
+ return false;
+}
+
+void RequestFromMobileImpl::RemoveDisallowedParameters() {
+ SDL_LOG_AUTO_TRACE();
+
+ smart_objects::SmartObject& params = (*message_)[strings::msg_params];
+
+ // Remove from request all disallowed parameters
+ RPCParams::const_iterator it_disallowed =
+ parameters_permissions_.disallowed_params.begin();
+ RPCParams::const_iterator it_disallowed_end =
+ parameters_permissions_.disallowed_params.end();
+ for (; it_disallowed != it_disallowed_end; ++it_disallowed) {
+ if (params.keyExists(*it_disallowed)) {
+ const std::string key = *it_disallowed;
+ params.erase(key);
+ removed_parameters_permissions_.disallowed_params.insert(key);
+ SDL_LOG_INFO("Following parameter is disallowed by user: " << key);
+ }
+ }
+
+ // Remove from request all undefined yet parameters
+ RPCParams::const_iterator it_undefined =
+ parameters_permissions_.undefined_params.begin();
+ RPCParams::const_iterator it_undefined_end =
+ parameters_permissions_.undefined_params.end();
+ for (; it_undefined != it_undefined_end; ++it_undefined) {
+ if (params.keyExists(*it_undefined)) {
+ const std::string key = *it_undefined;
+ params.erase(key);
+ removed_parameters_permissions_.undefined_params.insert(key);
+ SDL_LOG_INFO("Following parameter is disallowed by policy: " << key);
+ }
+ }
+
+ // Remove from request all parameters missed in allowed
+ const VehicleData& vehicle_data =
+ application_manager::MessageHelper::vehicle_data();
+
+ VehicleData::const_iterator it_vehicle_data = vehicle_data.begin();
+ VehicleData::const_iterator it_vehicle_data_end = vehicle_data.end();
+ for (; it_vehicle_data != it_vehicle_data_end; ++it_vehicle_data) {
+ const std::string key = it_vehicle_data->first;
+ if (params.keyExists(key) &&
+ parameters_permissions_.allowed_params.end() ==
+ std::find(parameters_permissions_.allowed_params.begin(),
+ parameters_permissions_.allowed_params.end(),
+ key)) {
+ params.erase(key);
+ removed_parameters_permissions_.undefined_params.insert(key);
+ SDL_LOG_INFO("Following parameter is not found among allowed parameters '"
+ << key << "' and will be treated as disallowed.");
+ }
+ }
+}
+
+bool RequestFromMobileImpl::HasDisallowedParams() const {
+ return ((!removed_parameters_permissions_.disallowed_params.empty()) ||
+ (!removed_parameters_permissions_.undefined_params.empty()));
+}
+
+bool RequestFromMobileImpl::PrepareResultForMobileResponse(
+ hmi_apis::Common_Result::eType result_code,
+ HmiInterfaces::InterfaceID interface) const {
+ SDL_LOG_AUTO_TRACE();
+
+ return IsHMIResultSuccess(result_code, interface);
+}
+
+bool RequestFromMobileImpl::PrepareResultForMobileResponse(
+ ResponseInfo& out_first, ResponseInfo& out_second) const {
+ SDL_LOG_AUTO_TRACE();
+ bool result = CheckResultCode(out_first, out_second) ||
+ CheckResultCode(out_second, out_first);
+ return result;
+}
+
+bool RequestFromMobileImpl::PrepareResultForMobileResponse(
+ ResponseInfo& out_first,
+ ResponseInfo& out_second,
+ ResponseInfo& out_third) const {
+ SDL_LOG_AUTO_TRACE();
+ bool result = (PrepareResultForMobileResponse(out_first, out_second) ||
+ PrepareResultForMobileResponse(out_second, out_third)) &&
+ PrepareResultForMobileResponse(out_first, out_third);
+ return result;
+}
+
+void RequestFromMobileImpl::GetInfo(
+ const smart_objects::SmartObject& response_from_hmi,
+ std::string& out_info) const {
+ if (response_from_hmi[strings::msg_params].keyExists(strings::info)) {
+ if (!response_from_hmi[strings::msg_params][strings::info].empty()) {
+ out_info =
+ response_from_hmi[strings::msg_params][strings::info].asString();
+ }
+ }
+}
+
+mobile_apis::Result::eType RequestFromMobileImpl::PrepareResultCodeForResponse(
+ const ResponseInfo& first, const ResponseInfo& second) {
+ SDL_LOG_AUTO_TRACE();
+ if (IsResultCodeUnsupported(first, second) ||
+ IsResultCodeUnsupported(second, first)) {
+ return mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ }
+ if (IsResultCodeWarning(first, second) ||
+ IsResultCodeWarning(second, first)) {
+ return mobile_apis::Result::WARNINGS;
+ }
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType first_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType second_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (!first.is_unsupported_resource) {
+ first_result = first.result_code;
+ }
+ if (!second.is_unsupported_resource) {
+ second_result = second.result_code;
+ }
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
+ return result_code;
+}
+
+mobile_apis::Result::eType RequestFromMobileImpl::PrepareResultCodeForResponse(
+ const ResponseInfo& first,
+ const ResponseInfo& second,
+ const ResponseInfo& third) {
+ SDL_LOG_AUTO_TRACE();
+
+ const auto first_comparison = PrepareResultCodeForResponse(first, second);
+ const auto second_comparison = PrepareResultCodeForResponse(second, third);
+ const auto third_comparison = PrepareResultCodeForResponse(first, third);
+
+ return std::max({first_comparison, second_comparison, third_comparison});
+}
+
+const CommandParametersPermissions&
+RequestFromMobileImpl::parameters_permissions() const {
+ return parameters_permissions_;
+}
+
+void RequestFromMobileImpl::SendProviderRequest(
+ const mobile_apis::FunctionID::eType& mobile_function_id,
+ const hmi_apis::FunctionID::eType& hmi_function_id,
+ const smart_objects::SmartObject* msg,
+ bool use_events) {
+ SDL_LOG_AUTO_TRACE();
+ bool hmi_destination = false;
+ ApplicationSharedPtr app;
+ // Default error code and error message
+ std::string error_msg = "No app service provider available";
+ mobile_apis::Result::eType error_code =
+ mobile_apis::Result::DATA_NOT_AVAILABLE;
+
+ if ((*msg)[strings::msg_params].keyExists(strings::service_type)) {
+ std::string service_type =
+ (*msg)[strings::msg_params][strings::service_type].asString();
+ application_manager_.GetAppServiceManager().GetProviderByType(
+ service_type, true, app, hmi_destination);
+ error_msg = "No app service provider with serviceType: " + service_type +
+ " is available";
+ error_code = mobile_apis::Result::DATA_NOT_AVAILABLE;
+ } else if ((*msg)[strings::msg_params].keyExists(strings::service_id)) {
+ std::string service_id =
+ (*msg)[strings::msg_params][strings::service_id].asString();
+ application_manager_.GetAppServiceManager().GetProviderByID(
+ service_id, true, app, hmi_destination);
+ error_msg = "No app service provider with serviceId: " + service_id +
+ " is available";
+ error_code = mobile_apis::Result::INVALID_ID;
+ }
+
+ if (hmi_destination) {
+ SDL_LOG_DEBUG("Sending Request to HMI Provider");
+ application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
+ correlation_id());
+ SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events);
+ return;
+ }
+
+ if (!app) {
+ SDL_LOG_DEBUG("Invalid App Provider pointer");
+ SendResponse(false, error_code, error_msg.c_str());
+ return;
+ }
+
+ if (connection_key() == app->app_id()) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Consumer app is same as producer app");
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr new_msg =
+ std::make_shared<smart_objects::SmartObject>();
+ smart_objects::SmartObject& request = *new_msg;
+
+ request[strings::params] = (*msg)[strings::params];
+ request[strings::msg_params] = (*msg)[strings::msg_params];
+ request[strings::params][strings::connection_key] = app->app_id();
+
+ application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
+ correlation_id());
+ SendMobileRequest(mobile_function_id, new_msg, use_events);
+}
+
+bool RequestFromMobileImpl::IsResultCodeUnsupported(
+ const ResponseInfo& first, const ResponseInfo& second) const {
+ const bool first_ok_second_unsupported =
+ (first.is_ok || first.is_not_used) && second.is_unsupported_resource;
+ const bool both_unsupported =
+ first.is_unsupported_resource && second.is_unsupported_resource;
+ return first_ok_second_unsupported || both_unsupported;
+}
+
+std::string GetComponentNameFromInterface(
+ const HmiInterfaces::InterfaceID& interface) {
+ switch (interface) {
+ case HmiInterfaces::HMI_INTERFACE_Buttons:
+ return hmi_interface::buttons;
+ case HmiInterfaces::HMI_INTERFACE_BasicCommunication:
+ return hmi_interface::basic_communication;
+ case HmiInterfaces::HMI_INTERFACE_VR:
+ return hmi_interface::vr;
+ case HmiInterfaces::HMI_INTERFACE_TTS:
+ return hmi_interface::tts;
+ case HmiInterfaces::HMI_INTERFACE_UI:
+ return hmi_interface::ui;
+ case HmiInterfaces::HMI_INTERFACE_Navigation:
+ return hmi_interface::navigation;
+ case HmiInterfaces::HMI_INTERFACE_VehicleInfo:
+ return hmi_interface::vehicle_info;
+ case HmiInterfaces::HMI_INTERFACE_SDL:
+ return hmi_interface::sdl;
+ case HmiInterfaces::HMI_INTERFACE_RC:
+ return hmi_interface::rc;
+ case HmiInterfaces::HMI_INTERFACE_AppService:
+ return hmi_interface::app_service;
+ default:
+ return "Unknown type";
+ }
+}
+
+const std::string InfoInterfaceSeparator(
+ const std::string& sum, const HmiInterfaces::InterfaceID container_value) {
+ return sum.empty()
+ ? GetComponentNameFromInterface(container_value)
+ : sum + ", " + GetComponentNameFromInterface(container_value);
+}
+
+void RequestFromMobileImpl::AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const {
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ if (awaiting_response_interfaces_.empty()) {
+ SDL_LOG_ERROR("No interfaces awaiting, info param is empty");
+ return;
+ }
+
+ const std::string not_responding_interfaces_string =
+ std::accumulate(awaiting_response_interfaces_.begin(),
+ awaiting_response_interfaces_.end(),
+ std::string(""),
+ InfoInterfaceSeparator);
+ SDL_LOG_DEBUG(
+ "Not responding interfaces string: " << not_responding_interfaces_string);
+ if (!not_responding_interfaces_string.empty()) {
+ const std::string component_info =
+ not_responding_interfaces_string + " component does not respond";
+ response[strings::msg_params][strings::info] = component_info;
+ }
+}
+
+void RequestFromMobileImpl::AddRequestToTimeoutHandler(
+ const smart_objects::SmartObject& request_to_hmi) const {
+ auto function_id = static_cast<hmi_apis::FunctionID::eType>(
+ request_to_hmi[strings::params][strings::function_id].asUInt());
+ // SDL must not apply "default timeout for RPCs processing" for
+ // BasicCommunication.DialNumber RPC (that is, SDL must always wait for HMI
+ // response to BC.DialNumber as long as it takes and not return GENERIC_ERROR
+ // to mobile app), so the OnResetTimeout logic is not applicable for
+ // DialNumber RPC
+ if (helpers::Compare<hmi_apis::FunctionID::eType, helpers::EQ, helpers::ONE>(
+ function_id,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber,
+ hmi_apis::FunctionID::INVALID_ENUM)) {
+ SDL_LOG_DEBUG(
+ "Current RPC is DialNumber or Invalid, OnResetTimeout "
+ "logic is not applicable in this case");
+ return;
+ }
+
+ // If soft buttons are present in Alert or SubtleAlert RPC, SDL will not use
+ // timeout tracking for response, so the OnResetTimeout logic is not
+ // applicable in this case
+ if (helpers::Compare<hmi_apis::FunctionID::eType, helpers::EQ, helpers::ONE>(
+ function_id,
+ hmi_apis::FunctionID::UI_Alert,
+ hmi_apis::FunctionID::UI_SubtleAlert)) {
+ if (request_to_hmi.keyExists(strings::msg_params)) {
+ if (request_to_hmi[strings::msg_params].keyExists(
+ strings::soft_buttons)) {
+ SDL_LOG_DEBUG("Soft buttons are present in "
+ << EnumToString(function_id)
+ << " RPC, OnResetTimeout "
+ "logic is not applicable in this case");
+ return;
+ }
+ }
+ }
+
+ const application_manager::request_controller::Request request{
+ correlation_id(), connection_key(), static_cast<uint32_t>(function_id)};
+ application_manager_.get_request_timeout_handler().AddRequest(
+ request_to_hmi[strings::params][strings::correlation_id].asUInt(),
+ request);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/request_to_hmi.cc b/src/components/application_manager/src/commands/request_to_hmi.cc
index 35ac71c8bd..86f25711da 100644
--- a/src/components/application_manager/src/commands/request_to_hmi.cc
+++ b/src/components/application_manager/src/commands/request_to_hmi.cc
@@ -80,26 +80,6 @@ bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
return HmiInterfaces::STATE_NOT_AVAILABLE != state;
}
-bool IsResponseCodeSuccess(
- const smart_objects::SmartObject& response_from_hmi) {
- auto response_code = static_cast<hmi_apis::Common_Result::eType>(
- response_from_hmi[strings::params][hmi_response::code].asInt());
-
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ONE;
-
- const bool is_result_success =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- response_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED);
- return is_result_success;
-}
-
bool ChangeInterfaceState(ApplicationManager& application_manager,
const smart_objects::SmartObject& response_from_hmi,
HmiInterfaces::InterfaceID interface) {
@@ -113,12 +93,14 @@ bool ChangeInterfaceState(ApplicationManager& application_manager,
return false;
}
- // Process response with result
- if (response_from_hmi[strings::params].keyExists(hmi_response::code) &&
- !IsResponseCodeSuccess(response_from_hmi)) {
- application_manager.hmi_interfaces().SetInterfaceState(
- interface, HmiInterfaces::STATE_NOT_AVAILABLE);
- return false;
+ if (response_from_hmi[strings::params].keyExists(hmi_response::code)) {
+ auto response_code = static_cast<hmi_apis::Common_Result::eType>(
+ response_from_hmi[strings::params][hmi_response::code].asInt());
+ if (!IsHMIResultSuccess(response_code)) {
+ application_manager.hmi_interfaces().SetInterfaceState(
+ interface, HmiInterfaces::STATE_NOT_AVAILABLE);
+ return false;
+ }
}
application_manager.hmi_interfaces().SetInterfaceState(
@@ -141,11 +123,11 @@ RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
RequestToHMI::~RequestToHMI() {}
@@ -155,6 +137,7 @@ bool RequestToHMI::Init() {
}
bool RequestToHMI::CleanUp() {
+ unsubscribe_from_all_hmi_events();
return true;
}
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
index 7392731d70..0d7dc9cfe0 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
@@ -66,7 +66,11 @@ void EventDispatcherImpl::raise_event(const Event& event) {
EventObserver* temp = *observers.begin();
observers.erase(observers.begin());
AutoUnlock unlock_observer(observer_lock);
- temp->on_event(event);
+
+ if (temp->IncrementReferenceCount()) {
+ temp->HandleOnEvent(event);
+ temp->DecrementReferenceCount();
+ }
}
}
@@ -89,6 +93,15 @@ struct IdCheckFunctor {
};
void EventDispatcherImpl::remove_observer(const Event::EventID& event_id,
+ const int32_t hmi_correlation_id) {
+ AutoLock auto_lock(state_lock_);
+ auto& observers = observers_event_[event_id][hmi_correlation_id];
+ for (auto observer : observers) {
+ remove_observer_from_vector(*observer);
+ }
+}
+
+void EventDispatcherImpl::remove_observer(const Event::EventID& event_id,
EventObserver& observer) {
remove_observer_from_vector(observer);
AutoLock auto_lock(state_lock_);
@@ -148,7 +161,11 @@ void EventDispatcherImpl::raise_mobile_event(const MobileEvent& event) {
EventObserver* temp = *mobile_observers_.begin();
mobile_observers_.erase(mobile_observers_.begin());
AutoUnlock unlock_observer(observer_lock);
- temp->on_event(event);
+
+ if (temp->IncrementReferenceCount()) {
+ temp->HandleOnEvent(event);
+ temp->DecrementReferenceCount();
+ }
}
}
diff --git a/src/components/application_manager/src/event_engine/event_observer.cc b/src/components/application_manager/src/event_engine/event_observer.cc
index e17203f2f2..6b6d6def35 100644
--- a/src/components/application_manager/src/event_engine/event_observer.cc
+++ b/src/components/application_manager/src/event_engine/event_observer.cc
@@ -75,7 +75,15 @@ void EventObserver::unsubscribe_from_all_mobile_events() {
event_dispatcher_.remove_mobile_observer(*this);
}
-void EventObserver::on_event(const event_engine::MobileEvent& event) {}
+void EventObserver::HandleOnEvent(const event_engine::MobileEvent& event) {}
+
+bool EventObserver::IncrementReferenceCount() const {
+ return true;
+}
+
+bool EventObserver::DecrementReferenceCount() const {
+ return true;
+}
} // namespace event_engine
} // namespace application_manager
diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc
index 8d43ff2d9f..30a1139deb 100644
--- a/src/components/application_manager/src/help_prompt_manager_impl.cc
+++ b/src/components/application_manager/src/help_prompt_manager_impl.cc
@@ -369,7 +369,9 @@ void HelpPromptManagerImpl::SetSendingType(
}
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
SDL_LOG_DEBUG(
"Sending type set to:" << static_cast<uint32_t>(sending_type_));
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
index 74810d7e09..09b8eed6fe 100644
--- a/src/components/application_manager/src/helpers/application_helper.cc
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -87,6 +87,7 @@ void DeleteGlobalProperties(ApplicationSharedPtr app,
app->set_keyboard_props(empty_so);
app->set_menu_icon(empty_so);
app->set_menu_title(empty_so);
+ app->set_menu_layout(empty_so);
MessageHelper::SendResetPropertiesRequest(app, app_manager);
}
@@ -94,13 +95,19 @@ void DeleteGlobalProperties(ApplicationSharedPtr app,
void DeleteButtonSubscriptions(ApplicationSharedPtr app,
ApplicationManager& app_manager) {
ButtonSubscriptions buttons = app->SubscribedButtons().GetData();
-
for (auto button : buttons) {
- if (mobile_apis::ButtonName::CUSTOM_BUTTON == button) {
+ const auto hmi_button =
+ static_cast<hmi_apis::Common_ButtonName::eType>(button);
+ if (hmi_apis::Common_ButtonName::CUSTOM_BUTTON == hmi_button) {
continue;
}
- MessageHelper::SendUnsubscribeButtonNotification(button, app, app_manager);
- app->UnsubscribeFromButton(button);
+ smart_objects::SmartObjectSPtr unsubscribe_request =
+ MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ app->app_id(),
+ hmi_button,
+ hmi_apis::FunctionID::Buttons_UnsubscribeButton,
+ app_manager);
+ app_manager.GetRPCService().ManageHMICommand(unsubscribe_request);
}
}
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index f313e0c0a5..a8001eba91 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -431,8 +431,6 @@ void HMICapabilitiesImpl::Init(
ui_language_, vr_language_, tts_language_);
}
-void HMICapabilitiesImpl::Init(resumption::LastState*) {}
-
bool HMICapabilitiesImpl::is_ui_cooperating() const {
return is_ui_cooperating_;
}
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index e4fa4c936c..205585959b 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -43,8 +43,8 @@ generate_function_to_interface_convert_map() {
convert_map[Buttons_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_Buttons;
convert_map[Buttons_OnButtonEvent] = HmiInterfaces::HMI_INTERFACE_Buttons;
convert_map[Buttons_OnButtonPress] = HmiInterfaces::HMI_INTERFACE_Buttons;
- convert_map[Buttons_OnButtonSubscription] =
- HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[Buttons_SubscribeButton] = HmiInterfaces::HMI_INTERFACE_Buttons;
+ convert_map[Buttons_UnsubscribeButton] = HmiInterfaces::HMI_INTERFACE_Buttons;
convert_map[BasicCommunication_OnReady] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnStartDeviceDiscovery] =
@@ -132,7 +132,8 @@ generate_function_to_interface_convert_map() {
convert_map[TTS_GetSupportedLanguages] = HmiInterfaces::HMI_INTERFACE_TTS;
convert_map[TTS_GetLanguage] = HmiInterfaces::HMI_INTERFACE_TTS;
convert_map[TTS_SetGlobalProperties] = HmiInterfaces::HMI_INTERFACE_TTS;
- convert_map[TTS_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_TTS;
+ convert_map[BasicCommunication_OnResetTimeout] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[UI_Alert] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_SubtleAlert] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_Show] = HmiInterfaces::HMI_INTERFACE_UI;
@@ -165,7 +166,6 @@ generate_function_to_interface_convert_map() {
convert_map[UI_EndAudioPassThru] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_IsReady] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_ClosePopUp] = HmiInterfaces::HMI_INTERFACE_UI;
- convert_map[UI_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_SendHapticData] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[Navigation_IsReady] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_SendLocation] =
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index 750755478e..776595a040 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/hmi_language_handler.h"
+
#include "application_manager/application_manager.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/message_helper.h"
@@ -119,7 +120,7 @@ hmi_apis::Common_Language::eType HMILanguageHandler::get_language_for(
return Common_Language::INVALID_ENUM;
}
-void HMILanguageHandler::on_event(const event_engine::Event& event) {
+void HMILanguageHandler::HandleOnEvent(const event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
smart_objects::SmartObject msg = event.smart_object();
switch (event.id()) {
@@ -263,10 +264,11 @@ void HMILanguageHandler::VerifyWithPersistedLanguages() {
const ApplicationSet& accessor =
application_manager_.applications().GetData();
+
ApplicationSetIt it = accessor.begin();
for (; accessor.end() != it;) {
- ApplicationConstSharedPtr app = *it++;
-
+ ApplicationConstSharedPtr app = *it;
+ ++it;
SDL_LOG_INFO("Application with app_id "
<< app->app_id()
<< " will be unregistered because of "
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 3487116baf..07200af6cd 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -241,32 +241,6 @@ PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {}
-mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
- using namespace mobile_apis;
- if (HMILevel::INVALID_ENUM == parent_hmi_level()) {
- return parent_hmi_level();
- }
- return std::max(parent_hmi_level(), max_hmi_level());
-}
-
-mobile_apis::HMILevel::eType PhoneCallHmiState::max_hmi_level() const {
- using namespace helpers;
- using namespace mobile_apis;
-
- if (WindowType::WIDGET == window_type()) {
- return std::max(HMILevel::HMI_FULL, parent_max_hmi_level());
- }
-
- auto expected = HMILevel::HMI_FULL;
- if (is_navi_app() || is_mobile_projection_app()) {
- expected = HMILevel::HMI_LIMITED;
- } else if (is_media_app()) {
- expected = HMILevel::HMI_BACKGROUND;
- }
-
- return std::max(expected, parent_max_hmi_level());
-}
-
SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {}
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 b25e07c8f3..bbe6189bc9 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -62,6 +62,7 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/semantic_version.h"
#include "formatters/CFormatterJsonBase.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
@@ -520,7 +521,7 @@ smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
smart_objects::SmartType_Map);
app_service_capability[strings::updated_app_service_record] = record;
app_services[i] = app_service_capability;
- i++;
+ ++i;
}
app_service_capabilities[strings::app_services] = app_services;
@@ -818,31 +819,6 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
}
}
-void MessageHelper::SendUnsubscribeButtonNotification(
- mobile_apis::ButtonName::eType button,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr) {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = application->app_id();
- msg_params[strings::name] = button;
- msg_params[strings::is_suscribed] = false;
-
- SmartObjectSPtr message = CreateMessageForHMI(
- hmi_apis::messageType::notification, app_mngr.GetNextHMICorrelationID());
- DCHECK(message);
-
- SmartObject& object = *message;
- object[strings::params][strings::function_id] =
- hmi_apis::FunctionID::Buttons_OnButtonSubscription;
-
- object[strings::msg_params] = msg_params;
-
- app_mngr.GetRPCService().ManageHMICommand(message);
-}
-
const VehicleData& MessageHelper::vehicle_data() {
return vehicle_data_;
}
@@ -1097,104 +1073,119 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
return set_icon;
}
-void MessageHelper::SendOnButtonSubscriptionNotification(
- uint32_t app_id,
- hmi_apis::Common_ButtonName::eType button,
- bool is_subscribed,
- ApplicationManager& app_mngr) {
- using namespace smart_objects;
- using namespace hmi_apis;
+smart_objects::SmartObjectSPtr MessageHelper::CreateButtonNotificationToMobile(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& source_message) {
SDL_LOG_AUTO_TRACE();
- SmartObjectSPtr notification_ptr =
- std::make_shared<SmartObject>(SmartType_Map);
- if (!notification_ptr) {
- SDL_LOG_ERROR("Memory allocation failed.");
- return;
+ if (!app) {
+ SDL_LOG_ERROR("application NULL pointer");
+ return std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
}
- SmartObject& notification = *notification_ptr;
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = app_id;
- msg_params[strings::name] = button;
- msg_params[strings::is_suscribed] = is_subscribed;
+ smart_objects::SmartObjectSPtr msg =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
- notification[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- notification[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- notification[strings::params][strings::protocol_type] =
- commands::CommandImpl::hmi_protocol_type_;
- notification[strings::params][strings::function_id] =
- hmi_apis::FunctionID::Buttons_OnButtonSubscription;
- notification[strings::msg_params] = msg_params;
+ smart_objects::SmartObject& ref = *msg;
+ ref[strings::params][strings::connection_key] = app->app_id();
+
+ const auto function_id = static_cast<mobile_apis::FunctionID::eType>(
+ source_message[strings::params][strings::function_id].asInt());
+ ref[strings::params][strings::function_id] = function_id;
+
+ mobile_apis::ButtonName::eType btn_id = mobile_apis::ButtonName::INVALID_ENUM;
+
+ if (source_message[strings::msg_params].keyExists(
+ hmi_response::button_name)) {
+ btn_id = static_cast<mobile_apis::ButtonName::eType>(
+ source_message[strings::msg_params][hmi_response::button_name].asInt());
- if (!app_mngr.GetRPCService().ManageHMICommand(notification_ptr)) {
- SDL_LOG_ERROR("Unable to send HMI notification");
+ } else if (source_message[strings::msg_params].keyExists(
+ strings::button_name)) {
+ btn_id = static_cast<mobile_apis::ButtonName::eType>(
+ source_message[strings::msg_params][strings::button_name].asInt());
}
-}
-void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
- ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- using namespace smart_objects;
- using namespace hmi_apis;
- using namespace mobile_apis;
- SDL_LOG_AUTO_TRACE();
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() <= utils::base_rpc_version) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
- if (app.use_count() == 0) {
- SDL_LOG_ERROR("Invalid application pointer ");
- return;
+ ref[strings::msg_params][strings::button_name] = btn_id;
+
+ auto get_mode_code = [&source_message](
+ const std::string& hmi_param_name,
+ const std::string& mobile_param_name) -> int64_t {
+ if (source_message[strings::msg_params].keyExists(hmi_param_name)) {
+ return source_message[strings::msg_params][hmi_param_name].asInt();
+ }
+
+ if (source_message[strings::msg_params].keyExists(mobile_param_name)) {
+ return source_message[strings::msg_params][mobile_param_name].asInt();
+ }
+
+ return -1;
+ };
+
+ if (mobile_apis::FunctionID::eType::OnButtonPressID == function_id) {
+ const auto press_mode = static_cast<mobile_apis::ButtonPressMode::eType>(
+ get_mode_code(hmi_response::button_mode, strings::button_press_mode));
+ ref[strings::msg_params][strings::button_press_mode] = press_mode;
+ }
+
+ if (mobile_apis::FunctionID::eType::OnButtonEventID == function_id) {
+ const auto press_mode = static_cast<mobile_apis::ButtonEventMode::eType>(
+ get_mode_code(hmi_response::button_mode, strings::button_event_mode));
+ ref[strings::msg_params][strings::button_event_mode] = press_mode;
+ }
+
+ if (source_message[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ ref[strings::msg_params][strings::custom_button_id] =
+ source_message[strings::msg_params][strings::custom_button_id];
}
- const ButtonSubscriptions subscriptions = app->SubscribedButtons().GetData();
- ButtonSubscriptions::iterator it = subscriptions.begin();
- for (; subscriptions.end() != it; ++it) {
- SendOnButtonSubscriptionNotification(
- app->hmi_app_id(),
- static_cast<Common_ButtonName::eType>(*it),
- true,
- app_mngr);
+ if (source_message[strings::msg_params].keyExists(strings::window_id)) {
+ ref[strings::msg_params][strings::window_id] =
+ source_message[strings::msg_params][strings::window_id];
}
+
+ return msg;
}
smart_objects::SmartObjectSPtr
-MessageHelper::CreateOnButtonSubscriptionNotification(
- uint32_t app_id,
- hmi_apis::Common_ButtonName::eType button,
- bool is_subscribed) {
+MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ const uint32_t app_id,
+ const hmi_apis::Common_ButtonName::eType button_name,
+ const hmi_apis::FunctionID::eType function_id,
+ application_manager::ApplicationManager& app_mngr) {
using namespace smart_objects;
- using namespace hmi_apis;
SDL_LOG_AUTO_TRACE();
- SmartObjectSPtr notification_ptr =
- std::make_shared<SmartObject>(SmartType_Map);
- SmartObject& notification = *notification_ptr;
+
+ SmartObjectSPtr request_ptr = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+
+ SmartObject& request = *request_ptr;
SmartObject msg_params = SmartObject(SmartType_Map);
msg_params[strings::app_id] = app_id;
- msg_params[strings::name] = button;
- msg_params[strings::is_suscribed] = is_subscribed;
- notification[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- notification[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- notification[strings::params][strings::protocol_type] =
- commands::CommandImpl::hmi_protocol_type_;
- notification[strings::params][strings::function_id] =
- hmi_apis::FunctionID::Buttons_OnButtonSubscription;
- notification[strings::msg_params] = msg_params;
- return notification_ptr;
+ msg_params[strings::button_name] = button_name;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::msg_params] = msg_params;
+ return request_ptr;
}
smart_objects::SmartObjectList
-MessageHelper::CreateOnButtonSubscriptionNotificationsForApp(
+MessageHelper::CreateButtonSubscriptionsHandlingRequestsList(
ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr,
- const ButtonSubscriptions& button_subscriptions) {
- using namespace smart_objects;
+ const ButtonSubscriptions& button_subscriptions,
+ const hmi_apis::FunctionID::eType function_id,
+ ApplicationManager& app_mngr) {
using namespace hmi_apis;
- using namespace mobile_apis;
SDL_LOG_AUTO_TRACE();
- SmartObjectList button_subscription_requests;
+ smart_objects::SmartObjectList button_subscription_requests;
if (app.use_count() == 0) {
SDL_LOG_ERROR("Invalid application pointer ");
@@ -1206,7 +1197,8 @@ MessageHelper::CreateOnButtonSubscriptionNotificationsForApp(
static_cast<Common_ButtonName::eType>(it);
button_subscription_requests.push_back(
- CreateOnButtonSubscriptionNotification(app->hmi_app_id(), btn, true));
+ CreateButtonSubscriptionHandlingRequestToHmi(
+ app->app_id(), btn, function_id, app_mngr));
}
return button_subscription_requests;
@@ -1289,7 +1281,7 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
if (can_send_ui &&
(app->vr_help_title() || app->vr_help() || app->keyboard_props() ||
- app->menu_title() || app->menu_icon())) {
+ app->menu_title() || app->menu_icon() || app->menu_layout())) {
smart_objects::SmartObjectSPtr ui_global_properties = CreateMessageForHMI(
hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (ui_global_properties) {
@@ -1313,6 +1305,9 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
if (app->menu_icon()) {
ui_msg_params[strings::menu_icon] = (*app->menu_icon());
}
+ if (app->menu_layout()) {
+ ui_msg_params[strings::menu_layout] = (*app->menu_layout());
+ }
ui_msg_params[strings::app_id] = app->app_id();
(*ui_global_properties)[strings::msg_params] = ui_msg_params;
@@ -1853,7 +1848,7 @@ bool MessageHelper::CreateHMIApplicationStruct(
if (file_system::FileExists(app->app_icon_path())) {
message[strings::icon] = icon_path;
}
- if (app->IsRegistered()) {
+ if (app->app_id() > 0 || app->IsRegistered()) {
message[strings::hmi_display_language_desired] = app->ui_language();
message[strings::is_media_application] = app->is_media_application();
} else {
@@ -1995,6 +1990,9 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestsToHMI(
msg_params[strings::menu_params][strings::parent_id] =
(*i->second)[strings::parent_id];
}
+ if ((*i->second).keyExists(strings::menu_layout)) {
+ msg_params[strings::menu_layout] = (*i->second)[strings::menu_layout];
+ }
msg_params[strings::app_id] = app->app_id();
(*ui_sub_menu)[strings::msg_params] = msg_params;
if (((*i->second).keyExists(strings::menu_icon)) &&
@@ -2290,13 +2288,11 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& user_friendly_messages =
(*message)[strings::msg_params][messages];
-#ifdef EXTERNAL_PROPRIETARY_MODE
const std::string tts = "ttsString";
const std::string label = "label";
const std::string line1 = "line1";
const std::string line2 = "line2";
const std::string textBody = "textBody";
-#endif // EXTERNAL_PROPRIETARY_MODE
const std::string message_code = "messageCode";
std::vector<policy::UserFriendlyMessage>::const_iterator it = msg.begin();
std::vector<policy::UserFriendlyMessage>::const_iterator it_end = msg.end();
@@ -2306,7 +2302,6 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& obj = user_friendly_messages[index];
obj[message_code] = it->message_code;
-#ifdef EXTERNAL_PROPRIETARY_MODE
if (!it->tts.empty()) {
obj[tts] = it->tts;
}
@@ -2322,7 +2317,6 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
if (!it->text_body.empty()) {
obj[textBody] = it->text_body;
}
-#endif // EXTERNAL_PROPRIETARY_MODE
}
app_mngr.GetRPCService().ManageHMICommand(message);
@@ -2333,7 +2327,8 @@ void MessageHelper::SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
const policy::ExternalConsentStatus& external_consent_status,
uint32_t correlation_id,
- ApplicationManager& app_mngr) {
+ ApplicationManager& app_mngr,
+ const bool success_flag) {
using namespace smart_objects;
using namespace hmi_apis;
@@ -2345,7 +2340,8 @@ void MessageHelper::SendGetListOfPermissionsResponse(
params[strings::function_id] = FunctionID::SDL_GetListOfPermissions;
params[strings::message_type] = MessageType::kResponse;
params[strings::correlation_id] = correlation_id;
- params[hmi_response::code] = static_cast<int32_t>(Common_Result::SUCCESS);
+ params[hmi_response::code] = static_cast<int32_t>(
+ success_flag ? Common_Result::SUCCESS : Common_Result::GENERIC_ERROR);
SmartObject& msg_params = (*message)[strings::msg_params];
@@ -2375,7 +2371,8 @@ void MessageHelper::SendGetListOfPermissionsResponse(
void MessageHelper::SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
uint32_t correlation_id,
- ApplicationManager& app_mngr) {
+ ApplicationManager& app_mngr,
+ const bool success_flag) {
using namespace smart_objects;
using namespace hmi_apis;
@@ -2387,7 +2384,8 @@ void MessageHelper::SendGetListOfPermissionsResponse(
params[strings::function_id] = FunctionID::SDL_GetListOfPermissions;
params[strings::message_type] = MessageType::kResponse;
params[strings::correlation_id] = correlation_id;
- params[hmi_response::code] = static_cast<int32_t>(Common_Result::SUCCESS);
+ params[hmi_response::code] = static_cast<int32_t>(
+ success_flag ? Common_Result::SUCCESS : Common_Result::GENERIC_ERROR);
SmartObject& msg_params = (*message)[strings::msg_params];
@@ -3408,7 +3406,9 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
}
break;
}
- default: { continue; }
+ default: {
+ continue;
+ }
}
soft_buttons[j++] = request_soft_buttons[i];
@@ -3475,4 +3475,95 @@ WindowID MessageHelper::ExtractWindowIdFromSmartObject(
return mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
}
+uint16_t MessageHelper::RemoveEmptyMessageParams(
+ smart_objects::SmartObject& msg_params) {
+ uint16_t erased_params = 0;
+
+ if (msg_params.empty()) {
+ return erased_params;
+ }
+
+ const auto keys = msg_params.enumerate();
+ for (const auto& key_params : keys) {
+ auto& param = msg_params[key_params];
+
+ if (smart_objects::SmartType_Array == param.getType()) {
+ smart_objects::SmartArray* array = param.asArray();
+
+ if (array == nullptr || array->empty())
+ continue;
+
+ const bool are_all_empty =
+ std::all_of(array->begin(),
+ array->end(),
+ [](const smart_objects::SmartObject& item) {
+ if (smart_objects::SmartType_Array == item.getType() ||
+ smart_objects::SmartType_Map == item.getType()) {
+ return item.empty();
+ }
+
+ return false;
+ });
+
+ if (are_all_empty) {
+ SDL_LOG_DEBUG("Remove empty array " + key_params +
+ " from msg_params in HMI response");
+ msg_params.erase(key_params);
+ ++erased_params;
+ }
+
+ continue;
+ }
+
+ if (smart_objects::SmartType_Map == param.getType()) {
+ if (param.empty()) {
+ SDL_LOG_DEBUG("Remove empty field " + key_params +
+ " from msg_params in HMI response");
+ msg_params.erase(key_params);
+ ++erased_params;
+ }
+ }
+ }
+
+ return erased_params;
+}
+
+void MessageHelper::AddDefaultParamsToTireStatus(
+ ApplicationSharedPtr app, smart_objects::SmartObject& response_from_hmi) {
+ const utils::SemanticVersion max_version_with_mandatory_params(8, 0, 0);
+
+ if (!app) {
+ SDL_LOG_ERROR("Application not found");
+ return;
+ }
+
+ if (app->msg_version() >= max_version_with_mandatory_params) {
+ SDL_LOG_DEBUG(
+ "Tire status parameters are "
+ "non-mandatory for this app version, no need in default values");
+ return;
+ }
+
+ smart_objects::SmartObject& tire_status =
+ response_from_hmi[strings::msg_params][strings::tire_pressure];
+
+ if (!tire_status.keyExists(strings::pressure_telltale)) {
+ tire_status[strings::pressure_telltale] =
+ mobile_apis::WarningLightStatus::WLS_NOT_USED;
+ }
+
+ const std::vector<std::string> tires{strings::left_front,
+ strings::right_front,
+ strings::left_rear,
+ strings::right_rear,
+ strings::inner_left_rear,
+ strings::inner_right_rear};
+ for (const std::string& tire : tires) {
+ if (!tire_status.keyExists(tire)) {
+ tire_status[tire][strings::status] =
+ mobile_apis::ComponentVolumeStatus::CVS_UNKNOWN;
+ }
+ }
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
index af44fd033f..7b8deb5e8c 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -55,9 +55,10 @@ void PolicyEventObserver::set_policy_handler(
policy_handler_ = policy_handler;
}
-void PolicyEventObserver::on_event(const event_engine::MobileEvent& event) {}
+void PolicyEventObserver::HandleOnEvent(
+ const event_engine::MobileEvent& event) {}
-void PolicyEventObserver::on_event(const event_engine::Event& event) {
+void PolicyEventObserver::HandleOnEvent(const event_engine::Event& event) {
sync_primitives::AutoLock auto_lock(policy_handler_lock_);
if (!policy_handler_) {
return;
@@ -70,7 +71,9 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index bacd478138..c8c2a25a6d 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -866,12 +866,11 @@ void PolicyHandler::ExchangePolicyManager(
atomic_policy_manager_.swap(policy_manager);
}
-std::vector<policy::FunctionalGroupPermission>
-PolicyHandler::CollectRegisteredAppsPermissions() {
+bool PolicyHandler::CollectRegisteredAppsPermissions(
+ std::vector<FunctionalGroupPermission>& out_permissions) {
SDL_LOG_AUTO_TRACE();
const auto policy_manager = LoadPolicyManager();
- POLICY_LIB_CHECK_OR_RETURN(policy_manager,
- std::vector<policy::FunctionalGroupPermission>());
+ POLICY_LIB_CHECK_OR_RETURN(policy_manager, false);
// If no specific app was passed, get permissions for all currently registered
// applications
sync_primitives::AutoLock lock(app_to_device_link_lock_);
@@ -887,14 +886,17 @@ PolicyHandler::CollectRegisteredAppsPermissions() {
it->first, it->second, group_permissions);
consolidator.Consolidate(group_permissions);
}
- return consolidator.GetConsolidatedPermissions();
+
+ out_permissions = consolidator.GetConsolidatedPermissions();
+ return true;
}
-std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
- const uint32_t connection_key) {
+bool PolicyHandler::CollectAppPermissions(
+ const uint32_t connection_key,
+ std::vector<policy::FunctionalGroupPermission>& out_permissions) {
std::vector<FunctionalGroupPermission> group_permissions;
const auto policy_manager = LoadPolicyManager();
- POLICY_LIB_CHECK_OR_RETURN(policy_manager, group_permissions);
+ POLICY_LIB_CHECK_OR_RETURN(policy_manager, false);
// Single app only
ApplicationSharedPtr app = application_manager_.application(connection_key);
@@ -905,7 +907,7 @@ std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
<< "' "
"not found within registered applications.");
- return group_permissions;
+ return false;
}
DeviceParams device_params = GetDeviceParams(
@@ -914,14 +916,13 @@ std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
if (device_params.device_mac_address.empty()) {
SDL_LOG_WARN("Couldn't find device, which hosts application.");
- return group_permissions;
+ return false;
}
- policy_manager->GetUserConsentForApp(device_params.device_mac_address,
- app->policy_app_id(),
- group_permissions);
+ policy_manager->GetUserConsentForApp(
+ device_params.device_mac_address, app->policy_app_id(), out_permissions);
- return group_permissions;
+ return true;
}
void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
@@ -935,15 +936,12 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
const bool is_app_registered = NULL != app.get();
const bool is_connection_key_valid = is_app_registered && connection_key;
- const std::vector<policy::FunctionalGroupPermission> permissions =
- is_connection_key_valid ? CollectAppPermissions(connection_key)
- : CollectRegisteredAppsPermissions();
+ std::vector<policy::FunctionalGroupPermission> permissions;
- if (permissions.empty() && is_connection_key_valid) {
- SDL_LOG_ERROR("No permissions found for application with connection key:"
- << connection_key);
- return;
- }
+ const bool collect_result =
+ is_connection_key_valid
+ ? CollectAppPermissions(connection_key, permissions)
+ : CollectRegisteredAppsPermissions(permissions);
MessageHelper::SendGetListOfPermissionsResponse(
permissions,
@@ -951,7 +949,14 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
policy_manager->GetExternalConsentStatus(),
#endif // EXTERNAL_PROPRIETARY_MODE
correlation_id,
- application_manager_);
+ application_manager_,
+ collect_result);
+
+ if (!collect_result) {
+ SDL_LOG_ERROR(
+ "Permissions collection failed for application with connection key:"
+ << connection_key);
+ }
}
void PolicyHandler::LinkAppsToDevice() {
@@ -1232,12 +1237,6 @@ void PolicyHandler::OnPendingPermissionChange(
}
bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
- const std::string& url) {
- const uint32_t app_id = GetAppIdForSending();
- return SendMessageToSDK(pt_string, url, app_id);
-}
-
-bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
const std::string& url,
const uint32_t app_id) {
SDL_LOG_AUTO_TRACE();
@@ -2009,7 +2008,9 @@ void PolicyHandler::AddStatisticsInfo(int type) {
++count_of_iap_buffer_full;
break;
}
- default: { SDL_LOG_WARN("Type of statistics is unknown"); }
+ default: {
+ SDL_LOG_WARN("Type of statistics is unknown");
+ }
}
}
@@ -2028,7 +2029,9 @@ void PolicyHandler::OnSystemError(int code) {
++count_sync_out_of_memory;
break;
}
- default: { SDL_LOG_WARN("System error is unknown"); }
+ default: {
+ SDL_LOG_WARN("System error is unknown");
+ }
}
}
diff --git a/src/components/application_manager/src/policies/policy_retry_sequence.cc b/src/components/application_manager/src/policies/policy_retry_sequence.cc
deleted file mode 100644
index abb2926c9e..0000000000
--- a/src/components/application_manager/src/policies/policy_retry_sequence.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- Copyright (c) 2013, 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/policies/policy_retry_sequence.h"
-
-#include <unistd.h>
-
-#include "application_manager/policies/policy_handler.h"
-
-namespace policy {
-
-SDL_CREATE_LOG_VARIABLE("PolicyHandler")
-
-RetrySequence::RetrySequence(PolicyHandler* const policy_handler)
- // TODO (Risk copy of PolicyHandler Pointer)
- : policy_handler_(policy_handler) {}
-
-void RetrySequence::threadMain() {
- StartNextRetry();
-}
-
-void RetrySequence::StartNextRetry() {
- SDL_LOG_TRACE("Start next retry of exchanging PT");
- DCHECK(policy_handler_);
- // TODO(Ezamakhov): inverstigate StartNextRetry on unload policy lib
-
- BinaryMessageSptr pt_snapshot = policy_handler_->RequestPTUpdate();
- if (pt_snapshot) {
- policy_handler_->SendMessageToSDK(*pt_snapshot);
-
- const uint32_t timeout = policy_handler_->TimeoutExchangeSec();
- const int seconds = policy_handler_->NextRetryTimeout();
- SDL_LOG_DEBUG("Timeout response: " << timeout << " Next try: " << seconds);
- if (timeout > 0) {
- sleep(timeout);
- policy_handler_->OnExceededTimeout();
- }
- if (seconds > 0) {
- sleep(seconds);
- StartNextRetry();
- } else {
- SDL_LOG_INFO("End retry sequence. Update PT was not received");
- policy_handler_->OnPTUFinished(false);
- }
- }
-}
-
-} // namespace policy
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller_impl.cc
index a34457ff66..76d4a70330 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller_impl.cc
@@ -30,12 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/logger.h"
+#include "application_manager/request_controller.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "application_manager/commands/request_to_hmi.h"
-#include "application_manager/request_controller.h"
-
+#include "application_manager/request_controller_impl.h"
+#include "utils/logger.h"
#include "utils/timer_task_impl.h"
namespace application_manager {
@@ -46,41 +47,60 @@ using namespace sync_primitives;
SDL_CREATE_LOG_VARIABLE("RequestController")
-RequestController::RequestController(const RequestControlerSettings& settings)
- : pool_state_(UNDEFINED)
+RequestControllerImpl::RequestControllerImpl(
+ const RequestControlerSettings& settings,
+ RequestTimeoutHandler& request_timeout_handler,
+ event_engine::EventDispatcher& event_dispatcher)
+ : threads::AsyncRunner("RequestController async runner")
+ , pool_state_(TPoolState::UNDEFINED)
, pool_size_(settings.thread_pool_size())
, request_tracker_(settings)
, duplicate_message_count_()
, timer_("AM RequestCtrlTimer",
- new timer::TimerTaskImpl<RequestController>(
- this, &RequestController::TimeoutThread))
+ new timer::TimerTaskImpl<RequestControllerImpl>(
+ this, &RequestControllerImpl::TimeoutThread))
, timer_stop_flag_(false)
, is_low_voltage_(false)
- , settings_(settings) {
+ , settings_(settings)
+ , request_timeout_handler_(request_timeout_handler)
+ , event_dispatcher_(event_dispatcher) {
SDL_LOG_AUTO_TRACE();
InitializeThreadpool();
timer_.Start(0, timer::kSingleShot);
}
-RequestController::~RequestController() {
+RequestControllerImpl::~RequestControllerImpl() {
SDL_LOG_AUTO_TRACE();
+ Stop();
+}
+
+void RequestControllerImpl::Stop() {
+ SDL_LOG_AUTO_TRACE();
+
{
sync_primitives::AutoLock auto_lock(timer_lock);
timer_stop_flag_ = true;
timer_condition_.Broadcast();
}
- timer_.Stop();
+
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
}
+
+ SDL_LOG_DEBUG("Stopping async runner");
+ AsyncRunner::Stop();
+
+ SDL_LOG_DEBUG("Stopping timeout tracker");
+ timer_.Stop();
}
-void RequestController::InitializeThreadpool() {
+void RequestControllerImpl::InitializeThreadpool() {
SDL_LOG_AUTO_TRACE();
+
// TODO(DK): Consider lazy loading threads instead of creating all at once
pool_state_ = TPoolState::STARTED;
char name[50];
- for (uint32_t i = 0; i < pool_size_; i++) {
+ for (uint32_t i = 0; i < pool_size_; ++i) {
snprintf(name, sizeof(name) / sizeof(name[0]), "AM Pool %u", i);
pool_.push_back(threads::CreateThread(name, new Worker(this)));
pool_[i]->Start();
@@ -88,7 +108,7 @@ void RequestController::InitializeThreadpool() {
}
}
-void RequestController::DestroyThreadpool() {
+void RequestControllerImpl::DestroyThreadpool() {
SDL_LOG_AUTO_TRACE();
{
AutoLock auto_lock(mobile_request_list_lock_);
@@ -96,7 +116,7 @@ void RequestController::DestroyThreadpool() {
SDL_LOG_DEBUG("Broadcasting STOP signal to all threads...");
cond_var_.Broadcast(); // notify all threads we are shutting down
}
- for (size_t i = 0; i < pool_.size(); i++) {
+ for (size_t i = 0; i < pool_.size(); ++i) {
threads::Thread* thread = pool_[i];
thread->Stop(threads::Thread::kThreadSoftStop);
delete thread->GetDelegate();
@@ -105,12 +125,12 @@ void RequestController::DestroyThreadpool() {
pool_.clear();
}
-RequestController::TResult RequestController::CheckPosibilitytoAdd(
+RequestControllerImpl::TResult RequestControllerImpl::CheckPosibilitytoAdd(
const RequestPtr request, const mobile_apis::HMILevel::eType level) {
SDL_LOG_AUTO_TRACE();
if (!CheckPendingRequestsAmount(settings_.pending_requests_amount())) {
SDL_LOG_ERROR("Too many pending request");
- return RequestController::TOO_MANY_PENDING_REQUESTS;
+ return RequestController::TResult::TOO_MANY_PENDING_REQUESTS;
}
const TrackResult track_result =
@@ -118,25 +138,26 @@ RequestController::TResult RequestController::CheckPosibilitytoAdd(
if (TrackResult::kNoneLevelMaxRequestsExceeded == track_result) {
SDL_LOG_ERROR("Too many application requests in hmi level NONE");
- return RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
+ return RequestController::TResult::NONE_HMI_LEVEL_MANY_REQUESTS;
}
if (TrackResult::kMaxRequestsExceeded == track_result) {
SDL_LOG_ERROR("Too many application requests");
- return RequestController::TOO_MANY_REQUESTS;
+ return RequestController::TResult::TOO_MANY_REQUESTS;
}
if (IsLowVoltage()) {
SDL_LOG_ERROR("Impossible to add request due to Low Voltage is active");
- return RequestController::INVALID_DATA;
+ return RequestController::TResult::INVALID_DATA;
}
- return SUCCESS;
+ return TResult::SUCCESS;
}
-bool RequestController::CheckPendingRequestsAmount(
- const uint32_t& pending_requests_amount) {
+bool RequestControllerImpl::CheckPendingRequestsAmount(
+ const uint32_t pending_requests_amount) {
SDL_LOG_AUTO_TRACE();
+
if (pending_requests_amount > 0) {
const size_t pending_requests_size = mobile_request_list_.size();
const bool available_to_add =
@@ -152,19 +173,19 @@ bool RequestController::CheckPendingRequestsAmount(
return true;
}
-RequestController::TResult RequestController::addMobileRequest(
+RequestController::TResult RequestControllerImpl::AddMobileRequest(
const RequestPtr request, const mobile_apis::HMILevel::eType& hmi_level) {
SDL_LOG_AUTO_TRACE();
if (!request) {
SDL_LOG_ERROR("Null Pointer request");
cond_var_.NotifyOne();
- return INVALID_DATA;
+ return TResult::INVALID_DATA;
}
SDL_LOG_DEBUG("correlation_id : " << request->correlation_id()
<< "connection_key : "
<< request->connection_key());
RequestController::TResult result = CheckPosibilitytoAdd(request, hmi_level);
- if (SUCCESS == result) {
+ if (TResult::SUCCESS == result) {
AutoLock auto_lock_list(mobile_request_list_lock_);
mobile_request_list_.push_back(request);
SDL_LOG_DEBUG("Waiting for execution: " << mobile_request_list_.size());
@@ -174,13 +195,13 @@ RequestController::TResult RequestController::addMobileRequest(
return result;
}
-RequestController::TResult RequestController::addHMIRequest(
+RequestController::TResult RequestControllerImpl::AddHMIRequest(
const RequestPtr request) {
SDL_LOG_AUTO_TRACE();
if (request.use_count() == 0) {
SDL_LOG_ERROR("HMI request pointer is invalid");
- return RequestController::INVALID_DATA;
+ return RequestController::TResult::INVALID_DATA;
}
SDL_LOG_DEBUG(" correlation_id : " << request->correlation_id());
@@ -197,18 +218,19 @@ RequestController::TResult RequestController::addHMIRequest(
if (IsLowVoltage()) {
SDL_LOG_ERROR("Impossible to add request due to Low Voltage is active");
- return RequestController::INVALID_DATA;
+ return RequestController::TResult::INVALID_DATA;
}
waiting_for_response_.Add(request_info_ptr);
SDL_LOG_DEBUG("Waiting for response count:" << waiting_for_response_.Size());
NotifyTimer();
- return RequestController::SUCCESS;
+ return RequestController::TResult::SUCCESS;
}
-void RequestController::addNotification(const RequestPtr ptr) {
+void RequestControllerImpl::AddNotification(const RequestPtr ptr) {
SDL_LOG_AUTO_TRACE();
+
if (IsLowVoltage()) {
SDL_LOG_ERROR(
"Impossible to add notification due to Low Voltage is active");
@@ -217,7 +239,7 @@ void RequestController::addNotification(const RequestPtr ptr) {
notification_list_.push_back(ptr);
}
-void RequestController::removeNotification(
+void RequestControllerImpl::RemoveNotification(
const commands::Command* notification) {
SDL_LOG_AUTO_TRACE();
std::list<RequestPtr>::iterator it = notification_list_.begin();
@@ -233,20 +255,65 @@ void RequestController::removeNotification(
SDL_LOG_DEBUG("Cannot find notification");
}
-void RequestController::TerminateRequest(const uint32_t correlation_id,
- const uint32_t connection_key,
- const int32_t function_id,
- bool force_terminate) {
+bool RequestControllerImpl::RetainRequestInstance(
+ const uint32_t connection_key, const uint32_t correlation_id) {
+ SDL_LOG_AUTO_TRACE();
+ auto request = waiting_for_response_.Find(connection_key, correlation_id);
+ if (request) {
+ retained_mobile_requests_.insert(request);
+ SDL_LOG_DEBUG("Request (" << connection_key << ", " << correlation_id
+ << ") has been retained");
+ }
+ SDL_LOG_DEBUG(
+ "Total retained requests: " << retained_mobile_requests_.size());
+
+ return static_cast<bool>(request);
+}
+
+bool RequestControllerImpl::RemoveRetainedRequest(
+ const uint32_t connection_key, const uint32_t correlation_id) {
+ SDL_LOG_AUTO_TRACE();
+ for (auto it = retained_mobile_requests_.begin();
+ it != retained_mobile_requests_.end();
+ ++it) {
+ if ((*it)->request()->connection_key() == connection_key &&
+ (*it)->request()->correlation_id() == correlation_id) {
+ SDL_LOG_DEBUG("Removing request (" << connection_key << ", "
+ << correlation_id << ")");
+ retained_mobile_requests_.erase(it);
+
+ SDL_LOG_DEBUG(
+ "Total retained requests: " << retained_mobile_requests_.size());
+ return true;
+ }
+ }
+
+ SDL_LOG_ERROR("Can't find request (" << connection_key << ", "
+ << correlation_id << ")");
+ return false;
+}
+
+bool RequestControllerImpl::IsStillWaitingForResponse(
+ const uint32_t connection_key, const uint32_t correlation_id) const {
+ auto request = waiting_for_response_.Find(connection_key, correlation_id);
+ return static_cast<bool>(request);
+}
+
+void RequestControllerImpl::TerminateRequest(const uint32_t correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id,
+ bool force_terminate) {
SDL_LOG_AUTO_TRACE();
SDL_LOG_DEBUG("correlation_id = "
<< correlation_id << " connection_key = " << connection_key
<< " function_id = " << function_id
<< " force_terminate = " << force_terminate);
+
{
AutoLock auto_lock(duplicate_message_count_lock_);
auto dup_it = duplicate_message_count_.find(correlation_id);
if (duplicate_message_count_.end() != dup_it) {
- duplicate_message_count_[correlation_id]--;
+ --duplicate_message_count_[correlation_id];
if (0 == duplicate_message_count_[correlation_id]) {
duplicate_message_count_.erase(dup_it);
}
@@ -268,28 +335,37 @@ void RequestController::TerminateRequest(const uint32_t correlation_id,
return;
}
if (force_terminate || request->request()->AllowedToTerminate()) {
+ event_dispatcher_.remove_observer(
+ static_cast<hmi_apis::FunctionID::eType>(function_id), correlation_id);
waiting_for_response_.RemoveRequest(request);
+ if (RequestInfo::HMIRequest == request->request_type()) {
+ request_timeout_handler_.RemoveRequest(request->requestId());
+ }
+
} else {
- SDL_LOG_WARN("Request was not terminated");
+ SDL_LOG_WARN("Request was not terminated "
+ << "correlation_id = " << correlation_id
+ << " function_id = " << function_id);
}
NotifyTimer();
}
-void RequestController::OnMobileResponse(const uint32_t mobile_correlation_id,
- const uint32_t connection_key,
- const int32_t function_id) {
+void RequestControllerImpl::OnMobileResponse(
+ const uint32_t mobile_correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id) {
SDL_LOG_AUTO_TRACE();
TerminateRequest(mobile_correlation_id, connection_key, function_id);
}
-void RequestController::OnHMIResponse(const uint32_t correlation_id,
- const int32_t function_id) {
+void RequestControllerImpl::OnHMIResponse(const uint32_t correlation_id,
+ const int32_t function_id) {
SDL_LOG_AUTO_TRACE();
- TerminateRequest(correlation_id, RequestInfo::HmiConnectionKey, function_id);
+ TerminateRequest(correlation_id, RequestInfo::kHmiConnectionKey, function_id);
}
-void RequestController::terminateWaitingForExecutionAppRequests(
- const uint32_t& app_id) {
+void RequestControllerImpl::TerminateWaitingForExecutionAppRequests(
+ const uint32_t app_id) {
SDL_LOG_AUTO_TRACE();
SDL_LOG_DEBUG("app_id: " << app_id << "Waiting for execution"
<< mobile_request_list_.size());
@@ -306,15 +382,54 @@ void RequestController::terminateWaitingForExecutionAppRequests(
SDL_LOG_DEBUG("Waiting for execution " << mobile_request_list_.size());
}
-void RequestController::terminateWaitingForResponseAppRequests(
- const uint32_t& app_id) {
+void RequestControllerImpl::scheduleRequestsCleanup(
+ const RequestInfoPtrs& requests) {
SDL_LOG_AUTO_TRACE();
- waiting_for_response_.RemoveByConnectionKey(app_id);
- SDL_LOG_DEBUG(
- "Waiting for response count : " << waiting_for_response_.Size());
+ AsyncRun(new RequestCleanerDelegate(requests));
}
-void RequestController::terminateAppRequests(const uint32_t& app_id) {
+void RequestControllerImpl::TerminateWaitingForResponseAppRequests(
+ const uint32_t app_id) {
+ SDL_LOG_AUTO_TRACE();
+ SDL_LOG_DEBUG("Waiting for response count before cleanup: "
+ << waiting_for_response_.Size());
+
+ RequestInfoPtrs requests_to_terminate;
+
+ auto pending_requests =
+ waiting_for_response_.GetRequestsByConnectionKey(app_id);
+ for (auto it = pending_requests.begin(); it != pending_requests.end(); ++it) {
+ auto request_ptr = (*it)->request();
+ if (!request_ptr->CleanUp()) {
+ SDL_LOG_WARN("Request with corr_id: "
+ << request_ptr->correlation_id()
+ << " can't be terminated right now. Keep in the queue");
+ continue;
+ }
+
+ SDL_LOG_DEBUG(
+ "Removing request with corr_id: " << request_ptr->correlation_id());
+ requests_to_terminate.push_back(*it);
+ waiting_for_response_.RemoveRequest(*it);
+ }
+
+ SDL_LOG_DEBUG("Waiting for response count after cleanup: "
+ << waiting_for_response_.Size());
+
+ // It is necessary to release requests references after some short amount of
+ // time because here might be a possible data races in event dispatcher
+ // between GetNextObserver() and IncrementReferenceCount() when reference to
+ // corresponding request is destroyed by that function right after CleanUp()
+ // This micro delay gives a time to event dispatcher to figure out that
+ // request was finalized and event should not be handled
+ if (!requests_to_terminate.empty()) {
+ SDL_LOG_DEBUG("Scheduling cleanup for " << requests_to_terminate.size()
+ << " requests for app " << app_id);
+ scheduleRequestsCleanup(requests_to_terminate);
+ }
+}
+
+void RequestControllerImpl::TerminateAppRequests(const uint32_t app_id) {
SDL_LOG_AUTO_TRACE();
SDL_LOG_DEBUG("app_id : " << app_id
<< "Requests waiting for execution count : "
@@ -322,18 +437,19 @@ void RequestController::terminateAppRequests(const uint32_t& app_id) {
<< "Requests waiting for response count : "
<< waiting_for_response_.Size());
- terminateWaitingForExecutionAppRequests(app_id);
- terminateWaitingForResponseAppRequests(app_id);
+ TerminateWaitingForExecutionAppRequests(app_id);
+ TerminateWaitingForResponseAppRequests(app_id);
NotifyTimer();
}
-void RequestController::terminateAllHMIRequests() {
+void RequestControllerImpl::TerminateAllHMIRequests() {
SDL_LOG_AUTO_TRACE();
- terminateWaitingForResponseAppRequests(RequestInfo::HmiConnectionKey);
+ TerminateWaitingForResponseAppRequests(RequestInfo::kHmiConnectionKey);
}
-void RequestController::terminateAllMobileRequests() {
+void RequestControllerImpl::TerminateAllMobileRequests() {
SDL_LOG_AUTO_TRACE();
+
waiting_for_response_.RemoveMobileRequests();
SDL_LOG_DEBUG("Mobile Requests waiting for response cleared");
AutoLock waiting_execution_auto_lock(mobile_request_list_lock_);
@@ -342,21 +458,30 @@ void RequestController::terminateAllMobileRequests() {
NotifyTimer();
}
-void RequestController::updateRequestTimeout(const uint32_t& app_id,
- const uint32_t& correlation_id,
- const uint32_t& new_timeout) {
+void RequestControllerImpl::UpdateRequestTimeout(const uint32_t app_id,
+ const uint32_t correlation_id,
+ const uint32_t new_timeout) {
SDL_LOG_AUTO_TRACE();
-
SDL_LOG_DEBUG("app_id : " << app_id
<< " mobile_correlation_id : " << correlation_id
<< " new_timeout : " << new_timeout);
- SDL_LOG_DEBUG(
- "New_timeout is NULL. RequestCtrl will "
- "not manage this request any more");
+
+ if (new_timeout == 0) {
+ SDL_LOG_DEBUG(
+ "New_timeout is NULL. RequestCtrl will "
+ "not manage this request any more");
+ }
RequestInfoPtr request_info =
waiting_for_response_.Find(app_id, correlation_id);
if (request_info) {
+ if (0 == request_info->timeout_msec()) {
+ SDL_LOG_INFO(
+ "Request with zero timeout is not updating, "
+ "manual control is assumed");
+ return;
+ }
+
waiting_for_response_.RemoveRequest(request_info);
request_info->updateTimeOut(new_timeout);
waiting_for_response_.Add(request_info);
@@ -371,26 +496,32 @@ void RequestController::updateRequestTimeout(const uint32_t& app_id,
}
}
-void RequestController::OnLowVoltage() {
+void RequestControllerImpl::OnLowVoltage() {
SDL_LOG_AUTO_TRACE();
is_low_voltage_ = true;
}
-void RequestController::OnWakeUp() {
+void RequestControllerImpl::OnWakeUp() {
SDL_LOG_AUTO_TRACE();
- terminateAllHMIRequests();
- terminateAllMobileRequests();
+ TerminateAllHMIRequests();
+ TerminateAllMobileRequests();
is_low_voltage_ = false;
SDL_LOG_DEBUG("Terminate old requests done");
}
-bool RequestController::IsLowVoltage() {
+bool RequestControllerImpl::IsLowVoltage() {
SDL_LOG_TRACE("result: " << is_low_voltage_);
return is_low_voltage_;
}
-void RequestController::TimeoutThread() {
+void RequestControllerImpl::TimeoutThread() {
SDL_LOG_AUTO_TRACE();
+
+ if (TPoolState::STOPPED == pool_state_) {
+ SDL_LOG_DEBUG("Thread pool has been stopped. Skipping timer restart");
+ return;
+ }
+
SDL_LOG_DEBUG(
"ENTER Waiting fore response count: " << waiting_for_response_.Size());
sync_primitives::AutoLock auto_lock(timer_lock);
@@ -427,18 +558,22 @@ void RequestController::TimeoutThread() {
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " is expired");
- const uint32_t experied_request_id = probably_expired->requestId();
- const uint32_t experied_app_id = probably_expired->app_id();
+ const uint32_t expired_request_id = probably_expired->requestId();
+ const uint32_t expired_app_id = probably_expired->app_id();
+
+ probably_expired->request()->HandleTimeOut();
- probably_expired->request()->onTimeOut();
- if (RequestInfo::HmiConnectionKey == probably_expired->app_id()) {
+ if (RequestInfo::kHmiConnectionKey == probably_expired->app_id()) {
SDL_LOG_DEBUG("Erase HMI request: " << probably_expired->requestId());
waiting_for_response_.RemoveRequest(probably_expired);
+ if (RequestInfo::HMIRequest == probably_expired->request_type()) {
+ request_timeout_handler_.RemoveRequest(expired_request_id);
+ }
}
probably_expired = waiting_for_response_.FrontWithNotNullTimeout();
if (probably_expired) {
- if (experied_request_id == probably_expired->requestId() &&
- experied_app_id == probably_expired->app_id()) {
+ if (expired_request_id == probably_expired->requestId() &&
+ expired_app_id == probably_expired->app_id()) {
SDL_LOG_DEBUG("Expired request wasn't removed");
break;
}
@@ -448,12 +583,12 @@ void RequestController::TimeoutThread() {
"EXIT Waiting for response count : " << waiting_for_response_.Size());
}
-RequestController::Worker::Worker(RequestController* requestController)
- : request_controller_(requestController), stop_flag_(false) {}
+RequestControllerImpl::Worker::Worker(RequestControllerImpl* request_controller)
+ : request_controller_(request_controller), stop_flag_(false) {}
-RequestController::Worker::~Worker() {}
+RequestControllerImpl::Worker::~Worker() {}
-void RequestController::Worker::threadMain() {
+void RequestControllerImpl::Worker::threadMain() {
SDL_LOG_AUTO_TRACE();
AutoLock auto_lock(thread_lock_);
while (!stop_flag_) {
@@ -490,8 +625,8 @@ void RequestController::Worker::threadMain() {
std::make_shared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) {
- commands::CommandRequestImpl* cmd_request =
- dynamic_cast<commands::CommandRequestImpl*>(request_ptr.get());
+ commands::RequestFromMobileImpl* cmd_request =
+ dynamic_cast<commands::RequestFromMobileImpl*>(request_ptr.get());
if (cmd_request != NULL) {
uint32_t corr_id = cmd_request->correlation_id();
request_controller_->duplicate_message_count_lock_.Acquire();
@@ -531,13 +666,39 @@ void RequestController::Worker::threadMain() {
}
}
-void RequestController::Worker::exitThreadMain() {
+void RequestControllerImpl::Worker::exitThreadMain() {
stop_flag_ = true;
// setup stop flag and whit while threadMain will be finished correctly
// FIXME (dchmerev@luxoft.com): There is no waiting
}
-void RequestController::NotifyTimer() {
+RequestControllerImpl::RequestCleanerDelegate::RequestCleanerDelegate(
+ const RequestInfoPtrs& requests)
+ : requests_(requests) {}
+
+RequestControllerImpl::RequestCleanerDelegate::~RequestCleanerDelegate() {
+ SDL_LOG_AUTO_TRACE();
+}
+
+void RequestControllerImpl::RequestCleanerDelegate::exitThreadMain() {
+ sync_primitives::AutoLock lock(state_lock_);
+ state_cond_.NotifyOne();
+}
+
+void RequestControllerImpl::RequestCleanerDelegate::threadMain() {
+ SDL_LOG_DEBUG("Prepare to cleanup of " << requests_.size() << " requests");
+
+ {
+ SDL_LOG_DEBUG("Waiting...");
+ sync_primitives::AutoLock lock(state_lock_);
+ state_cond_.WaitFor(lock, 50);
+ }
+
+ SDL_LOG_DEBUG("Releasing references");
+ requests_.clear();
+}
+
+void RequestControllerImpl::NotifyTimer() {
SDL_LOG_AUTO_TRACE();
timer_condition_.NotifyOne();
}
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index e1fffdf6fe..60d00b65de 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -42,12 +42,12 @@ namespace request_controller {
SDL_CREATE_LOG_VARIABLE("RequestController")
-uint32_t RequestInfo::HmiConnectionKey = 0;
+constexpr uint32_t RequestInfo::kHmiConnectionKey;
HMIRequestInfo::HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec)
: RequestInfo(request, HMIRequest, timeout_msec) {
correlation_id_ = request_->correlation_id();
- app_id_ = RequestInfo::HmiConnectionKey;
+ app_id_ = RequestInfo::kHmiConnectionKey;
}
HMIRequestInfo::HMIRequestInfo(RequestPtr request,
@@ -55,7 +55,7 @@ HMIRequestInfo::HMIRequestInfo(RequestPtr request,
const uint64_t timeout_msec)
: RequestInfo(request, HMIRequest, start_time, timeout_msec) {
correlation_id_ = request_->correlation_id();
- app_id_ = RequestInfo::HmiConnectionKey;
+ app_id_ = RequestInfo::kHmiConnectionKey;
}
MobileRequestInfo::MobileRequestInfo(RequestPtr request,
@@ -92,6 +92,7 @@ void application_manager::request_controller::RequestInfo::updateEndTime() {
void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
timeout_msec_ = timeout_msec;
updateEndTime();
+ request_->OnUpdateTimeOut();
}
bool RequestInfo::isExpired() {
@@ -132,13 +133,13 @@ bool RequestInfoSet::Add(RequestInfoPtr request_info) {
<< request_info->requestId());
sync_primitives::AutoLock lock(pending_requests_lock_);
CheckSetSizes();
- const std::pair<HashSortedRequestInfoSet::iterator, bool>& insert_resilt =
+ const std::pair<HashSortedRequestInfoSet::iterator, bool>& insert_result =
hash_sorted_pending_requests_.insert(request_info);
- if (insert_resilt.second == true) {
- const std::pair<TimeSortedRequestInfoSet::iterator, bool>& insert_resilt =
+ if (insert_result.second == true) {
+ const std::pair<TimeSortedRequestInfoSet::iterator, bool>& insert_result =
time_sorted_pending_requests_.insert(request_info);
- DCHECK(insert_resilt.second);
- if (!insert_resilt.second) {
+ DCHECK(insert_result.second);
+ if (!insert_result.second) {
return false;
}
CheckSetSizes();
@@ -153,7 +154,7 @@ bool RequestInfoSet::Add(RequestInfoPtr request_info) {
}
RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
- const uint32_t correlation_id) {
+ const uint32_t correlation_id) const {
RequestInfoPtr result;
// Request info for searching in request info set by log_n time
@@ -197,6 +198,22 @@ RequestInfoPtr RequestInfoSet::FrontWithNotNullTimeout() {
return result;
}
+std::list<RequestInfoPtr> RequestInfoSet::GetRequestsByConnectionKey(
+ const uint32_t connection_key) {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(pending_requests_lock_);
+
+ std::list<RequestInfoPtr> output_list;
+ AppIdCompararator comparator(AppIdCompararator::Equal, connection_key);
+
+ std::copy_if(hash_sorted_pending_requests_.begin(),
+ hash_sorted_pending_requests_.end(),
+ std::back_inserter(output_list),
+ comparator);
+
+ return output_list;
+}
+
bool RequestInfoSet::Erase(const RequestInfoPtr request_info) {
DCHECK(request_info);
if (!request_info) {
@@ -244,7 +261,7 @@ uint32_t RequestInfoSet::RemoveRequests(
HashSortedRequestInfoSet::iterator to_erase = it++;
Erase(*to_erase);
it = std::find_if(it, hash_sorted_pending_requests_.end(), filter);
- erased++;
+ ++erased;
}
CheckSetSizes();
return erased;
@@ -259,7 +276,7 @@ uint32_t RequestInfoSet::RemoveByConnectionKey(uint32_t connection_key) {
uint32_t RequestInfoSet::RemoveMobileRequests() {
SDL_LOG_AUTO_TRACE();
return RemoveRequests(AppIdCompararator(AppIdCompararator::NotEqual,
- RequestInfo::HmiConnectionKey));
+ RequestInfo::kHmiConnectionKey));
}
const size_t RequestInfoSet::Size() {
diff --git a/src/components/application_manager/src/request_timeout_handler_impl.cc b/src/components/application_manager/src/request_timeout_handler_impl.cc
new file mode 100644
index 0000000000..1ac72393a0
--- /dev/null
+++ b/src/components/application_manager/src/request_timeout_handler_impl.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2020, 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/request_timeout_handler_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/request_info.h"
+#include "utils/logger.h"
+
+SDL_CREATE_LOG_VARIABLE("RequestTimeoutHandler")
+
+namespace application_manager {
+namespace request_controller {
+
+RequestTimeoutHandlerImpl::RequestTimeoutHandlerImpl(
+ ApplicationManager& application_manager)
+ : EventObserver(application_manager.event_dispatcher())
+ , application_manager_(application_manager) {
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
+}
+
+void RequestTimeoutHandlerImpl::AddRequest(const uint32_t hmi_correlation_id,
+ const Request& request) {
+ requests_.insert(std::make_pair(hmi_correlation_id, request));
+}
+
+void RequestTimeoutHandlerImpl::RemoveRequest(
+ const uint32_t hmi_correlation_id) {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(requests_lock_);
+ auto it = requests_.find(hmi_correlation_id);
+ if (it != requests_.end()) {
+ requests_.erase(it);
+ };
+}
+
+bool RequestTimeoutHandlerImpl::IsTimeoutUpdateRequired(
+ const Request& request,
+ const uint32_t timeout,
+ const hmi_apis::FunctionID::eType method_name) {
+ if (0 == timeout) {
+ SDL_LOG_WARN("Zero timeout ignored");
+ return false;
+ }
+
+ if (static_cast<hmi_apis::FunctionID::eType>(request.hmi_function_id_) !=
+ method_name) {
+ SDL_LOG_WARN("Method name does not match the hmi function id");
+ return false;
+ }
+
+ return true;
+}
+
+void RequestTimeoutHandlerImpl::HandleOnEvent(
+ const event_engine::Event& event) {
+ SDL_LOG_AUTO_TRACE();
+ const auto event_id = event.id();
+ if (hmi_apis::FunctionID::BasicCommunication_OnResetTimeout == event_id) {
+ const smart_objects::SmartObject& message = event.smart_object();
+ const auto method_name = StringToEnum<hmi_apis::FunctionID::eType>(
+ message[strings::msg_params][strings::method_name].asString());
+
+ if (hmi_apis::FunctionID::INVALID_ENUM == method_name) {
+ SDL_LOG_WARN(
+ "Wrong method name received: "
+ << message[strings::msg_params][strings::method_name].asString());
+ return;
+ }
+ uint32_t timeout = application_manager_.get_settings().default_timeout();
+ if (message[strings::msg_params].keyExists(strings::reset_period)) {
+ timeout = message[strings::msg_params][strings::reset_period].asUInt();
+ }
+ const auto hmi_corr_id =
+ message[strings::msg_params][strings::request_id].asUInt();
+ auto it = requests_.find(hmi_corr_id);
+ if (it != requests_.end()) {
+ const auto& request = it->second;
+ if (IsTimeoutUpdateRequired(request, timeout, method_name)) {
+ // Add compensation time
+ timeout +=
+ application_manager_.get_settings().default_timeout_compensation();
+ application_manager_.UpdateRequestTimeout(
+ request.connection_key_, request.mob_correlation_id_, timeout);
+ application_manager_.UpdateRequestTimeout(
+ RequestInfo::kHmiConnectionKey, hmi_corr_id, timeout);
+ }
+ } else {
+ SDL_LOG_WARN("Timeout reset failed by " << hmi_corr_id
+ << ", no such mobile command");
+ }
+ }
+}
+} // namespace request_controller
+} // namespace application_manager
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 bc373d48c9..96870c12c1 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -283,10 +283,6 @@ void ResumeCtrlImpl::RemoveFromResumption(uint32_t app_id) {
queue_lock_.Release();
}
-bool ResumeCtrlImpl::Init(LastState&) {
- return false;
-}
-
bool ResumeCtrlImpl::SetAppHMIState(
ApplicationSharedPtr application,
const mobile_apis::HMILevel::eType hmi_level,
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 95dd331b88..c72231d334 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -132,6 +132,8 @@ smart_objects::SmartObject ResumptionData::GetApplicationGlobalProperties(
PointerToSmartObj(application->menu_title());
global_properties[strings::menu_icon] =
PointerToSmartObj(application->menu_icon());
+ global_properties[strings::menu_layout] =
+ PointerToSmartObj(application->menu_layout());
return global_properties;
}
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 1f2d0f116f..5d6d008911 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -573,8 +573,4 @@ void ResumptionDataJson::Persist() {
last_state_wrapper_->get_accessor().GetMutableData().SaveToFileSystem();
}
-LastState& ResumptionDataJson::last_state() const {
- return last_state_wrapper_->get_accessor().GetMutableData();
-}
-
} // namespace resumption
diff --git a/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc b/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc
index dffb1ea094..b8462a533a 100644
--- a/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc
@@ -162,6 +162,11 @@ void ResumptionDataProcessorImpl::ProcessResumptionStatus(
CheckVehicleDataResponse(found_request.message, response, status);
}
+ if (hmi_apis::FunctionID::Buttons_SubscribeButton ==
+ found_request.request_id.function_id) {
+ ProcessSubscribeButtonResponse(app_id, found_request.message, response);
+ }
+
if (hmi_apis::FunctionID::UI_CreateWindow ==
found_request.request_id.function_id) {
CheckCreateWindowResponse(found_request.message, response);
@@ -307,6 +312,14 @@ void ResumptionDataProcessorImpl::ProcessResponseFromHMI(
void ResumptionDataProcessorImpl::FinalizeResumption(
const ResumeCtrl::ResumptionCallBack& callback, const uint32_t app_id) {
+ auto app = application_manager_.application(app_id);
+ if (!app) {
+ SDL_LOG_ERROR("App " << app_id
+ << " is not registered, erasing resumption data");
+ EraseAppResumptionData(app_id);
+ return;
+ }
+
if (IsResumptionSuccessful(app_id)) {
SDL_LOG_DEBUG("Resumption for app " << app_id << " successful");
callback(mobile_apis::Result::SUCCESS, "Data resumption successful");
@@ -314,7 +327,7 @@ void ResumptionDataProcessorImpl::FinalizeResumption(
} else {
SDL_LOG_ERROR("Resumption for app " << app_id << " failed");
callback(mobile_apis::Result::RESUME_FAILED, "Data resumption failed");
- RevertRestoredData(application_manager_.application(app_id));
+ RevertRestoredData(app);
application_manager_.state_controller().DropPostponedWindows(app_id);
}
EraseAppResumptionData(app_id);
@@ -334,7 +347,8 @@ void ResumptionDataProcessorImpl::HandleOnTimeOut(
ProcessResponseFromHMI(*error_response, function_id, corr_id);
}
-void ResumptionDataProcessorImpl::on_event(const event_engine::Event& event) {
+void ResumptionDataProcessorImpl::HandleOnEvent(
+ const event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
SDL_LOG_DEBUG(
"Handling response message from HMI "
@@ -849,6 +863,7 @@ void ResumptionDataProcessorImpl::AddButtonsSubscriptions(
const smart_objects::SmartObject& subscriptions =
saved_app[strings::application_subscriptions];
+ ButtonSubscriptions button_subscriptions;
if (subscriptions.keyExists(strings::application_buttons)) {
const smart_objects::SmartObject& subscriptions_buttons =
subscriptions[strings::application_buttons];
@@ -856,29 +871,18 @@ void ResumptionDataProcessorImpl::AddButtonsSubscriptions(
for (size_t i = 0; i < subscriptions_buttons.length(); ++i) {
btn = static_cast<mobile_apis::ButtonName::eType>(
(subscriptions_buttons[i]).asInt());
- application->SubscribeToButton(btn);
+ if (mobile_apis::ButtonName::CUSTOM_BUTTON != btn) {
+ button_subscriptions.insert(btn);
+ }
}
- ButtonSubscriptions button_subscriptions =
- GetButtonSubscriptionsToResume(application);
-
ProcessMessagesToHMI(
- MessageHelper::CreateOnButtonSubscriptionNotificationsForApp(
- application, application_manager_, button_subscriptions));
- }
-}
-
-ButtonSubscriptions ResumptionDataProcessorImpl::GetButtonSubscriptionsToResume(
- ApplicationSharedPtr application) const {
- ButtonSubscriptions button_subscriptions =
- application->SubscribedButtons().GetData();
- auto it = button_subscriptions.find(mobile_apis::ButtonName::CUSTOM_BUTTON);
-
- if (it != button_subscriptions.end()) {
- button_subscriptions.erase(it);
+ MessageHelper::CreateButtonSubscriptionsHandlingRequestsList(
+ application,
+ button_subscriptions,
+ hmi_apis::FunctionID::Buttons_SubscribeButton,
+ application_manager_));
}
-
- return button_subscriptions;
}
void ResumptionDataProcessorImpl::AddPluginsSubscriptions(
@@ -908,11 +912,13 @@ void ResumptionDataProcessorImpl::DeleteButtonsSubscriptions(
if (hmi_apis::Common_ButtonName::CUSTOM_BUTTON == hmi_btn) {
continue;
}
- auto notification = MessageHelper::CreateOnButtonSubscriptionNotification(
- application->hmi_app_id(), hmi_btn, false);
- // is_subscribed = false
- ProcessMessageToHMI(notification, false);
- application->UnsubscribeFromButton(btn);
+ smart_objects::SmartObjectSPtr unsubscribe_request =
+ MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ application->app_id(),
+ hmi_btn,
+ hmi_apis::FunctionID::Buttons_UnsubscribeButton,
+ application_manager_);
+ ProcessMessageToHMI(unsubscribe_request, false);
}
}
@@ -975,7 +981,7 @@ void ResumptionDataProcessorImpl::DeletePluginsSubscriptions(
smart_objects::SmartObject(smart_objects::SmartType_Map);
module_data_so[index][message_params::kModuleType] = module.first;
module_data_so[index][message_params::kModuleId] = module.second;
- index++;
+ ++index;
}
}
@@ -999,7 +1005,7 @@ bool IsResponseSuccessful(const smart_objects::SmartObject& response) {
response[strings::params][application_manager::hmi_response::code]
.asInt());
- return commands::CommandRequestImpl::IsHMIResultSuccess(result_code) ||
+ return commands::IsHMIResultSuccess(result_code) ||
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
}
@@ -1038,6 +1044,26 @@ void ResumptionDataProcessorImpl::CheckVehicleDataResponse(
}
}
+void ResumptionDataProcessorImpl::ProcessSubscribeButtonResponse(
+ const uint32_t app_id,
+ const smart_objects::SmartObject& request,
+ const smart_objects::SmartObject& response) {
+ SDL_LOG_AUTO_TRACE();
+ if (!IsResponseSuccessful(response)) {
+ return;
+ }
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ SDL_LOG_ERROR("NULL pointer.");
+ return;
+ }
+ const mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ request[strings::msg_params][strings::button_name].asInt());
+ app->SubscribeToButton(btn_id);
+}
+
void ResumptionDataProcessorImpl::CheckModuleDataSubscription(
const ns_smart_device_link::ns_smart_objects::SmartObject& request,
const ns_smart_device_link::ns_smart_objects::SmartObject& response,
diff --git a/src/components/application_manager/src/rpc_passing_handler.cc b/src/components/application_manager/src/rpc_passing_handler.cc
index 74a865ff4f..b2ac58c4f7 100644
--- a/src/components/application_manager/src/rpc_passing_handler.cc
+++ b/src/components/application_manager/src/rpc_passing_handler.cc
@@ -85,7 +85,7 @@ bool RPCPassingHandler::CanHandleFunctionID(int32_t function_id) {
for (auto it = services.begin(); it != services.end(); ++it) {
auto handled_rpcs =
it->record[strings::service_manifest][strings::handled_rpcs];
- for (size_t i = 0; i < handled_rpcs.length(); i++) {
+ for (size_t i = 0; i < handled_rpcs.length(); ++i) {
if (handled_rpcs[i].asInt() == function_id) {
return true;
}
@@ -266,7 +266,7 @@ void RPCPassingHandler::PopulateRPCRequestQueue(
++services_it) {
auto handled_rpcs =
services_it->record[strings::service_manifest][strings::handled_rpcs];
- for (size_t i = 0; i < handled_rpcs.length(); i++) {
+ for (size_t i = 0; i < handled_rpcs.length(); ++i) {
if (handled_rpcs[i].asInt() == function_id) {
// Add requests to queue
ServiceInfo service_info{
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index f0cd720e30..36dcb335c1 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -36,6 +36,7 @@
#include "application_manager/app_service_manager.h"
#include "application_manager/command_factory.h"
#include "application_manager/commands/command.h"
+#include "application_manager/commands/command_impl.h"
#include "application_manager/plugin_manager/plugin_keys.h"
namespace application_manager {
@@ -138,10 +139,20 @@ bool RPCServiceImpl::ManageMobileCommand(
const uint32_t connection_key = static_cast<uint32_t>(
(*message)[strings::params][strings::connection_key].asUInt());
+ const WindowID window_id = MessageHelper::ExtractWindowIdFromSmartObject(
+ (*message)[strings::msg_params]);
+ int32_t message_type =
+ (*message)[strings::params][strings::message_type].asInt();
auto app_ptr = app_manager_.application(connection_key);
- if (app_ptr && app_manager_.IsAppInReconnectMode(app_ptr->device(),
- app_ptr->policy_app_id())) {
+ if (app_ptr &&
+ (app_manager_.IsAppInReconnectMode(app_ptr->device(),
+ app_ptr->policy_app_id()) ||
+ (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id &&
+ (!app_ptr->WindowIdExists(window_id) ||
+ mobile_apis::HMILevel::INVALID_ENUM ==
+ app_ptr->hmi_level(window_id)) &&
+ mobile_apis::messageType::notification == message_type))) {
commands_holder_.Suspend(
app_ptr, CommandHolder::CommandType::kMobileCommand, source, message);
return true;
@@ -209,8 +220,6 @@ bool RPCServiceImpl::ManageMobileCommand(
return false;
}
- int32_t message_type =
- (*message)[strings::params][strings::message_type].asInt();
if (message_type == mobile_apis::messageType::response) {
if (command->Init() && command->CheckPermissions()) {
command->Run();
@@ -219,11 +228,11 @@ bool RPCServiceImpl::ManageMobileCommand(
return true;
}
if (message_type == mobile_apis::messageType::notification) {
- request_ctrl_.addNotification(command);
+ request_ctrl_.AddNotification(command);
if (command->Init() && command->CheckPermissions()) {
command->Run();
if (command->CleanUp()) {
- request_ctrl_.removeNotification(command.get());
+ request_ctrl_.RemoveNotification(command.get());
}
// If CleanUp returned false notification should remove it self.
}
@@ -254,11 +263,11 @@ bool RPCServiceImpl::ManageMobileCommand(
// commands will be launched from request_ctrl
const request_controller::RequestController::TResult result =
- request_ctrl_.addMobileRequest(command, app_hmi_level);
+ request_ctrl_.AddMobileRequest(command, app_hmi_level);
- if (result == request_controller::RequestController::SUCCESS) {
+ if (result == request_controller::RequestController::TResult::SUCCESS) {
SDL_LOG_DEBUG("Perform request");
- } else if (result == request_controller::RequestController::
+ } else if (result == request_controller::RequestController::TResult::
TOO_MANY_PENDING_REQUESTS) {
SDL_LOG_ERROR("RET Unable top perform request: "
<< "TOO_MANY_PENDING_REQUESTS");
@@ -277,8 +286,8 @@ bool RPCServiceImpl::ManageMobileCommand(
SendMessageToMobile(response);
return false;
- } else if (result ==
- request_controller::RequestController::TOO_MANY_REQUESTS) {
+ } else if (result == request_controller::RequestController::TResult::
+ TOO_MANY_REQUESTS) {
SDL_LOG_ERROR("RET Unable to perform request: "
<< "TOO_MANY_REQUESTS");
@@ -297,7 +306,7 @@ bool RPCServiceImpl::ManageMobileCommand(
app_ptr->usage_report().RecordRemovalsForBadBehavior();
}
return false;
- } else if (result == request_controller::RequestController::
+ } else if (result == request_controller::RequestController::TResult::
NONE_HMI_LEVEL_MANY_REQUESTS) {
SDL_LOG_ERROR("RET Unable to perform request: "
<< "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
@@ -385,7 +394,9 @@ bool RPCServiceImpl::ManageHMICommand(const commands::MessageSharedPtr message,
if (kRequest == message_type) {
SDL_LOG_DEBUG("ManageHMICommand");
command->set_warning_info(warning_info);
- request_ctrl_.addHMIRequest(command);
+ if (!app_manager_.IsStopping()) {
+ request_ctrl_.AddHMIRequest(command);
+ }
}
if (command->Init()) {
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index a680653d6c..1490f9f5b1 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -275,6 +275,13 @@ const char* vin = "vin";
const char* gearStatus = "gearStatus";
const char* prndl = "prndl";
const char* tire_pressure = "tirePressure";
+const char* pressure_telltale = "pressureTelltale";
+const char* left_front = "leftFront";
+const char* right_front = "rightFront";
+const char* left_rear = "leftRear";
+const char* right_rear = "rightRear";
+const char* inner_left_rear = "innerLeftRear";
+const char* inner_right_rear = "innerRightRear";
const char* odometer = "odometer";
const char* belt_status = "beltStatus";
const char* electronic_park_brake_status = "electronicParkBrakeStatus";
@@ -454,6 +461,10 @@ const char* const rect = "rect";
const char* const x = "x";
const char* const y = "y";
const char* const preferred_fps = "preferredFPS";
+
+// OnResetTimeout
+const char* const request_id = "requestID";
+const char* const reset_period = "resetPeriod";
} // namespace strings
namespace hmi_interface {
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 89dac83165..b8dbb69f50 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -31,12 +31,13 @@
*/
#include "application_manager/state_controller_impl.h"
+
#include <tuple>
+
#include "application_manager/rpc_service.h"
#include "application_manager/usage_statistics.h"
-#include "utils/helpers.h"
-
#include "connection_handler/connection_handler.h"
+#include "utils/helpers.h"
namespace application_manager {
@@ -720,7 +721,8 @@ void StateControllerImpl::UpdateAppWindowsStreamingState(
}
}
-void StateControllerImpl::on_event(const event_engine::MobileEvent& event) {
+void StateControllerImpl::HandleOnEvent(
+ const event_engine::MobileEvent& event) {
using namespace mobile_apis;
SDL_LOG_AUTO_TRACE();
@@ -765,9 +767,9 @@ void StateControllerImpl::on_event(const event_engine::MobileEvent& event) {
default:
break;
}
-}
+} // namespace application_manager
-void StateControllerImpl::on_event(const event_engine::Event& event) {
+void StateControllerImpl::HandleOnEvent(const event_engine::Event& event) {
using event_engine::Event;
using smart_objects::SmartObject;
using namespace hmi_apis;
diff --git a/src/components/application_manager/src/system_time/system_time_handler_impl.cc b/src/components/application_manager/src/system_time/system_time_handler_impl.cc
index 3aee6d7e21..d66c70478b 100644
--- a/src/components/application_manager/src/system_time/system_time_handler_impl.cc
+++ b/src/components/application_manager/src/system_time/system_time_handler_impl.cc
@@ -121,7 +121,7 @@ void SystemTimeHandlerImpl::SendTimeRequest() {
awaiting_get_system_time_ = true;
}
-void SystemTimeHandlerImpl::on_event(
+void SystemTimeHandlerImpl::HandleOnEvent(
const application_manager::event_engine::Event& event) {
SDL_LOG_AUTO_TRACE();
using namespace application_manager;
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 7b1a262f1b..596d11cfa9 100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -72,6 +72,7 @@ set(testSources
${AM_TEST_DIR}/application_helper_test.cc
${AM_TEST_DIR}/rpc_service_impl_test.cc
${AM_TEST_DIR}/command_holder_test.cc
+ ${AM_TEST_DIR}/request_timeout_handler_test.cc
)
set(testSourcesMockHmi
@@ -123,7 +124,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM LIBRARIES dl)
endif()
-if (ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
diff --git a/src/components/application_manager/test/app_launch/CMakeLists.txt b/src/components/application_manager/test/app_launch/CMakeLists.txt
index 1c038020b9..89e1eef2b4 100644
--- a/src/components/application_manager/test/app_launch/CMakeLists.txt
+++ b/src/components/application_manager/test/app_launch/CMakeLists.txt
@@ -46,7 +46,7 @@ set(LIBRARIES
ApplicationManager
)
- if (ENABLE_LOG)
+ if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index f7bd636a66..240b5f7d01 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -60,17 +60,17 @@ using namespace file_system;
using namespace app_launch;
const std::string kAppStorageFolder = "app_storage_folder";
-const std::string kAppStorageFile = "./app_info.dat";
const std::string kAppInfoStorage = "app_info_storage";
class AppLaunchDataJsonTest : public ::testing::Test {
private:
virtual void SetUp() {
- ::file_system::DeleteFile(kAppStorageFile);
+ const std::string storage_file = kAppStorageFolder + "/" + kAppInfoStorage;
+ ::file_system::DeleteFile(storage_file);
last_state_wrapper_ = std::make_shared<resumption::LastStateWrapperImpl>(
std::make_shared<resumption::LastStateImpl>(kAppStorageFolder,
kAppInfoStorage));
- ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
+ ASSERT_TRUE(::file_system::CreateFile(storage_file));
NiceMock<app_launch_test::MockAppLaunchSettings> mock_app_launch_settings_;
ON_CALL(mock_app_launch_settings_, max_number_of_ios_device())
@@ -85,10 +85,14 @@ class AppLaunchDataJsonTest : public ::testing::Test {
res_json_.get()->Clear();
}
- static void SetUpTestCase() {}
+ static void SetUpTestCase() {
+ ::file_system::RemoveDirectory(kAppStorageFolder);
+ ::file_system::CreateDirectoryRecursively(kAppStorageFolder);
+ }
static void TearDownTestCase() {
- ::file_system::DeleteFile(kAppStorageFile);
+ const std::string storage_file = kAppStorageFolder + "/" + kAppInfoStorage;
+ ::file_system::DeleteFile(storage_file);
::file_system::RemoveDirectory(kAppStorageFolder);
}
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
index 1633b9d29b..1f1a76298c 100644
--- a/src/components/application_manager/test/application_helper_test.cc
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -149,7 +149,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
const uint32_t cmd_id = 1;
const uint32_t menu_id = 2;
const uint32_t choice_set_id = 3;
- const mobile_apis::ButtonName::eType button = mobile_apis::ButtonName::AC;
smart_objects::SmartObject cmd(smart_objects::SmartType_Map);
cmd[strings::msg_params][strings::cmd_id] = cmd_id;
@@ -163,8 +162,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
- EXPECT_TRUE(app_impl_->SubscribeToButton(button));
-
const std::string some_string = "some_string";
smart_objects::SmartObject dummy_data =
smart_objects::SmartObject(smart_objects::SmartType_String);
@@ -176,6 +173,7 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
app_impl_->set_keyboard_props(dummy_data);
app_impl_->set_menu_title(dummy_data);
app_impl_->set_menu_icon(dummy_data);
+ app_impl_->set_menu_layout(dummy_data);
const bool persistent = false;
const bool downloaded = true;
@@ -190,7 +188,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_TRUE(smart_objects::SmartType_Null != sub_menu1.getType());
const auto choice_set1 = app_impl_->FindChoiceSet(choice_set_id);
EXPECT_TRUE(smart_objects::SmartType_Null != choice_set1.getType());
- EXPECT_TRUE(app_impl_->IsSubscribedToButton(button));
auto help_prompt = app_impl_->help_prompt();
EXPECT_TRUE(help_prompt->asString() == some_string);
auto timeout_prompt = app_impl_->timeout_prompt();
@@ -205,6 +202,8 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_TRUE(menu_title->asString() == some_string);
auto menu_icon = app_impl_->menu_icon();
EXPECT_TRUE(menu_icon->asString() == some_string);
+ auto menu_layout = app_impl_->menu_layout();
+ EXPECT_TRUE(menu_layout->asString() == some_string);
auto file_ptr = app_impl_->GetFile(filename);
EXPECT_TRUE(NULL != file_ptr);
EXPECT_TRUE(file_ptr->file_name == filename);
@@ -224,7 +223,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_TRUE(smart_objects::SmartType_Null == sub_menu2.getType());
const auto choice_set2 = app_impl_->FindChoiceSet(choice_set_id);
EXPECT_TRUE(smart_objects::SmartType_Null == choice_set2.getType());
- EXPECT_FALSE(app_impl_->IsSubscribedToButton(button));
help_prompt = app_impl_->help_prompt();
EXPECT_FALSE(help_prompt->asString() == some_string);
timeout_prompt = app_impl_->timeout_prompt();
@@ -239,6 +237,8 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_FALSE(menu_title->asString() == some_string);
menu_icon = app_impl_->menu_icon();
EXPECT_FALSE(menu_icon->asString() == some_string);
+ menu_layout = app_impl_->menu_layout();
+ EXPECT_FALSE(menu_layout->asString() == some_string);
file_ptr = app_impl_->GetFile(filename);
EXPECT_TRUE(NULL == file_ptr);
}
@@ -256,7 +256,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
- app_impl_->SubscribeToButton(mobile_apis::ButtonName::AC);
EXPECT_CALL(*mock_message_helper_, CreateDeleteUICommandRequest(_, _, _))
.WillOnce(Return(std::make_shared<smart_objects::SmartObject>()));
@@ -270,9 +269,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
EXPECT_CALL(*mock_message_helper_, SendResetPropertiesRequest(_, _));
- EXPECT_CALL(*mock_message_helper_,
- SendUnsubscribeButtonNotification(_, _, _));
-
// Act
application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
}
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 5f23e97391..1e58ce8636 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -560,9 +560,9 @@ TEST_F(ApplicationImplTest, SubscribeToButton_UnsubscribeFromButton) {
EXPECT_FALSE(app_impl->IsSubscribedToButton(ButtonName::PRESET_0));
}
-TEST_F(ApplicationImplTest, SubscribeToDefaultButton_UnsubscribeFromButton) {
- EXPECT_TRUE(app_impl->IsSubscribedToButton(ButtonName::CUSTOM_BUTTON));
- EXPECT_FALSE(app_impl->SubscribeToButton(ButtonName::CUSTOM_BUTTON));
+TEST_F(ApplicationImplTest, NotSubscribedToDefaultButton_SubscribeToButton) {
+ EXPECT_FALSE(app_impl->IsSubscribedToButton(ButtonName::CUSTOM_BUTTON));
+ EXPECT_TRUE(app_impl->SubscribeToButton(ButtonName::CUSTOM_BUTTON));
}
TEST_F(ApplicationImplTest, SubscribeToSoftButton_UnsubscribeFromSoftButton) {
diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc
index 734a7d91b8..b12e67ceba 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -150,12 +150,14 @@ TEST_F(CommandImplTest, GetMethods_SUCCESS) {
(*msg)[strings::params][strings::function_id] = kFunctionId;
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
- EXPECT_EQ(kDefaultTimeout_, command->default_timeout());
+ const uint32_t expected_timeout =
+ kDefaultTimeout_ + kDefaultTimeoutCompensation_;
+ EXPECT_EQ(expected_timeout, command->default_timeout());
EXPECT_EQ(kCorrelationId, command->correlation_id());
EXPECT_EQ(kConnectionKey, command->connection_key());
EXPECT_EQ(kFunctionId, command->function_id());
EXPECT_NO_THROW(command->Run());
- EXPECT_NO_THROW(command->onTimeOut());
+ EXPECT_NO_THROW(command->HandleTimeOut());
}
TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_NoAppIdInMessage_UNSUCCESS) {
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_mobile_request_impl_test.cc
index 9034bf442f..5129f09a96 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_mobile_request_impl_test.cc
@@ -35,9 +35,9 @@
#include <string>
#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/command_request_test.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/request_from_mobile_impl.h"
#include "gtest/gtest.h"
#include "utils/lock.h"
@@ -78,6 +78,7 @@ using am::RPCParams;
using am::commands::CommandImpl;
using am::commands::CommandRequestImpl;
using am::commands::MessageSharedPtr;
+using am::commands::RequestFromMobileImpl;
using am::event_engine::EventObserver;
using test::components::application_manager_test::MockAppServiceManager;
@@ -101,32 +102,30 @@ const std::string kAppStorageFile = "./app_info.dat";
const std::string kAppInfoStorage = "app_info_storage";
} // namespace
-class CommandRequestImplTest
+class RequestFromMobileImplTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- CommandRequestImplTest()
+ RequestFromMobileImplTest()
: app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
- class UnwrappedCommandRequestImpl : public CommandRequestImpl {
+ class UnwrappedRequestFromMobileImpl
+ : public am::commands::RequestFromMobileImpl {
public:
- using CommandRequestImpl::AddDisallowedParameters;
- using CommandRequestImpl::CheckAllowedParameters;
- using CommandRequestImpl::HasDisallowedParams;
- using CommandRequestImpl::RemoveDisallowedParameters;
-
- UnwrappedCommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& am,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(
- message, am, rpc_service, hmi_capabilities, policy_handler) {}
-
- const RequestState current_state() const {
- return current_state_;
+ UnwrappedRequestFromMobileImpl(
+ const MessageSharedPtr& message,
+ ApplicationManager& ap_man,
+ am::rpc_service::RPCService& rpc_service,
+ am::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : am::commands::RequestFromMobileImpl(
+ message, ap_man, rpc_service, hmi_capabilities, policy_handler) {}
+
+ const RequestState get_current_state() const {
+ return am::commands::CommandRequestImpl::current_state();
}
- void set_current_state(const RequestState state) {
- current_state_ = state;
+
+ void change_current_state(const RequestState state) {
+ am::commands::CommandRequestImpl::set_current_state(state);
}
CommandParametersPermissions& parameters_permissions() {
@@ -137,9 +136,21 @@ class CommandRequestImplTest
return removed_parameters_permissions_;
}
- void SetHashUpdateMode(HashUpdateMode mode) {
+ void SetHashUpdateMode(RequestFromMobileImpl::HashUpdateMode mode) {
hash_update_mode_ = mode;
}
+
+ void RemoveDisallowedParameters() {
+ am::commands::RequestFromMobileImpl::RemoveDisallowedParameters();
+ }
+
+ bool HasDisallowedParams() {
+ return am::commands::RequestFromMobileImpl::HasDisallowedParams();
+ }
+
+ void AddDisallowedParameters(smart_objects::SmartObject& response) {
+ am::commands::RequestFromMobileImpl::AddDisallowedParameters(response);
+ }
};
MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
@@ -155,41 +166,24 @@ class CommandRequestImplTest
std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
};
-typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
-typedef std::shared_ptr<UCommandRequestImpl> CommandPtr;
+typedef RequestFromMobileImplTest::UnwrappedRequestFromMobileImpl
+ URequestFromMobileImpl;
+typedef std::shared_ptr<URequestFromMobileImpl> CommandPtr;
-TEST_F(CommandRequestImplTest, WindowID_ExpectDefaultWindowID) {
+TEST_F(RequestFromMobileImplTest, WindowID_ExpectDefaultWindowID) {
auto msg = CreateMessage();
- const auto command = CreateCommand<UCommandRequestImpl>(msg);
+ const auto command = CreateCommand<URequestFromMobileImpl>(msg);
EXPECT_EQ(mobile_apis::PredefinedWindows::DEFAULT_WINDOW,
command->window_id());
}
-TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
-
- // Should be called twice:
- // First -- on `onTimeOut` method call
- // Second -- on destruction;
- EXPECT_CALL(event_dispatcher_, remove_observer(_)).Times(2);
-
- EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
-
- // If `command` already done, then state should change to `kCompleted`.
- command->set_current_state(RequestState::kCompleted);
-
- command->onTimeOut();
-
- EXPECT_EQ(RequestState::kCompleted, command->current_state());
-}
-
-TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[strings::params][strings::correlation_id] = kCorrelationId;
(*msg)[strings::params][strings::function_id] = kInvalidFunctionId;
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
MessageSharedPtr dummy_msg(CreateMessage());
EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
@@ -199,15 +193,15 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
mock_rpc_service_,
ManageMobileCommand(dummy_msg, Command::CommandSource::SOURCE_SDL));
- command->onTimeOut();
+ command->HandleTimeOut();
// If `command` not done till now, then state should change to `kTimedOut`
// and sent it to application manager to deal with it.
- EXPECT_EQ(RequestState::kTimedOut, command->current_state());
+ EXPECT_EQ(RequestState::kTimedOut, command->get_current_state());
}
-TEST_F(CommandRequestImplTest, CheckSyntax_SUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+TEST_F(RequestFromMobileImplTest, CheckSyntax_SUCCESS) {
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
// Checking message syntax.
const std::string str1("\t\n");
@@ -221,14 +215,14 @@ TEST_F(CommandRequestImplTest, CheckSyntax_SUCCESS) {
EXPECT_TRUE(command->CheckSyntax(str4, true));
}
-TEST_F(CommandRequestImplTest, GetMobileResultCode_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, GetMobileResultCode_SUCCESS) {
union ResultU {
int32_t value_;
hmi_apis::Common_Result::eType hmi_;
mobile_apis::Result::eType mobile_;
};
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
// Run thru all possible accordance
// of HMI and Mobile result codes.
@@ -253,8 +247,8 @@ TEST_F(CommandRequestImplTest, GetMobileResultCode_SUCCESS) {
command->GetMobileResultCode(hmi_apis::Common_Result::TRUNCATED_DATA));
}
-TEST_F(CommandRequestImplTest, BasicMethodsOverloads_SUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+TEST_F(RequestFromMobileImplTest, BasicMethodsOverloads_SUCCESS) {
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
@@ -264,8 +258,8 @@ TEST_F(CommandRequestImplTest, BasicMethodsOverloads_SUCCESS) {
EXPECT_NO_THROW(command->on_event(event));
}
-TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+TEST_F(RequestFromMobileImplTest, CreateHMINotification_SUCCESS) {
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
const std::string kTestParamsKey = "test_msg_params";
@@ -284,8 +278,8 @@ TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
EXPECT_TRUE((*result)[strings::msg_params].keyExists(kTestParamsKey));
}
-TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+TEST_F(RequestFromMobileImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
@@ -302,8 +296,8 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
command->SendHMIRequest(kInvalidFunctionId, NULL, false));
}
-TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
+TEST_F(RequestFromMobileImplTest, SendHMIRequest_UseEvent_SUCCESS) {
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>();
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
@@ -321,7 +315,14 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
command->SendHMIRequest(kInvalidFunctionId, NULL, true));
}
-TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, RemoveDisallowedParameters_SUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMissedParam, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
+
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::msg_params][kDisallowedParam1] = 0u;
(*msg)[strings::msg_params][kDisallowedParam2] = 0u;
@@ -329,7 +330,8 @@ TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
(*msg)[strings::msg_params][kUndefinedParam] = 0u;
(*msg)[strings::msg_params][kMissedParam] = 0u;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
+
CommandParametersPermissions& permission = command->parameters_permissions();
permission.disallowed_params.insert(kDisallowedParam1);
permission.disallowed_params.insert(kDisallowedParam2);
@@ -346,27 +348,31 @@ TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
EXPECT_TRUE(command->HasDisallowedParams());
}
-TEST_F(CommandRequestImplTest,
+TEST_F(RequestFromMobileImplTest,
CheckAllowedParameters_RegisterAppInterface_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::function_id] =
mobile_apis::FunctionID::RegisterAppInterfaceID;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
EXPECT_CALL(app_mngr_, applications()).Times(0);
EXPECT_TRUE(command->CheckPermissions());
}
-TEST_F(CommandRequestImplTest,
+TEST_F(RequestFromMobileImplTest,
CheckAllowedParameters_NoAppWithSameConnectionKey_UNSUCCESS) {
MessageSharedPtr message = CreateMessage();
- CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(message);
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(dummy_msg));
EXPECT_FALSE(command->CheckPermissions());
}
-TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
+TEST_F(RequestFromMobileImplTest,
+ CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
ON_CALL(*mock_app, GetWindowIds())
@@ -380,7 +386,7 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
(*message)[strings::msg_params] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(message);
EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
.WillOnce(Return(kMobResultSuccess));
@@ -388,7 +394,7 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
EXPECT_TRUE(command->CheckPermissions());
}
-TEST_F(CommandRequestImplTest,
+TEST_F(RequestFromMobileImplTest,
CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) {
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
@@ -405,7 +411,7 @@ TEST_F(CommandRequestImplTest,
(*message)[strings::params][strings::message_type] =
mobile_apis::messageType::request;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(message);
EXPECT_CALL(*mock_app, app_id())
.Times(1)
@@ -425,12 +431,12 @@ ACTION_P(GetArg3, output) {
*output = arg3;
}
-TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
(*msg)[strings::msg_params][kPolicyAppId] = true;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
MockAppPtr app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
@@ -449,14 +455,16 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
std::find(params.begin(), params.end(), kPolicyAppId));
}
-TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, AddDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(
kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- MessageSharedPtr msg;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::SubscribeVehicleDataID;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
ON_CALL(mock_message_helper_, vehicle_data())
.WillByDefault(ReturnRef(vehicle_data));
@@ -469,22 +477,9 @@ TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
EXPECT_TRUE((*msg)[strings::msg_params].keyExists(kDisallowedParam1));
}
-TEST_F(CommandRequestImplTest, SendResponse_TimedOut_UNSUCCESS) {
- CommandPtr command = CreateCommand<UCommandRequestImpl>();
-
- command->set_current_state(RequestState::kTimedOut);
-
- EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
-
- // Args do not affect on anything in this case;
- command->SendResponse(true, kMobResultSuccess, NULL, NULL);
-
- EXPECT_EQ(RequestState::kTimedOut, command->current_state());
-}
-
-TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
+TEST_F(RequestFromMobileImplTest, SendResponse_SUCCESS) {
MessageSharedPtr msg;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
EXPECT_TRUE(smart_objects::SmartType_Null == (*msg).getType());
@@ -496,12 +491,10 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
// Args do not affect on anything in this case;
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
- EXPECT_EQ(RequestState::kCompleted, command->current_state());
-
EXPECT_TRUE(smart_objects::SmartType_Map == (*msg).getType());
}
-TEST_F(CommandRequestImplTest,
+TEST_F(RequestFromMobileImplTest,
SendResponse_AddDisallowedParametersToInfo_SUCCESS) {
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(
@@ -511,7 +504,7 @@ TEST_F(CommandRequestImplTest,
(*msg)[strings::params][strings::function_id] =
mobile_apis::FunctionID::SubscribeVehicleDataID;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
command->removed_parameters_permissions().disallowed_params.insert(
kDisallowedParam1);
@@ -526,17 +519,16 @@ TEST_F(CommandRequestImplTest,
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
- EXPECT_EQ(RequestState::kCompleted, command->current_state());
-
EXPECT_TRUE((*result)[strings::msg_params].keyExists(strings::info));
EXPECT_FALSE(
(*result)[strings::msg_params][strings::info].asString().empty());
}
-TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) {
+TEST_F(RequestFromMobileImplTest, HashUpdateAllowed_UpdateExpected) {
MessageSharedPtr msg;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
+ command->SetHashUpdateMode(
+ RequestFromMobileImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
@@ -553,11 +545,11 @@ TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) {
command.reset();
}
-TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
+TEST_F(RequestFromMobileImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
MessageSharedPtr msg;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
command->SetHashUpdateMode(
- CommandRequestImpl::HashUpdateMode::kSkipHashUpdate);
+ RequestFromMobileImpl::HashUpdateMode::kSkipHashUpdate);
MessageSharedPtr result;
@@ -573,10 +565,11 @@ TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
command.reset();
}
-TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) {
+TEST_F(RequestFromMobileImplTest, RequestFailed_HashUpdateNotExpected) {
MessageSharedPtr msg;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
+ command->SetHashUpdateMode(
+ RequestFromMobileImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
@@ -592,10 +585,11 @@ TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) {
command.reset();
}
-TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
+TEST_F(RequestFromMobileImplTest, AppNotFound_HashUpdateNotExpected) {
MessageSharedPtr msg;
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
+ command->SetHashUpdateMode(
+ RequestFromMobileImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
@@ -612,7 +606,7 @@ TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
command.reset();
}
-TEST_F(CommandRequestImplTest, SendProviderRequest_ByServiceType) {
+TEST_F(RequestFromMobileImplTest, SendProviderRequest_ByServiceType) {
auto last_state = std::make_shared<resumption::LastStateWrapperImpl>(
std::make_shared<resumption::LastStateImpl>(kAppStorageFolder,
kAppInfoStorage));
@@ -633,7 +627,7 @@ TEST_F(CommandRequestImplTest, SendProviderRequest_ByServiceType) {
mobile_apis::FunctionID::GetAppServiceDataID;
(*msg)[strings::msg_params][strings::service_type] = "MEDIA";
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
command->SendProviderRequest(
mobile_apis::FunctionID::GetAppServiceDataID,
hmi_apis::FunctionID::AppService_GetAppServiceData,
@@ -641,7 +635,7 @@ TEST_F(CommandRequestImplTest, SendProviderRequest_ByServiceType) {
true);
}
-TEST_F(CommandRequestImplTest, SendProviderRequest_ByProviderID) {
+TEST_F(RequestFromMobileImplTest, SendProviderRequest_ByProviderID) {
auto last_state = std::make_shared<resumption::LastStateWrapperImpl>(
std::make_shared<resumption::LastStateImpl>(kAppStorageFolder,
kAppInfoStorage));
@@ -662,7 +656,7 @@ TEST_F(CommandRequestImplTest, SendProviderRequest_ByProviderID) {
mobile_apis::FunctionID::GetAppServiceDataID;
(*msg)[strings::msg_params][strings::service_id] = "serviceid12345";
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
command->SendProviderRequest(
mobile_apis::FunctionID::GetAppServiceDataID,
hmi_apis::FunctionID::AppService_GetAppServiceData,
@@ -670,7 +664,7 @@ TEST_F(CommandRequestImplTest, SendProviderRequest_ByProviderID) {
true);
}
-TEST_F(CommandRequestImplTest, SendProviderRequestToHMI_ByProviderID) {
+TEST_F(RequestFromMobileImplTest, SendProviderRequestToHMI_ByProviderID) {
auto last_state = std::make_shared<resumption::LastStateWrapperImpl>(
std::make_shared<resumption::LastStateImpl>(kAppStorageFolder,
kAppInfoStorage));
@@ -691,7 +685,7 @@ TEST_F(CommandRequestImplTest, SendProviderRequestToHMI_ByProviderID) {
mobile_apis::FunctionID::GetAppServiceDataID;
(*msg)[strings::msg_params][strings::service_id] = "serviceid12345";
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ CommandPtr command = CreateCommand<URequestFromMobileImpl>(msg);
command->SendProviderRequest(
mobile_apis::FunctionID::GetAppServiceDataID,
hmi_apis::FunctionID::AppService_GetAppServiceData,
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index 6746e0d5ec..506eed1870 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -125,7 +125,7 @@ class EventEngineTest : public testing::Test {
event_id, correlation_id, event_observer_mock_);
event_->set_smart_object(so);
- EXPECT_CALL(event_observer_mock_, on_event(An<const Event&>()))
+ EXPECT_CALL(event_observer_mock_, HandleOnEvent(An<const Event&>()))
.Times(calls_number);
event_dispatcher_instance_->raise_event(*event_);
}
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 caff56f675..d9fb0b82d9 100644
--- a/src/components/application_manager/test/help_prompt_manager_test.cc
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -57,6 +57,7 @@ const uint32_t kAppId = 10u;
const uint32_t kCmdId = 1u;
const std::string kPolicyAppId = "fake_app_id";
const uint32_t kTimeout = 10000u;
+const uint32_t kTimeoutCompensation = 1000u;
const std::string kText = "one";
const uint32_t kPosition = 1u;
const std::string kFirstVrCommand = "first";
@@ -168,6 +169,8 @@ void HelpPromptManagerTest::SetUp() {
.WillByDefault(ReturnRef(mock_event_dispatcher_));
ON_CALL(app_mngr_settings_, default_timeout())
.WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kTimeoutCompensation));
ON_CALL(app_mngr_settings_, app_icons_folder())
.WillByDefault(ReturnRef(kDirectoryName));
ON_CALL(app_mngr_settings_, app_storage_folder())
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index c83dd76978..2127f46b69 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -286,7 +286,6 @@ TEST_F(
// Count of buttons in json file
const size_t btn_length = buttons_capabilities_so.length();
- EXPECT_EQ(16ull, btn_length);
for (size_t index = 0; index < btn_length; ++index) {
EXPECT_TRUE(buttons_capabilities_so
[index][rc_rpc_plugin::enums_value::kShortPressAvailable]
diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc
index 59913b19be..368f77ce8a 100644
--- a/src/components/application_manager/test/hmi_language_handler_test.cc
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -143,10 +143,10 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
// Repeatedly add events to set `is_*_language_received_` flags up
Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
- hmi_language_handler_->on_event(ui_event);
+ hmi_language_handler_->HandleOnEvent(ui_event);
Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
- hmi_language_handler_->on_event(vr_event);
+ hmi_language_handler_->HandleOnEvent(vr_event);
// After last flag gets up, `VerifyWithPersistedLanguages`
// method been called to and then will call `hmi_capabilities`
@@ -173,14 +173,14 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
- hmi_language_handler_->on_event(tts_event);
+ hmi_language_handler_->HandleOnEvent(tts_event);
}
TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_SUCCESS) {
Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
- hmi_language_handler_->on_event(ui_event);
+ hmi_language_handler_->HandleOnEvent(ui_event);
Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
- hmi_language_handler_->on_event(vr_event);
+ hmi_language_handler_->HandleOnEvent(vr_event);
ON_CALL(app_manager_, hmi_capabilities())
.WillByDefault(ReturnRef(hmi_capabilities_));
@@ -212,14 +212,14 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_SUCCESS) {
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
- hmi_language_handler_->on_event(tts_event);
+ hmi_language_handler_->HandleOnEvent(tts_event);
}
TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_UNSUCCESS) {
Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
- hmi_language_handler_->on_event(ui_event);
+ hmi_language_handler_->HandleOnEvent(ui_event);
Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
- hmi_language_handler_->on_event(vr_event);
+ hmi_language_handler_->HandleOnEvent(vr_event);
ON_CALL(app_manager_, hmi_capabilities())
.WillByDefault(ReturnRef(hmi_capabilities_));
@@ -242,7 +242,7 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_UNSUCCESS) {
ON_CALL(app_manager_, applications()).WillByDefault(Return(data_accessor));
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
- hmi_language_handler_->on_event(tts_event);
+ hmi_language_handler_->HandleOnEvent(tts_event);
}
TEST_F(HmiLanguageHandlerTest,
@@ -299,7 +299,7 @@ TEST_F(HmiLanguageHandlerTest,
event.set_smart_object(msg);
EXPECT_CALL(app_manager_, hmi_capabilities()).Times(0);
- hmi_language_handler_->on_event(event);
+ hmi_language_handler_->HandleOnEvent(event);
EXPECT_CALL(app_manager_, hmi_capabilities())
.WillOnce(ReturnRef(hmi_capabilities_));
@@ -327,7 +327,7 @@ TEST_F(HmiLanguageHandlerTest,
.WillRepeatedly(ReturnRef(mock_rpc_service_));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(2);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(1);
- hmi_language_handler_->on_event(event);
+ hmi_language_handler_->HandleOnEvent(event);
}
TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
@@ -339,7 +339,7 @@ TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
event.set_smart_object(msg);
EXPECT_CALL(app_manager_, hmi_capabilities()).Times(0);
- hmi_language_handler_->on_event(event);
+ hmi_language_handler_->HandleOnEvent(event);
hmi_language_handler_->OnUnregisterApplication(app_id);
@@ -356,7 +356,7 @@ TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
- hmi_language_handler_->on_event(event);
+ hmi_language_handler_->HandleOnEvent(event);
}
} // namespace hmi_language_handler
} // namespace components
diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
index 3a44d7b3ff..b252d37181 100644
--- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
@@ -38,6 +38,7 @@
#include "gtest/gtest.h"
#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/mock_request_timeout_handler.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
@@ -59,6 +60,7 @@ namespace am = ::application_manager;
using am::commands::Command;
using am::commands::CommandRequestImpl;
using am::event_engine::Event;
+using test::components::application_manager_test::MockRequestTimeoutHandler;
class CallRun {
public:
@@ -112,14 +114,17 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
}
MockEventDisp event_dispatcher_;
+ MockRequestTimeoutHandler mock_request_timeout_handler_;
protected:
CommandRequestTest() : CommandsTest<kIsNice>() {}
- virtual void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ void InitCommand(const uint32_t& default_timeout) OVERRIDE {
CommandsTest<kIsNice>::InitCommand(default_timeout);
ON_CALL(CommandsTest<kIsNice>::app_mngr_, event_dispatcher())
.WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(CommandsTest<kIsNice>::app_mngr_, get_request_timeout_handler())
+ .WillByDefault(ReturnRef(mock_request_timeout_handler_));
}
};
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
index 18afa01a88..b7d4608a25 100644
--- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -41,6 +41,7 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_rpc_service.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
@@ -69,6 +70,7 @@ using ::test::components::application_manager_test::MockApplication;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
+using ::test::components::event_engine_test::MockEventDispatcher;
// Depending on the value type will be selected
template <const bool kIf, class ThenT, class ElseT>
@@ -146,7 +148,24 @@ class CommandsTest : public ::testing::Test {
mock_policy_handler_);
}
- enum { kDefaultTimeout_ = 100 };
+ void InitEventDispatcher() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+
+ void InitNegativeResponse() {
+ MessageSharedPtr timeout_response =
+ CommandsTest<kIsNice>::CreateMessage(smart_objects::SmartType_Map);
+ (*timeout_response)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*timeout_response)[am::strings::msg_params][am::strings::success] = false;
+
+ ON_CALL(mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillByDefault(Return(timeout_response));
+ }
+
+ enum { kDefaultTimeout_ = 100, kDefaultTimeoutCompensation_ = 10 };
MockAppManager app_mngr_;
MockRPCService mock_rpc_service_;
@@ -155,21 +174,31 @@ class CommandsTest : public ::testing::Test {
testing::NiceMock<policy_test::MockPolicyHandlerInterface>
mock_policy_handler_;
MockAppManagerSettings app_mngr_settings_;
+ MockEventDispatcher event_dispatcher_;
MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
am::MockMessageHelper& mock_message_helper_;
protected:
virtual void InitCommand(const uint32_t& timeout) {
+ this->InitCommand(timeout, kDefaultTimeoutCompensation_);
+ }
+
+ virtual void InitCommand(const uint32_t timeout,
+ const uint32_t compensation) {
timeout_ = timeout;
+ timeout_compensation_ = compensation;
ON_CALL(app_mngr_, get_settings())
.WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, default_timeout())
.WillByDefault(ReturnRef(timeout_));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(timeout_compensation_));
}
CommandsTest()
: mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
- , timeout_(0) {
+ , timeout_(0)
+ , timeout_compensation_(0) {
ON_CALL(app_mngr_, hmi_interfaces())
.WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
@@ -254,6 +283,7 @@ class CommandsTest : public ::testing::Test {
private:
uint32_t timeout_;
+ uint32_t timeout_compensation_;
};
MATCHER_P(MobileResultCodeIs, result_code, "") {
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 2c9fe688b4..ac2a534929 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
@@ -253,6 +253,7 @@ 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(menu_layout, const smart_objects::SmartObject*());
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());
@@ -305,6 +306,8 @@ class MockApplication : public ::application_manager::Application {
void(const smart_objects::SmartObject& menu_title));
MOCK_METHOD1(set_menu_icon,
void(const smart_objects::SmartObject& menu_icon));
+ MOCK_METHOD1(set_menu_layout,
+ void(const smart_objects::SmartObject& menu_layout));
MOCK_METHOD1(set_day_color_scheme,
void(const smart_objects::SmartObject& color_scheme));
MOCK_METHOD1(set_night_color_scheme,
diff --git a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
index b345f53c1c..f0f8bd8dd1 100644
--- a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
+++ b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
@@ -57,6 +57,10 @@ class MockEventDispatcher
remove_observer,
void(const ::application_manager::event_engine::Event::EventID& event_id,
::application_manager::event_engine::EventObserver& observer));
+ MOCK_METHOD2(
+ remove_observer,
+ void(const ::application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id));
MOCK_METHOD1(
remove_observer,
void(::application_manager::event_engine::EventObserver& observer));
diff --git a/src/components/application_manager/test/include/application_manager/mock_event_observer.h b/src/components/application_manager/test/include/application_manager/mock_event_observer.h
index 1357d67a65..7ac9223e41 100644
--- a/src/components/application_manager/test/include/application_manager/mock_event_observer.h
+++ b/src/components/application_manager/test/include/application_manager/mock_event_observer.h
@@ -50,8 +50,10 @@ class MockEventObserver
MOCK_METHOD1(on_event,
void(const application_manager::event_engine::Event& event));
MOCK_METHOD1(
- on_event,
+ HandleOnEvent,
void(const application_manager::event_engine::MobileEvent& event));
+ MOCK_METHOD1(HandleOnEvent,
+ void(const application_manager::event_engine::Event& event));
};
} // namespace event_engine_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 e40197cc13..f0da952d18 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
@@ -205,9 +205,6 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
set_seat_location_capability,
void(const smart_objects::SmartObject& seat_location_capability));
- DEPRECATED
- MOCK_METHOD1(Init, void(resumption::LastState* last_state));
-
MOCK_METHOD1(Init, void(resumption::LastStateWrapperPtr last_state_wrapper));
MOCK_CONST_METHOD0(ccpu_version, const std::string&());
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 89b2d125e5..67d992d4af 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
@@ -125,11 +125,12 @@ class MockMessageHelper {
MOCK_METHOD2(CreateHMIStatusNotification,
smart_objects::SmartObjectSPtr(ApplicationSharedPtr application,
const WindowID window_id));
- MOCK_METHOD3(CreateOnButtonSubscriptionNotificationsForApp,
+ MOCK_METHOD4(CreateButtonSubscriptionsHandlingRequestsList,
smart_objects::SmartObjectList(
ApplicationConstSharedPtr application,
- ApplicationManager& app_mngr,
- const ButtonSubscriptions& button_subscriptions));
+ const ButtonSubscriptions& button_subscriptions,
+ const hmi_apis::FunctionID::eType function_id,
+ ApplicationManager& app_mngr));
MOCK_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
const uint32_t timeout,
@@ -139,18 +140,20 @@ class MockMessageHelper {
void(const std::string& file_name,
ApplicationManager& app_mngr));
#ifdef EXTERNAL_PROPRIETARY_MODE
- MOCK_METHOD4(
+ MOCK_METHOD5(
SendGetListOfPermissionsResponse,
void(const std::vector<policy::FunctionalGroupPermission>& permissions,
const policy::ExternalConsentStatus& external_consent_status,
uint32_t correlation_id,
- ApplicationManager& app_mngr));
+ ApplicationManager& app_mngr,
+ const bool success_flag));
#else
- MOCK_METHOD3(
+ MOCK_METHOD4(
SendGetListOfPermissionsResponse,
void(const std::vector<policy::FunctionalGroupPermission>& permissions,
uint32_t correlation_id,
- ApplicationManager& app_mngr));
+ ApplicationManager& app_mngr,
+ const bool success_flag));
#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
MOCK_METHOD4(SendOnPermissionsChangeNotification,
void(uint32_t connection_key,
@@ -170,9 +173,6 @@ class MockMessageHelper {
MOCK_METHOD2(CreateModuleInfoSO,
smart_objects::SmartObjectSPtr(uint32_t function_id,
ApplicationManager& app_mngr));
- MOCK_METHOD2(SendAllOnButtonSubscriptionNotificationsForApp,
- void(ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr));
MOCK_METHOD2(CreateUIResetGlobalPropertiesRequest,
smart_objects::SmartObjectSPtr(
const ResetGlobalPropertiesResult& reset_result,
@@ -194,11 +194,18 @@ class MockMessageHelper {
MOCK_METHOD1(CreateSubscribeWayPointsMessageToHMI,
smart_objects::SmartObjectSPtr(const uint32_t correlation_id));
- MOCK_METHOD3(
- CreateOnButtonSubscriptionNotification,
- smart_objects::SmartObjectSPtr(uint32_t app_id,
- hmi_apis::Common_ButtonName::eType button,
- bool is_subscribed));
+ MOCK_METHOD4(CreateButtonSubscriptionHandlingRequestToHmi,
+ smart_objects::SmartObjectSPtr(
+ const uint32_t app_id,
+ const hmi_apis::Common_ButtonName::eType button_name,
+ const hmi_apis::FunctionID::eType function_id,
+ application_manager::ApplicationManager& app_mngr));
+
+ MOCK_METHOD2(CreateButtonNotificationToMobile,
+ smart_objects::SmartObjectSPtr(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& source_message));
+
MOCK_METHOD2(SendOnResumeAudioSourceToHMI,
void(uint32_t app_id, ApplicationManager& app_mngr));
MOCK_METHOD2(CreateAddSubMenuRequestsToHMI,
@@ -350,10 +357,6 @@ class MockMessageHelper {
MOCK_METHOD2(SendResetPropertiesRequest,
void(ApplicationSharedPtr application,
ApplicationManager& app_mngr));
- MOCK_METHOD3(SendUnsubscribeButtonNotification,
- void(mobile_apis::ButtonName::eType button,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr));
MOCK_METHOD1(CreateAppServiceCapabilities,
smart_objects::SmartObject(
std::vector<smart_objects::SmartObject>& all_services));
@@ -391,6 +394,12 @@ class MockMessageHelper {
application_manager::ApplicationSharedPtr application,
application_manager::ApplicationManager& app_mngr,
const application_manager::WindowID window_id));
+ MOCK_METHOD1(RemoveEmptyMessageParams,
+ uint16_t(const smart_objects::SmartObject&));
+
+ MOCK_METHOD2(AddDefaultParamsToTireStatus,
+ void(application_manager::ApplicationSharedPtr application,
+ smart_objects::SmartObject& response_from_hmi));
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 c1cc7f601f..4348e39020 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
@@ -56,9 +56,10 @@ class MockRequest : public application_manager::commands::Command {
MOCK_CONST_METHOD0(default_timeout, uint32_t());
MOCK_CONST_METHOD0(function_id, int32_t());
MOCK_CONST_METHOD0(window_id, application_manager::WindowID());
+ MOCK_METHOD0(HandleTimeOut, void());
+ MOCK_METHOD0(OnUpdateTimeOut, void());
MOCK_METHOD1(set_warning_info, void(const std::string info));
MOCK_CONST_METHOD0(warning_info, std::string());
- 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 c2c02a1d0c..ed7d08e850 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
@@ -86,8 +86,7 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD1(OnAppActivated,
void(app_mngr::ApplicationSharedPtr application));
MOCK_METHOD1(RemoveFromResumption, void(uint32_t app_id));
- DEPRECATED
- MOCK_METHOD1(Init, bool(resumption::LastState& last_state));
+
MOCK_METHOD1(Init, bool(resumption::LastStateWrapperPtr last_state));
MOCK_METHOD2(OnAppRegistrationStart,
void(const std::string& policy_app_id,
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 f6ee2b654a..4b36647a11 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
@@ -37,7 +37,6 @@
#include "gmock/gmock.h"
#include "utils/macro.h"
-#include "application_manager/commands/command_impl.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
@@ -53,6 +52,7 @@
#include "utils/custom_string.h"
#include "utils/lock.h"
+#include "application_manager/commands/command_impl.h"
#include "policy/policy_table/types.h"
#include "rpc_base/rpc_base_json_inl.h"
@@ -650,7 +650,6 @@ class MessageHelperTest : public ::testing::Test {
const StringArray function_id_strings;
const StringArray events_id_strings;
const StringArray hmi_level_strings;
-
const size_t delta_from_functions_id;
};
@@ -963,7 +962,8 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
MessageHelper::SendGetListOfPermissionsResponse(permissions,
external_consent_status,
correlation_id,
- mock_application_manager_);
+ mock_application_manager_,
+ true);
ASSERT_TRUE(result.get());
@@ -1003,7 +1003,8 @@ TEST_F(MessageHelperTest,
MessageHelper::SendGetListOfPermissionsResponse(permissions,
external_consent_status,
correlation_id,
- mock_application_manager_);
+ mock_application_manager_,
+ true);
ASSERT_TRUE(result.get());
diff --git a/src/components/application_manager/test/mobile_event_engine_test.cc b/src/components/application_manager/test/mobile_event_engine_test.cc
index cad1ff14ff..56824b7020 100644
--- a/src/components/application_manager/test/mobile_event_engine_test.cc
+++ b/src/components/application_manager/test/mobile_event_engine_test.cc
@@ -116,7 +116,7 @@ class MobileEventEngineTest : public testing::Test {
event_dispatcher_instance_->add_mobile_observer(
event_id, correlation_id, event_observer_mock_);
event_->set_smart_object(so);
- EXPECT_CALL(event_observer_mock_, on_event(An<const MobileEvent&>()))
+ EXPECT_CALL(event_observer_mock_, HandleOnEvent(An<const MobileEvent&>()))
.Times(calls_number);
event_dispatcher_instance_->raise_mobile_event(*event_);
}
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 554b99ff72..9212b0feab 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -170,14 +170,16 @@ void MessageHelper::SendGetListOfPermissionsResponse(
const policy::ExternalConsentStatus& external_consent_status,
#endif // EXTERNAL_PROPRIETARY_MODE
uint32_t correlation_id,
- ApplicationManager& app_mngr) {
+ ApplicationManager& app_mngr,
+ const bool success_flag) {
MockMessageHelper::message_helper_mock()->SendGetListOfPermissionsResponse(
permissions,
#ifdef EXTERNAL_PROPRIETARY_MODE
external_consent_status,
#endif // EXTERNAL_PROPRIETARY_MODE
correlation_id,
- app_mngr);
+ app_mngr,
+ success_flag);
}
void MessageHelper::SendOnPermissionsChangeNotification(
@@ -267,11 +269,6 @@ MockMessageHelper* MockMessageHelper::message_helper_mock() {
static ::testing::NiceMock<MockMessageHelper> message_helper_mock;
return &message_helper_mock;
}
-void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
- ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- MockMessageHelper::message_helper_mock()
- ->SendAllOnButtonSubscriptionNotificationsForApp(app, app_mngr);
-}
void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr) {
@@ -598,30 +595,32 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
}
smart_objects::SmartObjectSPtr
-MessageHelper::CreateOnButtonSubscriptionNotification(
- uint32_t app_id,
- hmi_apis::Common_ButtonName::eType button,
- bool is_subscribed) {
+MessageHelper::CreateButtonSubscriptionHandlingRequestToHmi(
+ const uint32_t app_id,
+ const hmi_apis::Common_ButtonName::eType button_name,
+ const hmi_apis::FunctionID::eType function_id,
+ ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()
- ->CreateOnButtonSubscriptionNotification(app_id, button, is_subscribed);
+ ->CreateButtonSubscriptionHandlingRequestToHmi(
+ app_id, button_name, function_id, app_mngr);
}
-smart_objects::SmartObjectList
-MessageHelper::CreateOnButtonSubscriptionNotificationsForApp(
- ApplicationConstSharedPtr application,
- ApplicationManager& app_mngr,
- const ButtonSubscriptions& button_subscriptions) {
+smart_objects::SmartObjectSPtr MessageHelper::CreateButtonNotificationToMobile(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& source_message) {
return MockMessageHelper::message_helper_mock()
- ->CreateOnButtonSubscriptionNotificationsForApp(
- application, app_mngr, button_subscriptions);
+ ->CreateButtonNotificationToMobile(app, source_message);
}
-void MessageHelper::SendUnsubscribeButtonNotification(
- mobile_apis::ButtonName::eType button,
- ApplicationSharedPtr application,
+smart_objects::SmartObjectList
+MessageHelper::CreateButtonSubscriptionsHandlingRequestsList(
+ ApplicationConstSharedPtr app,
+ const ButtonSubscriptions& button_subscriptions,
+ const hmi_apis::FunctionID::eType function_id,
ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()
- ->SendUnsubscribeButtonNotification(button, application, app_mngr);
+ ->CreateButtonSubscriptionsHandlingRequestsList(
+ app, button_subscriptions, function_id, app_mngr);
}
smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
@@ -687,4 +686,18 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateResponseMessageFromHmi(
return MockMessageHelper::message_helper_mock()->CreateResponseMessageFromHmi(
function_id, correlation_id, result_code);
}
+
+uint16_t MessageHelper::RemoveEmptyMessageParams(
+ smart_objects::SmartObject& msg_params) {
+ return MockMessageHelper::message_helper_mock()->RemoveEmptyMessageParams(
+ msg_params);
+}
+
+void MessageHelper::AddDefaultParamsToTireStatus(
+ application_manager::ApplicationSharedPtr application,
+ smart_objects::SmartObject& response_from_hmi) {
+ return MockMessageHelper::message_helper_mock()->AddDefaultParamsToTireStatus(
+ application, response_from_hmi);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc
index 22d7a8cfa0..e42c7648b9 100644
--- a/src/components/application_manager/test/policy_event_observer_test.cc
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -89,7 +89,7 @@ class PolicyEventObserverTest : public ::testing::Test {
EXPECT_CALL(policy_handler_mock_,
PTUpdatedAt(Counters::KILOMETERS, field_value))
.Times(pt_updated_calls_number);
- policy_event_observer_->on_event(*event_);
+ policy_event_observer_->HandleOnEvent(*event_);
}
void DeleteEvent() {
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 1d764526b9..353f3f05b7 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -199,7 +199,9 @@ class PolicyHandlerTest : public ::testing::Test {
virtual void TearDown() OVERRIDE {
Mock::VerifyAndClearExpectations(&mock_message_helper_);
- ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ ON_CALL(
+ mock_event_dispatcher_,
+ remove_observer(_, testing::Matcher<event_engine::EventObserver&>(_)));
}
void ChangePolicyManagerToMock() {
@@ -292,6 +294,10 @@ class PolicyHandlerTest : public ::testing::Test {
}
};
+ACTION_P(SetDeviceParamsMacAdress, mac_adress) {
+ *arg3 = mac_adress;
+}
+
TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) {
// Check before policy enabled from ini file
EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(false));
@@ -1583,6 +1589,56 @@ TEST_F(PolicyHandlerTest, OnGetListOfPermissions) {
GetDataOnDeviceID(
testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(
+ _, external_consent_status, corr_id, _, true));
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, corr_id, _, true));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
+
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
+}
+
+TEST_F(PolicyHandlerTest, OnGetListOfPermissions_CollectResult_false) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ const uint32_t app_id = 10u;
+ const uint32_t corr_id = 1u;
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(app_manager_, application(app_id))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
+ .WillRepeatedly(
+ DoAll(SetDeviceParamsMacAdress(std::string()), (Return(1u))));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(
+ _, external_consent_status, corr_id, _, false))
+ .WillOnce(Return());
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, corr_id, _, false))
+ .WillOnce(Return());
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
+
policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
@@ -1614,14 +1670,14 @@ TEST_F(PolicyHandlerTest, OnGetListOfPermissions_WithoutConnectionKey) {
#ifdef EXTERNAL_PROPRIETARY_MODE
policy::ExternalConsentStatus external_consent_status =
policy::ExternalConsentStatus();
- EXPECT_CALL(
- mock_message_helper_,
- SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(
+ _, external_consent_status, corr_id, _, true));
EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
.WillOnce(Return(external_consent_status));
#else
EXPECT_CALL(mock_message_helper_,
- SendGetListOfPermissionsResponse(_, corr_id, _));
+ SendGetListOfPermissionsResponse(_, corr_id, _, true));
#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
policy_handler_.OnGetListOfPermissions(app_id, corr_id);
@@ -1690,14 +1746,14 @@ TEST_F(PolicyHandlerTest, OnGetListOfPermissions_GroupPermissions_SUCCESS) {
#ifdef EXTERNAL_PROPRIETARY_MODE
policy::ExternalConsentStatus external_consent_status =
policy::ExternalConsentStatus();
- EXPECT_CALL(
- mock_message_helper_,
- SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(
+ _, external_consent_status, corr_id, _, true));
EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
.WillOnce(Return(external_consent_status));
#else
EXPECT_CALL(mock_message_helper_,
- SendGetListOfPermissionsResponse(_, corr_id, _));
+ SendGetListOfPermissionsResponse(_, corr_id, _, true));
#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
policy_handler_.OnGetListOfPermissions(app_id, corr_id);
@@ -2318,10 +2374,6 @@ TEST_F(PolicyHandlerTest,
EXPECT_FALSE(waiter->WaitFor(kCallsCount_, kTimeout_));
}
-ACTION_P(SetDeviceParamsMacAdress, mac_adress) {
- *arg3 = mac_adress;
-}
-
TEST_F(PolicyHandlerTest,
OnAppPermissionConsentInternal_ExistAppsPreviouslyStored_SUCCESS) {
EnablePolicyAndPolicyManagerMock();
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
index 992bf8e303..2de2a69cf7 100644
--- a/src/components/application_manager/test/request_controller/request_controller_test.cc
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -33,7 +33,7 @@
#include <stdint.h>
#include "application_manager/mock_request.h"
-#include "application_manager/request_controller.h"
+#include "application_manager/request_controller_impl.h"
#include "application_manager/request_info.h"
#include "gtest/gtest.h"
@@ -44,10 +44,14 @@
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/mock_application_manager.h"
+
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/mock_request_timeout_handler.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/state_controller.h"
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
#include "resumption/last_state.h"
#include "utils/test_async_waiter.h"
@@ -56,8 +60,11 @@ namespace components {
namespace request_controller_test {
using ::application_manager::request_controller::RequestController;
+using ::application_manager::request_controller::RequestControllerImpl;
using ::application_manager::request_controller::RequestInfo;
+using test::components::application_manager_test::MockRequestTimeoutHandler;
+using ::test::components::event_engine_test::MockEventDispatcher;
using ::testing::_;
using ::testing::NiceMock;
using ::testing::Return;
@@ -65,7 +72,7 @@ using ::testing::ReturnRef;
typedef NiceMock<application_manager_test::MockRequest> MRequest;
typedef std::shared_ptr<MRequest> RequestPtr;
-typedef std::shared_ptr<RequestController> RequestControllerSPtr;
+typedef std::shared_ptr<RequestControllerImpl> RequestControllerSPtr;
namespace {
const size_t kNumberOfRequests = 10u;
@@ -103,8 +110,10 @@ class RequestControllerTestClass : public ::testing::Test {
RequestControllerTestClass() {
ON_CALL(mock_request_controller_settings_, thread_pool_size())
.WillByDefault(Return(kThreadPoolSize));
- request_ctrl_ =
- std::make_shared<RequestController>(mock_request_controller_settings_);
+ request_ctrl_ = std::make_shared<RequestControllerImpl>(
+ mock_request_controller_settings_,
+ mock_request_timeout_handler_,
+ mock_event_dispatcher_);
}
RequestPtr GetMockRequest(
@@ -126,10 +135,10 @@ class RequestControllerTestClass : public ::testing::Test {
const mobile_apis::HMILevel::eType& hmi_level =
mobile_apis::HMILevel::INVALID_ENUM) {
if (RequestInfo::RequestType::HMIRequest == request_type) {
- return request_ctrl_->addHMIRequest(request);
+ return request_ctrl_->AddHMIRequest(request);
}
CallSettings(settings);
- return request_ctrl_->addMobileRequest(request, hmi_level);
+ return request_ctrl_->AddMobileRequest(request, hmi_level);
}
void CallSettings(const TestSettings& settings) const {
@@ -154,6 +163,8 @@ class RequestControllerTestClass : public ::testing::Test {
NiceMock<application_manager_test::MockRequestControlerSettings>
mock_request_controller_settings_;
+ NiceMock<MockEventDispatcher> mock_event_dispatcher_;
+ MockRequestTimeoutHandler mock_request_timeout_handler_;
RequestControllerSPtr request_ctrl_;
RequestPtr empty_mock_request_;
const TestSettings default_settings_;
@@ -169,7 +180,7 @@ TEST_F(RequestControllerTestClass,
.Times(1)
.WillRepeatedly(NotifyTestAsyncWaiter(waiter_valid));
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
request_valid,
RequestInfo::RequestType::MobileRequest,
@@ -185,7 +196,7 @@ TEST_F(RequestControllerTestClass,
ON_CALL(*request_dup_corr_id, Run())
.WillByDefault(NotifyTestAsyncWaiter(waiter_dup));
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
request_dup_corr_id,
RequestInfo::RequestType::MobileRequest,
@@ -200,7 +211,7 @@ TEST_F(RequestControllerTestClass,
// app_hmi_level_none_time_scale_max_requests_ equals 0
// (in the default settings they setted to 0)
for (size_t i = 0; i < kMaxRequestAmount; ++i) {
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
GetMockRequest(i),
RequestInfo::RequestType::MobileRequest,
@@ -247,7 +258,7 @@ TEST_F(RequestControllerTestClass, IsLowVoltage_SetOnWakeUp_FALSE) {
}
TEST_F(RequestControllerTestClass, AddMobileRequest_SetValidData_SUCCESS) {
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
GetMockRequest(),
RequestInfo::RequestType::MobileRequest,
@@ -256,7 +267,7 @@ TEST_F(RequestControllerTestClass, AddMobileRequest_SetValidData_SUCCESS) {
TEST_F(RequestControllerTestClass,
AddMobileRequest_SetInvalidData_INVALID_DATA) {
- EXPECT_EQ(RequestController::INVALID_DATA,
+ EXPECT_EQ(RequestController::TResult::INVALID_DATA,
AddRequest(default_settings_,
empty_mock_request_,
RequestInfo::RequestType::MobileRequest,
@@ -264,14 +275,14 @@ TEST_F(RequestControllerTestClass,
}
TEST_F(RequestControllerTestClass, AddHMIRequest_AddRequest_SUCCESS) {
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
GetMockRequest(),
RequestInfo::RequestType::HMIRequest));
}
TEST_F(RequestControllerTestClass, AddHMIRequest_AddInvalidData_INVALID_DATA) {
- EXPECT_EQ(RequestController::INVALID_DATA,
+ EXPECT_EQ(RequestController::TResult::INVALID_DATA,
AddRequest(default_settings_,
empty_mock_request_,
RequestInfo::RequestType::HMIRequest));
@@ -283,12 +294,12 @@ TEST_F(RequestControllerTestClass, OnTimer_SUCCESS) {
kDefaultCorrelationID, kDefaultConnectionKey, request_timeout);
auto waiter = TestAsyncWaiter::createInstance();
- EXPECT_EQ(RequestController::SUCCESS,
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
AddRequest(default_settings_,
mock_request,
RequestInfo::RequestType::MobileRequest));
- EXPECT_CALL(*mock_request, onTimeOut())
+ EXPECT_CALL(*mock_request, HandleTimeOut())
.WillOnce(NotifyTestAsyncWaiter(waiter));
// Waiting for call of `onTimeOut` for `kTimeScale` seconds
diff --git a/src/components/application_manager/test/request_timeout_handler_test.cc b/src/components/application_manager/test/request_timeout_handler_test.cc
new file mode 100644
index 0000000000..b1acec5eb3
--- /dev/null
+++ b/src/components/application_manager/test/request_timeout_handler_test.cc
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2020, 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/request_timeout_handler_impl.h"
+
+#include <memory>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_request_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/request_info.h"
+#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+
+namespace test {
+namespace components {
+namespace request_timeout_handler_test {
+
+using application_manager::event_engine::Event;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using namespace application_manager::commands;
+using namespace application_manager::strings;
+using namespace application_manager::request_controller;
+using application_manager_test::MockRequestController;
+using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
+using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
+
+namespace {
+const uint32_t kDefaultTimeout = 10000u;
+const uint32_t kDefaultTimeoutCompensation = 1000u;
+const uint32_t kTimeout = 13000u;
+const uint32_t kRequestId = 22;
+const std::string kMethodNameSubscribeWayPoints =
+ "Navigation.SubscribeWayPoints";
+const std::string kMethodNameUnsubscribeWayPoints =
+ "Navigation.UnsubscribeWayPoints";
+const uint32_t kConnectionKey = 3u;
+} // namespace
+
+class RequestTimeoutHandlerTest
+ : public commands_test::CommandRequestTest<
+ commands_test::CommandsTestMocks::kIsNice> {
+ public:
+ RequestTimeoutHandlerTest()
+ : mock_message_helper_(
+ application_manager::MockMessageHelper::message_helper_mock()) {}
+
+ protected:
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_request_controller())
+ .WillByDefault(ReturnRef(mock_request_controller_));
+ request_timeout_handler_ =
+ std::make_shared<RequestTimeoutHandlerImpl>(app_mngr_);
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ template <typename Command>
+ std::unique_ptr<Command> CreateCommand() {
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kDefaultTimeoutCompensation));
+
+ std::shared_ptr<smart_objects::SmartObject> msg =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Null);
+
+ std::unique_ptr<Command> command(new Command(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_));
+ return command;
+ }
+
+ application_manager::MockMessageHelper* mock_message_helper_;
+ MockRequestController mock_request_controller_;
+ std::shared_ptr<RequestTimeoutHandlerImpl> request_timeout_handler_;
+ testing::NiceMock<application_manager_test::MockHMICapabilities>
+ mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(RequestTimeoutHandlerTest, OnEvent_OnResetTimeout_SUCCESS) {
+ // RequestTimeoutHandler works with all the commands.
+ // But just for testing, only SubscribeWayPointsRequest was chosen in current
+ // test.
+ std::unique_ptr<SubscribeWayPointsRequest> command =
+ CreateCommand<SubscribeWayPointsRequest>();
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(Ref(*mock_app)))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kRequestId));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
+ smart_objects::SmartObject notification_msg;
+ notification_msg[msg_params][reset_period] = kTimeout;
+ notification_msg[msg_params][request_id] = kRequestId;
+ notification_msg[msg_params][method_name] = kMethodNameSubscribeWayPoints;
+ event.set_smart_object(notification_msg);
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kDefaultTimeoutCompensation));
+
+ EXPECT_CALL(app_mngr_, get_request_timeout_handler())
+ .WillOnce(ReturnRef(*request_timeout_handler_));
+
+ EXPECT_CALL(app_mngr_,
+ UpdateRequestTimeout(mock_app->app_id(),
+ command->correlation_id(),
+ kTimeout + kDefaultTimeoutCompensation));
+ EXPECT_CALL(app_mngr_,
+ UpdateRequestTimeout(RequestInfo::kHmiConnectionKey,
+ kRequestId,
+ kTimeout + kDefaultTimeoutCompensation));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ request_timeout_handler_->HandleOnEvent(event);
+}
+
+TEST_F(RequestTimeoutHandlerTest, OnEvent_OnResetTimeout_MissedResetPeriod) {
+ // RequestTimeoutHandler works with all the commands.
+ // But just for testing, only SubscribeWayPointsRequest was chosen in current
+ // test.
+
+ std::unique_ptr<SubscribeWayPointsRequest> command =
+ CreateCommand<SubscribeWayPointsRequest>();
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(Ref(*mock_app)))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kRequestId));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
+ smart_objects::SmartObject notification_msg;
+ notification_msg[msg_params][request_id] = kRequestId;
+ notification_msg[msg_params][method_name] = kMethodNameSubscribeWayPoints;
+ event.set_smart_object(notification_msg);
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kDefaultTimeoutCompensation));
+
+ EXPECT_CALL(app_mngr_, get_request_timeout_handler())
+ .WillOnce(ReturnRef(*request_timeout_handler_));
+ EXPECT_CALL(
+ app_mngr_,
+ UpdateRequestTimeout(mock_app->app_id(),
+ command->correlation_id(),
+ kDefaultTimeout + kDefaultTimeoutCompensation));
+ EXPECT_CALL(
+ app_mngr_,
+ UpdateRequestTimeout(RequestInfo::kHmiConnectionKey,
+ kRequestId,
+ kDefaultTimeout + kDefaultTimeoutCompensation));
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ request_timeout_handler_->HandleOnEvent(event);
+}
+
+TEST_F(RequestTimeoutHandlerTest, OnEvent_OnResetTimeout_InvalidRequestId) {
+ // RequestTimeoutHandler works with all the commands.
+ // But just for testing, only SubscribeWayPointsRequest was chosen in
+ // current test.
+ std::unique_ptr<SubscribeWayPointsRequest> command =
+ CreateCommand<SubscribeWayPointsRequest>();
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(Ref(*mock_app)))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kRequestId));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
+ smart_objects::SmartObject notification_msg;
+ notification_msg[msg_params][reset_period] = kTimeout;
+ notification_msg[msg_params][method_name] = kMethodNameSubscribeWayPoints;
+ notification_msg[msg_params][request_id] = 0u;
+ event.set_smart_object(notification_msg);
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kDefaultTimeoutCompensation));
+
+ EXPECT_CALL(app_mngr_, get_request_timeout_handler())
+ .WillOnce(ReturnRef(*request_timeout_handler_));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ request_timeout_handler_->HandleOnEvent(event);
+}
+
+TEST_F(RequestTimeoutHandlerTest, OnEvent_OnResetTimeout_InvalidMethodName) {
+ // RequestTimeoutHandler works with all the commands.
+ // But just for testing, only SubscribeWayPointsRequest was chosen in
+ // current test.
+ std::unique_ptr<SubscribeWayPointsRequest> command =
+ CreateCommand<SubscribeWayPointsRequest>();
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(Ref(*mock_app)))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kRequestId));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnResetTimeout);
+ smart_objects::SmartObject notification_msg;
+ notification_msg[msg_params][reset_period] = kTimeout;
+ notification_msg[msg_params][method_name] = " ";
+ notification_msg[msg_params][request_id] = kRequestId;
+ event.set_smart_object(notification_msg);
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ON_CALL(app_mngr_settings_, default_timeout_compensation())
+ .WillByDefault(ReturnRef(kDefaultTimeoutCompensation));
+
+ EXPECT_CALL(app_mngr_, get_request_timeout_handler())
+ .WillOnce(ReturnRef(*request_timeout_handler_));
+ EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ request_timeout_handler_->HandleOnEvent(event);
+}
+} // namespace request_timeout_handler_test
+} // namespace components
+} // namespace test
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 a265b2b341..1ff04c332c 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -315,6 +315,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
smart_objects::SmartObjectList requests;
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
@@ -363,6 +365,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
@@ -412,6 +416,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
ON_CALL(*mock_app_, help_prompt_manager())
.WillByDefault(ReturnRef(*mock_help_prompt_manager_));
@@ -497,6 +503,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
@@ -538,6 +546,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
@@ -583,6 +593,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
std::shared_ptr<sync_primitives::Lock> button_lock_ptr =
std::make_shared<sync_primitives::Lock>();
@@ -592,19 +604,13 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
ON_CALL(*mock_app_, SubscribedButtons())
.WillByDefault(Return(button_subscription_accessor));
- smart_objects::SmartObjectList button_subscription_notifications;
+ smart_objects::SmartObjectList button_subscription_requests_list;
ON_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- CreateOnButtonSubscriptionNotificationsForApp(_, _, _))
- .WillByDefault(Return(button_subscription_notifications));
+ CreateButtonSubscriptionsHandlingRequestsList(_, _, _, _))
+ .WillByDefault(Return(button_subscription_requests_list));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
- for (uint32_t i = 0; i < count_of_buttons; ++i) {
- EXPECT_CALL(
- *mock_app_,
- SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(i)));
- }
-
std::list<application_manager::AppExtensionPtr> extensions;
extensions.insert(extensions.begin(), mock_app_extension_);
@@ -612,7 +618,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
EXPECT_CALL(*mock_app_extension_, ProcessResumption(saved_app));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- CreateOnButtonSubscriptionNotificationsForApp(_, _, _));
+ CreateButtonSubscriptionsHandlingRequestsList(_, _, _, _));
const bool res = res_ctrl_->StartResumption(mock_app_, kHash_, callback_);
EXPECT_TRUE(res);
@@ -646,6 +652,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
@@ -674,6 +682,8 @@ TEST_F(ResumeCtrlTest,
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
smart_objects::SmartObjectSPtr subscribe_waypoints_msg;
@@ -1020,7 +1030,7 @@ TEST_F(ResumeCtrlTest,
res_ctrl_->SetupDefaultHMILevel(mock_app_);
}
-TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
+TEST_F(ResumeCtrlTest, ApplicationResumptionTimer_AppInFull) {
ON_CALL(mock_app_mngr_, application(kTestAppId_))
.WillByDefault(Return(mock_app_));
diff --git a/src/components/application_manager/test/rpc_service_impl_test.cc b/src/components/application_manager/test/rpc_service_impl_test.cc
index 0a7cff031d..cdfc6114e9 100644
--- a/src/components/application_manager/test/rpc_service_impl_test.cc
+++ b/src/components/application_manager/test/rpc_service_impl_test.cc
@@ -43,14 +43,17 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_command_factory.h"
#include "application_manager/mock_command_holder.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_request.h"
#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/mock_request_timeout_handler.h"
#include "application_manager/mock_rpc_plugin.h"
#include "application_manager/mock_rpc_plugin_manager.h"
#include "application_manager/mock_rpc_protection_manager.h"
#include "application_manager/plugin_manager/plugin_keys.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/request_controller_impl.h"
#include "connection_handler/mock_connection_handler.h"
#include "hmi_message_handler/mock_hmi_message_handler.h"
#include "include/test/protocol_handler/mock_protocol_handler.h"
@@ -66,6 +69,8 @@ using test::components::protocol_handler_test::MockProtocolHandler;
typedef smart_objects::SmartObjectSPtr MessageSharedPtr;
typedef utils::Optional<am::plugin_manager::RPCPlugin> PluginOpt;
using test::components::application_manager_test::MockAppServiceManager;
+using test::components::application_manager_test::MockRequestTimeoutHandler;
+using test::components::event_engine_test::MockEventDispatcher;
using ::testing::_;
using ::testing::NiceMock;
using ::testing::Return;
@@ -86,7 +91,9 @@ const int32_t kConnectionSessionsCount = 2;
class RPCServiceImplTest : public ::testing::Test {
public:
RPCServiceImplTest()
- : request_controller_(mock_request_controler_)
+ : request_controller_(mock_request_controler_,
+ mock_request_timeout_handler_,
+ mock_event_dispatcher_)
, mock_rpc_protection_manager_(
std::make_shared<
testing::NiceMock<am::MockRPCProtectionManager> >())
@@ -145,8 +152,9 @@ class RPCServiceImplTest : public ::testing::Test {
testing::NiceMock<MockApplicationManager> mock_app_mngr_;
testing::NiceMock<MockRequestControlerSettings> mock_request_controler_;
testing::NiceMock<MockProtocolHandler> mock_protocol_handler_;
- am::request_controller::RequestController request_controller_;
+ am::request_controller::RequestControllerImpl request_controller_;
testing::NiceMock<MockHMIMessageHandler> mock_hmi_handler_;
+ MockEventDispatcher mock_event_dispatcher_;
testing::NiceMock<MockCommandHolder> mock_command_holder_;
std::shared_ptr<am::MockRPCProtectionManager> mock_rpc_protection_manager_;
std::shared_ptr<rpc_service::RPCService> rpc_service_;
@@ -157,6 +165,7 @@ class RPCServiceImplTest : public ::testing::Test {
mock_rpc_plugin_manager_;
testing::NiceMock<am::plugin_manager::MockRPCPlugin> mock_rpc_plugin_;
testing::NiceMock<MockCommandFactory> mock_command_factory_;
+ MockRequestTimeoutHandler mock_request_timeout_handler_;
};
TEST_F(RPCServiceImplTest, ManageMobileCommand_MessageIsNullPtr_False) {
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index dc4fe16027..bb69933497 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -75,21 +75,11 @@
"line2" : "permission(s)?",
"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."
},
- "en-ie" : {
- "line1" : "Grant requested",
- "line2" : "permission(s)?",
- "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."
- },
"en-us" : {
"line1" : "Grant Requested",
"line2" : "Permission(s)?",
"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."
},
- "es-en" : {
- "line1" : "¿Otorgar permiso(s)",
- "line2" : "solicitado(s)?",
- "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."
- },
"es-es" : {
"line1" : "¿Conceder permisos",
"line2" : "solicitados?",
@@ -173,15 +163,9 @@
"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."
},
@@ -237,15 +221,9 @@
"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."
},
@@ -304,18 +282,10 @@
"line1" : "not authorized",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "en-ie" : {
- "line1" : "not authorized",
- "tts" : "This version of %appName% is not authorized and will not work with SYNC."
- },
"en-us" : {
"line1" : "Not Authorized",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "es-en" : {
- "line1" : "no autorizada",
- "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
"es-es" : {
"line1" : "No autorizada",
"tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
@@ -388,18 +358,10 @@
"line1" : "not supported",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "en-ie" : {
- "line1" : "not supported",
- "tts" : "This version of %appName% is not supported by SYNC."
- },
"en-us" : {
"line1" : "Not Supported",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "es-en" : {
- "line1" : "no compatible",
- "tts" : "Esta versión de %appName% no es compatible con SYNC."
- },
"es-es" : {
"line1" : "No compatible",
"tts" : "Esta versión de %appName% no es compatible con SYNC."
@@ -491,21 +453,11 @@
"line2" : "and Mobile Apps?",
"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."
},
- "en-ie" : {
- "line1" : "Disable auto-updates",
- "line2" : "and Mobile Apps?",
- "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."
- },
"en-us" : {
"line1" : "Disable Auto-Updates",
"line2" : "and Mobile Apps?",
"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."
},
- "es-en" : {
- "line1" : "¿Deshab. actualiz.",
- "line2" : "autom. y aplic. móv.?",
- "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."
- },
"es-es" : {
"line1" : "¿Desact. actual. auto",
"line2" : "y apl. móviles?",
@@ -592,18 +544,10 @@
"label" : "Driving characteristics",
"tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
},
- "en-ie" : {
- "label" : "Driving characteristics",
- "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
"en-us" : {
"label" : "Driving Characteristics",
"tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
},
- "es-en" : {
- "label" : "Características del manejo",
- "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
"es-es" : {
"label" : "Características de conducción",
"tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
@@ -676,18 +620,10 @@
"label" : "GPS and speed",
"tts" : "An app can access vehicle GPS and speed."
},
- "en-ie" : {
- "label" : "GPS and speed",
- "tts" : "An app can access vehicle GPS and speed."
- },
"en-us" : {
"label" : "GPS and speed",
"tts" : "An app can access vehicle GPS and speed."
},
- "es-en" : {
- "label" : "GPS y velocidad",
- "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
"es-es" : {
"label" : "GPS y velocidad",
"tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
@@ -760,18 +696,10 @@
"label" : "Push notifications",
"tts" : "An app can send notifications when running in the background."
},
- "en-ie" : {
- "label" : "Push notifications",
- "tts" : "An app can send notifications when running in the background."
- },
"en-us" : {
"label" : "Push notifications",
"tts" : "An app can send notifications when running in the background."
},
- "es-en" : {
- "label" : "Notificaciones tipo Push",
- "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
"es-es" : {
"label" : "Notificaciones push",
"tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
@@ -841,15 +769,9 @@
"en-gb" : {
"line1" : "Disable updates"
},
- "en-ie" : {
- "line1" : "Disable updates"
- },
"en-us" : {
"line1" : "Disable Updates"
},
- "es-en" : {
- "line1" : "Deshab. actual."
- },
"es-es" : {
"line1" : "Desact. actual."
},
@@ -905,15 +827,9 @@
"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."
},
@@ -969,15 +885,9 @@
"en-gb" : {
"line1" : "Request update"
},
- "en-ie" : {
- "line1" : "Request update"
- },
"en-us" : {
"line1" : "Request Update"
},
- "es-en" : {
- "line1" : "Solicit. actualiz."
- },
"es-es" : {
"line1" : "Solicitar actual."
},
@@ -1033,15 +943,9 @@
"en-gb" : {
"line1" : "Update needed"
},
- "en-ie" : {
- "line1" : "Update needed"
- },
"en-us" : {
"line1" : "Update Needed"
},
- "es-en" : {
- "line1" : "Actualiz. neces."
- },
"es-es" : {
"line1" : "Actu. necesaria"
},
@@ -1097,15 +1001,9 @@
"en-gb" : {
"line1" : "Updating..."
},
- "en-ie" : {
- "line1" : "Updating..."
- },
"en-us" : {
"line1" : "Updating..."
},
- "es-en" : {
- "line1" : "Actualizando..."
- },
"es-es" : {
"line1" : "Actualizando..."
},
@@ -1161,15 +1059,9 @@
"en-gb" : {
"line1" : "Up-to-date"
},
- "en-ie" : {
- "line1" : "Up-to-date"
- },
"en-us" : {
"line1" : "Up-To-Date"
},
- "es-en" : {
- "line1" : "Actualizado"
- },
"es-es" : {
"line1" : "Actualizada"
},
@@ -1228,18 +1120,10 @@
"label" : "Vehicle information",
"tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
},
- "en-ie" : {
- "label" : "Vehicle information",
- "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
- },
"en-us" : {
"label" : "Vehicle information",
"tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
},
- "es-en" : {
- "label" : "Información del vehículo",
- "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."
- },
"es-es" : {
"label" : "Información del vehículo",
"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."
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 16e8bff8b8..b6ec4fc8ef 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
@@ -392,22 +392,22 @@ class StateControllerImplTest : public ::testing::Test {
case APP_TYPE_MEDIA: {
PrepareCommonStateResults(result_hmi_state);
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_BACKGROUND,
+ createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_BACKGROUND,
+ createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_BACKGROUND,
+ createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_BACKGROUND,
+ createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
@@ -426,18 +426,20 @@ class StateControllerImplTest : public ::testing::Test {
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_LIMITED,
+ createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
- createHmiState(HMILevel::HMI_LIMITED,
+ createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
@@ -491,7 +493,9 @@ class StateControllerImplTest : public ::testing::Test {
PrepareStateResultsForAttenuated(result_hmi_state);
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
@@ -548,7 +552,9 @@ class StateControllerImplTest : public ::testing::Test {
PrepareStateResultsForAttenuated(result_hmi_state);
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
@@ -579,7 +585,9 @@ class StateControllerImplTest : public ::testing::Test {
PrepareStateResultsForAttenuated(result_hmi_state);
break;
}
- default: { break; }
+ default: {
+ break;
+ }
}
}
@@ -604,7 +612,8 @@ class StateControllerImplTest : public ::testing::Test {
return APP_TYPE_NAVI;
}
- if (app->is_media_application()) {
+ if (app->is_media_application() ||
+ app->is_voice_communication_supported()) {
return APP_TYPE_MEDIA;
}
@@ -1294,12 +1303,12 @@ class StateControllerImplTest : public ::testing::Test {
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_start_event(FunctionID::VR_Started);
- state_ctrl_->on_event(vr_start_event);
+ state_ctrl_->HandleOnEvent(vr_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
Event tts_start_event(FunctionID::TTS_Started);
- state_ctrl_->on_event(tts_start_event);
+ state_ctrl_->HandleOnEvent(tts_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
@@ -1310,7 +1319,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::PHONE_CALL;
phone_call_event.set_smart_object(message);
- state_ctrl_->on_event(phone_call_event);
+ state_ctrl_->HandleOnEvent(phone_call_event);
break;
}
case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
@@ -1321,7 +1330,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
emergency_event.set_smart_object(message);
- state_ctrl_->on_event(emergency_event);
+ state_ctrl_->HandleOnEvent(emergency_event);
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
@@ -1365,12 +1374,12 @@ class StateControllerImplTest : public ::testing::Test {
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_start_event(FunctionID::VR_Started);
- state_ctrl_->on_event(vr_start_event);
+ state_ctrl_->HandleOnEvent(vr_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
Event tts_start_event(FunctionID::TTS_Started);
- state_ctrl_->on_event(tts_start_event);
+ state_ctrl_->HandleOnEvent(tts_start_event);
break;
}
case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
@@ -1381,7 +1390,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::PHONE_CALL;
phone_call_event.set_smart_object(message);
- state_ctrl_->on_event(phone_call_event);
+ state_ctrl_->HandleOnEvent(phone_call_event);
break;
}
case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
@@ -1392,7 +1401,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
emergency_event.set_smart_object(message);
- state_ctrl_->on_event(emergency_event);
+ state_ctrl_->HandleOnEvent(emergency_event);
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
@@ -1418,12 +1427,12 @@ class StateControllerImplTest : public ::testing::Test {
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
Event vr_stop_event(FunctionID::VR_Stopped);
- state_ctrl_->on_event(vr_stop_event);
+ state_ctrl_->HandleOnEvent(vr_stop_event);
break;
}
case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
Event tts_stop_event(FunctionID::TTS_Stopped);
- state_ctrl_->on_event(tts_stop_event);
+ state_ctrl_->HandleOnEvent(tts_stop_event);
break;
}
case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
@@ -1434,7 +1443,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::PHONE_CALL;
phone_call_event.set_smart_object(message);
- state_ctrl_->on_event(phone_call_event);
+ state_ctrl_->HandleOnEvent(phone_call_event);
break;
}
case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
@@ -1445,7 +1454,7 @@ class StateControllerImplTest : public ::testing::Test {
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
emergency_event.set_smart_object(message);
- state_ctrl_->on_event(emergency_event);
+ state_ctrl_->HandleOnEvent(emergency_event);
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
@@ -2286,7 +2295,7 @@ TEST_F(StateControllerImplTest, ActivateAppSuccessReceivedFromHMI) {
am::event_engine::Event event(
hmi_apis::FunctionID::BasicCommunication_ActivateApp);
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
}
@@ -2348,7 +2357,7 @@ TEST_F(StateControllerImplTest, SendEventBCActivateApp_HMIReceivesError) {
message[am::strings::params][am::strings::correlation_id] = corr_id;
am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
}
@@ -2372,7 +2381,7 @@ TEST_F(StateControllerImplTest, ActivateAppInvalidCorrelationId) {
message[am::strings::params][am::strings::correlation_id] = corr_id;
am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForSimpleApp) {
@@ -2866,7 +2875,7 @@ TEST_F(StateControllerImplTest,
// Precondition
am::event_engine::Event event(hmi_apis::FunctionID::VR_Started);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
HmiStatePtr check_state = FullNotAudibleState();
@@ -2900,10 +2909,10 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
// Precondition
am::event_engine::Event prev_event(hmi_apis::FunctionID::VR_Started);
- state_ctrl_->on_event(prev_event);
+ state_ctrl_->HandleOnEvent(prev_event);
am::event_engine::Event next_event(hmi_apis::FunctionID::VR_Stopped);
- state_ctrl_->on_event(next_event);
+ state_ctrl_->HandleOnEvent(next_event);
// Set state of non-media app after vr has stopped
HmiStatePtr check_state = FullNotAudibleState();
@@ -2964,7 +2973,7 @@ TEST_F(StateControllerImplTest,
Common_EventTypes::EMERGENCY_EVENT;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
// Non-media app can't have LIMITED-AUDIO state
HmiStatePtr check_state = FullNotAudibleState();
@@ -3012,7 +3021,7 @@ TEST_F(StateControllerImplTest,
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
am::HmiStatePtr check_state = FullAudibleState();
@@ -3048,7 +3057,7 @@ TEST_F(StateControllerImplTest,
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
am::HmiStatePtr hmi_state = FullAudibleState();
@@ -3082,7 +3091,7 @@ TEST_F(StateControllerImplTest,
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
am::HmiStatePtr hmi_state = FullAudibleState();
@@ -3119,7 +3128,7 @@ TEST_F(StateControllerImplTest,
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
am::HmiStatePtr hmi_state = FullAudibleState();
@@ -3156,7 +3165,7 @@ TEST_F(StateControllerImplTest,
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(message);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
am::HmiStatePtr hmi_state = FullAudibleState();
@@ -3211,7 +3220,7 @@ TEST_F(StateControllerImplTest,
am::WindowIds window_ids = {kDefaultWindowId};
EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_FULL);
EXPECT_EQ(new_state->audio_streaming_state(),
@@ -3246,7 +3255,7 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
am::WindowIds window_ids = {kDefaultWindowId};
EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_BACKGROUND);
EXPECT_EQ(new_state->audio_streaming_state(),
@@ -3278,7 +3287,7 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceNavAppToLimited) {
am::WindowIds window_ids = {kDefaultWindowId};
EXPECT_CALL(*navi_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_LIMITED);
EXPECT_EQ(new_state->audio_streaming_state(),
@@ -3299,12 +3308,13 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
.WillOnce(Return(simple_app_));
EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+
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);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectApp) {
@@ -3318,7 +3328,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectApp) {
EXPECT_CALL(app_manager_mock_, application(_))
.WillOnce(Return(incorrect_app));
EXPECT_CALL(*simple_app_ptr_, hmi_level(kDefaultWindowId)).Times(0);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
@@ -3352,7 +3362,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
am::WindowIds window_ids = {kDefaultWindowId};
EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
@@ -3387,7 +3397,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
am::WindowIds window_ids = {kDefaultWindowId};
EXPECT_CALL(*simple_app_ptr_, GetWindowIds()).WillOnce(Return(window_ids));
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, OnEventOnAppActivatedIncorrectApp) {
@@ -3402,7 +3412,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivatedIncorrectApp) {
EXPECT_CALL(app_manager_mock_, application(_))
.WillOnce(Return(incorrect_app));
EXPECT_CALL(*simple_app_ptr_, app_id()).Times(0);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
@@ -3440,7 +3450,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
std::make_shared<smart_objects::SmartObject>();
(*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID;
SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
}
}
@@ -3476,7 +3486,7 @@ TEST_F(StateControllerImplTest, IsStateActiveApplyNotCorrectTempStates) {
const hmi_apis::FunctionID::eType event_id = hmi_apis::FunctionID::VR_Started;
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
EXPECT_FALSE(state_ctrl_->IsStateActive(HmiState::STATE_ID_AUDIO_SOURCE));
}
@@ -3493,19 +3503,19 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::AUDIO_SOURCE;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::DEACTIVATE_HMI;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::EMBEDDED_NAVI;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
@@ -3556,11 +3566,11 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::AUDIO_SOURCE;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
msg[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::PHONE_CALL;
event.set_smart_object(msg);
- state_ctrl_->on_event(event);
+ state_ctrl_->HandleOnEvent(event);
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
@@ -3603,7 +3613,7 @@ TEST_F(
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);
+ state_ctrl_->HandleOnEvent(audio_source_event);
EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
EXPECT_CALL(*media_app_ptr_, SetRegularState(_, _)).Times(0);
@@ -3624,7 +3634,7 @@ TEST_F(
message[am::strings::msg_params][am::hmi_notification::event_name] =
hmi_apis::Common_EventTypes::EMBEDDED_NAVI;
embedded_navi_event.set_smart_object(message);
- state_ctrl_->on_event(embedded_navi_event);
+ state_ctrl_->HandleOnEvent(embedded_navi_event);
EXPECT_CALL(*media_wep_app_ptr_, is_resuming())
.Times(2)
@@ -3724,7 +3734,7 @@ TEST_F(StateControllerImplTest,
ExpectAppWontChangeHmiStateDueToConflictResolving(
simple_app_, simple_app_ptr_, kCustomWindowId, NoneNotAudibleState());
- state_ctrl_->on_event(activate_widget_event);
+ state_ctrl_->HandleOnEvent(activate_widget_event);
}
TEST_F(StateControllerImplTest,
@@ -3765,7 +3775,7 @@ TEST_F(StateControllerImplTest,
GetBCActivateAppRequestToHMI(_, _, _, _, _))
.Times(0);
- state_ctrl_->on_event(activate_widget_event);
+ state_ctrl_->HandleOnEvent(activate_widget_event);
}
}
@@ -3786,7 +3796,7 @@ TEST_F(StateControllerImplTest,
ExpectAppWontChangeHmiStateDueToConflictResolving(
simple_app_, simple_app_ptr_, kCustomWindowId, FullNotAudibleState());
- state_ctrl_->on_event(activate_widget_event);
+ state_ctrl_->HandleOnEvent(activate_widget_event);
}
TEST_F(StateControllerImplTest,
@@ -3827,7 +3837,7 @@ TEST_F(StateControllerImplTest,
GetBCActivateAppRequestToHMI(_, _, _, _, _))
.Times(0);
- state_ctrl_->on_event(activate_widget_event);
+ state_ctrl_->HandleOnEvent(activate_widget_event);
}
}
@@ -3911,7 +3921,7 @@ TEST_F(StateControllerImplTest,
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);
+ state_ctrl_->HandleOnEvent(audio_source_event);
HmiStatePtr initial_state =
createHmiState(mobile_apis::HMILevel::INVALID_ENUM,
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
index 0166c036c1..4f943176c0 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -99,19 +99,19 @@ TEST(RequestControlTest, ZeroValuePendingRequestsAmount) {
RequestController request_ctrl_;
commands::Command* reg = RegisterApplication();
- request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
correlation_id = i;
commands::Command* testCommand =
PutFileCommand(correlation_id, connection_key);
- result = request_ctrl_.addMobileRequest(testCommand,
+ result = request_ctrl_.AddMobileRequest(testCommand,
mobile_apis::HMILevel::HMI_FULL);
EXPECT_EQ(RequestController::SUCCESS, result);
}
commands::Command* unreg = UnregisterApplication();
- request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
}
TEST(RequestControlTest, ZeroValueAppRequestsTimeScale) {
@@ -124,19 +124,19 @@ TEST(RequestControlTest, ZeroValueAppRequestsTimeScale) {
RequestController request_ctrl_;
commands::Command* reg = RegisterApplication();
- request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
correlation_id = i;
commands::Command* testCommand =
PutFileCommand(correlation_id, connection_key);
- result = request_ctrl_.addMobileRequest(testCommand,
+ result = request_ctrl_.AddMobileRequest(testCommand,
mobile_apis::HMILevel::HMI_FULL);
EXPECT_EQ(RequestController::SUCCESS, result);
}
commands::Command* unreg = UnregisterApplication();
- request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
}
TEST(RequestControlTest, ZeroValueAppTimeScaleMaxRequests) {
@@ -149,19 +149,19 @@ TEST(RequestControlTest, ZeroValueAppTimeScaleMaxRequests) {
RequestController request_ctrl_;
commands::Command* reg = RegisterApplication();
- request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL);
for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
correlation_id = i;
commands::Command* testCommand =
PutFileCommand(correlation_id, connection_key);
- result = request_ctrl_.addMobileRequest(testCommand,
+ result = request_ctrl_.AddMobileRequest(testCommand,
mobile_apis::HMILevel::HMI_FULL);
EXPECT_EQ(RequestController::SUCCESS, result);
}
commands::Command* unreg = UnregisterApplication();
- request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
+ request_ctrl_.AddMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
}
} // namespace application_manager_test
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt
index 4b545c65ae..8863c098ea 100644
--- a/src/components/config_profile/CMakeLists.txt
+++ b/src/components/config_profile/CMakeLists.txt
@@ -33,6 +33,7 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/smart_objects/include
${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
${BOOST_INCLUDE_DIR}
@@ -44,6 +45,7 @@ set(PATHS
)
set(LIBRARIES
+ SmartObjects
Utils
)
diff --git a/src/components/config_profile/include/config_profile/ini_file.h b/src/components/config_profile/include/config_profile/ini_file.h
deleted file mode 100644
index 204fb6c7bf..0000000000
--- a/src/components/config_profile/include/config_profile/ini_file.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2013, 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_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
-#define SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
-
-#include <stdint.h>
-
-namespace profile {
-
-#define INI_FILE_VER 1000
-
-#if !defined TRUE
-#define TRUE 1
-#endif
-#if !defined True
-#define True 1
-#endif
-
-#if !defined FALSE
-#define FALSE 0
-#endif
-#if !defined False
-#define False 0
-#endif
-
-/*
- * @brief Global defines
- */
-#define INI_LINE_LEN 1024
-#define INI_FILE_TEMP_NAME "ini.tmp"
-
-#define INI_FLAG_UPDATE 0x00
-#define INI_FLAG_ITEM_UP_CREA 0x01
-#define INI_FLAG_FILE_UP_CREA 0x10
-
-/*
- * @brief Global typedefs
- */
-typedef enum Ini_search_id_e {
- INI_NOTHING,
- INI_RIGHT_CHAPTER,
- INI_WRONG_CHAPTER,
- INI_RIGHT_ITEM,
- INI_WRONG_ITEM,
- INI_REMARK,
-
- INI_SEARCH_MAX
-} Ini_search_id;
-
-/*
- * @brief Prototypes of functions
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * @brief Write usage instructions to the end of the file
- * @param
- *
- * @return NULL if file or desired entry not found, otherwise pointer to fname
- */
-extern char* ini_write_inst(const char* fname, uint8_t flag);
-
-/*
- * @brief Read a certain item of the specified chapter of a ini-file
- *
- * @return NULL if file or desired entry not found, otherwise pointer to value
- */
-extern char* ini_read_value(const char* fname,
- const char* chapter,
- const char* item,
- char* value);
-
-/*
- * @brief Write a certain item of the specified chapter of a ini-file
- *
- * @return NULL if file not found, otherwise pointer to value
- */
-extern char ini_write_value(const char* fname,
- const char* chapter,
- const char* item,
- const char* value,
- uint8_t flag);
-
-/*
- * @brief Parse the given line for the item and returns the value if
- * there is one otherwise NULL
- *
- * @return NULL if desired entry not found, otherwise pointer to value
- */
-extern Ini_search_id ini_parse_line(const char* line,
- const char* tag,
- char* value);
-
-#ifdef __cplusplus
-}
-#endif
-
-} // namespace profile
-
-#endif // SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index dffa2d1571..bb7762721f 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -44,6 +44,7 @@
#include "media_manager/media_manager_settings.h"
#include "policy/policy_settings.h"
#include "protocol_handler/protocol_handler_settings.h"
+#include "smart_objects/smart_object.h"
#include "transport_manager/transport_manager_settings.h"
#include "utils/macro.h"
@@ -249,6 +250,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint32_t& default_timeout() const;
/**
+ * @brief Default timeout compensation for waiting some extra time for
+ * response to mobile app
+ */
+ const uint32_t& default_timeout_compensation() const;
+
+ /**
* @brief Default timeout for waiting for resuming
*/
const uint32_t& app_resuming_timeout() const;
@@ -825,6 +832,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint32_t app_transport_change_timer_addition() const OVERRIDE;
/**
+ * @brief Parses values in config_file_name_ to config_obj_ smart object
+ */
+ void ParseConfiguration();
+
+ /**
* @brief Updates all related values from ini file
*/
void UpdateValues();
@@ -989,6 +1001,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
size_t maximum_audio_payload_size_;
size_t maximum_video_payload_size_;
std::string config_file_name_;
+ smart_objects::SmartObject config_obj_;
std::string server_address_;
uint16_t server_port_;
uint16_t video_streaming_port_;
@@ -1005,6 +1018,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool is_redecoding_enabled_;
uint32_t max_cmd_id_;
uint32_t default_timeout_;
+ uint32_t default_timeout_compensation_;
uint32_t app_resuming_timeout_;
uint32_t app_resumption_save_persistent_data_timeout_;
std::string vr_help_title_;
@@ -1114,6 +1128,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
int iap2_hub_connect_attempts_;
int iap_hub_connection_wait_timeout_;
uint16_t tts_global_properties_timeout_;
+ size_t maximum_payload_size_;
+ size_t message_frequency_count_;
+ size_t message_frequency_time_;
+ bool malformed_message_filtering_;
+ size_t malformed_frequency_count_;
+ size_t malformed_frequency_time_;
+ uint32_t multiframe_waiting_timeout_;
uint16_t attempts_to_open_policy_db_;
uint16_t open_attempt_timeout_ms_;
uint32_t resumption_delay_before_ign_;
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
deleted file mode 100644
index dd64f48afa..0000000000
--- a/src/components/config_profile/src/ini_file.cc
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (c) 2013, 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 "config_profile/ini_file.h"
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "utils/logger.h"
-
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#define PATH_MAX _MAX_PATH
-#endif
-
-#ifdef __linux__
-#define USE_MKSTEMP 1
-#endif
-
-#include <string>
-
-namespace profile {
-
-SDL_CREATE_LOG_VARIABLE("Profile")
-
-char* ini_write_inst(const char* fname, uint8_t flag) {
- FILE* fp = 0;
-
- if (NULL == fname)
- return NULL;
- if ('\0' == *fname)
- return NULL;
-
- if ((fp = fopen(fname, "a")) == 0)
- if (flag & INI_FLAG_FILE_UP_CREA)
- if ((fp = fopen(fname, "w")) == 0)
- return NULL;
- if (0 == fp) {
- return NULL;
- }
- fprintf(fp, "\n");
- fprintf(fp, "; The INI-file consists of different chapters.\n");
- fprintf(fp, "; Each chapter begins with the line containing\n");
- fprintf(fp, "; the name in square brackets. Syntax:\n");
- fprintf(fp, "; [chapter]\n");
- fprintf(fp, "; The chapters consists of a set of items with a\n");
- fprintf(fp, "; assinged value. The syntax is:\n");
- fprintf(fp, "; item=value\n");
- fprintf(fp, "; All white spaces an second encounters of chapters\n");
- fprintf(fp, "; or items will be ignored.\n");
- fprintf(fp, "; Remarks start with semicolon or star as first character.\n");
- fprintf(fp, "; It is alowed for names of chapters and items to\n");
- fprintf(fp, "; contain semicolon and star. Possible syntax is:\n");
- fprintf(fp, "; [ chapter ] ;Remark\n");
- fprintf(fp, "; item = value\n");
- fprintf(fp, "\n");
-
- fclose(fp);
- return const_cast<char*>(fname);
-}
-
-char* ini_read_value(const char* fname,
- const char* chapter,
- const char* item,
- char* value) {
- FILE* fp = 0;
- bool chapter_found = false;
- char line[INI_LINE_LEN] = "";
- char val[INI_LINE_LEN] = "";
- char tag[INI_LINE_LEN] = "";
-
- Ini_search_id result;
- *line = '\0';
- *val = '\0';
- *tag = '\0';
- if ((NULL == fname) || (NULL == chapter) || (NULL == item) || (NULL == value))
- return NULL;
-
- *value = '\0';
- if (('\0' == *fname) || ('\0' == *chapter) || ('\0' == *item))
- return NULL;
-
- if ((fp = fopen(fname, "r")) == 0)
- return NULL;
-
- snprintf(tag, INI_LINE_LEN, "%s", chapter);
- for (uint32_t i = 0; i < strlen(tag); i++) {
- tag[i] = toupper(tag[i]);
- }
-
- while (NULL != fgets(line, INI_LINE_LEN, fp)) {
- // Now start the line parsing
- result = ini_parse_line(line, tag, val);
- if (!chapter_found) {
- if (INI_RIGHT_CHAPTER == result) {
- chapter_found = true;
-
- snprintf(tag, INI_LINE_LEN, "%s", item);
- for (uint32_t i = 0; i < strlen(tag); i++)
- tag[i] = toupper(tag[i]);
- }
- } else {
- // FIXME (dchmerev): Unnecessary condition
- if ((INI_RIGHT_CHAPTER == result) || (INI_WRONG_CHAPTER == result)) {
- fclose(fp);
- return NULL;
- }
- if (INI_RIGHT_ITEM == result) {
- fclose(fp);
- snprintf(value, INI_LINE_LEN, "%s", val);
- return value;
- }
- }
- }
-
- fclose(fp);
-
- return NULL;
-}
-
-#ifdef BUILD_TESTS
-// cppcheck-suppress unusedFunction //Used in unit tests
-char ini_write_value(const char* fname,
- const char* chapter,
- const char* item,
- const char* value,
- uint8_t flag) {
- FILE *rd_fp, *wr_fp = 0;
- uint16_t cr_count;
- int32_t wr_result;
- bool chapter_found = false;
- bool value_written = false;
- char line[INI_LINE_LEN] = "";
- char val[INI_LINE_LEN] = "";
- char tag[INI_LINE_LEN] = "";
- char temp_fname[PATH_MAX] = "";
- Ini_search_id result;
- *line = '\0';
- *val = '\0';
- *tag = '\0';
- *temp_fname = '\0';
-
- if ((NULL == fname) || (NULL == chapter) || (NULL == item) || (NULL == value))
- return FALSE;
- if (('\0' == *fname) || ('\0' == *chapter) || ('\0' == *item))
- return FALSE;
-
- if (0 == (rd_fp = fopen(fname, "r"))) {
- ini_write_inst(fname, flag);
- if (0 == (rd_fp = fopen(fname, "r")))
- return FALSE;
- }
-
-#if USE_MKSTEMP
- {
- const char* temp_str = "./";
- if (temp_str) {
- snprintf(temp_fname, PATH_MAX, "%s/ini.XXXXXX", temp_str);
- int32_t fd = mkstemp(temp_fname);
- if (-1 == fd) {
- fclose(rd_fp);
- return FALSE;
- }
- wr_fp = fdopen(fd, "w");
- if (NULL == wr_fp) {
- unlink(temp_fname);
- close(fd);
- fclose(rd_fp);
- return FALSE;
- }
- } else {
- fclose(rd_fp);
- return FALSE;
- }
- }
-#else // #if USE_MKSTEMP
- tmpnam(temp_fname);
- if (0 == (wr_fp = fopen(temp_fname, "w"))) {
- fclose(rd_fp);
- return FALSE;
- }
-#endif // #else #if USE_MKSTEMP
-
- snprintf(tag, INI_LINE_LEN, "%s", chapter);
- for (uint32_t i = 0; i < strlen(tag); i++)
- tag[i] = toupper(tag[i]);
-
- wr_result = 1;
- cr_count = 0;
- while ((NULL != fgets(line, INI_LINE_LEN, rd_fp)) && (0 < wr_result)) {
- // Now start the line parsing
- result = ini_parse_line(line, tag, val);
-
- if (!value_written) {
- if (!chapter_found) {
- if (INI_RIGHT_CHAPTER == result) {
- chapter_found = true;
- // coding style
- snprintf(tag, INI_LINE_LEN, "%s", item);
- for (uint32_t i = 0; i < strlen(tag); i++)
- tag[i] = toupper(tag[i]);
- }
- } else {
- if ((INI_RIGHT_CHAPTER == result) || (INI_WRONG_CHAPTER == result)) {
- /* item not found but new capture */
- if (flag & INI_FLAG_ITEM_UP_CREA)
- fprintf(wr_fp, "%s=%s\n", item, value);
- /* The item must not update in an other chapter
- even it has the right name because only the
- first chapter is significant */
- value_written = true;
- } else if (result == INI_RIGHT_ITEM) {
- for (uint16_t i = 0; i < cr_count; i++)
- fprintf(wr_fp, "\n");
- cr_count = 0;
- wr_result = fprintf(wr_fp, "%s=%s\n", item, value);
- value_written = true;
- continue;
- }
- }
- } /* if (!value_written) */
-
- if (0 == strcmp(val, "\n")) {
- cr_count++;
- } else {
- for (uint32_t i = 0; i < cr_count; i++)
- fprintf(wr_fp, "\n");
- cr_count = 0;
- wr_result = fprintf(wr_fp, "%s", line);
- }
- }
- if (0 < (wr_result) && (!value_written)) {
- if (flag & INI_FLAG_ITEM_UP_CREA) {
- if (!chapter_found)
- fprintf(wr_fp, "\n[%s]\n", chapter);
- fprintf(wr_fp, "%s=%s\n", item, value);
- value_written = true;
- }
- }
- fprintf(wr_fp, "\n");
-
- fclose(wr_fp);
- fclose(rd_fp);
-
- if (0 != rename(temp_fname, fname)) {
- if (0 != remove(temp_fname)) {
- SDL_LOG_WARN_WITH_ERRNO(
- "Unable to remove temp file: " << std::string(temp_fname));
- }
- return FALSE;
- }
-
- return (value_written);
-}
-#endif // BUILD_TESTS
-
-Ini_search_id ini_parse_line(const char* line, const char* tag, char* value) {
- const char* line_ptr;
- char temp_str[INI_LINE_LEN] = "";
- *temp_str = '\0';
-
- snprintf(value, INI_LINE_LEN, "%s", line);
-
- /* cut leading spaces */
- line_ptr = line;
- for (uint32_t i = 0; i < strlen(line); i++) {
- if ((line[i] == ' ') || (line[i] == 9) || // TAB
- (line[i] == 10) || // LF
- (line[i] == 13)) { // CR
- line_ptr++;
- } else {
- break;
- }
- }
- if ('\0' == *line_ptr) {
- snprintf(value, INI_LINE_LEN, "\n");
- return INI_NOTHING;
- }
-
- if ((*line_ptr == ';') || (*line_ptr == '*')) /* remark */
- return INI_REMARK;
-
- if (*line_ptr == '[' && strrchr(line_ptr, ']') != NULL) {
- line_ptr++;
-
- /* cut leading stuff */
- uint16_t len = strlen(line_ptr);
- for (int32_t i = 0; i < len; i++) {
- if ((*line_ptr == ' ') || (*line_ptr == 9) || // TAB
- (*line_ptr == 10) || // LF
- (*line_ptr == 13)) { // CR
- line_ptr++;
- } else {
- break;
- }
- }
- if (*line_ptr == '\0')
- return INI_NOTHING;
-
- snprintf(temp_str, INI_LINE_LEN, "%s", line_ptr);
- char* temp_ptr = strrchr(temp_str, ']');
- if (NULL == temp_ptr) {
- return INI_NOTHING;
- } else {
- *temp_ptr = '\0';
- }
-
- /* cut trailing stuff */
- for (int32_t i = strlen(temp_str) - 1; i > 0; i--) {
- if ((temp_str[i] == ' ') || (temp_str[i] == 9) || // TAB
- (temp_str[i] == 10) || // LF
- (temp_str[i] == 13)) { // CR
- temp_str[i] = '\0';
- } else {
- break;
- }
- }
-
- snprintf(value, INI_LINE_LEN, "%s", temp_str);
-
- for (uint32_t i = 0; i < strlen(temp_str); i++)
- temp_str[i] = toupper(temp_str[i]);
- if (strcmp(temp_str, tag) == 0)
- return INI_RIGHT_CHAPTER;
- else
- return INI_WRONG_CHAPTER;
- }
-
- if (NULL != strchr(line_ptr, '=')) {
- strncpy(temp_str, line_ptr, (strchr(line_ptr, '=') - line_ptr));
- /* cut trailing stuff */
- for (int32_t i = strlen(temp_str) - 1; i > 0; i--) {
- if ((temp_str[i] == '=') || (temp_str[i] == ' ') ||
- (temp_str[i] == 9) || // TAB
- (temp_str[i] == 10) || // LF
- (temp_str[i] == 13)) { // CR
- temp_str[i] = '\0';
- } else {
- break;
- }
- }
-
- snprintf(value, INI_LINE_LEN, "%s", temp_str);
-
- for (uint32_t i = 0; i < strlen(temp_str); i++)
- temp_str[i] = toupper(temp_str[i]);
- if (strcmp(temp_str, tag) == 0) {
- line_ptr = strchr(line_ptr, '=') + 1;
- uint16_t len = strlen(line_ptr);
- /* cut trailing stuff */
- for (uint32_t i = 0; i < len; i++) {
- if ((*line_ptr == ' ') || (*line_ptr == 9) || // TAB
- (*line_ptr == 10) || // LF
- (*line_ptr == 13)) { // CR
- line_ptr++;
- } else {
- break;
- }
- }
-
- snprintf(value, INI_LINE_LEN, "%s", line_ptr);
-
- if (value[0] != '\0') {
- /* cut trailing stuff */
- for (int32_t i = strlen(value) - 1; i > 0; i--) {
- if ((value[i] == ' ') || (value[i] == ';') ||
- (value[i] == 9) || // TAB
- (value[i] == 10) || // LF
- (value[i] == 13)) { // CR
- value[i] = '\0';
- } else {
- break;
- }
- }
- }
- return INI_RIGHT_ITEM;
- } else {
- return INI_WRONG_ITEM;
- }
- }
-
- return INI_NOTHING;
-}
-} // namespace profile
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 27829d478f..f318ec98f5 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -41,7 +41,6 @@
#include <string>
-#include "config_profile/ini_file.h"
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/threads/thread.h"
@@ -64,6 +63,8 @@ namespace {
<< "'."); \
}
+#define INI_LINE_LEN 1024
+
const char* kDefaultConfigFileName = "smartDeviceLink.ini";
const char* kMainSection = "MAIN";
@@ -180,6 +181,7 @@ const char* kDeleteFileRequestKey = "DeleteFileRequest";
const char* kListFilesRequestKey = "ListFilesRequest";
const char* kListFilesResponseSizeKey = "ListFilesResponseSize";
const char* kDefaultTimeoutKey = "DefaultTimeout";
+const char* kDefaultTimeoutCompensationKey = "DefaultTimeoutCompensation";
const char* kAppResumingTimeoutKey = "ApplicationResumingTimeout";
const char* kAppSavePersistentDataTimeoutKey = "AppSavePersistentDataTimeout";
const char* kResumptionDelayBeforeIgnKey = "ResumptionDelayBeforeIgn";
@@ -342,7 +344,7 @@ const uint32_t kDefaultSecurityLevel = 1;
#endif // ENABLE_SECURITY
const uint32_t kDefaultHubProtocolIndex = 0;
-const uint32_t kDefaultHeartBeatTimeout = 0;
+const uint32_t kDefaultHeartBeatTimeout = 5000;
const uint16_t kDefaultMaxSupportedProtocolVersion = 5;
const uint16_t kDefautTransportManagerTCPPort = 12345;
const uint16_t kDefaultWebSocketServerPort = 2020;
@@ -358,6 +360,7 @@ const uint32_t kDefaultPutFileRequestInNone = 5;
const uint32_t kDefaultDeleteFileRequestInNone = 5;
const uint32_t kDefaultListFilesRequestInNone = 5;
const uint32_t kDefaultTimeout = 10000;
+const uint32_t kDefaultTimeoutCompensation = 1000;
const uint32_t kDefaultAppResumingTimeout = 3000;
const uint32_t kDefaultAppSavePersistentDataTimeout = 10000;
const uint32_t kDefaultResumptionDelayBeforeIgn = 30;
@@ -481,6 +484,7 @@ Profile::Profile()
, is_redecoding_enabled_(false)
, max_cmd_id_(kDefaultMaxCmdId)
, default_timeout_(kDefaultTimeout)
+ , default_timeout_compensation_(kDefaultTimeoutCompensation)
, app_resuming_timeout_(kDefaultAppResumingTimeout)
, app_resumption_save_persistent_data_timeout_(
kDefaultAppSavePersistentDataTimeout)
@@ -532,6 +536,13 @@ Profile::Profile()
, iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts)
, iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout)
, tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout)
+ , maximum_payload_size_(kDefaultMaximumPayloadSize)
+ , message_frequency_count_(kDefaultFrequencyCount)
+ , message_frequency_time_(kDefaultFrequencyTime)
+ , malformed_message_filtering_(kDefaulMalformedMessageFiltering)
+ , malformed_frequency_count_(kDefaultMalformedFrequencyCount)
+ , malformed_frequency_time_(kDefaultMalformedFrequencyTime)
+ , multiframe_waiting_timeout_(kDefaultExpectedConsecutiveFramesTimeout)
, attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB)
, open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB)
, resumption_delay_before_ign_(kDefaultResumptionDelayBeforeIgn)
@@ -564,9 +575,6 @@ Profile::Profile()
, ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset)
, rpc_pass_through_timeout_(kDefaultRpcPassThroughTimeout)
, period_for_consent_expiration_(kDefaultPeriodForConsentExpiration) {
- // SDL version
- ReadStringValue(
- &sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
}
Profile::~Profile() {}
@@ -680,6 +688,10 @@ const uint32_t& Profile::default_timeout() const {
return default_timeout_;
}
+const uint32_t& Profile::default_timeout_compensation() const {
+ return default_timeout_compensation_;
+}
+
const uint32_t& Profile::app_resuming_timeout() const {
return app_resuming_timeout_;
}
@@ -993,65 +1005,30 @@ uint32_t Profile::iap_hub_connection_wait_timeout() const {
}
size_t Profile::maximum_payload_size() const {
- size_t maximum_payload_size = 0;
- ReadUIntValue(&maximum_payload_size,
- kDefaultMaximumPayloadSize,
- kProtocolHandlerSection,
- kMaximumPayloadSizeKey);
- return maximum_payload_size;
+ return maximum_payload_size_;
}
size_t Profile::message_frequency_count() const {
- size_t message_frequency_count = 0;
- ReadUIntValue(&message_frequency_count,
- kDefaultFrequencyCount,
- kProtocolHandlerSection,
- kFrequencyCount);
- return message_frequency_count;
+ return message_frequency_count_;
}
size_t Profile::message_frequency_time() const {
- size_t message_frequency_time = 0;
- ReadUIntValue(&message_frequency_time,
- kDefaultFrequencyTime,
- kProtocolHandlerSection,
- kFrequencyTime);
- return message_frequency_time;
+ return message_frequency_time_;
}
bool Profile::malformed_message_filtering() const {
- bool malformed_message_filtering = 0;
- ReadBoolValue(&malformed_message_filtering,
- kDefaulMalformedMessageFiltering,
- kProtocolHandlerSection,
- kMalformedMessageFiltering);
- return malformed_message_filtering;
+ return malformed_message_filtering_;
}
size_t Profile::malformed_frequency_count() const {
- size_t malformed_frequency_count = 0;
- ReadUIntValue(&malformed_frequency_count,
- kDefaultMalformedFrequencyCount,
- kProtocolHandlerSection,
- kMalformedFrequencyCount);
- return malformed_frequency_count;
+ return malformed_frequency_count_;
}
size_t Profile::malformed_frequency_time() const {
- size_t malformed_frequency_time = 0;
- ReadUIntValue(&malformed_frequency_time,
- kDefaultMalformedFrequencyTime,
- kProtocolHandlerSection,
- kMalformedFrequencyTime);
- return malformed_frequency_time;
+ return malformed_frequency_time_;
}
uint32_t Profile::multiframe_waiting_timeout() const {
- uint32_t multiframe_waiting_timeout = 0;
- ReadUIntValue(&multiframe_waiting_timeout,
- kDefaultExpectedConsecutiveFramesTimeout,
- kProtocolHandlerSection,
- kExpectedConsecutiveFramesTimeout);
- return multiframe_waiting_timeout;
+ return multiframe_waiting_timeout_;
}
uint16_t Profile::attempts_to_open_policy_db() const {
@@ -1250,9 +1227,81 @@ const std::string Profile::hmi_origin_id() const {
return hmi_origin_id_;
}
+void Profile::ParseConfiguration() {
+ FILE* config_file_ = fopen(config_file_name_.c_str(), "r");
+ config_obj_ = smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (nullptr != config_file_) {
+ char line[INI_LINE_LEN] = "\0";
+ std::string chapter;
+
+ while (nullptr != fgets(line, INI_LINE_LEN, config_file_)) {
+ std::string line_str(line);
+ auto whitespace_len = line_str.find_first_not_of(" \t\r\n");
+ if (std::string::npos == whitespace_len) {
+ continue;
+ }
+ line_str.erase(0, whitespace_len);
+
+ if (';' == line_str[0] || '*' == line_str[0]) {
+ continue;
+ }
+
+ if ('[' == line_str[0] && std::string::npos != line_str.find(']')) {
+ line_str.erase(0, line_str.find_first_not_of("[ \t\r\n"));
+ line_str.erase(line_str.find_last_not_of(" \t\r\n]") + 1);
+
+ if (false == line_str.empty()) {
+ chapter = line_str;
+ config_obj_[chapter] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ }
+
+ continue;
+ }
+
+ size_t equals_idx = line_str.find('=');
+ if (std::string::npos == equals_idx) {
+ continue;
+ }
+
+ std::string key(line_str.data(), equals_idx);
+ std::string value(line_str.data() + equals_idx + 1);
+
+ auto key_whitespace_len = key.find_first_not_of(" \t\r\n");
+ if (std::string::npos == key_whitespace_len) {
+ continue;
+ }
+ key.erase(0, key_whitespace_len);
+ key.erase(key.find_last_not_of(" \t\r\n") + 1);
+
+ if (true == config_obj_[chapter].keyExists(key)) {
+ continue;
+ }
+
+ auto val_whitespace_len = value.find_first_not_of(" \t\r\n");
+ if (std::string::npos == val_whitespace_len) {
+ value = "";
+ } else {
+ value.erase(0, value.find_first_not_of(" \t\r\n"));
+ value.erase(value.find_last_not_of(" \t\r\n") + 1);
+ }
+
+ config_obj_[chapter][key] = value;
+ }
+ }
+
+ if (nullptr != config_file_) {
+ fclose(config_file_);
+ config_file_ = nullptr;
+ }
+}
+
void Profile::UpdateValues() {
SDL_LOG_AUTO_TRACE();
+ ParseConfiguration();
+
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -1395,10 +1444,6 @@ void Profile::UpdateValues() {
kSDL4Section,
kAppIconsFolderMaxSizeKey);
- if (app_icons_folder_max_size_ < kDefaultAppIconsFolderMaxSize) {
- app_icons_folder_max_size_ = kDefaultAppIconsFolderMaxSize;
- }
-
LOG_UPDATED_VALUE(
app_icons_folder_max_size_, kAppIconsFolderMaxSizeKey, kSDL4Section);
@@ -1683,6 +1728,16 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(default_timeout_, kDefaultTimeoutKey, kMainSection);
+ // Default timeout compensation
+ ReadUIntValue(&default_timeout_compensation_,
+ kDefaultTimeoutCompensation,
+ kMainSection,
+ kDefaultTimeoutCompensationKey);
+
+ LOG_UPDATED_VALUE(default_timeout_compensation_,
+ kDefaultTimeoutCompensationKey,
+ kMainSection);
+
// Application resuming timeout
ReadUIntValue(&app_resuming_timeout_,
kDefaultAppResumingTimeout,
@@ -2134,6 +2189,73 @@ void Profile::UpdateValues() {
error_description_ = "PathToSnapshot has forbidden(non-portable) symbols";
}
+ // Packet with payload bigger than this value will be marked as malformed
+ ReadUIntValue(&maximum_payload_size_,
+ kDefaultMaximumPayloadSize,
+ kProtocolHandlerSection,
+ kMaximumPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_payload_size_, kMaximumPayloadSizeKey, kProtocolHandlerSection);
+
+ // Check for apps sending too many messages
+ ReadUIntValue(&message_frequency_count_,
+ kDefaultFrequencyCount,
+ kProtocolHandlerSection,
+ kFrequencyCount);
+
+ LOG_UPDATED_VALUE(
+ message_frequency_count_, kFrequencyCount, kProtocolHandlerSection);
+
+ // Check for apps sending too many messages
+ ReadUIntValue(&message_frequency_time_,
+ kDefaultFrequencyTime,
+ kProtocolHandlerSection,
+ kFrequencyTime);
+
+ LOG_UPDATED_VALUE(
+ message_frequency_time_, kFrequencyTime, kProtocolHandlerSection);
+
+ // Enable filter malformed messages
+ ReadBoolValue(&malformed_message_filtering_,
+ kDefaulMalformedMessageFiltering,
+ kProtocolHandlerSection,
+ kMalformedMessageFiltering);
+
+ LOG_UPDATED_BOOL_VALUE(malformed_message_filtering_,
+ kMalformedMessageFiltering,
+ kProtocolHandlerSection);
+
+ // Count for malformed message detection
+ ReadUIntValue(&malformed_frequency_count_,
+ kDefaultMalformedFrequencyCount,
+ kProtocolHandlerSection,
+ kMalformedFrequencyCount);
+
+ LOG_UPDATED_VALUE(malformed_frequency_count_,
+ kMalformedFrequencyCount,
+ kProtocolHandlerSection);
+
+ // Time for malformed message detection
+ ReadUIntValue(&malformed_frequency_time_,
+ kDefaultMalformedFrequencyTime,
+ kProtocolHandlerSection,
+ kMalformedFrequencyTime);
+
+ LOG_UPDATED_VALUE(malformed_frequency_time_,
+ kMalformedFrequencyTime,
+ kProtocolHandlerSection);
+
+ // Timeout for waiting CONSECUTIVE frames of multiframe
+ ReadUIntValue(&multiframe_waiting_timeout_,
+ kDefaultExpectedConsecutiveFramesTimeout,
+ kProtocolHandlerSection,
+ kExpectedConsecutiveFramesTimeout);
+
+ LOG_UPDATED_VALUE(multiframe_waiting_timeout_,
+ kExpectedConsecutiveFramesTimeout,
+ kProtocolHandlerSection);
+
// Attempts number for opening policy DB
ReadUIntValue(&attempts_to_open_policy_db_,
kDefaultAttemptsToOpenPolicyDB,
@@ -2361,7 +2483,7 @@ void Profile::UpdateValues() {
entry->ini_key_name,
kTransportRequiredForResumptionSection);
}
- entry++;
+ ++entry;
}
}
@@ -2561,7 +2683,7 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(
list_with_comma, entry->ini_key_name, entry->ini_section_name);
}
- entry++;
+ ++entry;
}
}
@@ -2599,7 +2721,7 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(
list_with_comma, entry->ini_key_name, entry->ini_section_name);
}
- entry++;
+ ++entry;
}
}
}
@@ -2610,18 +2732,18 @@ bool Profile::ReadValue(bool* value,
DCHECK(value);
bool ret = false;
- char buf[INI_LINE_LEN + 1];
- *buf = '\0';
- if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) &&
- ('\0' != *buf)) {
- const int32_t tmpVal = atoi(buf);
- if ((0 == strcmp("true", buf)) || (0 != tmpVal)) {
+ if (config_obj_.keyExists(pSection) &&
+ config_obj_[pSection].keyExists(pKey)) {
+ auto val_str = config_obj_[pSection][pKey].asString();
+ const int32_t tmpVal = atoi(val_str.data());
+ if ((0 == strcmp("true", val_str.data())) || (0 != tmpVal)) {
*value = true;
} else {
*value = false;
}
ret = true;
}
+
return ret;
}
@@ -2638,10 +2760,9 @@ bool Profile::ReadValueEmpty(std::string* value,
DCHECK(value);
bool ret = false;
- char buf[INI_LINE_LEN + 1];
- *buf = '\0';
- if (0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) {
- *value = buf;
+ if (config_obj_.keyExists(pSection) &&
+ config_obj_[pSection].keyExists(pKey)) {
+ *value = config_obj_[pSection][pKey].asString();
ret = true;
}
diff --git a/src/components/config_profile/test/CMakeLists.txt b/src/components/config_profile/test/CMakeLists.txt
index 597be8fe00..d586485f64 100644
--- a/src/components/config_profile/test/CMakeLists.txt
+++ b/src/components/config_profile/test/CMakeLists.txt
@@ -33,11 +33,13 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/smart_objects/include
)
set(LIBRARIES
gmock
ConfigProfile
+ SmartObjects
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/src/components/config_profile/test/ini_file_test.cc b/src/components/config_profile/test/ini_file_test.cc
deleted file mode 100644
index ca4f2fc849..0000000000
--- a/src/components/config_profile/test/ini_file_test.cc
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2015, 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 "config_profile/ini_file.h"
-#include "gtest/gtest.h"
-#include "utils/file_system.h"
-
-namespace test {
-namespace components {
-namespace profile_test {
-
-using namespace ::profile;
-
-TEST(IniFileTest, WriteItemReadItem) {
- // Write line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* item = "Test_item";
- const char* value = "test_value";
- const bool write_result =
- ini_write_value(fname, chapter, item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_TRUE(write_result);
- char search_value[INI_LINE_LEN] = {0};
- const bool read_result = ini_read_value(fname, chapter, item, search_value);
- const char* res = search_value;
-
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res, value);
- EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
-}
-
-TEST(IniFileTest, WriteItemWithoutValueReadItem) {
- // Write line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* test_item = "Test_item";
- const char* value = "";
- const bool write_result =
- ini_write_value(fname, chapter, test_item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_TRUE(write_result);
-
- // Read value from file
- char search_value[INI_LINE_LEN] = {0};
- const bool read_result =
- ini_read_value(fname, chapter, test_item, search_value);
- const char* res = search_value;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res, value);
-
- EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
-}
-
-TEST(IniFileTest, WriteSameItemInDifferentChapters) {
- // Write line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter1 = "Chapter1";
- const char* test_item = "Test_item";
- const char* value = "test_value";
- const bool write_result =
- ini_write_value(fname, chapter1, test_item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_TRUE(write_result);
- char search_value[INI_LINE_LEN] = {0};
- const bool read_result =
- ini_read_value(fname, chapter1, test_item, search_value);
- const char* res = search_value;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res, value);
-
- // Create new chapter and write the same value
- const char* chapter2 = "Chapter2";
-
- const bool write_result2 =
- ini_write_value(fname, chapter2, test_item, value, INI_FLAG_ITEM_UP_CREA);
-
- EXPECT_TRUE(write_result2);
-
- char value2[INI_LINE_LEN] = "test_value";
- const bool read_result2 = ini_read_value(fname, chapter2, test_item, value2);
- const char* res2 = value2;
- EXPECT_TRUE(read_result2);
- EXPECT_STREQ(res2, res);
- EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
-}
-
-TEST(IniFileTest, RewriteItem) {
- // Write line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* item = "Test_item";
- const char* value = "test_value";
- bool write_result =
- ini_write_value(fname, chapter, item, value, INI_FLAG_ITEM_UP_CREA);
-
- EXPECT_TRUE(write_result);
- char search_value[INI_LINE_LEN] = {0};
- bool read_result = ini_read_value(fname, chapter, item, search_value);
- const char* res = search_value;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res, value);
-
- // Write item again
- const char* newvalue = "new_test_value";
- write_result =
- ini_write_value(fname, chapter, item, newvalue, INI_FLAG_ITEM_UP_CREA);
-
- EXPECT_TRUE(write_result);
- char new_search_value[INI_LINE_LEN] = {0};
- read_result = ini_read_value(fname, chapter, item, new_search_value);
- const char* new_res = new_search_value;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(new_res, newvalue);
- EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
-}
-
-TEST(IniFileTest, WriteTwoItemsInOneChapter) {
- // Write line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* item = "Test_item";
- const char* value1 = "test_value";
-
- bool write_result =
- ini_write_value(fname, chapter, item, value1, INI_FLAG_ITEM_UP_CREA);
- EXPECT_TRUE(write_result);
-
- // Write another line in the same chapter
- const char* item2 = "Test_item2";
- const char* value2 = "test_value2";
-
- write_result =
- ini_write_value(fname, chapter, item2, value2, INI_FLAG_ITEM_UP_CREA);
- EXPECT_TRUE(write_result);
-
- // Search both values
- char search_value[INI_LINE_LEN] = {0};
- bool read_result = ini_read_value(fname, chapter, item, search_value);
- const char* res = search_value;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res, value1);
-
- char search_value2[INI_LINE_LEN] = {0};
- read_result = ini_read_value(fname, chapter, item2, search_value2);
- const char* res2 = search_value2;
- EXPECT_TRUE(read_result);
- EXPECT_STREQ(res2, value2);
- EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
-}
-
-TEST(IniFileTest, WriteEmptyItemWithValueReadItem) {
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* test_item = "";
- const char* value = "test_value";
- bool result =
- ini_write_value(fname, chapter, test_item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_FALSE(result);
-}
-
-TEST(IniFileTest, WriteEmptyItemWithEmptyValue_ExpectFalse) {
- // Write empty line in chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "Chapter";
- const char* test_item = "";
- const char* value = "";
- bool result =
- ini_write_value(fname, chapter, test_item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_FALSE(result);
-}
-
-TEST(IniFileTest, WriteItemInEmptyChapter_ExpectFalse) {
- // Write line in empty chapter
- const char* fname = "./test_ini_file.ini";
- const char* chapter = "";
- const char* test_item = "Test_item";
- const char* value = "test_value";
- bool result =
- ini_write_value(fname, chapter, test_item, value, INI_FLAG_ITEM_UP_CREA);
- EXPECT_FALSE(result);
-}
-
-TEST(IniFileTest, ParseEmptyLine) {
- char line[INI_LINE_LEN] = {0};
- char val[INI_LINE_LEN] = {0};
- const char* tag = "HMI";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_NOTHING, result);
-}
-
-TEST(IniFileTest, ParseChapter) {
- const char* line = "[HMI]";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "HMI";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_RIGHT_CHAPTER, result);
-}
-
-TEST(IniFileTest, ParseChapterTagEmpty) {
- const char* line = "[HMI]";
- char val[INI_LINE_LEN] = {0};
- char tag[INI_LINE_LEN] = {0};
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_WRONG_CHAPTER, result);
-}
-
-TEST(IniFileTest, ParseChapterWithUppercaseTag) {
- const char* line = "[Security Manager]";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "SECURITY MANAGER";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_RIGHT_CHAPTER, result);
-}
-
-TEST(IniFileTest, ParseChapterWithLowcaseTag) {
- const char* line = "[Security Manager]";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "Security Manager";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_WRONG_CHAPTER, result);
-}
-
-TEST(IniFileTest, ParseWithWrongChapter) {
- const char* line = "[HMI]";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "MAIN";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_WRONG_CHAPTER, result);
-}
-
-TEST(IniFileTest, ParseLineWithItem) {
- char line[INI_LINE_LEN] = "LaunchHMI = true";
- char val[INI_LINE_LEN] = "";
- char tag[INI_LINE_LEN] = "LAUNCHHMI";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_RIGHT_ITEM, result);
-
- char check_val[INI_LINE_LEN] = "true";
- EXPECT_EQ(*check_val, *val);
-}
-
-TEST(IniFileTest, ParseLineWithoutItem) {
- const char* line = "LaunchHMI = ";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "LAUNCHHMI";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- const char* res = val;
- const char* check_val = "";
- EXPECT_EQ(INI_RIGHT_ITEM, result);
- EXPECT_STREQ(check_val, res);
-}
-
-TEST(IniFileTest, ParseLineWithEmptytag) {
- const char* line = "LaunchHMI = true";
- char val[INI_LINE_LEN] = {0};
- char tag[INI_LINE_LEN] = {0};
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_WRONG_ITEM, result);
-}
-
-TEST(IniFileTest, ParseLineWithLowcaseTag) {
- const char* line = "LaunchHMI = true";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "LaunchHmi";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- EXPECT_EQ(INI_WRONG_ITEM, result);
-}
-
-TEST(IniFileTest, ParseLineWithComment) {
- const char* line = "; [HMI]";
- char val[INI_LINE_LEN] = {0};
- const char* tag = "HMI";
-
- Ini_search_id result;
- result = ini_parse_line(line, tag, val);
- const char* res = val;
- EXPECT_EQ(INI_REMARK, result);
- EXPECT_STREQ(line, res);
-}
-
-} // namespace profile_test
-} // namespace components
-} // namespace test
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index 7b9bb374b9..900bbd1f93 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -373,7 +373,7 @@ TEST_F(ProfileTest, IntInsteadOfPair) {
TEST_F(ProfileTest, WrongIntValue) {
// Default value
- uint32_t heart_beat_timeout = 0;
+ uint32_t heart_beat_timeout = 5000;
EXPECT_EQ(heart_beat_timeout, profile_.heart_beat_timeout());
// Change config file
@@ -381,7 +381,7 @@ TEST_F(ProfileTest, WrongIntValue) {
EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name());
// Value in file includes letters. Check that value is default
- heart_beat_timeout = 0;
+ heart_beat_timeout = 5000;
EXPECT_EQ(heart_beat_timeout, profile_.heart_beat_timeout());
// Update config file
@@ -679,6 +679,7 @@ TEST_F(ProfileTest, CheckVectorContainer) {
std::vector<int> diagmodes_list =
profile_.ReadIntContainer("MAIN", "SupportedDiagModes", &isread);
EXPECT_TRUE(isread);
+
// Compare with result of ReadIntContainer
ASSERT_EQ(diag_modes.size(), diagmodes_list.size());
bool isEqual = true;
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index cb7fc31575..c2c70ccae8 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -1002,7 +1002,7 @@ uint32_t ConnectionHandlerImpl::KeyFromPair(
transport_manager::ConnectionUID connection_handle,
uint8_t session_id) const {
const uint32_t key = connection_handle | (session_id << 16);
- SDL_LOG_DEBUG("Key for ConnectionHandle:"
+ SDL_LOG_TRACE("Key for ConnectionHandle:"
<< static_cast<uint32_t>(connection_handle)
<< " Session:" << static_cast<uint32_t>(session_id) << " is: 0x"
<< std::hex << static_cast<uint32_t>(key));
@@ -1020,7 +1020,7 @@ void ConnectionHandlerImpl::PairFromKey(
uint8_t* session_id) const {
*connection_handle = key & 0xFF00FFFF;
*session_id = key >> 16;
- SDL_LOG_DEBUG("ConnectionHandle: "
+ SDL_LOG_TRACE("ConnectionHandle: "
<< static_cast<int32_t>(*connection_handle)
<< " Session: " << static_cast<int32_t>(*session_id)
<< " for key: " << static_cast<int32_t>(key));
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc
index d88ffc7158..4e67d5dcbe 100644
--- a/src/components/formatters/src/CFormatterJsonBase.cc
+++ b/src/components/formatters/src/CFormatterJsonBase.cc
@@ -45,14 +45,14 @@ void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
Json::Value::Members members = value.getMemberNames();
- for (uint32_t i = 0; i < members.size(); i++) {
+ for (uint32_t i = 0; i < members.size(); ++i) {
jsonValueToObj(value[members[i]], obj[members[i]]);
}
} else if (value.type() == Json::arrayValue) {
obj = ns_smart_device_link::ns_smart_objects::SmartObject(
ns_smart_device_link::ns_smart_objects::SmartType_Array);
- for (uint32_t i = 0; i < value.size(); i++) {
+ for (uint32_t i = 0; i < value.size(); ++i) {
jsonValueToObj(value[i], obj[i]);
}
} else if (value.type() == Json::intValue) {
@@ -81,7 +81,7 @@ void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
obj.getType()) {
item = Json::arrayValue;
- for (uint32_t i = 0; i < obj.length(); i++) {
+ for (uint32_t i = 0; i < obj.length(); ++i) {
Json::Value value(Json::nullValue);
objToJsonValue(obj.getElement(i), value);
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index 8fafee1ac5..f66b19696d 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -74,7 +74,7 @@ endif()
target_link_libraries("HMIMessageHandler" ${LIBRARIES})
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 54f7ab9f05..5fd9be2a66 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -48,6 +48,8 @@
#include "application_manager/application_manager_settings.h"
#include "application_manager/hmi_interfaces.h"
#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/request_timeout_handler.h"
#include "application_manager/state_controller.h"
#include "policy/policy_types.h"
@@ -87,7 +89,10 @@ class RPCService;
namespace rpc_handler {
class RPCHandler;
}
-
+namespace request_controller {
+class RequestTimeoutHandler;
+class RequestController;
+} // namespace request_controller
class Application;
class AppServiceManager;
class StateControllerImpl;
@@ -114,6 +119,11 @@ struct ApplicationsPolicyAppIdSorter {
}
};
+struct ExpiredButtonRequestData {
+ uint32_t app_id_;
+ hmi_apis::Common_ButtonName::eType button_name_;
+};
+
typedef std::set<ApplicationSharedPtr, ApplicationsSorter> ApplicationSet;
typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
@@ -135,10 +145,6 @@ class ApplicationManager {
public:
virtual ~ApplicationManager() {}
- DEPRECATED
- virtual bool Init(resumption::LastState&,
- media_manager::MediaManager* media_manager) = 0;
-
/**
* Inits application manager
*/
@@ -210,9 +216,6 @@ class ApplicationManager {
virtual ApplicationSharedPtr application_by_policy_id(
const std::string& policy_app_id) const = 0;
- DEPRECATED virtual ApplicationSharedPtr application_by_name(
- const std::string& app_name) const = 0;
-
virtual ApplicationSharedPtr pending_application_by_policy_id(
const std::string& policy_app_id) const = 0;
@@ -502,6 +505,10 @@ class ApplicationManager {
virtual rpc_service::RPCService& GetRPCService() const = 0;
virtual rpc_handler::RPCHandler& GetRPCHandler() const = 0;
+ virtual request_controller::RequestTimeoutHandler&
+ get_request_timeout_handler() const = 0;
+ virtual request_controller::RequestController& get_request_controller()
+ const = 0;
virtual bool is_stopping() const = 0;
virtual bool is_audio_pass_thru_active() const = 0;
@@ -510,12 +517,20 @@ class ApplicationManager {
virtual uint32_t GenerateNewHMIAppID() = 0;
/**
- * @brief Ends opened navi services (audio/video) for application
+ * @brief Ends opened navi services audio and video for application
* @param app_id Application id
*/
virtual void EndNaviServices(uint32_t app_id) = 0;
/**
+ * @brief Ends opened navi service audio or video for application
+ * @param app_id Application id
+ * @param service_type Service type to check
+ */
+ virtual void EndService(const uint32_t app_id,
+ const protocol_handler::ServiceType service_type) = 0;
+
+ /**
* @brief returns true if low voltage state is active
*/
virtual bool IsLowVoltage() const = 0;
@@ -702,6 +717,36 @@ class ApplicationManager {
const uint32_t corr_id,
const int32_t function_id) = 0;
+ /**
+ * @brief RetainRequestInstance retains request instance by its
+ * connection+correlation key
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ * @return true if request was rerained. false if the request with such
+ * connection+correlation key was not found
+ */
+ virtual bool RetainRequestInstance(const uint32_t connection_key,
+ const uint32_t correlation_id) = 0;
+
+ /**
+ * @brief RemoveRetainedRequest removes request instance retained before
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ */
+ virtual bool RemoveRetainedRequest(const uint32_t connection_key,
+ const uint32_t correlation_id) = 0;
+
+ /**
+ * @brief IsStillWaitingForResponse check if request is still waiting for
+ * response
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ * @return true if request is still waiting for response, otherwise returns
+ * false
+ */
+ virtual bool IsStillWaitingForResponse(
+ const uint32_t connection_key, const uint32_t correlation_id) const = 0;
+
/*
* @brief Closes application by id
*
@@ -724,7 +769,7 @@ class ApplicationManager {
* @param mobile_correlation_id Correlation ID of the mobile request
* @param new_timeout_value New timeout in milliseconds to be set
*/
- virtual void updateRequestTimeout(uint32_t connection_key,
+ virtual void UpdateRequestTimeout(uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value) = 0;
@@ -867,11 +912,6 @@ class ApplicationManager {
protocol_handler::ServiceType service_type,
bool state) = 0;
- DEPRECATED
- virtual void OnAppStreaming(uint32_t app_id,
- protocol_handler::ServiceType service_type,
- const Application::StreamingState new_state) = 0;
-
/**
* @brief CreateRegularState create regular HMI state for application
* @param app Application
@@ -899,9 +939,6 @@ class ApplicationManager {
virtual bool CanAppStream(
uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
- DEPRECATED
- virtual void ForbidStreaming(uint32_t app_id) = 0;
-
/**
* @brief ForbidStreaming forbid the stream over the certain application.
* @param app_id the application's id which should stop streaming.
@@ -953,6 +990,35 @@ class ApplicationManager {
*/
virtual bool UnsubscribeAppFromSoftButtons(
const commands::MessageSharedPtr response_message) = 0;
+
+ /**
+ * @brief Save subscribe/unsubscribe button request after timeout to ensure
+ * possibility to align mobile subscription/unsubscription status with actual
+ * subscription/unsubscription status on HMI
+ * @param app_id Application id from request message
+ * @param corr_id Correlation id
+ * @param button_name name of button to subscribe/unsubscribe
+ */
+ virtual void AddExpiredButtonRequest(
+ const uint32_t app_id,
+ const int32_t corr_id,
+ const hmi_apis::Common_ButtonName::eType button_name) = 0;
+
+ /**
+ * @brief Return optional structure with information regarding
+ * subscribe/unsubscribe button request data
+ * @param corr_id Correlation id
+ * @return optional structure with subscribe/unsubscribe button request data
+ */
+ virtual utils::Optional<ExpiredButtonRequestData> GetExpiredButtonRequestData(
+ const int32_t corr_id) const = 0;
+
+ /**
+ * @brief Delete data about already processed expired subscribe/unsubscribe
+ * button request in case if HMI send response to expired request
+ * @param corr_id Correlation id
+ */
+ virtual void DeleteExpiredButtonRequest(const int32_t corr_id) = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index 02cd79aa8e..c7ab634ad0 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -63,6 +63,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual uint16_t tts_global_properties_timeout() const = 0;
virtual uint16_t max_supported_protocol_version() const = 0;
virtual const uint32_t& default_timeout() const = 0;
+ virtual const uint32_t& default_timeout_compensation() const = 0;
virtual const uint32_t& max_cmd_id() const = 0;
virtual bool launch_hmi() const = 0;
virtual const uint32_t& delete_file_in_none() const = 0;
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index e7d7aa485b..93cb09737d 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -274,7 +274,7 @@ class HMICapabilities {
/**
* @brief Sets supported Button's capabilities
- * @param soft_button_capabilities supported Button's capabilities
+ * @param button_capabilities supported Button's capabilities
*/
virtual void set_button_capabilities(
const smart_objects::SmartObject& button_capabilities) = 0;
@@ -519,9 +519,6 @@ class HMICapabilities {
virtual const smart_objects::SmartObjectSPtr seat_location_capability()
const = 0;
- DEPRECATED
- virtual void Init(resumption::LastState* last_state) = 0;
-
virtual void Init(resumption::LastStateWrapperPtr last_state_wrapper) = 0;
/**
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 7ada7884bf..d79c059b34 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -77,9 +77,7 @@ class PolicyHandlerInterface : public VehicleDataItemProvider {
virtual bool InitPolicyTable() = 0;
virtual bool ResetPolicyTable() = 0;
virtual bool ClearUserConsent() = 0;
- // Deprecated in favor of private variant
- DEPRECATED virtual bool SendMessageToSDK(const BinaryMessage& pt_string,
- const std::string& url) = 0;
+
virtual bool ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string) = 0;
virtual bool UnloadPolicyLibrary() = 0;
diff --git a/src/components/include/application_manager/request_controller.h b/src/components/include/application_manager/request_controller.h
new file mode 100644
index 0000000000..e892762312
--- /dev/null
+++ b/src/components/include/application_manager/request_controller.h
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2020, 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_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+
+#include "application_manager/commands/command.h"
+
+#include <memory>
+
+namespace application_manager {
+namespace request_controller {
+
+typedef std::shared_ptr<commands::Command> RequestPtr;
+/**
+ * @brief RequestController class is used to control currently active mobile
+ * requests.
+ */
+class RequestController {
+ public:
+ /**
+ * @brief Result code for addRequest
+ */
+ enum class TResult {
+ SUCCESS = 0,
+ TOO_MANY_REQUESTS,
+ TOO_MANY_PENDING_REQUESTS,
+ NONE_HMI_LEVEL_MANY_REQUESTS,
+ INVALID_DATA
+ };
+
+ /**
+ * @brief Thread pool state
+ */
+ enum class TPoolState {
+ UNDEFINED = 0,
+ STARTED,
+ STOPPED,
+ };
+
+ /**
+ * @brief Class destructor
+ */
+ virtual ~RequestController() {}
+
+ /**
+ * @brief Stop request controller internal activities
+ */
+ virtual void Stop() = 0;
+
+ /**
+ * @brief Initialize thread pool
+ */
+ virtual void InitializeThreadpool() = 0;
+
+ /**
+ * @brief Destroy thread pool
+ */
+ virtual void DestroyThreadpool() = 0;
+
+ /**
+ * @brief Check if max request amount wasn't exceed and adds request to queue.
+ * @param request Active request to mobile
+ * @param hmi_level Current application hmi_level
+ * @return Result code
+ */
+ virtual TResult AddMobileRequest(
+ const RequestPtr request,
+ const mobile_apis::HMILevel::eType& hmi_level) = 0;
+
+ /**
+ * @brief Store HMI request until response or timeout won't remove it
+ * @param request Active request to hmi
+ * @return Result code
+ */
+ virtual TResult AddHMIRequest(const RequestPtr request) = 0;
+
+ /**
+ * @brief Add notification to collection
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ virtual void AddNotification(const RequestPtr ptr) = 0;
+
+ /**
+ * @brief RetainRequestInstance retains request instance by its
+ * connection+correlation key
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ * @return true if request was rerained. false if the request with such
+ * connection+correlation key was not found
+ */
+ virtual bool RetainRequestInstance(const uint32_t connection_key,
+ const uint32_t correlation_id) = 0;
+
+ /**
+ * @brief RemoveRetainedRequest removes request instance retained before
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ */
+ virtual bool RemoveRetainedRequest(const uint32_t connection_key,
+ const uint32_t correlation_id) = 0;
+
+ /**
+ * @brief IsStillWaitingForResponse check if request is still waiting for
+ * response
+ * @param connection_key connection key of application
+ * @param correlation_id correlation id of request
+ * @return true if request is still waiting for response, otherwise returns
+ * false
+ */
+ virtual bool IsStillWaitingForResponse(
+ const uint32_t connection_key, const uint32_t correlation_id) const = 0;
+
+ /**
+ * @brief Removes request from queue
+ * @param correlation_id Active request correlation ID,
+ * @param connection_key Active request connection key (0 for HMI requests)
+ * @param function_id Active request function id
+ * @param force_terminate if true, request controller will terminate
+ * even if not allowed by request
+ */
+ virtual void TerminateRequest(const uint32_t correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id,
+ const bool force_terminate = false) = 0;
+
+ /**
+ * @brief Removes request from queue
+ * @param mobile_correlation_id Active mobile request correlation ID
+ * @param connection_key Active request connection key (0 for HMI requests)
+ * @param function_id Active request function ID
+ */
+ virtual void OnMobileResponse(const uint32_t mobile_correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id) = 0;
+
+ /**
+ * @brief Removes request from queue
+ * @param mobile_correlation_id Active mobile request correlation ID
+ * @param function_id Active request function ID
+ */
+ virtual void OnHMIResponse(const uint32_t correlation_id,
+ const int32_t function_id) = 0;
+
+ /**
+ * @ Add notification to collection
+ * @param notification Pointer that points to hmi notification
+ */
+ virtual void RemoveNotification(const commands::Command* notification) = 0;
+
+ /**
+ * @brief Removes all requests from queue for specified application
+ * @param app_id Mobile application ID (app_id)
+ */
+ virtual void TerminateAppRequests(const uint32_t app_id) = 0;
+
+ /**
+ * @brief Terminates all requests from HMI
+ */
+ virtual void TerminateAllHMIRequests() = 0;
+
+ /**
+ * @brief Terminates all requests from Mobile
+ */
+ virtual void TerminateAllMobileRequests() = 0;
+
+ /**
+ * @brief Updates request timeout
+ * @param app_id Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ * @param new_timeout_value New timeout to be set in milliseconds
+ */
+ virtual void UpdateRequestTimeout(const uint32_t app_id,
+ const uint32_t mobile_correlation_id,
+ const uint32_t new_timeout) = 0;
+ /**
+ * @brief Function Should be called when Low Voltage is occured
+ */
+ virtual void OnLowVoltage() = 0;
+
+ /**
+ * @brief Function Should be called when WakeUp occures after Low Voltage
+ */
+ virtual void OnWakeUp() = 0;
+
+ /**
+ * @return true if low voltage state is active
+ */
+ virtual bool IsLowVoltage() = 0;
+};
+
+} // namespace request_controller
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
diff --git a/src/components/include/application_manager/request_timeout_handler.h b/src/components/include/application_manager/request_timeout_handler.h
new file mode 100644
index 0000000000..ef646d8a94
--- /dev/null
+++ b/src/components/include/application_manager/request_timeout_handler.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2020, 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_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_H_
+
+#include <cstdint>
+
+namespace application_manager {
+namespace request_controller {
+
+/*
+ * @brief Structure for active mobile request
+ * that is waiting for a response from the HMI.
+ * Used for OnResetTimeout logic.
+ */
+struct Request {
+ Request(const uint32_t mob_correlation_id,
+ const uint32_t connection_key,
+ const uint32_t hmi_function_id)
+ : mob_correlation_id_(mob_correlation_id)
+ , connection_key_(connection_key)
+ , hmi_function_id_(hmi_function_id) {}
+
+ uint32_t mob_correlation_id_;
+ uint32_t connection_key_;
+ uint32_t hmi_function_id_;
+};
+
+/**
+ * @brief The RequestTimeoutHandler class
+ * handles OnResetTimeout notification from HMI,
+ * reset timeout for mobile request
+ */
+class RequestTimeoutHandler {
+ public:
+ /**
+ * @brief AddRequest adds request that waits for response
+ * @param hmi_correlation_id hmi correlation id
+ * @param request active mobile request
+ */
+ virtual void AddRequest(const uint32_t hmi_correlation_id,
+ const Request& request) = 0;
+ /**
+ * @brief RemoveRequest removes processed request
+ * @param hmi_correlation_id hmi correlation id
+ */
+ virtual void RemoveRequest(const uint32_t hmi_correlation_id) = 0;
+
+ virtual ~RequestTimeoutHandler() {}
+};
+
+} // namespace request_controller
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_TIMEOUT_HANDLER_H_
diff --git a/src/components/include/media_manager/media_manager.h b/src/components/include/media_manager/media_manager.h
index 2d2201a949..60c93843d1 100644
--- a/src/components/include/media_manager/media_manager.h
+++ b/src/components/include/media_manager/media_manager.h
@@ -42,13 +42,6 @@ namespace media_manager {
class MediaManager {
public:
- virtual void PlayA2DPSource(int32_t application_key) = 0;
- virtual void StopA2DPSource(int32_t application_key) = 0;
-
- DEPRECATED virtual void StartMicrophoneRecording(
- int32_t application_key,
- const std::string& outputFileName,
- int32_t duration) = 0;
virtual void StartMicrophoneRecording(
int32_t application_key,
const std::string& outputFileName,
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 d9844c153b..5d57d5ca45 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -753,15 +753,6 @@ class PolicyManager : public usage_statistics::StatisticsManager,
virtual const PolicySettings& get_settings() const = 0;
/**
- * @deprecated Unused in EXTERNAL_PROPRIETARY policies
- * @brief Finds the next URL that must be sent on OnSystemRequest retry
- * @param urls vector of vectors that contain urls for each application
- * @return Pair of policy application id and application url id from the
- * urls vector
- */
- DEPRECATED virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
-
- /**
* @brief Assigns new HMI types for specified application
* @param device_handle device identifier
* @param application_id Unique application id
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index 011592da49..2cea958bae 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -137,22 +137,6 @@ class ProtocolHandler {
* @param err_reason string with NACK reason. Only valid when
* generated_session_id is 0.
*/
- DEPRECATED
- virtual void NotifySessionStarted(
- const SessionContext& context,
- std::vector<std::string>& rejected_params,
- const std::string err_reason = std::string()) = 0;
-
- /**
- * @brief Called by connection handler to notify the context of
- * OnSessionStartedCallback().
- * @param context reference to structure with started session data
- * @param rejected_params list of parameters name that are rejected.
- * Only valid when generated_session_id is 0. Note, even if
- * generated_session_id is 0, the list may be empty.
- * @param err_reason string with NACK reason. Only valid when
- * generated_session_id is 0.
- */
virtual void NotifySessionStarted(
SessionContext& context,
std::vector<std::string>& rejected_params,
diff --git a/src/components/include/resumption/last_state.h b/src/components/include/resumption/last_state.h
index b28e5611b7..1f54959ffc 100644
--- a/src/components/include/resumption/last_state.h
+++ b/src/components/include/resumption/last_state.h
@@ -46,12 +46,6 @@ class LastState {
virtual ~LastState() {}
/**
- * @brief Saves dictionary to filesystem
- */
- DEPRECATED
- virtual void SaveStateToFileSystem() = 0;
-
- /**
* @brief SaveToFileSystem
* Saving dictionary to filesystem
*/
@@ -65,12 +59,6 @@ class LastState {
/**
* @brief dictionary Gets internal dictionary
- * @return Reference to internal dictionary json value
- */
- virtual Json::Value& get_dictionary() = 0;
-
- /**
- * @brief dictionary Gets internal dictionary
* @return Copy of internal dictionary json value
*/
virtual Json::Value dictionary() const = 0;
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
index 305ade2b47..b231005010 100644
--- a/src/components/include/security_manager/security_manager.h
+++ b/src/components/include/security_manager/security_manager.h
@@ -69,6 +69,9 @@ class SecurityManager : public protocol_handler::ProtocolObserver,
ERROR_DECRYPTION_FAILED = 0x06,
ERROR_ENCRYPTION_FAILED = 0x07,
ERROR_SSL_INVALID_DATA = 0x08,
+ ERROR_HANDSHAKE_FAILED = 0x09, // Handshake failed
+ ERROR_INVALID_CERT = 0x0A, // Handshake failed because cert is invalid
+ ERROR_EXPIRED_CERT = 0x0B, // Handshake failed because cert is expired
ERROR_INTERNAL = 0xFF,
ERROR_UNKNOWN_INTERNAL_ERROR = 0xFE // error value for testing
};
@@ -99,24 +102,24 @@ class SecurityManager : public protocol_handler::ProtocolObserver,
* \param connection_key Unique key used by other components as session
* identifier
* \param error_id unique error identifier
- * \param erorr_text SSL impelmentation error text
+ * \param error_text SSL impelmentation error text
* \param seq_number received from Mobile Application
*/
virtual void SendInternalError(const uint32_t connection_key,
const uint8_t& error_id,
- const std::string& erorr_text,
+ const std::string& error_text,
const uint32_t seq_number) = 0;
/**
* \brief Sends InternalError override methode for sending without seq_number
* \param connection_key Unique key used by other components as session
* identifier
* \param error_id unique error identifier
- * \param erorr_text SSL impelmentation error text
+ * \param error_text SSL impelmentation error text
*/
void SendInternalError(const uint32_t connection_key,
const uint8_t& error_id,
- const std::string& erorr_text) {
- SendInternalError(connection_key, error_id, erorr_text, 0);
+ const std::string& error_text) {
+ SendInternalError(connection_key, error_id, error_text, 0);
}
/**
diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h
index 397cf89347..4f2caf530c 100644
--- a/src/components/include/security_manager/ssl_context.h
+++ b/src/components/include/security_manager/ssl_context.h
@@ -73,7 +73,6 @@ class SSLContext {
Handshake_Result_NotYetValid,
Handshake_Result_CertNotSigned,
Handshake_Result_AppIDMismatch,
- Handshake_Result_AppNameMismatch,
};
struct HandshakeContext {
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 fd7ddeac15..ef0f20ac65 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -68,10 +68,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD2(Init,
bool(resumption::LastStateWrapperPtr last_state,
media_manager::MediaManager* media_manager));
- DEPRECATED
- MOCK_METHOD2(Init,
- bool(resumption::LastState& last_state,
- media_manager::MediaManager* media_manager));
MOCK_METHOD0(Stop, bool());
MOCK_METHOD1(set_hmi_message_handler,
void(hmi_message_handler::HMIMessageHandler* handler));
@@ -117,9 +113,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD1(application_by_policy_id,
application_manager::ApplicationSharedPtr(
const std::string& policy_app_id));
- MOCK_CONST_METHOD1(
- application_by_name,
- application_manager::ApplicationSharedPtr(const std::string& app_name));
MOCK_CONST_METHOD1(pending_application_by_policy_id,
application_manager::ApplicationSharedPtr(
const std::string& policy_app_id));
@@ -195,12 +188,21 @@ class MockApplicationManager : public application_manager::ApplicationManager {
application_manager::rpc_service::RPCService&());
MOCK_CONST_METHOD0(GetRPCHandler,
application_manager::rpc_handler::RPCHandler&());
+ MOCK_CONST_METHOD0(
+ get_request_timeout_handler,
+ application_manager::request_controller::RequestTimeoutHandler&());
+ MOCK_CONST_METHOD0(
+ get_request_controller,
+ application_manager::request_controller::RequestController&());
MOCK_CONST_METHOD0(is_stopping, bool());
MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool());
MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
MOCK_METHOD0(GetNextMobileCorrelationID, uint32_t());
MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
+ MOCK_METHOD2(EndService,
+ void(const uint32_t app_id,
+ const protocol_handler::ServiceType service_type));
MOCK_METHOD1(BeginAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
@@ -269,7 +271,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(const connection_handler::DeviceHandle));
MOCK_METHOD4(UnregisterApplication,
void(const uint32_t&, mobile_apis::Result::eType, bool, bool));
- MOCK_METHOD3(updateRequestTimeout,
+ MOCK_METHOD3(UpdateRequestTimeout,
void(uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value));
@@ -319,12 +321,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(uint32_t app_id,
protocol_handler::ServiceType service_type,
bool state));
- DEPRECATED
- MOCK_METHOD3(
- OnAppStreaming,
- void(uint32_t app_id,
- protocol_handler::ServiceType service_type,
- const application_manager::Application::StreamingState new_state));
MOCK_CONST_METHOD6(CreateRegularState,
application_manager::HmiStatePtr(
application_manager::ApplicationSharedPtr app,
@@ -339,8 +335,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD2(CanAppStream,
bool(uint32_t app_id,
protocol_handler::ServiceType service_type));
- DEPRECATED
- MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
MOCK_METHOD2(ForbidStreaming,
void(uint32_t app_id,
protocol_handler::ServiceType service_type));
@@ -405,6 +399,24 @@ class MockApplicationManager : public application_manager::ApplicationManager {
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));
+ MOCK_METHOD2(RetainRequestInstance,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_METHOD2(RemoveRetainedRequest,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_CONST_METHOD2(IsStillWaitingForResponse,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_METHOD3(AddExpiredButtonRequest,
+ void(const uint32_t app_id,
+ const int32_t corr_id,
+ const hmi_apis::Common_ButtonName::eType button_name));
+ MOCK_CONST_METHOD1(
+ GetExpiredButtonRequestData,
+ utils::Optional<application_manager::ExpiredButtonRequestData>(
+ const int32_t corr_id));
+ MOCK_METHOD1(DeleteExpiredButtonRequest, void(const int32_t corr_id));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index 9a70a374a7..b30fc09830 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -70,6 +70,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(tts_global_properties_timeout, uint16_t());
MOCK_CONST_METHOD0(max_supported_protocol_version, uint16_t());
MOCK_CONST_METHOD0(default_timeout, const uint32_t&());
+ MOCK_CONST_METHOD0(default_timeout_compensation, const uint32_t&());
MOCK_CONST_METHOD0(max_cmd_id, const uint32_t&());
MOCK_CONST_METHOD0(launch_hmi, bool());
MOCK_CONST_METHOD0(delete_file_in_none, const uint32_t&());
diff --git a/src/components/include/test/application_manager/mock_request_controller.h b/src/components/include/test/application_manager/mock_request_controller.h
new file mode 100644
index 0000000000..a4a7cbc1e2
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_request_controller.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2020, 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_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_CONTROLLER_H_
+
+#include "application_manager/request_controller.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRequestController
+ : public application_manager::request_controller::RequestController {
+ public:
+ MOCK_METHOD0(Stop, void());
+ MOCK_METHOD0(InitializeThreadpool, void());
+ MOCK_METHOD0(DestroyThreadpool, void());
+ MOCK_METHOD2(
+ AddMobileRequest,
+ TResult(const application_manager::request_controller::RequestPtr request,
+ const mobile_apis::HMILevel::eType& hmi_level));
+ MOCK_METHOD1(AddHMIRequest,
+ TResult(const application_manager::request_controller::RequestPtr
+ request));
+ MOCK_METHOD1(
+ AddNotification,
+ void(const application_manager::request_controller::RequestPtr request));
+ MOCK_METHOD2(RetainRequestInstance,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_METHOD2(RemoveRetainedRequest,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_CONST_METHOD2(IsStillWaitingForResponse,
+ bool(const uint32_t connection_key,
+ const uint32_t correlation_id));
+ MOCK_METHOD4(TerminateRequest,
+ void(const uint32_t correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id,
+ bool force_terminate));
+ MOCK_METHOD3(OnMobileResponse,
+ void(const uint32_t mobile_correlation_id,
+ const uint32_t connection_key,
+ const int32_t function_id));
+ MOCK_METHOD2(OnHMIResponse,
+ void(const uint32_t correlation_id, const int32_t function_id));
+ MOCK_METHOD1(
+ RemoveNotification,
+ void(const application_manager::commands::Command* notification));
+ MOCK_METHOD1(TerminateAppRequests, void(const uint32_t app_id));
+ MOCK_METHOD0(TerminateAllHMIRequests, void());
+ MOCK_METHOD0(TerminateAllMobileRequests, void());
+ MOCK_METHOD3(UpdateRequestTimeout,
+ void(const uint32_t app_id,
+ const uint32_t mobile_correlation_id,
+ const uint32_t new_timeout));
+ MOCK_METHOD0(OnLowVoltage, void());
+ MOCK_METHOD0(OnWakeUp, void());
+ MOCK_METHOD0(IsLowVoltage, bool());
+};
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_CONTROLLER_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/include/test/application_manager/mock_request_timeout_handler.h
index c8d36407b8..b1492a9812 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
+++ b/src/components/include/test/application_manager/mock_request_timeout_handler.h
@@ -30,39 +30,28 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-namespace hmi {
-
-SDL_CREATE_LOG_VARIABLE("Commands")
-
-OnButtonSubscriptionNotification::OnButtonSubscriptionNotification(
- const application_manager::commands::MessageSharedPtr& message,
- ApplicationManager& application_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handle)
- : NotificationToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
-OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {}
-
-void OnButtonSubscriptionNotification::Run() {
- SDL_LOG_AUTO_TRACE();
-
- SendNotification();
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace sdl_rpc_plugin
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_TIMEOUT_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_TIMEOUT_HANDLER_H_
+
+#include "application_manager/request_timeout_handler.h"
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRequestTimeoutHandler
+ : public application_manager::request_controller::RequestTimeoutHandler {
+ public:
+ MOCK_METHOD2(
+ AddRequest,
+ void(const uint32_t hmi_correlation_id,
+ const application_manager::request_controller::Request& request));
+ MOCK_METHOD1(RemoveRequest, void(const uint32_t hmi_correlation_id));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_REQUEST_TIMEOUT_HANDLER_H_
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin.h b/src/components/include/test/application_manager/mock_rpc_plugin.h
index 2633825428..2dba5367c6 100644
--- a/src/components/include/test/application_manager/mock_rpc_plugin.h
+++ b/src/components/include/test/application_manager/mock_rpc_plugin.h
@@ -16,13 +16,6 @@ class MockRPCPlugin : public RPCPlugin {
HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler,
resumption::LastStateWrapperPtr last_state));
- DEPRECATED
- MOCK_METHOD5(Init,
- bool(ApplicationManager& app_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- resumption::LastState& last_state));
MOCK_METHOD2(IsAbleToProcess,
bool(const int32_t function_id,
const commands::Command::CommandSource message_source));
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 af4019ce21..ca5d25ed4c 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
@@ -53,9 +53,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD0(InitPolicyTable, bool());
MOCK_METHOD0(ResetPolicyTable, bool());
MOCK_METHOD0(ClearUserConsent, bool());
- MOCK_METHOD2(SendMessageToSDK,
- bool(const policy::BinaryMessage& pt_string,
- const std::string& url));
MOCK_METHOD2(ReceiveMessageFromSDK,
bool(const std::string& file,
const policy::BinaryMessage& pt_string));
diff --git a/src/components/include/test/media_manager/mock_media_manager.h b/src/components/include/test/media_manager/mock_media_manager.h
index 364c495236..cfee287d12 100644
--- a/src/components/include/test/media_manager/mock_media_manager.h
+++ b/src/components/include/test/media_manager/mock_media_manager.h
@@ -41,12 +41,6 @@ namespace media_manager_test {
class MockMediaManager : public media_manager::MediaManager {
public:
- MOCK_METHOD1(PlayA2DPSource, void(int32_t application_key));
- MOCK_METHOD1(StopA2DPSource, void(int32_t application_key));
- MOCK_METHOD3(StartMicrophoneRecording,
- void(int32_t application_key,
- const std::string& outputFileName,
- int32_t duration));
MOCK_METHOD6(StartMicrophoneRecording,
void(int32_t application_key,
const std::string& outputFileName,
diff --git a/src/components/include/test/resumption/mock_last_state.h b/src/components/include/test/resumption/mock_last_state.h
index 99c3799a95..c646dcd286 100644
--- a/src/components/include/test/resumption/mock_last_state.h
+++ b/src/components/include/test/resumption/mock_last_state.h
@@ -43,10 +43,6 @@ namespace resumption_test {
class MockLastState : public resumption::LastState {
public:
- DEPRECATED
- MOCK_METHOD0(SaveStateToFileSystem, void());
- DEPRECATED
- MOCK_METHOD0(get_dictionary, Json::Value&());
MOCK_METHOD0(SaveToFileSystem, void());
MOCK_METHOD0(RemoveFromFileSystem, void());
MOCK_CONST_METHOD0(dictionary, Json::Value());
diff --git a/src/components/include/test/transport_manager/mock_transport_manager.h b/src/components/include/test/transport_manager/mock_transport_manager.h
index 1920af18a3..7aa70b8061 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager.h
@@ -57,8 +57,6 @@ class MockTransportManager : public ::transport_manager::TransportManager,
transport_manager::TMTelemetryObserver> {
public:
MOCK_METHOD1(Init, int(resumption::LastStateWrapperPtr last_state));
- DEPRECATED
- MOCK_METHOD1(Init, int(resumption::LastState& last_state));
MOCK_METHOD0(Reinit, int());
MOCK_METHOD0(Deinit, void());
MOCK_METHOD0(StopEventsProcessing, void());
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 184616d714..770b55a347 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -163,7 +163,7 @@ class Device {
* @brief Increment @link retry_count_ @endlink value
*/
inline void next_retry() {
- retry_count_++;
+ ++retry_count_;
}
/**
diff --git a/src/components/include/transport_manager/transport_manager.h b/src/components/include/transport_manager/transport_manager.h
index 4697bf9982..45bb159aa2 100644
--- a/src/components/include/transport_manager/transport_manager.h
+++ b/src/components/include/transport_manager/transport_manager.h
@@ -53,9 +53,6 @@ class TransportManager {
**/
virtual ~TransportManager() {}
- DEPRECATED
- virtual int Init(resumption::LastState& last_state) = 0;
-
/**
* @brief Initialize transport manager.
* @return Error code.
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index 92806e7372..a5fa36a9a0 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -1809,10 +1809,10 @@
<param name="moduleId" type="String" maxlength="100" mandatory="true">
<description> uuid of a module. "moduleId + moduleType" uniquely identify a module.</description>
</param>
- <param name="location" type="Grid" mandatory="false">
+ <param name="location" type="Common.Grid" mandatory="false">
<description>Location of a module.</description>
</param>
- <param name="serviceArea" type="Grid" mandatory="false">
+ <param name="serviceArea" type="Common.Grid" mandatory="false">
<description>Service area of a module. </description>
</param>
<param name="allowMultipleAccess" type="Boolean" mandatory="false" defvalue="true">
@@ -1832,7 +1832,7 @@
<param name="columns" type="Integer" minvalue="1" maxvalue="100" mandatory="false"></param>
<param name="levels" type="Integer" minvalue="1" maxvalue="100" defvalue="1" mandatory="false">
</param>
- <param name="seats" type="SeatLocation" array="true" mandatory="false">
+ <param name="seats" type="Common.SeatLocation" array="true" mandatory="false">
<description>Contains a list of SeatLocation in the vehicle</description>
</param>
</struct>
@@ -1880,8 +1880,8 @@
<struct name="MassageModeData">
<description>Specify the mode of a massage zone.</description>
- <param name="massageZone" type="MassageZone" mandatory="true"></param>
- <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ <param name="massageZone" type="Common.MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="Common.MassageMode" mandatory="true"></param>
</struct>
<enum name="MassageCushion">
@@ -1895,7 +1895,7 @@
<struct name="MassageCushionFirmness">
<description>The intensity or firmness of a cushion.</description>
- <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="cushion" type="Common.MassageCushion" mandatory="true"></param>
<param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
</struct>
@@ -1914,7 +1914,7 @@
<struct name="SeatMemoryAction">
<param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
<param name="label" type="String" maxlength="100" mandatory="false"/>
- <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ <param name="action" type="Common.SeatMemoryActionType" mandatory="true"/>
</struct>
<enum name="SupportedSeat">
@@ -1925,7 +1925,7 @@
<struct name="SeatControlData">
<description>Seat control data corresponds to "SEAT" ModuleType. </description>
- <param name="id" type="SupportedSeat" mandatory="false"></param>
+ <param name="id" type="Common.SupportedSeat" mandatory="false"></param>
<param name="heatingEnabled" type="Boolean" mandatory="false"></param>
<param name="coolingEnabled" type="Boolean" mandatory="false"></param>
<param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
@@ -1941,19 +1941,19 @@
<param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
<param name="massageEnabled" type="Boolean" mandatory="false"></param>
- <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
- <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
- <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ <param name="massageMode" type="Common.MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="Common.MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+ <param name="memory" type="Common.SeatMemoryAction" mandatory="false"></param>
</struct>
<struct name="SeatControlCapabilities">
<param name="moduleName" type="String" maxlength="100" mandatory="true">
<description>
- The short friendly name of the light control module.
+ The short friendly name of the seat control module.
It should not be used to identify a module by mobile application.
</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
@@ -2107,13 +2107,13 @@
<param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
<description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
</param>
- <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <param name="stationIDNumber" type="Common.StationIDNumber" mandatory="false">
<description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
</param>
<param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
<description>Identifies the station call sign or other identifying information in the long format.</description>
</param>
- <param name="stationLocation" type="GPSData" mandatory="false">
+ <param name="stationLocation" type="Common.GPSData" mandatory="false">
<description>Provides the 3-dimensional geographic station location.</description>
</param>
<param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
@@ -2157,7 +2157,7 @@
</param>
<param name="state" type="Common.RadioState" mandatory="false">
</param>
- <param name="sisData" type="SisData" mandatory="false">
+ <param name="sisData" type="Common.SisData" mandatory="false">
<description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
</param>
</struct>
@@ -2167,7 +2167,7 @@
<param name="moduleName" type="String" maxlength="100" mandatory="true" >
<description>The short name or a short description of the radio control module.</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="radioEnableAvailable" type="Boolean" mandatory="false">
@@ -2293,7 +2293,7 @@
</param>
<param name="autoModeEnable" type="Boolean" mandatory="false">
</param>
- <param name="defrostZone" type="DefrostZone" mandatory="false">
+ <param name="defrostZone" type="Common.DefrostZone" mandatory="false">
</param>
<param name="dualModeEnable" type="Boolean" mandatory="false">
</param>
@@ -2322,7 +2322,7 @@
<param name="moduleName" type="String" maxlength="100" mandatory="true" >
<description>The short name or a short description of the climate control module.</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
@@ -2437,7 +2437,7 @@
</struct>
<struct name="AudioControlData">
- <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <param name="source" type="Common.PrimaryAudioSource" mandatory="false">
<description>
In a getter response or a notification, it is the current primary audio source of the system.
In a setter request, it is the target audio source that the system shall switch to.
@@ -2456,7 +2456,7 @@
<param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
<description>Reflects the volume of audio, from 0%-100%.</description>
</param>
- <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <param name="equalizerSettings" type="Common.EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
<description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
</param>
</struct>
@@ -2464,11 +2464,11 @@
<struct name="AudioControlCapabilities">
<param name="moduleName" type="String" maxlength="100" mandatory="true">
<description>
- The short friendly name of the light control module.
+ The short friendly name of the audio control module.
It should not be used to identify a module by mobile application.
</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="sourceAvailable" type="Boolean" mandatory="false">
@@ -2605,7 +2605,7 @@
</enum>
<struct name="LightCapabilities">
- <param name="name" type="LightName" mandatory="true" />
+ <param name="name" type="Common.LightName" mandatory="true" />
<param name="statusAvailable" type="Boolean" mandatory="false">
<description>
Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
@@ -2630,25 +2630,25 @@
It should not be used to identify a module by mobile application.
</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
- <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <param name="supportedLights" type="Common.LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
<description> An array of available light names that are controllable. </description>
</param>
</struct>
<struct name="LightState">
- <param name="id" type="LightName" mandatory="true">
+ <param name="id" type="Common.LightName" mandatory="true">
<description>The name of a light or a group of lights. </description>
</param>
- <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="status" type="Common.LightStatus" mandatory="true"/>
<param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
- <param name="color" type="RGBColor" mandatory="false" />
+ <param name="color" type="Common.RGBColor" mandatory="false" />
</struct>
<struct name="LightControlData">
- <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <param name="lightState" type="Common.LightState" mandatory="true" minsize="1" maxsize="100" array="true">
<description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
</param>
</struct>
@@ -2665,9 +2665,9 @@
<struct name="HMISettingsControlData">
<description>Corresponds to "HMI_SETTINGS" ModuleType</description>
- <param name="displayMode" type="DisplayMode" mandatory="false"></param>
- <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
- <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ <param name="displayMode" type="Common.DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="Common.TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="Common.DistanceUnit" mandatory="false"></param>
</struct>
<struct name="HMISettingsControlCapabilities">
@@ -2677,7 +2677,7 @@
It should not be used to identify a module by mobile application.
</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="distanceUnitAvailable" type="Boolean" mandatory="false">
@@ -2702,13 +2702,13 @@
</param>
<param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
</param>
- <param name="seatControlData" type="SeatControlData" mandatory="false">
+ <param name="seatControlData" type="Common.SeatControlData" mandatory="false">
</param>
- <param name="audioControlData" type="AudioControlData" mandatory="false">
+ <param name="audioControlData" type="Common.AudioControlData" mandatory="false">
</param>
- <param name="lightControlData" type="LightControlData" mandatory="false">
+ <param name="lightControlData" type="Common.LightControlData" mandatory="false">
</param>
- <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false">
+ <param name="hmiSettingsControlData" type="Common.HMISettingsControlData" mandatory="false">
</param>
</struct>
@@ -2744,7 +2744,7 @@
<param name="name" type="Common.ButtonName" mandatory="true">
<description>The name of the Button from the ButtonName enum</description>
</param>
- <param name="moduleInfo" type="ModuleInfo" mandatory="false">
+ <param name="moduleInfo" type="Common.ModuleInfo" mandatory="false">
<description>Information about a RC module, including its id. </description>
</param>
<param name="shortPressAvailable" type="Boolean" mandatory="true">
@@ -2886,8 +2886,8 @@
Currently only predefined window template layouts are defined.
</description>
</param>
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" />
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" />
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false" />
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false" />
</struct>
<struct name="HMIApplication">
@@ -3280,7 +3280,7 @@
<param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
<description>The status of component volume. See ComponentVolumeStatus.</description>
</param>
- <param name="tpms" type="TPMS" mandatory="false">
+ <param name="tpms" type="Common.TPMS" mandatory="false">
<description>The status of TPMS according to the particular tire.</description>
</param>
<param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000">
@@ -3638,7 +3638,7 @@
</struct>
<struct name="LocationDetails">
- <param name="coordinate" type="Coordinate" mandatory="false">
+ <param name="coordinate" type="Common.Coordinate" mandatory="false">
<description>Latitude/Longitude of the location.</description>
</param>
<param name="locationName" type="String" maxlength="500" mandatory="false">
@@ -3653,10 +3653,10 @@
<param name="phoneNumber" type="String" maxlength="500" mandatory="false">
<description>Phone number of location / establishment.</description>
</param>
- <param name="locationImage" type="Image" mandatory="false">
+ <param name="locationImage" type="Common.Image" mandatory="false">
<description>Image / icon of intended location.</description>
</param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
+ <param name="searchAddress" type="Common.OASISAddress" mandatory="false">
<description>Address to be used by navigation engines for search</description>
</param>
</struct>
@@ -3708,24 +3708,24 @@
<param name="preferredFPS" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
<description>The preferred frame rate per second of the head unit. The mobile application / app library may take other factors into account that constrain the frame rate lower than this value, but it should not perform streaming at a higher frame rate than this value.</description>
</param>
- <param name="additionalVideoStreamingCapabilities" type="VideoStreamingCapability" array="true" minsize="1" maxsize="100" mandatory="false">
+ <param name="additionalVideoStreamingCapabilities" type="Common.VideoStreamingCapability" array="true" minsize="1" maxsize="100" mandatory="false">
</param>
</struct>
<struct name="AppCapability">
- <param name="appCapabilityType" type="AppCapabilityType" mandatory="true">
+ <param name="appCapabilityType" type="Common.AppCapabilityType" 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>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <param name="videoStreamingCapability" type="Common.VideoStreamingCapability" mandatory="false">
<description>Describes supported capabilities for video streaming </description>
</param>
</struct>
<struct name="DynamicUpdateCapabilities">
- <param name="supportedDynamicImageFieldNames" type="ImageFieldName" array="true" mandatory="false" minsize="1">
+ <param name="supportedDynamicImageFieldNames" type="Common.ImageFieldName" array="true" mandatory="false" minsize="1">
<description>An array of ImageFieldName values for which the system supports sending OnFileUpdate notifications. If you send an Image struct for that image field with a name without having uploaded the image data using PutFile that matches that name, the system will request that you upload the data with PutFile at a later point when the HMI needs it. The HMI will then display the image in the appropriate field. If not sent, assume false.</description>
</param>
@@ -3743,7 +3743,7 @@
<description>
Describes the capabilities of a single keyboard layout.
</description>
- <param name="keyboardLayout" type="KeyboardLayout" mandatory="true"/>
+ <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="true"/>
<param name="numConfigurableKeys" type="Integer" minvalue="0" maxvalue="10" mandatory="true">
<description>Number of keys available for special characters, App can customize as per their needs.</description>
</param>
@@ -3753,7 +3753,7 @@
<param name="maskInputCharactersSupported" type="Boolean" mandatory="false">
<description>Availability of capability to mask input characters using keyboard. True: Available, False: Not Available</description>
</param>
- <param name="supportedKeyboards" type="KeyboardLayoutCapability" minsize="1" maxsize="1000" array="true" mandatory="false">
+ <param name="supportedKeyboards" type="Common.KeyboardLayoutCapability" minsize="1" maxsize="1000" array="true" mandatory="false">
<description>Capabilities of supported keyboard layouts by HMI.</description>
</param>
</struct>
@@ -3765,13 +3765,13 @@
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">
+ <param name="textFields" type="Common.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">
+ <param name="imageFields" type="Common.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">
+ <param name="imageTypeSupported" type="Common.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">
@@ -3780,19 +3780,19 @@
<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">
+ <param name="buttonCapabilities" type="Common.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">
+ <param name="softButtonCapabilities" type="Common.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>
<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>
- <param name="dynamicUpdateCapabilities" type="DynamicUpdateCapabilities" mandatory="false">
+ <param name="dynamicUpdateCapabilities" type="Common.DynamicUpdateCapabilities" mandatory="false">
<description>Contains the head unit's capabilities for dynamic updating features declaring if the module will send dynamic update RPCs.</description>
</param>
- <param name="keyboardCapabilities" type="KeyboardCapabilities" mandatory="false">
+ <param name="keyboardCapabilities" type="Common.KeyboardCapabilities" mandatory="false">
<description>See KeyboardCapabilities</description>
</param>
</struct>
@@ -3800,12 +3800,12 @@
<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">
+ <param name="windowTypeSupported" type="Common.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">
+ <param name="windowCapabilities" type="Common.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.
@@ -3830,39 +3830,39 @@
</struct>
<struct name="SystemCapabilities">
- <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ <param name="navigationCapability" type="Common.NavigationCapability" mandatory="false">
</param>
- <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ <param name="phoneCapability" type="Common.PhoneCapability" mandatory="false">
</param>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <param name="videoStreamingCapability" type="Common.VideoStreamingCapability" mandatory="false">
</param>
- <param name="driverDistractionCapability" type="DriverDistractionCapability" mandatory="false">
+ <param name="driverDistractionCapability" type="Common.DriverDistractionCapability" mandatory="false">
<description>Describes capabilities when the driver is distracted</description>
</param>
</struct>
<struct name="RemoteControlCapabilities">
- <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <param name="climateControlCapabilities" type="Common.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 >
</param>
- <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <param name="radioControlCapabilities" type="Common.RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
</param>
- <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <param name="buttonCapabilities" type="Common.ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
<description>If included, the platform supports RC button controls with the included button names.</description >
</param>
- <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <param name="seatControlCapabilities" type="Common.SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description>
If included, the platform supports seat controls.
</description >
</param>
- <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <param name="audioControlCapabilities" type="Common.AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description> If included, the platform supports audio controls. </description >
</param>
- <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false">
+ <param name="hmiSettingsControlCapabilities" type="Common.HMISettingsControlCapabilities" mandatory="false">
<description> If included, the platform supports hmi setting controls. </description >
</param>
- <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false">
+ <param name="lightControlCapabilities" type="Common.LightControlCapabilities" mandatory="false">
<description> If included, the platform supports light controls. </description >
</param>
</struct>
@@ -4395,10 +4395,10 @@
</description>
</param>
<param name="displayCapabilities" type="Common.DisplayCapability" array="true" minsize="1" maxsize="1000" mandatory="false"/>
- <param name="seatLocationCapability" type="SeatLocationCapability" mandatory="false">
+ <param name="seatLocationCapability" type="Common.SeatLocationCapability" mandatory="false">
<description>Contains information about the locations of each seat</description>
</param>
- <param name="driverDistractionCapability" type="DriverDistractionCapability" mandatory="false">
+ <param name="driverDistractionCapability" type="Common.DriverDistractionCapability" mandatory="false">
<description>Describes capabilities when the driver is distracted</description>
</param>
</struct>
@@ -4471,7 +4471,7 @@
<description>
The seek next / skip previous subscription buttons' content
</description>
- <param name="type" type="SeekIndicatorType" mandatory="true" />
+ <param name="type" type="Common.SeekIndicatorType" mandatory="true" />
<param name="seekTime" type="Integer" minvalue="1" maxvalue="99" mandatory="false">
<description>
If the type is TIME, this number of seconds may be present alongside the skip indicator.
@@ -4546,24 +4546,30 @@
</description>
</param>
</function>
- <function name="OnButtonSubscription" messagetype="notification">
+ <function name="SubscribeButton" messagetype="request">
<description>
- Sender: SDL->HMI. Purpose: to notify about button subscription state is changed for the named application
+ Subscribes to buttons.
</description>
- <param name="name" type="Common.ButtonName" mandatory="true" />
- <param name="isSubscribed" type="Boolean" mandatory="true">
- <description>
- Defines whether the named button has status of 'subscribed' or 'unsubscribed':
- If "true" - the named button is subscribed.
- If "false" - the named button is unsubscribed.
- </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>The ID of the application requesting this button subscription. </description>
+ </param>
+ <param name="buttonName" type="Common.ButtonName" mandatory="true">
+ <description>Name of the button to subscribe.</description>
</param>
+ </function>
+ <function name="SubscribeButton" messagetype="response"> </function>
+ <function name="UnsubscribeButton" messagetype="request">
+ <description>
+ Unsubscribes from buttons.
+ </description>
<param name="appID" type="Integer" mandatory="true">
- <description>
- The ID of application that relates to this button-subscription status change.
- </description>
+ <description>The ID of the application requesting this button unsubscription. </description>
+ </param>
+ <param name="buttonName" type="Common.ButtonName" mandatory="true">
+ <description>Name of the button to unsubscribe from.</description>
</param>
</function>
+ <function name="UnsubscribeButton" messagetype="response"></function>
</interface>
<interface name="BasicCommunication" version="2.2.0" date="2021-04-14">
@@ -4783,6 +4789,27 @@
</function>
<function name="DialNumber" messagetype="response">
</function>
+ <function name="OnResetTimeout" messagetype="notification">
+ <description>
+ HMI must send this notification to SDL for method instance for which timeout needs to be reset
+ </description>
+ <param name="requestID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>
+ Id between HMI and SDL which SDL used to send the request for method in question, for which timeout needs to be reset.
+ </description>
+ </param>
+ <param name="methodName" type="String" mandatory="true">
+ <description>
+ Name of the function for which timeout needs to be reset
+ </description>
+ </param>
+ <param name="resetPeriod" type="Integer" minvalue="0" maxvalue="1000000" mandatory="false">
+ <description>
+ Timeout period in milliseconds, for the method for which timeout needs to be reset.
+ If omitted, timeout would be reset by defaultTimeout specified in smartDeviceLink.ini
+ </description>
+ </param>
+ </function>
<!-- Policies -->
<!-- SyncP RPC-->
@@ -5317,18 +5344,6 @@
</function>
<function name="SetGlobalProperties" messagetype="response">
</function>
- <function name="OnResetTimeout" messagetype="notification">
- <description>
- Sender: HMI->SDL. HMI must send this notification every 10 sec. in case the 'methodName'
- results long processing on HMI
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that concerns the 'methodName'.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>The name of the method, the renew of timeout is required for</description>
- </param>
- </function>
</interface>
<interface name="UI" version="1.5.0" date="2021-04-14">
@@ -6028,15 +6043,6 @@
<function name="ClosePopUp" messagetype="response">
<description>Provides the result of operation.</description>
</function>
- <function name="OnResetTimeout" messagetype="notification">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that invoked notifcation.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>Currently used method name on which was triggered action</description>
- </param>
- </function>
<function name="OnRecordStart" messagetype="notification">
<description>Issued by SDL to notify HMI about capturing mic data should be started</description>
<param name="appID" type="Integer" mandatory="true">
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index 50c9fce20a..f4da8ded48 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -102,7 +102,7 @@ collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
add_library("MediaManager" ${SOURCES})
target_link_libraries("MediaManager" ${LIBRARIES})
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries("MediaManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
index 9e0a8b5123..5ecb1a6b4a 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
@@ -53,7 +53,6 @@ class FromMicRecorderAdapter : public MediaAdapterImpl {
void StopActivity(int32_t application_key);
bool is_app_performing_activity(int32_t application_key) const;
void set_output_file(const std::string& output_file);
- DEPRECATED void set_duration(int32_t duration);
void set_config(mobile_apis::SamplingRate::eType sampling_rate,
mobile_apis::BitsPerSample::eType bits_per_sample,
mobile_apis::AudioType::eType audio_type,
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index 3e24212ed5..faa51feec9 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -60,13 +60,6 @@ class MediaManagerImpl : public MediaManager,
const MediaManagerSettings& settings);
virtual ~MediaManagerImpl();
- virtual void PlayA2DPSource(int32_t application_key);
- virtual void StopA2DPSource(int32_t application_key);
-
- DEPRECATED virtual void StartMicrophoneRecording(
- int32_t application_key,
- const std::string& outputFileName,
- int32_t duration);
virtual void StartMicrophoneRecording(
int32_t application_key,
const std::string& outputFileName,
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
index 68018028ae..911ef239cc 100644
--- a/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
+++ b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
@@ -108,10 +108,6 @@ void FromMicRecorderAdapter::set_output_file(const std::string& output_file) {
output_file_ = output_file;
}
-void FromMicRecorderAdapter::set_duration(int32_t duration) {
- duration_ = duration;
-}
-
void FromMicRecorderAdapter::set_config(
mobile_apis::SamplingRate::eType sampling_rate,
mobile_apis::BitsPerSample::eType bits_per_sample,
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
index d2634214fa..310fca7aa3 100644
--- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -111,7 +111,7 @@ void FromMicToFileRecorderThread::deinitArgs() {
SDL_LOG_AUTO_TRACE();
if (argv_) {
- for (int32_t i = 0; i < argc_; i++) {
+ for (int32_t i = 0; i < argc_; ++i) {
delete[] argv_[i];
}
delete[] argv_;
@@ -164,7 +164,7 @@ void FromMicToFileRecorderThread::threadMain() {
// g_option_context_parse() modifies params, so keep argc_ and argv_
int32_t argc = argc_;
gchar** argv = new gchar*[argc];
- for (int32_t i = 0; i < argc; i++) {
+ for (int32_t i = 0; i < argc; ++i) {
argv[i] = argv_[i];
}
@@ -366,7 +366,7 @@ void FromMicToFileRecorderThread::exitThreadMain() {
if (sleepThread_) {
SDL_LOG_DEBUG("Stop sleep thread\n");
- sleepThread_->stop();
+ sleepThread_->Stop(threads::Thread::kThreadStopDelegate);
}
SDL_LOG_TRACE("Set should be stopped flag\n");
diff --git a/src/components/media_manager/src/file_streamer_adapter.cc b/src/components/media_manager/src/file_streamer_adapter.cc
index 301b093829..f17d1f89ed 100644
--- a/src/components/media_manager/src/file_streamer_adapter.cc
+++ b/src/components/media_manager/src/file_streamer_adapter.cc
@@ -95,7 +95,7 @@ bool FileStreamerAdapter::FileStreamer::Send(
return false;
}
- SDL_LOG_INFO("Streamer::sent " << msg->data_size());
+ SDL_LOG_TRACE("Streamer::sent " << msg->data_size());
return true;
}
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index 4fc8b38d87..8a73101b47 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -184,39 +184,6 @@ void MediaManagerImpl::Init() {
}
}
-void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
- SDL_LOG_AUTO_TRACE();
-
-#if defined(EXTENDED_MEDIA_MODE)
- if (!a2dp_player_ && protocol_handler_) {
- a2dp_player_ =
- new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer());
- }
-#endif
-
- if (a2dp_player_) {
- a2dp_player_->StartActivity(application_key);
- }
-}
-
-void MediaManagerImpl::StopA2DPSource(int32_t application_key) {
- SDL_LOG_AUTO_TRACE();
- if (a2dp_player_) {
- a2dp_player_->StopActivity(application_key);
- }
-}
-
-void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key,
- const std::string& output_file,
- int32_t duration) {
- StartMicrophoneRecording(application_key,
- output_file,
- duration,
- mobile_apis::SamplingRate::INVALID_ENUM,
- mobile_apis::BitsPerSample::INVALID_ENUM,
- mobile_apis::AudioType::INVALID_ENUM);
-}
-
void MediaManagerImpl::StartMicrophoneRecording(
int32_t application_key,
const std::string& output_file,
diff --git a/src/components/media_manager/src/pipe_streamer_adapter.cc b/src/components/media_manager/src/pipe_streamer_adapter.cc
index 5e4c87c73d..b4e66be483 100644
--- a/src/components/media_manager/src/pipe_streamer_adapter.cc
+++ b/src/components/media_manager/src/pipe_streamer_adapter.cc
@@ -144,7 +144,7 @@ bool PipeStreamerAdapter::PipeStreamer::Send(
// Loop to send remaining data if there is any.
} while (data_remaining);
- SDL_LOG_INFO("Streamer::sent " << msg->data_size());
+ SDL_LOG_TRACE("Streamer::sent " << msg->data_size());
return true;
}
diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc
index 2f10a29c7d..134ccb8038 100644
--- a/src/components/media_manager/src/socket_streamer_adapter.cc
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -149,7 +149,7 @@ bool SocketStreamerAdapter::SocketStreamer::Send(
SDL_LOG_WARN("Couldn't send all the data to socket " << send_socket_fd_);
}
- SDL_LOG_INFO("Streamer::sent " << msg->data_size());
+ SDL_LOG_TRACE("Streamer::sent " << msg->data_size());
return true;
}
diff --git a/src/components/media_manager/src/streamer_adapter.cc b/src/components/media_manager/src/streamer_adapter.cc
index 808b9715af..ad61ac1f63 100644
--- a/src/components/media_manager/src/streamer_adapter.cc
+++ b/src/components/media_manager/src/streamer_adapter.cc
@@ -150,7 +150,7 @@ void StreamerAdapter::Streamer::threadMain() {
static int32_t messages_for_session = 0;
++messages_for_session;
- SDL_LOG_DEBUG("Handling map streaming message. This is "
+ SDL_LOG_TRACE("Handling map streaming message. This is "
<< messages_for_session << " message for "
<< adapter_->current_application_);
std::set<MediaListenerPtr>::iterator it =
diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt
index 265a62a0d8..1b74554fb1 100644
--- a/src/components/media_manager/test/CMakeLists.txt
+++ b/src/components/media_manager/test/CMakeLists.txt
@@ -69,6 +69,6 @@ endif()
create_test("media_manager_test" "${SOURCES}" "${LIBRARIES}")
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries("media_manager_test" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
index ab0a9cf494..8cca2ad995 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -279,21 +279,6 @@ TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
InitMediaManagerFileServerType();
}
-TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
- // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
- MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
- EXPECT_CALL(*media_adapter_mock, StartActivity(kApplicationKey));
- media_manager_impl_->PlayA2DPSource(kApplicationKey);
-}
-
-TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
- MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
- EXPECT_CALL(*media_adapter_mock, StopActivity(kApplicationKey));
- media_manager_impl_->StopA2DPSource(kApplicationKey);
-}
-
TEST_F(MediaManagerImplTest,
StartMicrophoneRecording_SourceFileIsWritable_ExpectTrue) {
StartMicrophoneCheckHelper();
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index 361c48a598..0e3735093f 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -128,11 +128,11 @@ target_link_libraries(PolicyStatic ${LIBRARIES})
add_library(Policy SHARED "src/policy_manager_impl.cc")
target_link_libraries(Policy PolicyStatic)
-if (ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries(Policy log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_custom_target(copy_library_Policy ALL
+add_custom_target(copy_policy_library ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${library_name}
${copy_destination}
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 813af17b3f..2be8183bfa 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
@@ -791,14 +791,6 @@ class PolicyManagerImpl : public PolicyManager {
const PolicySettings& get_settings() const OVERRIDE;
/**
- * @brief Finds the next URL that must be sent on OnSystemRequest retry
- * @param urls vector of vectors that contain urls for each application
- * @return Pair of policy application id and application url id from the
- * urls vector
- */
- DEPRECATED AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
-
- /**
* @brief Checks if there is existing URL in the EndpointUrls vector with
* index saved in the policy manager and if not, it moves to the next
* application index
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 d6aa007ac1..75920be58c 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -1596,7 +1596,6 @@ void PolicyManagerImpl::GetPermissionsForApp(
FillFunctionalGroupPermissions(
all_disallowed, group_names, kGroupDisallowed, permissions);
}
- return;
}
std::string& PolicyManagerImpl::GetCurrentDeviceId(
@@ -2144,18 +2143,6 @@ void PolicyManagerImpl::SetDecryptedCertificate(
cache_->SetDecryptedCertificate(certificate);
}
-AppIdURL PolicyManagerImpl::GetNextUpdateUrl(const EndpointUrls& urls) {
- SDL_LOG_AUTO_TRACE();
-
- const AppIdURL next_app_url = RetrySequenceUrl(retry_sequence_url_, urls);
-
- retry_sequence_url_.url_idx_ = next_app_url.second + 1;
- retry_sequence_url_.app_idx_ = next_app_url.first;
- retry_sequence_url_.policy_app_id_ = urls[next_app_url.first].app_id;
-
- return next_app_url;
-}
-
AppIdURL PolicyManagerImpl::RetrySequenceUrl(const struct RetrySequenceURL& rs,
const EndpointUrls& urls) const {
uint32_t url_idx = rs.url_idx_;
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 47c4202de0..9e056752a8 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -19,7 +19,9 @@ std::string PolicyTableTypeToString(const PolicyTableType pt_type) {
case PT_SNAPSHOT: {
return "PT_SNAPSHOT";
}
- default: { return "INVALID_PT_TYPE"; }
+ default: {
+ return "INVALID_PT_TYPE";
+ }
}
}
@@ -1641,7 +1643,7 @@ AppLevel::AppLevel(const Json::Value* value__)
impl::ValueMember(value__, "count_of_rpcs_sent_in_hmi_none"))
, count_of_removals_for_bad_behavior(
impl::ValueMember(value__, "count_of_removals_for_bad_behavior"))
- , count_of_tls_errors(impl::ValueMember(value__, "count_of_tls_errors"))
+ , count_of_tls_errors(impl::ValueMember(value__, "count_of_TLS_errors"))
, count_of_run_attempts_while_revoked(
impl::ValueMember(value__, "count_of_run_attempts_while_revoked")) {}
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 519e51dde5..c5fc3a9e92 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -400,8 +400,8 @@ const std::string kCreateSchema =
" ON `endpoint`(`application_id` COLLATE NOCASE); "
/*endpoint properties*/
"CREATE TABLE IF NOT EXISTS `endpoint_properties`( "
- " `service` VARCHAR(100) NOT NULL, "
- " `version` VARCHAR(100) NOT NULL "
+ " `service` VARCHAR(100) PRIMARY KEY NOT NULL, "
+ " `version` VARCHAR(100) "
");"
"CREATE TABLE IF NOT EXISTS `message`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
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 d4458ef2a5..3309893db0 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -530,9 +530,13 @@ void SQLPTRepresentation::GatherModuleConfig(
} else {
while (endpoint_properties.Next()) {
const std::string& service = endpoint_properties.GetString(0);
- const std::string& version = endpoint_properties.GetString(1);
auto& ep_properties = (*config->endpoint_properties);
- *ep_properties[service].version = version;
+ if (!endpoint_properties.IsNull(1)) {
+ const std::string& version = endpoint_properties.GetString(1);
+ *ep_properties[service].version = version;
+ } else {
+ ep_properties[service].version = rpc::Optional<rpc::String<0, 100> >();
+ }
}
}
@@ -1581,7 +1585,9 @@ bool SQLPTRepresentation::SaveServiceEndpointProperties(
for (auto& endpoint_property : endpoint_properties) {
query.Bind(0, endpoint_property.first);
- query.Bind(1, endpoint_property.second.version);
+ endpoint_property.second.version.is_initialized()
+ ? query.Bind(1, *endpoint_property.second.version)
+ : query.Bind(1);
if (!query.Exec() || !query.Reset()) {
SDL_LOG_WARN(
diff --git a/src/components/policy/policy_external/test/boostlogconfig.ini b/src/components/policy/policy_external/test/boostlogconfig.ini
new file mode 100644
index 0000000000..5cf35d0e7a
--- /dev/null
+++ b/src/components/policy/policy_external/test/boostlogconfig.ini
@@ -0,0 +1,46 @@
+# Core settings
+[Core]
+DisableLogging=false
+
+# Console Logging (Only ERROR and FATAL messages are logged to console)
+[Sinks.Console]
+DisableLogging=false
+Destination=Console
+Filter="%Severity% >= error"
+Format="%Severity% [%TimeStamp%][%Component%] %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# SDL log file
+[Sinks.AllMessages]
+DisableLogging=false
+Destination=TextFile
+FileName=SmartDeviceLinkCore.log
+Append=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for all SQLPTRepresentation messages
+[Sinks.SQLPTRepresentation]
+DisableLogging=false
+Destination=TextFile
+FileName="SQLRepresentation_%Y-%m-%d.log"
+RotationTimePoint="00:00:00"
+Append=false
+Filter="%Trace% contains SQLPTRepresentation"
+Format="%Severity% [%TimeStamp%] :%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for all PolicyManagerImpl messages
+[Sinks.PolicyManagerImpl]
+DisableLogging=false
+Destination=TextFile
+FileName="PolicyManagerImpl_%Y-%m-%d.log"
+RotationTimePoint="00:00:00"
+Append=false
+Filter="%Trace% contains PolicyManagerImpl"
+Format="%Severity% [%TimeStamp%] :%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
index c949575190..087da1e93b 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_initial.json
@@ -56,12 +56,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Grant requested",
- "line2" : "permission(s)?",
- "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."
- },
"en-us" :
{
"line1" : "Grant Requested",
@@ -69,13 +63,6 @@
"textBody" : "The %appName% App is requesting permission to use the following: %functionalGroupLabels%.\r\n\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. I agree and consent.",
"tts" : "%appName% is requesting permission to use the following: %functionalGroupLabels%.\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. Please press yes to allow or no to deny."
},
- "es-en" :
- {
- "line1" : "¿Otorgar permiso(s)",
- "line2" : "solicitado(s)?",
- "textBody" : "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior.",
- "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."
- },
"es-es" :
{
"line1" : "¿Conceder permisos",
@@ -180,18 +167,10 @@
{
"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."
@@ -266,18 +245,10 @@
{
"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."
@@ -356,23 +327,12 @@
"textBody" : "This version of %appName% is not authorized and will not work with SYNC.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "en-ie" :
- {
- "line1" : "not authorized",
- "tts" : "This version of %appName% is not authorized and will not work with SYNC."
- },
"en-us" :
{
"line1" : "Not Authorized",
"textBody" : "This version of %appName% is no longer authorized to work with Mobile Apps. Please update to the latest version of %appName%.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "es-en" :
- {
- "line1" : "no autorizada",
- "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
"es-es" :
{
"line1" : "No autorizada",
@@ -467,23 +427,12 @@
"textBody" : "This version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "en-ie" :
- {
- "line1" : "not supported",
- "tts" : "This version of %appName% is not supported by SYNC."
- },
"en-us" :
{
"line1" : "Not Supported",
"textBody" : "Your version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "es-en" :
- {
- "line1" : "no compatible",
- "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
- "tts" : "Esta versión de %appName% no es compatible con SYNC."
- },
"es-es" :
{
"line1" : "No compatible",
@@ -623,12 +572,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Disable auto-updates",
- "line2" : "and Mobile Apps?",
- "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."
- },
"en-us" :
{
"line1" : "Disable Auto-Updates",
@@ -636,13 +579,6 @@
"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.",
"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."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"line1" : "¿Desact. actual. auto",
@@ -751,23 +687,12 @@
"textBody" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
"tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
},
- "en-ie" :
- {
- "label" : "Driving characteristics",
- "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
"en-us" :
{
"label" : "Driving Characteristics",
"textBody" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
"tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
},
- "es-en" :
- {
- "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.",
- "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
"es-es" :
{
"label" : "Características de conducción",
@@ -863,23 +788,12 @@
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "en-ie" :
- {
- "label" : "GPS and speed",
- "tts" : "An app can access vehicle GPS and speed."
- },
"en-us" :
{
"label" : "GPS and Speed",
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "es-en" :
- {
- "label" : "GPS y velocidad",
- "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
"es-es" :
{
"label" : "GPS y velocidad",
@@ -974,23 +888,12 @@
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "en-ie" :
- {
- "label" : "Push notifications",
- "tts" : "An app can send notifications when running in the background."
- },
"en-us" :
{
"label" : "Push Notifications",
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "es-en" :
- {
- "label" : "Notificaciones tipo Push",
- "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
"es-es" :
{
"label" : "Notificaciones push",
@@ -1100,20 +1003,11 @@
{
"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."
@@ -1190,18 +1084,10 @@
{
"line1" : "Enable Apps"
},
- "en-ie" :
- {
- "line1" : "Enable Apps"
- },
"en-us" :
{
"line1" : "Enable Apps"
},
- "es-en" :
- {
- "line1" : "Hab. aplic."
- },
"es-es" :
{
"line1" : "Activar apl."
@@ -1277,20 +1163,11 @@
{
"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."
@@ -1368,20 +1245,11 @@
"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"
@@ -1459,20 +1327,11 @@
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "en-ie" :
- {
- "line1" : "Updating..."
- },
"en-us" :
{
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "es-en" :
- {
- "line1" : "Actualizando...",
- "textBody" : "Actualizando..."
- },
"es-es" :
{
"line1" : "Actualizando..."
@@ -1550,20 +1409,11 @@
"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"
@@ -1644,23 +1494,12 @@
"textBody" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
"tts" : "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" :
- {
- "label" : "Vehicle information",
- "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
- },
"en-us" :
{
"label" : "Vehicle Information",
"textBody" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
"tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"label" : "Información del vehículo",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
index 81c2093c72..43c16f18b8 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_for_merge_latest.json
@@ -56,12 +56,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Grant requested",
- "line2" : "permission(s)?",
- "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."
- },
"en-us" :
{
"line1" : "Grant Requested",
@@ -69,13 +63,6 @@
"textBody" : "The %appName% App is requesting permission to use the following: %functionalGroupLabels%.\r\n\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. I agree and consent.",
"tts" : "%appName% is requesting permission to use the following: %functionalGroupLabels%.\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. Please press yes to allow or no to deny."
},
- "es-en" :
- {
- "line1" : "¿Otorgar permiso(s)",
- "line2" : "solicitado(s)?",
- "textBody" : "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior.",
- "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."
- },
"es-es" :
{
"line1" : "¿Conceder permisos",
@@ -180,18 +167,10 @@
{
"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."
@@ -266,18 +245,10 @@
{
"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."
@@ -356,23 +327,12 @@
"textBody" : "This version of %appName% is not authorized and will not work with SYNC.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "en-ie" :
- {
- "line1" : "not authorized",
- "tts" : "This version of %appName% is not authorized and will not work with SYNC."
- },
"en-us" :
{
"line1" : "Not Authorized",
"textBody" : "This version of %appName% is no longer authorized to work with Mobile Apps. Please update to the latest version of %appName%.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "es-en" :
- {
- "line1" : "no autorizada",
- "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
"es-es" :
{
"line1" : "No autorizada",
@@ -467,23 +427,12 @@
"textBody" : "This version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "en-ie" :
- {
- "line1" : "not supported",
- "tts" : "This version of %appName% is not supported by SYNC."
- },
"en-us" :
{
"line1" : "Not Supported",
"textBody" : "Your version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "es-en" :
- {
- "line1" : "no compatible",
- "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
- "tts" : "Esta versión de %appName% no es compatible con SYNC."
- },
"es-es" :
{
"line1" : "No compatible",
@@ -623,12 +572,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Disable auto-updates",
- "line2" : "and Mobile Apps?",
- "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."
- },
"en-us" :
{
"line1" : "Disable Auto-Updates",
@@ -636,13 +579,6 @@
"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.",
"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."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"line1" : "¿Desact. actual. auto",
@@ -751,23 +687,12 @@
"textBody" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
"tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
},
- "en-ie" :
- {
- "label" : "Driving characteristics",
- "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
"en-us" :
{
"label" : "Driving Characteristics",
"textBody" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
"tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
},
- "es-en" :
- {
- "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.",
- "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
"es-es" :
{
"label" : "Características de conducción",
@@ -863,23 +788,12 @@
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "en-ie" :
- {
- "label" : "GPS and speed",
- "tts" : "An app can access vehicle GPS and speed."
- },
"en-us" :
{
"label" : "GPS and Speed",
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "es-en" :
- {
- "label" : "GPS y velocidad",
- "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
"es-es" :
{
"label" : "GPS y velocidad",
@@ -974,23 +888,12 @@
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "en-ie" :
- {
- "label" : "Push notifications",
- "tts" : "An app can send notifications when running in the background."
- },
"en-us" :
{
"label" : "Push Notifications",
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "es-en" :
- {
- "label" : "Notificaciones tipo Push",
- "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
"es-es" :
{
"label" : "Notificaciones push",
@@ -1100,20 +1003,11 @@
{
"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."
@@ -1190,18 +1084,10 @@
{
"line1" : "Enable Apps"
},
- "en-ie" :
- {
- "line1" : "Enable Apps"
- },
"en-us" :
{
"line1" : "Enable Apps"
},
- "es-en" :
- {
- "line1" : "Hab. aplic."
- },
"es-es" :
{
"line1" : "Activar apl."
@@ -1277,20 +1163,11 @@
{
"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."
@@ -1368,20 +1245,11 @@
"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"
@@ -1459,20 +1327,11 @@
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "en-ie" :
- {
- "line1" : "Updating..."
- },
"en-us" :
{
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "es-en" :
- {
- "line1" : "Actualizando...",
- "textBody" : "Actualizando..."
- },
"es-es" :
{
"line1" : "Actualizando..."
@@ -1550,20 +1409,11 @@
"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"
@@ -1644,23 +1494,12 @@
"textBody" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
"tts" : "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" :
- {
- "label" : "Vehicle information",
- "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
- },
"en-us" :
{
"label" : "Vehicle Information",
"textBody" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
"tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"label" : "Información del vehículo",
diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
index 1adf9ae7c6..548b6f3666 100644
--- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
@@ -48,7 +48,6 @@
#include "policy/sql_wrapper.h"
#include "rpc_base/rpc_base.h"
#include "utils/file_system.h"
-#include "utils/system.h"
namespace policy_table = rpc::policy_table_interface_base;
using policy::CheckPermissionResult;
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index e14057ec89..39c520a0e3 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -85,7 +85,6 @@ generate_policy_types("${GENERATED_HMI_POLICY_TYPES}"
set(POLICY_TABLE_PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include/policy/policy_table
${CMAKE_CURRENT_SOURCE_DIR}/src/policy_table
- ${CMAKE_CURRENT_BINARY_DIR}/
)
set(POLICY_TABLE_SOURCES
@@ -124,6 +123,7 @@ set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/src
${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
)
+
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
@@ -142,7 +142,6 @@ else ()
list(APPEND LIBRARIES sqlite3)
endif ()
-
add_library(PolicyStatic ${SOURCES})
target_link_libraries(PolicyStatic ${LIBRARIES})
@@ -150,7 +149,7 @@ target_link_libraries(PolicyStatic ${LIBRARIES})
add_library(Policy SHARED "src/policy_manager_impl.cc")
target_link_libraries(Policy PolicyStatic)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries(Policy log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
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 32c546df62..0d1a61ec89 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
@@ -873,7 +873,6 @@ class PolicyManagerImpl : public PolicyManager {
void ResetTimeout() OVERRIDE;
protected:
-#if defined USE_HMI_PTU_DECRYPTION && defined PROPRIETARY_MODE
/**
* @brief Parse policy table content and convert to PT object
* @param pt_content binary content of PT
@@ -881,15 +880,6 @@ class PolicyManagerImpl : public PolicyManager {
*/
virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
-#else
- /**
- * @brief Parse policy table content and convert to PT object
- * @param pt_content binary content of PT
- * @return pointer to converted PT
- */
- virtual std::shared_ptr<policy_table::Table> ParseArray(
- const BinaryMessage& pt_content);
-#endif
/**
* @brief Getter for policy settings
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 b6101eb960..3a41cfa08b 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -87,8 +87,6 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) {
update_status_manager_.set_listener(listener);
}
-#if defined USE_HMI_PTU_DECRYPTION && defined PROPRIETARY_MODE
-
std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
@@ -96,23 +94,8 @@ std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
Json::Value value;
if (reader.parse(json, &value)) {
- return std::make_shared<policy_table::Table>(&value);
- } else {
- return std::make_shared<policy_table::Table>();
- }
-}
-
-#else
-
-std::shared_ptr<policy_table::Table> PolicyManagerImpl::ParseArray(
- const BinaryMessage& pt_content) {
- std::string json(pt_content.begin(), pt_content.end());
- utils::JsonReader reader;
- Json::Value value;
-
- if (reader.parse(json, &value)) {
// For PT Update received from SDL Server.
- if (value["data"].size() != 0) {
+ if (value.isObject() && value["data"].isArray() && !value["data"].empty()) {
Json::Value data = value["data"];
return std::make_shared<policy_table::Table>(&data[0]);
} else {
@@ -123,8 +106,6 @@ std::shared_ptr<policy_table::Table> PolicyManagerImpl::ParseArray(
}
}
-#endif
-
void PolicyManagerImpl::CheckTriggers() {
SDL_LOG_AUTO_TRACE();
const bool exceed_ignition_cycles = ExceededIgnitionCycles();
@@ -330,16 +311,7 @@ PolicyManager::PtProcessingResult PolicyManagerImpl::LoadPT(
SDL_LOG_DEBUG(
"PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
-#if defined USE_HMI_PTU_DECRYPTION && defined PROPRIETARY_MODE
- // Assuemes Policy Table was parsed, formatted, and/or decrypted by
- // the HMI after system request before calling OnReceivedPolicyUpdate
- // Parse message into table struct
std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
-#else
- // Message Received from server unecnrypted with PTU in first element
- // of 'data' array. No Parsing was done by HMI.
- std::shared_ptr<policy_table::Table> pt_update = ParseArray(pt_content);
-#endif
if (!pt_update) {
SDL_LOG_WARN("Parsed table pointer is NULL.");
;
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 d2a70baafe..8b937f3142 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -19,7 +19,9 @@ std::string PolicyTableTypeToString(const PolicyTableType pt_type) {
case PT_SNAPSHOT: {
return "PT_SNAPSHOT";
}
- default: { return "INVALID_PT_TYPE"; }
+ default: {
+ return "INVALID_PT_TYPE";
+ }
}
}
@@ -1457,13 +1459,47 @@ AppLevel::AppLevel(const Json::Value* value__)
impl::ValueMember(value__, "count_of_rpcs_sent_in_hmi_none"))
, count_of_removals_for_bad_behavior(
impl::ValueMember(value__, "count_of_removals_for_bad_behavior"))
- , count_of_tls_errors(impl::ValueMember(value__, "count_of_tls_errors"))
+ , count_of_tls_errors(impl::ValueMember(value__, "count_of_TLS_errors"))
, count_of_run_attempts_while_revoked(
impl::ValueMember(value__, "count_of_run_attempts_while_revoked")) {}
Json::Value AppLevel::ToJsonValue() const {
Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("minutes_in_hmi_full", minutes_in_hmi_full, &result__);
+ impl::WriteJsonField("app_registration_language_gui",
+ app_registration_language_gui,
+ &result__);
+ impl::WriteJsonField("app_registration_language_vui",
+ app_registration_language_vui,
+ &result__);
+ impl::WriteJsonField(
+ "minutes_in_hmi_limited", minutes_in_hmi_limited, &result__);
+ impl::WriteJsonField(
+ "minutes_in_hmi_background", minutes_in_hmi_background, &result__);
+ impl::WriteJsonField("minutes_in_hmi_none", minutes_in_hmi_none, &result__);
+ impl::WriteJsonField(
+ "count_of_user_selections", count_of_user_selections, &result__);
+ impl::WriteJsonField("count_of_rejections_sync_out_of_memory",
+ count_of_rejections_sync_out_of_memory,
+ &result__);
+ impl::WriteJsonField("count_of_rejections_nickname_mismatch",
+ count_of_rejections_nickname_mismatch,
+ &result__);
+ impl::WriteJsonField("count_of_rejections_duplicate_name",
+ count_of_rejections_duplicate_name,
+ &result__);
+ impl::WriteJsonField(
+ "count_of_rejected_rpc_calls", count_of_rejected_rpc_calls, &result__);
+ impl::WriteJsonField("count_of_rpcs_sent_in_hmi_none",
+ count_of_rpcs_sent_in_hmi_none,
+ &result__);
+ impl::WriteJsonField("count_of_removals_for_bad_behavior",
+ count_of_removals_for_bad_behavior,
+ &result__);
impl::WriteJsonField("count_of_TLS_errors", count_of_tls_errors, &result__);
+ impl::WriteJsonField("count_of_run_attempts_while_revoked",
+ count_of_run_attempts_while_revoked,
+ &result__);
return result__;
}
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 ea0b7fe997..a58867966c 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -371,8 +371,8 @@ const std::string kCreateSchema =
/*endpoint properties*/
"CREATE TABLE IF NOT EXISTS `endpoint_properties`( "
- " `service` VARCHAR(100) NOT NULL, "
- " `version` VARCHAR(100) NOT NULL "
+ " `service` VARCHAR(100) PRIMARY KEY NOT NULL, "
+ " `version` VARCHAR(100) "
");"
"CREATE TABLE IF NOT EXISTS `message`( "
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 57781ae16f..1f24ca9472 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -519,9 +519,13 @@ void SQLPTRepresentation::GatherModuleConfig(
} else {
while (endpoint_properties.Next()) {
const std::string& service = endpoint_properties.GetString(0);
- const std::string& version = endpoint_properties.GetString(1);
auto& ep_properties = (*config->endpoint_properties);
- *ep_properties[service].version = version;
+ if (!endpoint_properties.IsNull(1)) {
+ const std::string& version = endpoint_properties.GetString(1);
+ *ep_properties[service].version = version;
+ } else {
+ ep_properties[service].version = rpc::Optional<rpc::String<0, 100> >();
+ }
}
}
@@ -1546,7 +1550,9 @@ bool SQLPTRepresentation::SaveServiceEndpointProperties(
for (auto& endpoint_property : endpoint_properties) {
query.Bind(0, endpoint_property.first);
- query.Bind(1, endpoint_property.second.version);
+ endpoint_property.second.version.is_initialized()
+ ? query.Bind(1, *endpoint_property.second.version)
+ : query.Bind(1);
if (!query.Exec() || !query.Reset()) {
SDL_LOG_WARN(
diff --git a/src/components/policy/policy_regular/test/boostlogconfig.ini b/src/components/policy/policy_regular/test/boostlogconfig.ini
new file mode 100644
index 0000000000..f33da81c93
--- /dev/null
+++ b/src/components/policy/policy_regular/test/boostlogconfig.ini
@@ -0,0 +1,51 @@
+# Core settings
+[Core]
+DisableLogging=false
+
+# Console Logging
+[Sinks.Console]
+DisableLogging=true
+Destination=Console
+Filter="%Severity% > trace"
+Format="%Severity% [%TimeStamp%][%Component%] %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# SDL log file
+[Sinks.AllMessages]
+DisableLogging=false
+Destination=TextFile
+FileName=SmartDeviceLinkCore.log
+Append=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for all TransportManager messages
+[Sinks.TransportManager]
+DisableLogging=false
+Destination=TextFile
+FileName=TransportManager.log
+Append=false
+Filter="%Component% = TransportManager"
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for handling Ford protocol info (include ProtocolHandler, ConnectionHandler, SecurityManager)
+[Sinks.ProtocolFordHandling]
+DisableLogging=false
+Destination=TextFile
+FileName=ProtocolFordHandling.log
+Append=false
+Filter="%Component% = ConnectionHandler or %Component% = HeartBeatMonitor or %Component% = ProtocolHandler or %Component% = SecurityManager"
+Format="%Severity% [%TimeStamp%][%Component%] %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+[Sinks.Telnet]
+DisableLogging=true
+Destination=Syslog
+Asynchronous=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+LocalAddress="http://127.0.0.1:6676/" \ No newline at end of file
diff --git a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
index d17a4b82e4..066ed86727 100644
--- a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
+++ b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_initial.json
@@ -56,12 +56,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Grant requested",
- "line2" : "permission(s)?",
- "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."
- },
"en-us" :
{
"line1" : "Grant Requested",
@@ -69,13 +63,6 @@
"textBody" : "The %appName% App is requesting permission to use the following: %functionalGroupLabels%.\r\n\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. I agree and consent.",
"tts" : "%appName% is requesting permission to use the following: %functionalGroupLabels%.\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. Please press yes to allow or no to deny."
},
- "es-en" :
- {
- "line1" : "¿Otorgar permiso(s)",
- "line2" : "solicitado(s)?",
- "textBody" : "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior.",
- "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."
- },
"es-es" :
{
"line1" : "¿Conceder permisos",
@@ -180,18 +167,10 @@
{
"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."
@@ -266,18 +245,10 @@
{
"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."
@@ -356,23 +327,12 @@
"textBody" : "This version of %appName% is not authorized and will not work with SYNC.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "en-ie" :
- {
- "line1" : "not authorized",
- "tts" : "This version of %appName% is not authorized and will not work with SYNC."
- },
"en-us" :
{
"line1" : "Not Authorized",
"textBody" : "This version of %appName% is no longer authorized to work with Mobile Apps. Please update to the latest version of %appName%.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "es-en" :
- {
- "line1" : "no autorizada",
- "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
"es-es" :
{
"line1" : "No autorizada",
@@ -467,23 +427,12 @@
"textBody" : "This version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "en-ie" :
- {
- "line1" : "not supported",
- "tts" : "This version of %appName% is not supported by SYNC."
- },
"en-us" :
{
"line1" : "Not Supported",
"textBody" : "Your version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "es-en" :
- {
- "line1" : "no compatible",
- "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
- "tts" : "Esta versión de %appName% no es compatible con SYNC."
- },
"es-es" :
{
"line1" : "No compatible",
@@ -623,12 +572,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Disable auto-updates",
- "line2" : "and Mobile Apps?",
- "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."
- },
"en-us" :
{
"line1" : "Disable Auto-Updates",
@@ -636,13 +579,6 @@
"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.",
"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."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"line1" : "¿Desact. actual. auto",
@@ -751,23 +687,12 @@
"textBody" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
"tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
},
- "en-ie" :
- {
- "label" : "Driving characteristics",
- "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
"en-us" :
{
"label" : "Driving Characteristics",
"textBody" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
"tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
},
- "es-en" :
- {
- "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.",
- "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
"es-es" :
{
"label" : "Características de conducción",
@@ -863,23 +788,12 @@
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "en-ie" :
- {
- "label" : "GPS and speed",
- "tts" : "An app can access vehicle GPS and speed."
- },
"en-us" :
{
"label" : "GPS and Speed",
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "es-en" :
- {
- "label" : "GPS y velocidad",
- "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
"es-es" :
{
"label" : "GPS y velocidad",
@@ -974,23 +888,12 @@
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "en-ie" :
- {
- "label" : "Push notifications",
- "tts" : "An app can send notifications when running in the background."
- },
"en-us" :
{
"label" : "Push Notifications",
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "es-en" :
- {
- "label" : "Notificaciones tipo Push",
- "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
"es-es" :
{
"label" : "Notificaciones push",
@@ -1100,20 +1003,11 @@
{
"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."
@@ -1190,18 +1084,10 @@
{
"line1" : "Enable Apps"
},
- "en-ie" :
- {
- "line1" : "Enable Apps"
- },
"en-us" :
{
"line1" : "Enable Apps"
},
- "es-en" :
- {
- "line1" : "Hab. aplic."
- },
"es-es" :
{
"line1" : "Activar apl."
@@ -1277,20 +1163,11 @@
{
"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."
@@ -1368,20 +1245,11 @@
"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"
@@ -1459,20 +1327,11 @@
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "en-ie" :
- {
- "line1" : "Updating..."
- },
"en-us" :
{
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "es-en" :
- {
- "line1" : "Actualizando...",
- "textBody" : "Actualizando..."
- },
"es-es" :
{
"line1" : "Actualizando..."
@@ -1550,20 +1409,11 @@
"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"
@@ -1644,23 +1494,12 @@
"textBody" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
"tts" : "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" :
- {
- "label" : "Vehicle information",
- "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
- },
"en-us" :
{
"label" : "Vehicle Information",
"textBody" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
"tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"label" : "Información del vehículo",
diff --git a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
index 81c2093c72..43c16f18b8 100644
--- a/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
+++ b/src/components/policy/policy_regular/test/json/sdl_preloaded_pt_for_merge_latest.json
@@ -56,12 +56,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Grant requested",
- "line2" : "permission(s)?",
- "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."
- },
"en-us" :
{
"line1" : "Grant Requested",
@@ -69,13 +63,6 @@
"textBody" : "The %appName% App is requesting permission to use the following: %functionalGroupLabels%.\r\n\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. I agree and consent.",
"tts" : "%appName% is requesting permission to use the following: %functionalGroupLabels%.\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. Please press yes to allow or no to deny."
},
- "es-en" :
- {
- "line1" : "¿Otorgar permiso(s)",
- "line2" : "solicitado(s)?",
- "textBody" : "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior.",
- "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."
- },
"es-es" :
{
"line1" : "¿Conceder permisos",
@@ -180,18 +167,10 @@
{
"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."
@@ -266,18 +245,10 @@
{
"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."
@@ -356,23 +327,12 @@
"textBody" : "This version of %appName% is not authorized and will not work with SYNC.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "en-ie" :
- {
- "line1" : "not authorized",
- "tts" : "This version of %appName% is not authorized and will not work with SYNC."
- },
"en-us" :
{
"line1" : "Not Authorized",
"textBody" : "This version of %appName% is no longer authorized to work with Mobile Apps. Please update to the latest version of %appName%.",
"tts" : "This version of %appName% is not authorized and will not work with SYNC."
},
- "es-en" :
- {
- "line1" : "no autorizada",
- "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
"es-es" :
{
"line1" : "No autorizada",
@@ -467,23 +427,12 @@
"textBody" : "This version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "en-ie" :
- {
- "line1" : "not supported",
- "tts" : "This version of %appName% is not supported by SYNC."
- },
"en-us" :
{
"line1" : "Not Supported",
"textBody" : "Your version of %appName% is not supported by SYNC.",
"tts" : "This version of %appName% is not supported by SYNC."
},
- "es-en" :
- {
- "line1" : "no compatible",
- "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
- "tts" : "Esta versión de %appName% no es compatible con SYNC."
- },
"es-es" :
{
"line1" : "No compatible",
@@ -623,12 +572,6 @@
"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.",
"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."
},
- "en-ie" :
- {
- "line1" : "Disable auto-updates",
- "line2" : "and Mobile Apps?",
- "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."
- },
"en-us" :
{
"line1" : "Disable Auto-Updates",
@@ -636,13 +579,6 @@
"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.",
"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."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"line1" : "¿Desact. actual. auto",
@@ -751,23 +687,12 @@
"textBody" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
"tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
},
- "en-ie" :
- {
- "label" : "Driving characteristics",
- "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
"en-us" :
{
"label" : "Driving Characteristics",
"textBody" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
"tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
},
- "es-en" :
- {
- "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.",
- "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
"es-es" :
{
"label" : "Características de conducción",
@@ -863,23 +788,12 @@
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "en-ie" :
- {
- "label" : "GPS and speed",
- "tts" : "An app can access vehicle GPS and speed."
- },
"en-us" :
{
"label" : "GPS and Speed",
"textBody" : "An app can access vehicle GPS and speed.",
"tts" : "An app can access vehicle GPS and speed."
},
- "es-en" :
- {
- "label" : "GPS y velocidad",
- "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
"es-es" :
{
"label" : "GPS y velocidad",
@@ -974,23 +888,12 @@
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "en-ie" :
- {
- "label" : "Push notifications",
- "tts" : "An app can send notifications when running in the background."
- },
"en-us" :
{
"label" : "Push Notifications",
"textBody" : "An app can send notifications when running in the background.",
"tts" : "An app can send notifications when running in the background."
},
- "es-en" :
- {
- "label" : "Notificaciones tipo Push",
- "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
"es-es" :
{
"label" : "Notificaciones push",
@@ -1100,20 +1003,11 @@
{
"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."
@@ -1190,18 +1084,10 @@
{
"line1" : "Enable Apps"
},
- "en-ie" :
- {
- "line1" : "Enable Apps"
- },
"en-us" :
{
"line1" : "Enable Apps"
},
- "es-en" :
- {
- "line1" : "Hab. aplic."
- },
"es-es" :
{
"line1" : "Activar apl."
@@ -1277,20 +1163,11 @@
{
"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."
@@ -1368,20 +1245,11 @@
"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"
@@ -1459,20 +1327,11 @@
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "en-ie" :
- {
- "line1" : "Updating..."
- },
"en-us" :
{
"line1" : "Updating...",
"textBody" : "Updating..."
},
- "es-en" :
- {
- "line1" : "Actualizando...",
- "textBody" : "Actualizando..."
- },
"es-es" :
{
"line1" : "Actualizando..."
@@ -1550,20 +1409,11 @@
"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"
@@ -1644,23 +1494,12 @@
"textBody" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
"tts" : "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" :
- {
- "label" : "Vehicle information",
- "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
- },
"en-us" :
{
"label" : "Vehicle Information",
"textBody" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
"tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
},
- "es-en" :
- {
- "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.",
- "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."
- },
"es-es" :
{
"label" : "Información del vehículo",
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
index 02c96fc3c7..b036735216 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -462,11 +462,6 @@ class ProtocolHandlerImpl
* Only valid when generated_session_id is 0. Note, even if
* generated_session_id is 0, the list may be empty.
*/
- DEPRECATED
- void NotifySessionStarted(const SessionContext& context,
- std::vector<std::string>& rejected_params,
- const std::string err_reason) OVERRIDE;
-
void NotifySessionStarted(SessionContext& context,
std::vector<std::string>& rejected_params,
const std::string err_reason) OVERRIDE;
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index 78f324e0ae..87369c0793 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -149,8 +149,6 @@ bool HandshakeHandler::OnHandshakeDone(
return "Certificate is not signed";
case security_manager::SSLContext::Handshake_Result_AppIDMismatch:
return "Trying to run handshake with wrong app id";
- case security_manager::SSLContext::Handshake_Result_AppNameMismatch:
- return "Trying to run handshake with wrong app name";
case security_manager::SSLContext::Handshake_Result_AbnormalFail:
return "Error occurred during handshake";
case security_manager::SSLContext::Handshake_Result_Fail:
diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc
index 08997acaac..c7a3f095a8 100644
--- a/src/components/protocol_handler/src/incoming_data_handler.cc
+++ b/src/components/protocol_handler/src/incoming_data_handler.cc
@@ -63,8 +63,8 @@ ProtocolFramePtrList IncomingDataHandler::ProcessData(
out_result = RESULT_FAIL;
return ProtocolFramePtrList();
}
- SDL_LOG_INFO("Processing incoming data of size "
- << tm_message_size << " for connection " << connection_id);
+ SDL_LOG_TRACE("Processing incoming data of size "
+ << tm_message_size << " for connection " << connection_id);
ConnectionsDataMap::iterator it = connections_data_.find(connection_id);
if (connections_data_.end() == it) {
SDL_LOG_WARN("ProcessData requested for unknown connection");
@@ -73,16 +73,16 @@ ProtocolFramePtrList IncomingDataHandler::ProcessData(
}
std::vector<uint8_t>& connection_data = it->second;
connection_data.insert(connection_data.end(), data, data + tm_message_size);
- SDL_LOG_DEBUG("Total data size for connection " << connection_id << " is "
+ SDL_LOG_TRACE("Total data size for connection " << connection_id << " is "
<< connection_data.size());
ProtocolFramePtrList out_frames;
*malformed_occurrence = 0;
out_result = CreateFrame(
connection_data, out_frames, *malformed_occurrence, connection_id);
- SDL_LOG_DEBUG("New data size for connection " << connection_id << " is "
+ SDL_LOG_TRACE("New data size for connection " << connection_id << " is "
<< connection_data.size());
if (!out_frames.empty()) {
- SDL_LOG_INFO("Created and passed " << out_frames.size() << " packets");
+ SDL_LOG_TRACE("Created and passed " << out_frames.size() << " packets");
} else {
if (RESULT_DEFERRED == out_result) {
SDL_LOG_DEBUG(
@@ -156,7 +156,7 @@ RESULT_CODE IncomingDataHandler::CreateFrame(
<< std::hex << static_cast<const void*>(&*data_it));
continue;
}
- SDL_LOG_DEBUG("Payload size " << header_.dataSize);
+ SDL_LOG_TRACE("Payload size " << header_.dataSize);
const uint32_t packet_size = GetPacketSize(header_);
if (packet_size == 0) {
SDL_LOG_WARN("Null packet size");
@@ -167,14 +167,14 @@ RESULT_CODE IncomingDataHandler::CreateFrame(
continue;
}
if (data_size < packet_size) {
- SDL_LOG_DEBUG("Packet data is not available yet");
+ SDL_LOG_TRACE("Packet data is not available yet");
incoming_data.erase(incoming_data.begin(), data_it);
return RESULT_DEFERRED;
}
ProtocolFramePtr frame(new protocol_handler::ProtocolPacket(connection_id));
const RESULT_CODE deserialize_result =
frame->deserializePacket(&*data_it, packet_size);
- SDL_LOG_DEBUG("Deserialized frame " << frame);
+ SDL_LOG_TRACE("Deserialized frame " << frame);
if (deserialize_result != RESULT_OK) {
SDL_LOG_WARN("Packet deserialization failed");
incoming_data.erase(incoming_data.begin(), data_it);
@@ -183,7 +183,7 @@ RESULT_CODE IncomingDataHandler::CreateFrame(
out_frames.push_back(frame);
last_portion_of_data_was_malformed_ = false;
- SDL_LOG_DEBUG("Frame added. "
+ SDL_LOG_TRACE("Frame added. "
<< "Connection ID " << connection_id);
data_it += packet_size;
diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc
index 0cffe724c7..b66ce9b911 100644
--- a/src/components/protocol_handler/src/multiframe_builder.cc
+++ b/src/components/protocol_handler/src/multiframe_builder.cc
@@ -91,8 +91,8 @@ bool MultiFrameBuilder::RemoveConnection(const ConnectionID connection_id) {
ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
SDL_LOG_AUTO_TRACE();
sync_primitives::AutoLock lock(multiframes_map_lock_);
- SDL_LOG_DEBUG("Current state is: " << multiframes_map_);
- SDL_LOG_DEBUG("Current multiframe map size is: " << multiframes_map_.size());
+ SDL_LOG_TRACE("Current state is: " << multiframes_map_);
+ SDL_LOG_TRACE("Current multiframe map size is: " << multiframes_map_.size());
ProtocolFramePtrList outpute_frame_list;
for (MultiFrameMap::iterator connection_it = multiframes_map_.begin();
connection_it != multiframes_map_.end();
@@ -115,7 +115,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
if (frame && frame->frame_data() == FRAME_DATA_LAST_CONSECUTIVE &&
frame->payload_size() > 0u) {
- SDL_LOG_DEBUG("Ready frame: " << frame);
+ SDL_LOG_TRACE("Ready frame: " << frame);
outpute_frame_list.push_back(frame);
messageId_map.erase(messageId_it++);
continue;
@@ -136,7 +136,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
} // iteration over messageId_map
} // iteration over session_map
} // iteration over multiframes_map_
- SDL_LOG_DEBUG("Result frames count: " << outpute_frame_list.size());
+ SDL_LOG_TRACE("Result frames count: " << outpute_frame_list.size());
return outpute_frame_list;
}
@@ -164,8 +164,8 @@ RESULT_CODE MultiFrameBuilder::AddFrame(const ProtocolFramePtr packet) {
RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) {
DCHECK_OR_RETURN(packet->frame_type() == FRAME_TYPE_FIRST, RESULT_FAIL);
sync_primitives::AutoLock lock(multiframes_map_lock_);
- SDL_LOG_DEBUG("Waiting : " << multiframes_map_);
- SDL_LOG_DEBUG("Handling FIRST frame: " << packet);
+ SDL_LOG_TRACE("Waiting : " << multiframes_map_);
+ SDL_LOG_TRACE("Handling FIRST frame: " << packet);
if (packet->payload_size() != 0u) {
SDL_LOG_ERROR("First frame shall have no data:" << packet);
return RESULT_FAIL;
@@ -193,10 +193,11 @@ RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) {
return RESULT_FAIL;
}
- SDL_LOG_DEBUG("Start waiting frames for connection_id: "
+ SDL_LOG_TRACE("Start waiting frames for connection_id: "
<< connection_id
<< ", session_id: " << static_cast<int>(session_id)
<< ", message_id: " << message_id);
+ packet->set_frame_data(FRAME_DATA_FIRST);
messageId_map[message_id] = {packet, date_time::getCurrentTime()};
return RESULT_OK;
}
@@ -240,7 +241,7 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame(
if (is_last_consecutive) {
// TODO(EZamakhov): implement count of frames and result size verification
- SDL_LOG_DEBUG("Last CONSECUTIVE frame");
+ SDL_LOG_TRACE("Last CONSECUTIVE frame");
} else {
uint8_t previous_frame_data = assembling_frame->frame_data();
if (previous_frame_data == std::numeric_limits<uint8_t>::max()) {
@@ -275,8 +276,8 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame(
SDL_LOG_ERROR("Failed to append frame for multiframe message.");
return RESULT_FAIL;
}
- SDL_LOG_INFO("Assembled frame with payload size: "
- << assembling_frame->payload_size());
+ SDL_LOG_TRACE("Assembled frame with payload size: "
+ << assembling_frame->payload_size());
frame_data.append_time = date_time::getCurrentTime();
return RESULT_OK;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 525e825d84..7b5d9901ea 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -371,7 +371,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
BsonArray secondaryTransportsArr;
bson_array_initialize(&secondaryTransportsArr,
secondaryTransports.size());
- for (unsigned int i = 0; i < secondaryTransports.size(); i++) {
+ for (unsigned int i = 0; i < secondaryTransports.size(); ++i) {
char secondaryTransport[255];
strncpy(secondaryTransport,
secondaryTransports[i].c_str(),
@@ -389,7 +389,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
BsonArray audioServiceTransportsArr;
bson_array_initialize(&audioServiceTransportsArr,
audioServiceTransports.size());
- for (unsigned int i = 0; i < audioServiceTransports.size(); i++) {
+ for (unsigned int i = 0; i < audioServiceTransports.size(); ++i) {
SDL_LOG_DEBUG("Adding " << audioServiceTransports[i]
<< " to audioServiceTransports parameter "
"of StartSessionAck");
@@ -403,7 +403,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
BsonArray videoServiceTransportsArr;
bson_array_initialize(&videoServiceTransportsArr,
videoServiceTransports.size());
- for (unsigned int i = 0; i < videoServiceTransports.size(); i++) {
+ for (unsigned int i = 0; i < videoServiceTransports.size(); ++i) {
SDL_LOG_DEBUG("Adding " << videoServiceTransports[i]
<< " to videoServiceTransports parameter "
"of StartSessionAck");
@@ -1021,7 +1021,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
}
const uint32_t connection_key = tm_message->connection_key();
- SDL_LOG_DEBUG("Received data from TM with connection id "
+ SDL_LOG_TRACE("Received data from TM with connection id "
<< connection_key << " msg data_size "
<< tm_message->data_size());
@@ -1030,7 +1030,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
const ProtocolFramePtrList protocol_frames =
incoming_data_handler_.ProcessData(
*tm_message, result, &malformed_occurs);
- SDL_LOG_DEBUG("Processed " << protocol_frames.size() << " frames");
+ SDL_LOG_TRACE("Processed " << protocol_frames.size() << " frames");
if (result != RESULT_OK) {
if (result == RESULT_MALFORMED_OCCURS) {
SDL_LOG_WARN("Malformed message occurs, connection id "
@@ -1464,7 +1464,7 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
RESULT_CODE ProtocolHandlerImpl::HandleMessage(const ProtocolFramePtr packet) {
DCHECK_OR_RETURN(packet, RESULT_UNKNOWN);
- SDL_LOG_DEBUG("Handling message " << packet);
+ SDL_LOG_TRACE("Handling message " << packet);
switch (packet->frame_type()) {
case FRAME_TYPE_CONTROL:
SDL_LOG_TRACE("FRAME_TYPE_CONTROL");
@@ -1488,7 +1488,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
const ProtocolFramePtr packet) {
SDL_LOG_AUTO_TRACE();
- SDL_LOG_DEBUG(
+ SDL_LOG_TRACE(
"FRAME_TYPE_SINGLE message of size "
<< packet->data_size() << "; message "
<< utils::ConvertBinaryDataToString(packet->data(), packet->data_size()));
@@ -2128,14 +2128,6 @@ void ProtocolHandlerImpl::NotifySessionStarted(
}
}
-void ProtocolHandlerImpl::NotifySessionStarted(
- const SessionContext& context,
- std::vector<std::string>& rejected_params,
- const std::string err_reason) {
- SessionContext context_copy = context;
- NotifySessionStarted(context_copy, rejected_params, err_reason);
-}
-
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
const ProtocolPacket& packet) {
const ConnectionID connection_id = packet.connection_id();
@@ -2182,7 +2174,7 @@ void ProtocolHandlerImpl::PopValidAndExpiredMultiframes() {
const uint32_t connection_key = session_observer_.KeyFromPair(
frame->connection_id(), frame->session_id());
- SDL_LOG_DEBUG("Result frame" << frame << "for connection "
+ SDL_LOG_TRACE("Result frame" << frame << "for connection "
<< connection_key);
const RawMessagePtr rawMessage(new RawMessage(connection_key,
frame->protocol_version(),
@@ -2261,7 +2253,7 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageFromMobile message) {
}
} break;
}
- SDL_LOG_DEBUG("Message : " << message.get());
+ SDL_LOG_TRACE("Message : " << message.get());
const uint8_t c_id = message->connection_id();
const uint32_t m_id = message->session_id();
@@ -2273,7 +2265,7 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageFromMobile message) {
if (((0 != message->data()) && (0 != message->data_size())) ||
FRAME_TYPE_CONTROL == message->frame_type() ||
FRAME_TYPE_FIRST == message->frame_type()) {
- SDL_LOG_DEBUG("Packet: dataSize " << message->data_size());
+ SDL_LOG_TRACE("Packet: dataSize " << message->data_size());
HandleMessage(message);
PopValidAndExpiredMultiframes();
} else {
@@ -2448,7 +2440,7 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
void ProtocolHandlerImpl::SendFramesNumber(uint32_t connection_key,
int32_t number_of_frames) {
- SDL_LOG_DEBUG("SendFramesNumber MobileNaviAck for session "
+ SDL_LOG_TRACE("SendFramesNumber MobileNaviAck for session "
<< connection_key);
transport_manager::ConnectionUID connection_id = 0;
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index db2f124c53..51b5e838b3 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -262,7 +262,7 @@ ProtocolPacket::ProtocolHeaderValidator::max_payload_size_by_service_type(
RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
const ProtocolHeader& header) const {
- SDL_LOG_DEBUG("Validating header - " << header);
+ SDL_LOG_TRACE("Validating header - " << header);
// expected payload size will be calculated depending
// on used protocol version and service type
size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
@@ -325,21 +325,8 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
break;
}
case FRAME_TYPE_SINGLE:
- if (header.frameData != FRAME_DATA_SINGLE) {
- SDL_LOG_WARN("FRAME_TYPE_SINGLE - Invalide frame data "
- << static_cast<int>(header.frameData));
- return RESULT_FAIL;
- }
- break;
case FRAME_TYPE_FIRST:
- if (header.frameData != FRAME_DATA_FIRST) {
- SDL_LOG_WARN("FRAME_TYPE_FIRST - Invalide frame data "
- << static_cast<int>(header.frameData));
- return RESULT_FAIL;
- }
- break;
case FRAME_TYPE_CONSECUTIVE:
- // Could have any FrameInfo value
break;
default:
SDL_LOG_WARN("Unknown frame type " << static_cast<int>(header.frameType));
@@ -390,7 +377,7 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
return RESULT_FAIL;
}
}
- SDL_LOG_DEBUG("Message header is completely correct.");
+ SDL_LOG_TRACE("Message header is completely correct.");
return RESULT_OK;
}
diff --git a/src/components/protocol_handler/src/service_status_update_handler.cc b/src/components/protocol_handler/src/service_status_update_handler.cc
index 71d11bcf5b..05f493c74b 100644
--- a/src/components/protocol_handler/src/service_status_update_handler.cc
+++ b/src/components/protocol_handler/src/service_status_update_handler.cc
@@ -19,7 +19,9 @@ hmi_apis::Common_ServiceType::eType GetHMIServiceType(
case SERVICE_TYPE_NAVI: {
return Common_ServiceType::VIDEO;
}
- default: { return Common_ServiceType::INVALID_ENUM; }
+ default: {
+ return Common_ServiceType::INVALID_ENUM;
+ }
}
}
diff --git a/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h b/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h
index a099cff225..cfbc5d6b53 100644
--- a/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h
+++ b/src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h
@@ -32,6 +32,7 @@
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_
+#include <iomanip>
#include <ios>
#include <string>
#include <vector>
@@ -153,7 +154,8 @@ MATCHER_P4(ControlMessage,
*result_listener << "Message with " << data_vector.size()
<< " byte data : 0x";
for (size_t i = 0u; i < data_vector.size(); ++i) {
- *result_listener << std::hex << static_cast<int>(data_vector[i]);
+ *result_listener << std::setw(2) << std::setfill('0') << std::hex
+ << static_cast<int>(data_vector[i]);
}
return false;
}
diff --git a/src/components/protocol_handler/test/service_status_update_handler_test.cc b/src/components/protocol_handler/test/service_status_update_handler_test.cc
index 7d4516a7ff..5db7f2be45 100644
--- a/src/components/protocol_handler/test/service_status_update_handler_test.cc
+++ b/src/components/protocol_handler/test/service_status_update_handler_test.cc
@@ -87,7 +87,9 @@ class ServiceStatusUpdateHandlerTest
case ServiceStatus::PROTECTION_ENFORCED: {
return Common_ServiceEvent::REQUEST_REJECTED;
}
- default: { return Common_ServiceEvent::INVALID_ENUM; }
+ default: {
+ return Common_ServiceEvent::INVALID_ENUM;
+ }
}
}
diff --git a/src/components/resumption/include/resumption/last_state_impl.h b/src/components/resumption/include/resumption/last_state_impl.h
index 5eb4050d2d..8495c39d04 100644
--- a/src/components/resumption/include/resumption/last_state_impl.h
+++ b/src/components/resumption/include/resumption/last_state_impl.h
@@ -57,9 +57,6 @@ class LastStateImpl : public LastState {
*/
~LastStateImpl();
- DEPRECATED
- void SaveStateToFileSystem();
-
/**
* @brief Saving dictionary to filesystem
*/
@@ -77,12 +74,6 @@ class LastStateImpl : public LastState {
Json::Value dictionary() const OVERRIDE;
/**
- * @brief Get the dictionary
- * @return Reference to the dictionary
- */
- DEPRECATED Json::Value& get_dictionary();
-
- /**
* @brief Resets internal dictionary
* @param dictionary New dictionary json value to be set
*/
diff --git a/src/components/resumption/src/last_state_impl.cc b/src/components/resumption/src/last_state_impl.cc
index 185535c50d..9920a1499b 100644
--- a/src/components/resumption/src/last_state_impl.cc
+++ b/src/components/resumption/src/last_state_impl.cc
@@ -52,23 +52,6 @@ LastStateImpl::~LastStateImpl() {
SaveToFileSystem();
}
-void LastStateImpl::SaveStateToFileSystem() {
- SDL_LOG_AUTO_TRACE();
-
- std::string styled_string;
- {
- sync_primitives::AutoLock lock(dictionary_lock_);
- styled_string = dictionary_.toStyledString();
- }
-
- const std::vector<uint8_t> char_vector_pdata(styled_string.begin(),
- styled_string.end());
- DCHECK(file_system::CreateDirectoryRecursively(app_storage_folder_));
- SDL_LOG_INFO("LastState::SaveStateToFileSystem[DEPRECATED] "
- << app_info_storage_ << styled_string);
- DCHECK(file_system::Write(app_info_storage_, char_vector_pdata));
-}
-
void LastStateImpl::SaveToFileSystem() {
SDL_LOG_AUTO_TRACE();
@@ -78,17 +61,26 @@ void LastStateImpl::SaveToFileSystem() {
styled_string = dictionary_.toStyledString();
}
+ const std::string full_path =
+ !app_storage_folder_.empty()
+ ? app_storage_folder_ + "/" + app_info_storage_
+ : app_info_storage_;
+
const std::vector<uint8_t> char_vector_pdata(styled_string.begin(),
styled_string.end());
DCHECK(file_system::CreateDirectoryRecursively(app_storage_folder_));
SDL_LOG_INFO("LastState::SaveToFileSystem " << app_info_storage_
- << styled_string);
- DCHECK(file_system::Write(app_info_storage_, char_vector_pdata));
+ << full_path);
+ DCHECK(file_system::Write(full_path, char_vector_pdata));
}
void LastStateImpl::LoadFromFileSystem() {
+ const std::string full_path =
+ !app_storage_folder_.empty()
+ ? app_storage_folder_ + "/" + app_info_storage_
+ : app_info_storage_;
std::string buffer;
- const bool result = file_system::ReadFile(app_info_storage_, buffer);
+ const bool result = file_system::ReadFile(full_path, buffer);
utils::JsonReader reader;
if (result && reader.parse(buffer, &dictionary_)) {
@@ -110,11 +102,6 @@ Json::Value LastStateImpl::dictionary() const {
return dictionary_;
}
-Json::Value& LastStateImpl::get_dictionary() {
- sync_primitives::AutoLock lock(dictionary_lock_);
- return dictionary_;
-}
-
void LastStateImpl::set_dictionary(const Json::Value& dictionary) {
DCHECK(dictionary.type() == Json::objectValue ||
dictionary.type() == Json::nullValue);
diff --git a/src/components/resumption/test/last_state_test.cc b/src/components/resumption/test/last_state_test.cc
index 61c227bbf3..c242f18099 100644
--- a/src/components/resumption/test/last_state_test.cc
+++ b/src/components/resumption/test/last_state_test.cc
@@ -50,12 +50,15 @@ class LastStateTest : public ::testing::Test {
protected:
LastStateTest()
: empty_dictionary_("null\n")
- , app_info_dat_file_("app_info.dat")
+ , app_info_dat_file_(kAppStorageFolder + "/" + kAppInfoStorageFile)
, last_state_(kAppStorageFolder, kAppInfoStorageFile) {}
static void SetUpTestCase() {
- file_system::DeleteFile(kAppInfoStorageFile);
+ const std::string storage_file =
+ kAppStorageFolder + "/" + kAppInfoStorageFile;
+ file_system::DeleteFile(storage_file);
file_system::RemoveDirectory(kAppStorageFolder);
+ file_system::CreateDirectoryRecursively(kAppStorageFolder);
}
void SetUp() OVERRIDE {
diff --git a/src/components/security_manager/include/security_manager/security_manager_impl.h b/src/components/security_manager/include/security_manager/security_manager_impl.h
index 7cbb19708e..437fede683 100644
--- a/src/components/security_manager/include/security_manager/security_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/security_manager_impl.h
@@ -121,12 +121,12 @@ class SecurityManagerImpl : public SecurityManager,
* \param connection_key Unique key used by other components as session
* identifier
* \param error_id unique error identifier
- * \param erorr_text SSL impelmentation error text
+ * \param error_text SSL impelmentation error text
* \param seq_number received from Mobile Application
*/
void SendInternalError(const uint32_t connection_key,
const uint8_t& error_id,
- const std::string& erorr_text,
+ const std::string& error_text,
const uint32_t seq_number) OVERRIDE;
using SecurityManager::SendInternalError;
@@ -226,17 +226,24 @@ class SecurityManagerImpl : public SecurityManager,
private:
/**
+ * @brief NextSequentialNumber get next sequential number for request
+ * @return next sequential number
+ */
+ uint32_t NextSequentialNumber();
+
+ /**
* \brief Sends Handshake binary data to mobile application
* \param connection_key Unique key used by other components as session
* identifier
* \param data pointer to binary data array
* \param data_size size of binary data array
- * \param seq_number received from Mobile Application
+ * \param custom_seq_number specific sequential number of request. If omitted,
+ * this will be automatically generated
*/
void SendHandshakeBinData(const uint32_t connection_key,
const uint8_t* const data,
const size_t data_size,
- const uint32_t seq_number = 0);
+ const uint32_t custom_seq_number = 0);
/**
* \brief Parse SecurityMessage as HandshakeData request
* \param inMessage SecurityMessage with binary data of handshake
@@ -327,6 +334,8 @@ class SecurityManagerImpl : public SecurityManager,
std::set<uint32_t> awaiting_certificate_connections_;
std::set<uint32_t> awaiting_time_connections_;
+ uint32_t current_seq_number_;
+
mutable sync_primitives::Lock waiters_lock_;
volatile bool waiting_for_certificate_;
volatile bool waiting_for_time_;
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 717991cf5c..4d66d7ec2d 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -50,8 +50,6 @@
#include "utils/macro.h"
#include "utils/scope_guard.h"
-#define OPENSSL1_1_VERSION 0x1010000fL
-#define TLS1_1_MINIMAL_VERSION 0x1000103fL
#define CONST_SSL_METHOD_MINIMAL_VERSION 0x00909000L
namespace security_manager {
@@ -91,7 +89,7 @@ CryptoManagerImpl::CryptoManagerImpl(
: settings_(set), context_(NULL) {
SDL_LOG_AUTO_TRACE();
sync_primitives::AutoLock lock(instance_lock_);
- instance_count_++;
+ ++instance_count_;
if (instance_count_ == 1) {
SDL_LOG_DEBUG("Openssl engine initialization");
SSL_load_error_strings();
@@ -110,7 +108,7 @@ CryptoManagerImpl::~CryptoManagerImpl() {
} else {
SSL_CTX_free(context_);
}
- instance_count_--;
+ --instance_count_;
if (instance_count_ == 0) {
SDL_LOG_DEBUG("Openssl engine deinitialization");
EVP_cleanup();
@@ -165,58 +163,23 @@ bool CryptoManagerImpl::Init() {
#endif
switch (get_settings().security_manager_protocol_name()) {
case SSLv3:
-#ifdef OPENSSL_NO_SSL3
SDL_LOG_WARN("OpenSSL does not support SSL3 protocol");
return false;
-#else
- SDL_LOG_DEBUG("SSLv3 is used");
- method = is_server ? SSLv3_server_method() : SSLv3_client_method();
- SSL_CTX_set_max_proto_version(context_, SSL3_VERSION);
- break;
-#endif
case TLSv1:
- SDL_LOG_DEBUG("TLSv1 is used");
-#if OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
- method = is_server ? TLSv1_server_method() : TLSv1_client_method();
-#else
- method = is_server ? TLS_server_method() : TLS_client_method();
- SSL_CTX_set_max_proto_version(context_, TLS1_VERSION);
-#endif
- break;
+ SDL_LOG_WARN("Protocol TLSv1 is unsupported");
+ return false;
case TLSv1_1:
- SDL_LOG_DEBUG("TLSv1_1 is used");
-#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
- SDL_LOG_WARN(
- "OpenSSL has no TLSv1.1 with version lower 1.0.1, set TLSv1.0");
- method = is_server ? TLSv1_server_method() : TLSv1_client_method();
-#elif OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
- method = is_server ? TLSv1_1_server_method() : TLSv1_1_client_method();
-#else
- method = is_server ? TLS_server_method() : TLS_client_method();
- SSL_CTX_set_max_proto_version(context_, TLS1_1_VERSION);
-#endif
- break;
+ SDL_LOG_WARN("Protocol TLSv1_1 is unsupported");
+ return false;
case TLSv1_2:
SDL_LOG_DEBUG("TLSv1_2 is used");
-#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
- SDL_LOG_WARN(
- "OpenSSL has no TLSv1.2 with version lower 1.0.1, set TLSv1.0");
- method = is_server ? TLSv1_server_method() : TLSv1_client_method();
-#elif OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
- method = is_server ? TLSv1_2_server_method() : TLSv1_2_client_method();
-#else
method = is_server ? TLS_server_method() : TLS_client_method();
SSL_CTX_set_max_proto_version(context_, TLS1_2_VERSION);
-#endif
break;
case DTLSv1:
SDL_LOG_DEBUG("DTLSv1 is used");
-#if OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
- method = is_server ? DTLSv1_server_method() : DTLSv1_client_method();
-#else
method = is_server ? DTLS_server_method() : DTLS_client_method();
SSL_CTX_set_max_proto_version(context_, DTLS1_VERSION);
-#endif
break;
default:
SDL_LOG_ERROR("Unknown protocol: "
@@ -248,22 +211,19 @@ bool CryptoManagerImpl::Init() {
"Could not set cipher list: " << get_settings().ciphers_list());
return false;
}
-#if OPENSSL_VERSION_NUMBER > OPENSSL1_1_VERSION
+
auto sk = SSL_CTX_get_ciphers(context_);
const char* p;
- for (int i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
+ for (int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
const SSL_CIPHER* c = sk_SSL_CIPHER_value(sk, i);
p = SSL_CIPHER_get_name(c);
if (p == NULL)
break;
SDL_LOG_DEBUG("Using Cipher: " << p);
}
-#endif
}
-#if OPENSSL_VERSION_NUMBER >= OPENSSL1_1_VERSION
SSL_CTX_set_security_level(context_, get_settings().security_level());
-#endif
if (get_settings().ca_cert_path().empty()) {
SDL_LOG_WARN("Setting up empty CA certificate location");
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 914d30003a..75cc104d95 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -54,6 +54,7 @@ SecurityManagerImpl::SecurityManagerImpl(
, crypto_manager_(NULL)
, protocol_handler_(NULL)
, system_time_handler_(std::move(system_time_handler))
+ , current_seq_number_(0)
, waiting_for_certificate_(false)
, waiting_for_time_(false) {
DCHECK(system_time_handler_);
@@ -556,6 +557,7 @@ bool SecurityManagerImpl::ProcessHandshakeData(
// no handshake data to send
return false;
}
+
if (sslContext->IsInitCompleted()) {
// On handshake success
SDL_LOG_DEBUG("SSL initialization finished success.");
@@ -564,6 +566,29 @@ bool SecurityManagerImpl::ProcessHandshakeData(
} else if (handshake_result != SSLContext::Handshake_Result_Success) {
// On handshake fail
SDL_LOG_WARN("SSL initialization finished with fail.");
+ int32_t error_code = ERROR_HANDSHAKE_FAILED;
+ std::string error_text = "Handshake failed";
+ switch (handshake_result) {
+ case SSLContext::Handshake_Result_CertExpired:
+ error_code = ERROR_EXPIRED_CERT;
+ error_text = "Certificate is expired";
+ break;
+ case SSLContext::Handshake_Result_NotYetValid:
+ error_code = ERROR_INVALID_CERT;
+ error_text = "Certificate is not yet valid";
+ break;
+ case SSLContext::Handshake_Result_CertNotSigned:
+ error_code = ERROR_INVALID_CERT;
+ error_text = "Certificate is not signed";
+ break;
+ case SSLContext::Handshake_Result_AppIDMismatch:
+ error_code = ERROR_INVALID_CERT;
+ error_text = "App ID does not match certificate";
+ break;
+ default:
+ break;
+ }
+ SendInternalError(connection_key, error_code, error_text);
NotifyListenersOnHandshakeDone(connection_key, handshake_result);
}
@@ -596,13 +621,24 @@ bool SecurityManagerImpl::ProcessInternalError(
return true;
}
-void SecurityManagerImpl::SendHandshakeBinData(const uint32_t connection_key,
- const uint8_t* const data,
- const size_t data_size,
- const uint32_t seq_number) {
- const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
- SecurityQuery::SEND_HANDSHAKE_DATA,
- seq_number);
+uint32_t SecurityManagerImpl::NextSequentialNumber() {
+ if (current_seq_number_ >= std::numeric_limits<uint32_t>::max()) {
+ current_seq_number_ = 0;
+ }
+ current_seq_number_++;
+ return current_seq_number_;
+}
+
+void SecurityManagerImpl::SendHandshakeBinData(
+ const uint32_t connection_key,
+ const uint8_t* const data,
+ const size_t data_size,
+ const uint32_t custom_seq_number) {
+ uint32_t seq_number =
+ (0 == custom_seq_number) ? NextSequentialNumber() : custom_seq_number;
+
+ const SecurityQuery::QueryHeader header(
+ SecurityQuery::REQUEST, SecurityQuery::SEND_HANDSHAKE_DATA, seq_number);
DCHECK(data_size < 1024 * 1024 * 1024);
const SecurityQuery query =
SecurityQuery(header, connection_key, data, data_size);
diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc
index 85e1ad3129..44e24afe70 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -190,14 +190,6 @@ TEST_F(CryptoManagerTest, CorrectInit) {
// Recall init with other protocols
SetInitialValues(
- security_manager::CLIENT, security_manager::TLSv1_2, kFordCipher);
- EXPECT_TRUE(crypto_manager_->Init());
-
- SetInitialValues(
- security_manager::CLIENT, security_manager::TLSv1_1, kFordCipher);
- EXPECT_TRUE(crypto_manager_->Init());
-
- SetInitialValues(
security_manager::CLIENT, security_manager::DTLSv1, kFordCipher);
EXPECT_TRUE(crypto_manager_->Init());
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index 912ffff4c7..c2b0cda373 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -152,7 +152,7 @@ class SecurityManagerTest : public ::testing::Test {
void EmulateMobileMessageHandshake(const uint8_t* const data,
const uint32_t data_size,
const int repeat_count = 1) {
- const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
+ const SecurityQuery::QueryHeader header(SecurityQuery::RESPONSE,
SecurityQuery::SEND_HANDSHAKE_DATA,
kSeqNumber);
for (int c = 0; c < repeat_count; ++c) {
@@ -730,12 +730,13 @@ TEST_F(SecurityManagerTest, ProcessHandshakeData_InvalidData) {
}
/*
* Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
- * with correct handshake data Check Fail and sussecc states
+ * with correct handshake data Check Fail and success states
*/
TEST_F(SecurityManagerTest, ProcessHandshakeData_Answer) {
SetMockCryptoManager();
// Count handshake calls
const int handshake_emulates = 2;
+ const int internal_error_count = 1;
uint32_t connection_id = 0;
uint8_t session_id = 0;
@@ -743,14 +744,14 @@ TEST_F(SecurityManagerTest, ProcessHandshakeData_Answer) {
auto waiter = TestAsyncWaiter::createInstance();
uint32_t times = 0;
EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
- .Times(handshake_emulates)
+ .Times(handshake_emulates + internal_error_count)
.WillRepeatedly(NotifyTestAsyncWaiter(waiter));
times += handshake_emulates;
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, An<uint8_t&>()))
- .Times(handshake_emulates)
+ .Times(handshake_emulates + internal_error_count)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(waiter), Return(true)));
- times += handshake_emulates;
+ times += handshake_emulates + internal_error_count;
// Get size of raw message after
const size_t raw_message_size = 15;
@@ -759,7 +760,15 @@ TEST_F(SecurityManagerTest, ProcessHandshakeData_Answer) {
RawMessageEqSize(raw_message_size), false, kIsFinal))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(waiter));
- times += handshake_emulates;
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp(
+ InternalErrorWithErrId(SecurityManager::ERROR_HANDSHAKE_FAILED),
+ false,
+ kIsFinal))
+ .Times(internal_error_count)
+ .WillRepeatedly(NotifyTestAsyncWaiter(waiter));
+ times += handshake_emulates + internal_error_count;
// Expect notifying listeners (unsuccess)
EXPECT_CALL(*mock_sm_listener,
@@ -804,6 +813,97 @@ TEST_F(SecurityManagerTest, ProcessHandshakeData_Answer) {
mock_sm_listener.release();
}
/*
+ * Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
+ * with correct handshake data Check Fail and success states
+ */
+TEST_F(SecurityManagerTest, ProcessHandshakeData_Answer_Invalid_Cert) {
+ SetMockCryptoManager();
+ // Count handshake calls
+ const int handshake_emulates = 4;
+
+ uint32_t connection_id = 0;
+ uint8_t session_id = 0;
+
+ auto waiter = TestAsyncWaiter::createInstance();
+ uint32_t times = 0;
+ // Each of these calls is run twice, once for the next handshake data request,
+ // once for the the internal error notification
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
+ .Times(handshake_emulates)
+ .WillRepeatedly(NotifyTestAsyncWaiter(waiter));
+ times += handshake_emulates;
+ EXPECT_CALL(mock_session_observer,
+ ProtocolVersionUsed(connection_id, session_id, An<uint8_t&>()))
+ .Times(handshake_emulates)
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(waiter), Return(true)));
+ times += handshake_emulates;
+
+ EXPECT_CALL(mock_protocol_handler,
+ SendMessageToMobileApp(
+ InternalErrorWithErrId(SecurityManager::ERROR_EXPIRED_CERT),
+ false,
+ kIsFinal))
+ .WillOnce(NotifyTestAsyncWaiter(waiter));
+ EXPECT_CALL(mock_protocol_handler,
+ SendMessageToMobileApp(
+ InternalErrorWithErrId(SecurityManager::ERROR_INVALID_CERT),
+ false,
+ kIsFinal))
+ .Times(3)
+ .WillRepeatedly(NotifyTestAsyncWaiter(waiter));
+ times += 4;
+
+ // Listener is erased after first call
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_CertExpired))
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(waiter), Return(true)));
+ times++;
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
+ .Times(handshake_emulates)
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(waiter), Return(false)));
+ times += handshake_emulates;
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
+ .Times(handshake_emulates)
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(waiter),
+ Return(&mock_ssl_context_exists)));
+ times += handshake_emulates;
+
+ // Emulate DoHandshakeStep correct logics
+ EXPECT_CALL(
+ mock_ssl_context_exists,
+ DoHandshakeStep(HandshakeStepEq(handshake_data, handshake_data_size),
+ handshake_data_size,
+ _,
+ _))
+ .WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(waiter),
+ Return(SSLContext::Handshake_Result_CertExpired)))
+ .WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(waiter),
+ Return(SSLContext::Handshake_Result_NotYetValid)))
+ .WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(waiter),
+ Return(SSLContext::Handshake_Result_AppIDMismatch)))
+ .WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(waiter),
+ Return(SSLContext::Handshake_Result_CertNotSigned)));
+ times += 4; // matches to each single call above
+
+ EmulateMobileMessageHandshake(
+ handshake_data, handshake_data_size, handshake_emulates);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
+}
+/*
* Shall call all listeners on success end handshake
* and return handshake data
* Check Fail and sussecc states
diff --git a/src/components/security_manager/test/security_query_test.cc b/src/components/security_manager/test/security_query_test.cc
index 6becddaaf9..60e3a20d77 100644
--- a/src/components/security_manager/test/security_query_test.cc
+++ b/src/components/security_manager/test/security_query_test.cc
@@ -53,7 +53,7 @@ class SecurityQueryTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
// init_header used for SecurityQuery initialization
- init_header.query_type = SecurityQuery::NOTIFICATION;
+ init_header.query_type = SecurityQuery::REQUEST;
init_header.query_id = SecurityQuery::SEND_HANDSHAKE_DATA;
init_header.seq_number = SEQ_NUMBER;
init_header.json_size = 0u;
@@ -107,18 +107,17 @@ TEST_F(SecurityQueryTest, QueryHeaderConstructor) {
* Security QueryHeader shall construct with correct fields
*/
TEST_F(SecurityQueryTest, QueryHeaderConstructor2) {
- SecurityQuery::QueryHeader new_header(SecurityQuery::NOTIFICATION,
- SecurityQuery::SEND_HANDSHAKE_DATA,
- SEQ_NUMBER);
- ASSERT_EQ(new_header.query_type, SecurityQuery::NOTIFICATION);
+ SecurityQuery::QueryHeader new_header(
+ SecurityQuery::REQUEST, SecurityQuery::SEND_HANDSHAKE_DATA, SEQ_NUMBER);
+ ASSERT_EQ(new_header.query_type, SecurityQuery::REQUEST);
ASSERT_EQ(new_header.query_id, SecurityQuery::SEND_HANDSHAKE_DATA);
ASSERT_EQ(new_header.seq_number, SEQ_NUMBER);
ASSERT_EQ(new_header.json_size, 0u);
- SecurityQuery::QueryHeader new_header2(SecurityQuery::RESPONSE,
+ SecurityQuery::QueryHeader new_header2(SecurityQuery::NOTIFICATION,
SecurityQuery::SEND_INTERNAL_ERROR,
SEQ_NUMBER + 1);
- ASSERT_EQ(new_header2.query_type, SecurityQuery::RESPONSE);
+ ASSERT_EQ(new_header2.query_type, SecurityQuery::NOTIFICATION);
ASSERT_EQ(new_header2.query_id, SecurityQuery::SEND_INTERNAL_ERROR);
ASSERT_EQ(new_header2.seq_number, SEQ_NUMBER + 1);
ASSERT_EQ(new_header2.json_size, 0u);
@@ -385,9 +384,7 @@ TEST_F(SecurityQueryTest, Parse_InvalidQuery_UnknownId_Response) {
*/
TEST_F(SecurityQueryTest, Parse_Handshake) {
SecurityQuery::QueryHeader handshake_header(
- SecurityQuery::NOTIFICATION,
- SecurityQuery::SEND_HANDSHAKE_DATA,
- SEQ_NUMBER);
+ SecurityQuery::REQUEST, SecurityQuery::SEND_HANDSHAKE_DATA, SEQ_NUMBER);
// some sample data
uint8_t raw_data[] = {0x6, 0x7, 0x8};
const size_t raw_data_size = sizeof(raw_data) / sizeof(raw_data[0]);
diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
index d1de81de73..9c21fba0bb 100644
--- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc
+++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
@@ -369,14 +369,12 @@ class SSLHandshakeTest : public testing::TestWithParam<Protocol> {
const std::vector<int> forced_unprotected_service_;
};
-INSTANTIATE_TEST_CASE_P(
- CorrectProtocol,
- SSLHandshakeTest,
- ::testing::Values(
- Protocol(security_manager::TLSv1, security_manager::TLSv1),
- Protocol(security_manager::TLSv1_1, security_manager::TLSv1_1),
- Protocol(security_manager::TLSv1_2, security_manager::TLSv1_2),
- Protocol(security_manager::DTLSv1, security_manager::DTLSv1)));
+INSTANTIATE_TEST_CASE_P(CorrectProtocol,
+ SSLHandshakeTest,
+ ::testing::Values(Protocol(security_manager::TLSv1_2,
+ security_manager::TLSv1_2),
+ Protocol(security_manager::DTLSv1,
+ security_manager::DTLSv1)));
TEST_P(SSLHandshakeTest, NoVerification) {
ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
diff --git a/src/components/smart_objects/CMakeLists.txt b/src/components/smart_objects/CMakeLists.txt
index 6bc70f8226..bb8bb1cf07 100644
--- a/src/components/smart_objects/CMakeLists.txt
+++ b/src/components/smart_objects/CMakeLists.txt
@@ -48,7 +48,7 @@ add_library("SmartObjects" ${SOURCES})
target_link_libraries("SmartObjects" Utils)
add_dependencies("SmartObjects" MOBILE_API)
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries("SmartObjects" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
index 8f9a179fff..43870ddb42 100644
--- a/src/components/smart_objects/include/smart_objects/array_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -63,6 +63,13 @@ class CArraySchemaItem : public ISchemaItem {
const TSchemaItemParameter<size_t>& MaxSize =
TSchemaItemParameter<size_t>());
+ static std::shared_ptr<CArraySchemaItem> create(
+ ISchemaItem* ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize =
+ TSchemaItemParameter<size_t>(),
+ const TSchemaItemParameter<size_t>& MaxSize =
+ TSchemaItemParameter<size_t>());
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
@@ -131,10 +138,16 @@ class CArraySchemaItem : public ISchemaItem {
const TSchemaItemParameter<size_t>& MinSize,
const TSchemaItemParameter<size_t>& MaxSize);
+ CArraySchemaItem(ISchemaItem* ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize);
+
/**
* @brief SchemaItem for array elements.
**/
- const ISchemaItemPtr mElementSchemaItem;
+ ISchemaItem* mElementSchemaItem;
+ const ISchemaItemPtr mElementSchemaItemShared;
+
/**
* @brief Minimum allowed size.
**/
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index de4c3adcc8..07b4f38f62 100644
--- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -296,7 +296,7 @@ template <typename EnumType>
const ElementSignature TEnumSchemaItem<EnumType>::getSignature(
const std::vector<ElementSignature>& signatures,
const utils::SemanticVersion& MessageVersion) {
- for (uint i = 0; i < signatures.size(); i++) {
+ for (uint i = 0; i < signatures.size(); ++i) {
ElementSignature signature = signatures[i];
// Check if signature matches message version
if (signature.mSince != boost::none &&
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h
index 25b7684829..5fa9597db7 100644
--- a/src/components/smart_objects/include/smart_objects/number_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h
@@ -135,6 +135,7 @@ bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) {
typeid(int32_t),
typeid(uint32_t),
typeid(int64_t),
+ typeid(uint64_t),
typeid(double))) {
return true;
}
@@ -157,11 +158,26 @@ errors::eType TNumberSchemaItem<NumberType>::validate(
report->set_validation_info(validation_info);
return errors::INVALID_VALUE;
}
+
NumberType value(0);
if (typeid(int32_t) == typeid(value)) {
- value = utils::SafeStaticCast<int64_t, int32_t>(Object.asInt());
+ if (Object.asInt() < std::numeric_limits<int32_t>::min() ||
+ Object.asInt() > std::numeric_limits<int32_t>::max()) {
+ const std::string validation_info =
+ "Value " + Object.asString() + " out of int32 range";
+ report->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
+ }
+ value = Object.asInt();
} else if (typeid(uint32_t) == typeid(value)) {
- value = utils::SafeStaticCast<uint64_t, uint32_t>(Object.asUInt());
+ if (Object.asInt() < std::numeric_limits<uint32_t>::min() ||
+ Object.asInt() > std::numeric_limits<uint32_t>::max()) {
+ const std::string validation_info =
+ "Value " + Object.asString() + " out of uint32 range";
+ report->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
+ }
+ value = Object.asUInt();
} else if (typeid(double) == typeid(value)) {
value = Object.asDouble();
} else if (typeid(int64_t) == typeid(value)) {
@@ -231,6 +247,9 @@ template <>
SmartType TNumberSchemaItem<int64_t>::getSmartType() const;
template <>
+SmartType TNumberSchemaItem<uint64_t>::getSmartType() const;
+
+template <>
SmartType TNumberSchemaItem<double>::getSmartType() const;
} // namespace ns_smart_objects
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index d5c8a7f3e9..0a971d50ee 100644
--- a/src/components/smart_objects/include/smart_objects/object_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -69,6 +69,14 @@ struct SMember {
const bool IsRemoved = false,
const std::vector<SMember>& history_vector = {});
+ SMember(ISchemaItem* SchemaItem,
+ const bool IsMandatory = true,
+ const std::string& Since = "",
+ const std::string& Until = "",
+ const bool IsDeprecated = false,
+ const bool IsRemoved = false,
+ const std::vector<SMember>& history_vector = {});
+
/**
* @brief Checks the version a parameter was removed (until)
* If the mobile's msg version is greater than or
@@ -79,7 +87,8 @@ struct SMember {
/**
* @brief Member schema item.
**/
- ISchemaItemPtr mSchemaItem;
+ ISchemaItem* mSchemaItem;
+ ISchemaItemPtr mSchemaItemShared;
/**
* @brief true if member is mandatory, false otherwise.
**/
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 3c28396213..6f1e65d2eb 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -44,6 +44,14 @@ std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize));
}
+std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
+ ISchemaItem* ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize) {
+ return std::shared_ptr<CArraySchemaItem>(
+ new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize));
+}
+
errors::eType CArraySchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report,
@@ -146,7 +154,7 @@ void CArraySchemaItem::BuildObjectBySchema(const SmartObject& pattern_object,
if (SmartType_Array == pattern_object.getType()) {
const size_t array_len = pattern_object.length();
if (array_len > 0) {
- for (size_t i = 0u; i < array_len; i++) {
+ for (size_t i = 0u; i < array_len; ++i) {
mElementSchemaItem->BuildObjectBySchema(pattern_object.getElement(i),
result_object[i]);
}
@@ -161,10 +169,19 @@ TypeID CArraySchemaItem::GetType() {
return TYPE_ARRAY;
}
-CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
+CArraySchemaItem::CArraySchemaItem(ISchemaItem* ElementSchemaItem,
const TSchemaItemParameter<size_t>& MinSize,
const TSchemaItemParameter<size_t>& MaxSize)
: mElementSchemaItem(ElementSchemaItem)
+ , mElementSchemaItemShared(nullptr)
+ , mMinSize(MinSize)
+ , mMaxSize(MaxSize) {}
+
+CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize)
+ : mElementSchemaItem(ElementSchemaItem.get())
+ , mElementSchemaItemShared(ElementSchemaItem)
, mMinSize(MinSize)
, mMaxSize(MaxSize) {}
diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc
index c383f6ecca..1874ff30a0 100644
--- a/src/components/smart_objects/src/number_schema_item.cc
+++ b/src/components/smart_objects/src/number_schema_item.cc
@@ -50,6 +50,11 @@ SmartType TNumberSchemaItem<int64_t>::getSmartType() const {
}
template <>
+SmartType TNumberSchemaItem<uint64_t>::getSmartType() const {
+ return SmartType_UInteger;
+}
+
+template <>
SmartType TNumberSchemaItem<double>::getSmartType() const {
return SmartType_Double;
}
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index 920d548c48..4b14d9e5a1 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -51,19 +51,21 @@ namespace ns_smart_device_link {
namespace ns_smart_objects {
SMember::SMember()
- : mSchemaItem(CAlwaysFalseSchemaItem::create())
- , mIsMandatory(true)
- , mIsDeprecated(false)
- , mIsRemoved(false) {}
+ : mIsMandatory(true), mIsDeprecated(false), mIsRemoved(false) {
+ mSchemaItemShared = CAlwaysFalseSchemaItem::create();
+ mSchemaItem = mSchemaItemShared.get();
+}
-SMember::SMember(const ISchemaItemPtr SchemaItem,
+SMember::SMember(ISchemaItem* SchemaItem,
const bool IsMandatory,
const std::string& Since,
const std::string& Until,
const bool IsDeprecated,
const bool IsRemoved,
const std::vector<SMember>& history_vector)
- : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {
+ : mSchemaItem(SchemaItem)
+ , mSchemaItemShared(nullptr)
+ , mIsMandatory(IsMandatory) {
if (Since.size() > 0) {
utils::SemanticVersion since_struct(Since);
if (since_struct.isValid()) {
@@ -81,6 +83,23 @@ SMember::SMember(const ISchemaItemPtr SchemaItem,
mHistoryVector = history_vector;
}
+SMember::SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory,
+ const std::string& Since,
+ const std::string& Until,
+ const bool IsDeprecated,
+ const bool IsRemoved,
+ const std::vector<SMember>& history_vector)
+ : SMember(SchemaItem.get(),
+ IsMandatory,
+ Since,
+ Until,
+ IsDeprecated,
+ IsRemoved,
+ history_vector) {
+ mSchemaItemShared = SchemaItem;
+}
+
bool SMember::CheckHistoryFieldVersion(
const utils::SemanticVersion& MessageVersion) const {
if (MessageVersion.isValid()) {
@@ -326,7 +345,7 @@ const SMember* CObjectSchemaItem::GetCorrectMember(
}
// Check for history tag items
if (!member.mHistoryVector.empty()) {
- for (uint i = 0; i < member.mHistoryVector.size(); i++) {
+ for (uint i = 0; i < member.mHistoryVector.size(); ++i) {
if (member.mHistoryVector[i].CheckHistoryFieldVersion(messageVersion)) {
return &member.mHistoryVector[i];
}
diff --git a/src/components/telemetry_monitor/test/CMakeLists.txt b/src/components/telemetry_monitor/test/CMakeLists.txt
index 960985e45c..a66d3bdddc 100644
--- a/src/components/telemetry_monitor/test/CMakeLists.txt
+++ b/src/components/telemetry_monitor/test/CMakeLists.txt
@@ -74,4 +74,10 @@ endif()
create_test("telemetry_monitor_test" "${SOURCES}" "${LIBRARIES}")
-file(COPY ${COMPONENTS_DIR}/telemetry_monitor/test/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+if (${LOGGER_NAME} STREQUAL "LOG4CXX")
+ file(COPY ${COMPONENTS_DIR}/telemetry_monitor/test/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+if (${LOGGER_NAME} STREQUAL "BOOST")
+ file(COPY ${COMPONENTS_DIR}/telemetry_monitor/test/boostlogconfig.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endif()
diff --git a/src/components/telemetry_monitor/test/boostlogconfig.ini b/src/components/telemetry_monitor/test/boostlogconfig.ini
new file mode 100644
index 0000000000..4ab6b6e473
--- /dev/null
+++ b/src/components/telemetry_monitor/test/boostlogconfig.ini
@@ -0,0 +1,22 @@
+# Core settings
+[Core]
+DisableLogging=false
+
+# Console Logging (Only ERROR and FATAL messages are logged to console)
+[Sinks.Console]
+DisableLogging=false
+Destination=Console
+Filter="%Severity% >= error"
+Format="%Severity% [%TimeStamp%][%Component%] %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# SDL log file
+[Sinks.AllMessages]
+DisableLogging=false
+Destination=TextFile
+FileName=SmartDeviceLinkCore.log
+Append=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 62442cb64f..55b1f96aeb 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -3,7 +3,6 @@
#include "utils/custom_string.h"
#ifdef ENABLE_LOG
-#include "utils/logger/log4cxxlogger.h"
#include "utils/logger/logger_impl.h"
#endif // ENABLE_LOG
@@ -15,8 +14,6 @@ int main(int argc, char** argv) {
// --------------------------------------------------------------------------
// Logger initialization
// Redefine for each paticular logger implementation
- auto logger = std::unique_ptr<logger::Log4CXXLogger>(
- new logger::Log4CXXLogger("log4cxx.properties"));
auto logger_impl =
std::unique_ptr<logger::LoggerImpl>(new logger::LoggerImpl(false));
logger::Logger::instance(logger_impl.get());
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 82cc00baf2..eea719088f 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -38,6 +38,7 @@ include_directories (
${COMPONENTS_DIR}/connection_handler/include
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/smart_objects/include
${POLICY_GLOBAL_INCLUDE_PATH}/
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
@@ -145,7 +146,7 @@ list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
add_library("TransportManager" ${SOURCES})
target_link_libraries("TransportManager" ${LIBRARIES})
-if(ENABLE_LOG)
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
target_link_libraries("TransportManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
index 5429f50f7f..6e36877e2d 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
@@ -52,10 +52,6 @@ class BluetoothTransportAdapter : public TransportAdapterImpl {
BluetoothTransportAdapter(resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- BluetoothTransportAdapter(resumption::LastState&,
- const TransportManagerSettings& settings);
-
protected:
/**
* @brief Return type of device.
diff --git a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
index 3dabfb39ca..4525f6b5d9 100644
--- a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
@@ -63,11 +63,6 @@ class IAP2BluetoothEmulationTransportAdapter : public TcpTransportAdapter {
resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- IAP2BluetoothEmulationTransportAdapter(
- const uint16_t port,
- resumption::LastState& last_state_wrapper,
- const TransportManagerSettings& settings);
/**
* @brief DeviceSwitched is called during switching from iAP2 Bluetooth to
* iAP2 USB transport.
@@ -113,12 +108,6 @@ class IAP2USBEmulationTransportAdapter : public TcpTransportAdapter {
resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- IAP2USBEmulationTransportAdapter(const uint16_t port,
- resumption::LastState&,
- const TransportManagerSettings& settings) =
- delete;
-
/**
* Destructor
*/
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
index c5948062c9..1cd5c1cb7b 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
@@ -53,11 +53,6 @@ class TcpTransportAdapter : public TransportAdapterImpl {
resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- TcpTransportAdapter(uint16_t port,
- resumption::LastState&,
- const TransportManagerSettings& settings) = delete;
-
/**
* @brief Destructor.
*/
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index cfc886cb15..58dd4b16db 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -85,13 +85,6 @@ class TransportAdapterImpl : public TransportAdapter,
resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- TransportAdapterImpl(DeviceScanner* device_scanner,
- ServerConnectionFactory* server_connection_factory,
- ClientConnectionListener* client_connection_listener,
- resumption::LastState& last_state,
- const TransportManagerSettings& settings) = delete;
-
/**
* @brief Destructor.
**/
@@ -677,10 +670,6 @@ class TransportAdapterImpl : public TransportAdapter,
TMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
- resumption::LastState& last_state() const {
- return last_state_wrapper_->get_accessor().GetMutableData();
- }
-
/**
* @brief Pointer to the device scanner.
*/
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_default.h b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
index 81fc92dc38..d9407276b0 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_default.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
@@ -82,9 +82,6 @@ class TransportManagerDefault : public TransportManagerImpl {
*/
int Init(resumption::LastStateWrapperPtr last_state_wrapper) OVERRIDE;
- DEPRECATED
- int Init(resumption::LastState& last_state) OVERRIDE;
-
/**
* @brief Destructor.
*/
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index 85d96bac55..b45d7cc379 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -126,9 +126,6 @@ class TransportManagerImpl
*/
int Init(resumption::LastStateWrapperPtr last_state_wrapper) OVERRIDE;
- DEPRECATED
- int Init(resumption::LastState& last_state) OVERRIDE;
-
/**
* Reinitializes transport manager
* @return Error code
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
index 45c6d4c0e4..12516e769e 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
@@ -47,10 +47,6 @@ class UsbAoaAdapter : public TransportAdapterImpl {
UsbAoaAdapter(resumption::LastStateWrapperPtr last_state_wrapper,
const TransportManagerSettings& settings);
- DEPRECATED
- UsbAoaAdapter(resumption::LastState&,
- const TransportManagerSettings& settings) = delete;
-
virtual ~UsbAoaAdapter();
protected:
diff --git a/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc b/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
index 402a103910..98c51d4aab 100644
--- a/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
+++ b/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
@@ -105,7 +105,7 @@ void CloudWebsocketTransportAdapter::CreateDevice(const std::string& uid) {
SDL_LOG_DEBUG("#Results: " << results.size());
std::string results_str;
- for (size_t i = 0; i < results.size(); i++) {
+ for (size_t i = 0; i < results.size(); ++i) {
results_str += " R[" + std::to_string(i) + "]:";
results_str +=
(results[i].length() != 0) ? results[i] : std::string("<EMPTY>");
diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
index eb92599ae5..61562d88c0 100644
--- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
+++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
@@ -237,13 +237,13 @@ void ThreadedSocketConnection::Transmit() {
poll_fds[1].fd = read_fd_;
poll_fds[1].events = POLLIN | POLLPRI;
- SDL_LOG_DEBUG("poll " << this);
+ SDL_LOG_TRACE("poll " << this);
if (-1 == poll(poll_fds, kPollFdsSize, -1)) {
SDL_LOG_ERROR_WITH_ERRNO("poll failed for connection " << this);
Abort();
return;
}
- SDL_LOG_DEBUG("poll is ok " << this << " revents0: " << std::hex
+ SDL_LOG_TRACE("poll is ok " << this << " revents0: " << std::hex
<< poll_fds[0].revents << " revents1:" << std::hex
<< poll_fds[1].revents);
// error check
@@ -307,7 +307,7 @@ bool ThreadedSocketConnection::Receive() {
bytes_read = recv(socket_, buffer, sizeof(buffer), MSG_DONTWAIT);
if (bytes_read > 0) {
- SDL_LOG_DEBUG("Received " << bytes_read << " bytes for connection "
+ SDL_LOG_TRACE("Received " << bytes_read << " bytes for connection "
<< this);
::protocol_handler::RawMessagePtr frame(
new protocol_handler::RawMessage(0, 0, buffer, bytes_read, false));
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
index 45d0b04528..0ffb8432ea 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -190,10 +190,6 @@ int TransportManagerDefault::Init(
return E_SUCCESS;
}
-int TransportManagerDefault::Init(resumption::LastState&) {
- return 1;
-}
-
TransportManagerDefault::~TransportManagerDefault() {}
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index ee6398db44..5f4ddc9d7e 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -582,15 +582,6 @@ int TransportManagerImpl::Init(
return E_SUCCESS;
}
-int TransportManagerImpl::Init(resumption::LastState& last_state) {
- // Last state required to initialize Transport adapters
- UNUSED(last_state);
- SDL_LOG_TRACE("enter");
- is_initialized_ = true;
- SDL_LOG_TRACE("exit with E_SUCCESS");
- return E_SUCCESS;
-}
-
void TransportManagerImpl::Deinit() {
SDL_LOG_AUTO_TRACE();
DisconnectAllDevices();
@@ -768,7 +759,7 @@ void TransportManagerImpl::PostMessage(
void TransportManagerImpl::PostEvent(const TransportAdapterEvent& event) {
SDL_LOG_AUTO_TRACE();
- SDL_LOG_DEBUG("TransportAdapterEvent: " << &event);
+ SDL_LOG_TRACE("TransportAdapterEvent: " << &event);
event_queue_.PostMessage(event);
}
@@ -823,12 +814,12 @@ void TransportManagerImpl::DeactivateDeviceConnections(
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const ConnectionUID id) {
SDL_LOG_AUTO_TRACE();
- SDL_LOG_DEBUG("ConnectionUID: " << id);
+ SDL_LOG_TRACE("ConnectionUID: " << id);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
if (it->id == id) {
- SDL_LOG_DEBUG("ConnectionInternal. It's address: " << &*it);
+ SDL_LOG_TRACE("ConnectionInternal. It's address: " << &*it);
return &*it;
}
}
@@ -838,13 +829,13 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const DeviceUID& device, const ApplicationHandle& application) {
SDL_LOG_AUTO_TRACE();
- SDL_LOG_DEBUG("DeviceUID: " << device
+ SDL_LOG_TRACE("DeviceUID: " << device
<< "ApplicationHandle: " << application);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
if (it->device == device && it->application == application) {
- SDL_LOG_DEBUG("ConnectionInternal. It's address: " << &*it);
+ SDL_LOG_TRACE("ConnectionInternal. It's address: " << &*it);
return &*it;
}
}
@@ -1297,7 +1288,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
#endif // TELEMETRY_MONITOR
RaiseEvent(&TransportManagerListener::OnTMMessageReceived,
event.event_data);
- SDL_LOG_DEBUG("event_type = ON_RECEIVED_DONE");
+ SDL_LOG_TRACE("event_type = ON_RECEIVED_DONE");
break;
}
case EventTypeEnum::ON_RECEIVED_FAIL: {
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index 278a1b1f05..865784e9a5 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -81,7 +81,6 @@ UsbConnection::UsbConnection(const DeviceUID& device_uid,
UsbConnection::~UsbConnection() {
SDL_LOG_TRACE("enter with this" << this);
Finalise();
- libusb_free_transfer(in_transfer_);
delete[] in_buffer_;
SDL_LOG_TRACE("exit");
}
@@ -97,6 +96,12 @@ void OutTransferCallback(libusb_transfer* transfer) {
bool UsbConnection::PostInTransfer() {
SDL_LOG_TRACE("enter");
+
+ if (nullptr == in_transfer_) {
+ SDL_LOG_TRACE("exit with FALSE. Condition: nullptr == in_transfer_");
+ return false;
+ }
+
libusb_fill_bulk_transfer(in_transfer_,
device_handle_,
in_endpoint_,
@@ -129,28 +134,40 @@ std::string hex_data(const unsigned char* const buffer,
void UsbConnection::OnInTransfer(libusb_transfer* transfer) {
SDL_LOG_TRACE("enter with Libusb_transfer*: " << transfer);
- if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
- SDL_LOG_DEBUG("USB incoming transfer, size:"
- << transfer->actual_length << ", data:"
- << hex_data(transfer->buffer, transfer->actual_length));
- ::protocol_handler::RawMessagePtr data(new protocol_handler::RawMessage(
- 0, 0, in_buffer_, transfer->actual_length, false));
- controller_->DataReceiveDone(device_uid_, app_handle_, data);
- } else {
- SDL_LOG_ERROR("USB incoming transfer failed: "
- << libusb_error_name(transfer->status));
- controller_->DataReceiveFailed(
- device_uid_, app_handle_, DataReceiveError());
+ switch (transfer->status) {
+ case LIBUSB_TRANSFER_COMPLETED: {
+ SDL_LOG_DEBUG("USB incoming transfer, size:"
+ << transfer->actual_length << ", data:"
+ << hex_data(transfer->buffer, transfer->actual_length));
+ ::protocol_handler::RawMessagePtr data(new protocol_handler::RawMessage(
+ 0, 0, in_buffer_, transfer->actual_length, false));
+ controller_->DataReceiveDone(device_uid_, app_handle_, data);
+ break;
+ }
+
+ case LIBUSB_TRANSFER_CANCELLED: {
+ SDL_LOG_DEBUG("Free already canceled transfer.");
+ break;
+ }
+
+ default: {
+ SDL_LOG_ERROR("USB incoming transfer failed: "
+ << libusb_error_name(transfer->status));
+ controller_->DataReceiveFailed(
+ device_uid_, app_handle_, DataReceiveError());
+ }
}
- if (disconnecting_) {
+
+ if (waiting_in_transfer_cancel_) {
+ libusb_free_transfer(in_transfer_);
+ in_transfer_ = nullptr;
waiting_in_transfer_cancel_ = false;
- } else {
- if (!PostInTransfer()) {
- SDL_LOG_ERROR("USB incoming transfer failed with "
- << "LIBUSB_TRANSFER_NO_DEVICE. Abort connection.");
- AbortConnection();
- }
+ } else if (!PostInTransfer()) {
+ SDL_LOG_ERROR("USB incoming transfer failed with "
+ << "LIBUSB_TRANSFER_NO_DEVICE. Abort connection.");
+ AbortConnection();
}
+
SDL_LOG_TRACE("exit");
}
@@ -200,38 +217,49 @@ TransportAdapter::Error UsbConnection::PostOutTransfer() {
}
void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
+ SDL_LOG_AUTO_TRACE();
SDL_LOG_TRACE("enter with Libusb_transfer*: " << transfer);
auto error_code = TransportAdapter::OK;
{
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (LIBUSB_TRANSFER_COMPLETED == transfer->status) {
- bytes_sent_ += transfer->actual_length;
- if (current_out_message_->data_size() == bytes_sent_) {
- SDL_LOG_DEBUG(
- "USB out transfer, data sent: " << current_out_message_.get());
- controller_->DataSendDone(
- device_uid_, app_handle_, current_out_message_);
+ switch (transfer->status) {
+ case LIBUSB_TRANSFER_COMPLETED: {
+ bytes_sent_ += transfer->actual_length;
+ if (current_out_message_->data_size() == bytes_sent_) {
+ SDL_LOG_DEBUG(
+ "USB out transfer, data sent: " << current_out_message_.get());
+ controller_->DataSendDone(
+ device_uid_, app_handle_, current_out_message_);
+ error_code = PopOutMessage();
+ }
+ break;
+ }
+
+ case LIBUSB_TRANSFER_CANCELLED: {
+ SDL_LOG_DEBUG("Free already canceled transfer.");
+ break;
+ }
+
+ default: {
+ SDL_LOG_ERROR(
+ "USB out transfer failed: " << libusb_error_name(transfer->status));
+ controller_->DataSendFailed(
+ device_uid_, app_handle_, current_out_message_, DataSendError());
error_code = PopOutMessage();
}
- } else {
- SDL_LOG_ERROR(
- "USB out transfer failed: " << libusb_error_name(transfer->status));
- controller_->DataSendFailed(
- device_uid_, app_handle_, current_out_message_, DataSendError());
- error_code = PopOutMessage();
}
- if (current_out_message_.use_count() == 0) {
+
+ if (waiting_out_transfer_cancel_ || current_out_message_.use_count() == 0) {
libusb_free_transfer(transfer);
out_transfer_ = nullptr;
waiting_out_transfer_cancel_ = false;
+ return;
}
}
if (TransportAdapter::FAIL == error_code) {
AbortConnection();
}
-
- SDL_LOG_TRACE("exit");
}
TransportAdapter::Error UsbConnection::SendData(
diff --git a/src/components/transport_manager/src/websocket_server/websocket_server_transport_adapter.cc b/src/components/transport_manager/src/websocket_server/websocket_server_transport_adapter.cc
index 68f23a6326..9c02b78872 100644
--- a/src/components/transport_manager/src/websocket_server/websocket_server_transport_adapter.cc
+++ b/src/components/transport_manager/src/websocket_server/websocket_server_transport_adapter.cc
@@ -100,7 +100,10 @@ TransportAdapter::Error WebSocketServerTransportAdapter::Init() {
void WebSocketServerTransportAdapter::Store() const {
SDL_LOG_AUTO_TRACE();
if (webengine_device_) {
- Json::Value& dictionary = last_state().get_dictionary();
+ resumption::LastStateAccessor accessor =
+ last_state_wrapper_->get_accessor();
+ resumption::LastState& data = accessor.GetMutableData();
+ Json::Value dictionary = data.dictionary();
if (dictionary["TransportManager"].isMember("WebsocketServerAdapter")) {
SDL_LOG_DEBUG(
"WebsocketServerAdapter already exists. Storing is skipped");
@@ -114,12 +117,15 @@ void WebSocketServerTransportAdapter::Store() const {
ws_adapter_dictionary["device"] = device_dictionary;
dictionary["TransportManager"]["WebsocketServerAdapter"] =
ws_adapter_dictionary;
+
+ data.set_dictionary(dictionary);
}
}
bool WebSocketServerTransportAdapter::Restore() {
SDL_LOG_AUTO_TRACE();
- const Json::Value& dictionary = last_state().get_dictionary();
+ resumption::LastStateAccessor accessor = last_state_wrapper_->get_accessor();
+ Json::Value dictionary = accessor.GetData().dictionary();
const Json::Value ws_adapter_dictionary =
dictionary["TransportManager"]["WebsocketServerAdapter"];
webengine_device_id_ =
diff --git a/src/components/transport_manager/src/websocket_server/websocket_session.cc b/src/components/transport_manager/src/websocket_server/websocket_session.cc
index 1def04d700..020da580f9 100644
--- a/src/components/transport_manager/src/websocket_server/websocket_session.cc
+++ b/src/components/transport_manager/src/websocket_server/websocket_session.cc
@@ -92,6 +92,8 @@ void WebSocketSession<ExecutorType>::AsyncRead(boost::system::error_code ec) {
if (ec) {
auto str_err = "ErrorMessage: " + ec.message();
SDL_LOG_ERROR(str_err);
+ buffer_.consume(buffer_.size());
+ on_io_error_();
return;
}
diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
index 5aedfd58aa..4f5cbf71eb 100644
--- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
+++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
@@ -54,10 +54,6 @@ using namespace ::protocol_handler;
class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
public:
explicit RawMessageMatcher(RawMessagePtr ptr);
-
- DEPRECATED
- virtual bool MatchAndExplain(const RawMessagePtr msg,
- MatchResultListener* listener) const;
virtual void DescribeTo(std::ostream* os) const;
virtual void DescribeNegationTo(std::ostream* os) const;
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
index 7b1d720ba2..4be51431d7 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
@@ -66,13 +66,6 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
last_state_wrapper,
settings) {}
- DEPRECATED
- MockTransportAdapterImpl(DeviceScanner*,
- ServerConnectionFactory*,
- ClientConnectionListener*,
- resumption::LastState&,
- const transport_manager::TransportManagerSettings&);
-
ConnectionSPtr FindStatedConnection(const DeviceUID& device_handle,
const ApplicationHandle& app_handle) {
return this->FindEstablishedConnection(device_handle, app_handle);
diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc
index 67b4a0a8ba..66cfa85ef9 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -210,8 +210,6 @@ void TestTransportManagerDefault::ExpectationsSettings_TM(
.WillByDefault(ReturnRef(kWSServerCACertPath));
ON_CALL(*mock_last_state_, dictionary())
.WillByDefault(Return(custom_dictionary_));
- ON_CALL(*mock_last_state_, get_dictionary())
- .WillByDefault(ReturnRef(custom_dictionary_));
EXPECT_CALL(transport_manager_settings_, use_last_state())
.WillRepeatedly(Return(use_last_state));
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index b65b19253a..50f75151a4 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -69,17 +69,27 @@ if(NOT BUILD_BACKTRACE_SUPPORT)
)
endif()
-if(ENABLE_LOG)
- list(APPEND LIBRARIES
- log4cxx -L${LOG4CXX_LIBS_DIRECTORY}
- apr-1 -L${APR_LIBS_DIRECTORY}
- aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY}
- ConfigProfile
- )
+if (ENABLE_LOG)
+ if (${LOGGER_NAME} STREQUAL "LOG4CXX")
+ list(APPEND EXCLUDE_PATHS
+ logger/boostlogger.cc
+ )
+ list(APPEND LIBRARIES
+ log4cxx -L${LOG4CXX_LIBS_DIRECTORY}
+ apr-1 -L${APR_LIBS_DIRECTORY}
+ aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY}
+ ConfigProfile
+ )
+ else()
+ list(APPEND EXCLUDE_PATHS
+ logger/log4cxxlogger.cc
+ )
+ endif()
else()
list(APPEND EXCLUDE_PATHS
auto_trace.cc
logger/log4cxxlogger.cc
+ logger/boostlogger.cc
)
endif()
@@ -121,12 +131,21 @@ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
list(APPEND LIBRARIES boost_thread -L${BOOST_LIBS_DIRECTORY})
list(APPEND LIBRARIES boost_date_time -L${BOOST_LIBS_DIRECTORY})
list(APPEND LIBRARIES boost_filesystem -L${BOOST_LIBS_DIRECTORY})
+if (ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "BOOST")
+ list(APPEND LIBRARIES boost_log_setup -L${BOOST_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES boost_log -L${BOOST_LIBS_DIRECTORY})
+endif ()
+list(APPEND LIBRARIES boost_regex -L${BOOST_LIBS_DIRECTORY})
target_link_libraries("Utils" ${LIBRARIES})
add_dependencies("Utils" Boost)
if(ENABLE_LOG)
- add_dependencies("Utils" install-3rd_party_logger Boost)
+ if (${LOGGER_NAME} STREQUAL "LOG4CXX")
+ add_dependencies("Utils" install-3rd_party_logger Boost)
+ else()
+ add_dependencies("Utils" Boost)
+ endif()
endif()
if(BUILD_TESTS)
diff --git a/src/components/utils/include/utils/convert_utils.h b/src/components/utils/include/utils/convert_utils.h
index ba23b620dc..e51cf8cd57 100644
--- a/src/components/utils/include/utils/convert_utils.h
+++ b/src/components/utils/include/utils/convert_utils.h
@@ -70,20 +70,6 @@ unsigned long long int ConvertUInt64ToLongLongUInt(const uint64_t value);
uint64_t ConvertLongLongUIntToUInt64(const unsigned long long int value);
/**
- * @brief Convert one number value to another type value
- * @param value to be converted
- * @return conversion result
- */
-template <typename InputType, typename OutputType>
-OutputType SafeStaticCast(const InputType value) {
- DCHECK_OR_RETURN(value >= std::numeric_limits<OutputType>::min(),
- std::numeric_limits<OutputType>::min());
- DCHECK_OR_RETURN(value <= std::numeric_limits<OutputType>::max(),
- std::numeric_limits<OutputType>::max());
- return static_cast<OutputType>(value);
-}
-
-/**
* @brief Convert binary data to a string value
* @param data raw binary data
* @param data_size string length. Required to check whether the data is a
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index 232d9583b1..382f38e520 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -257,9 +257,6 @@ bool ReadBinaryFile(const std::string& name,
bool ReadFile(const std::string& name, std::string& result);
-DEPRECATED
-const std::string ConvertPathForURL(const std::string& path);
-
/**
* @brief Create empty file
*
diff --git a/src/components/utils/src/threads/thread_manager.cc b/src/components/utils/include/utils/logger/boostlogger.h
index 466bd98dc5..b7eeb7ab61 100644
--- a/src/components/utils/src/threads/thread_manager.cc
+++ b/src/components/utils/include/utils/logger/boostlogger.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2020, Livio
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,26 +29,31 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#pragma once
-#include "utils/threads/thread_manager.h"
-#include "utils/conditional_variable.h"
-#include "utils/lock.h"
-#include "utils/logger.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
+#define BOOST_LOG_DYN_LINK 1
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include "utils/ilogger.h"
-#include <pthread.h>
+namespace logger {
-#include <list>
-#include <sstream>
+class BoostLogger : public ThirdPartyLoggerInterface {
+ public:
+ BoostLogger(const std::string& filename);
+ void Init() override;
+ void DeInit() override;
+ bool IsEnabledFor(const std::string& component,
+ LogLevel log_level) const override;
+ void PushLog(const LogMessage& log_message) override;
-#if defined(OS_LINUX)
-#include <sys/syscall.h>
-#include <unistd.h>
-#endif
+ private:
+ boost::posix_time::ptime GetLocalPosixTime(
+ const logger::TimePoint& timestamp);
-namespace threads {
+ std::string GetFilteredFunctionTrace(
+ const std::string& full_function_signature);
-SDL_CREATE_LOG_VARIABLE("Utils")
+ std::string filename_;
+};
-} // namespace threads
+} // namespace logger
diff --git a/src/components/utils/include/utils/threads/pulse_thread_delegate.h b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
deleted file mode 100644
index ad6df6fca7..0000000000
--- a/src/components/utils/include/utils/threads/pulse_thread_delegate.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2014, 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_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
-#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
-
-#include <sys/neutrino.h>
-
-#include "utils/threads/thread_delegate.h"
-
-namespace threads {
-
-/**
- * @brief This ThreadDelegate derivative is designed
- * to implement threads waiting for QNX Pulse messages
- * When constucted, an instance of this class creates QNX channel and connects
- * to it
- * In exitThreadMain() channel is disconnected and destroyed
- * In threadMain() endless loop event is armed via pure virtual method
- * ArmEvent()
- * and thread blocks on MsgReceivePulse() waiting for Pulse
- * When Pulse comes, OnPulse() pure virtual method is invoked
- * Subclassed must implement ArmEvent() for events of interest
- * and OnPulse() for reaction on such events
- */
-class PulseThreadDelegate : public ThreadDelegate {
- public:
- /**
- * @brief default constructor
- */
- PulseThreadDelegate();
- virtual void threadMain();
- virtual void exitThreadMain();
-
- protected:
- /**
- * @brief This method is to be implemented to arm events of interest
- * @param event pointer to structure sigevent
- * @return If this method returns true, thread is blocked on
- * MsgReceivePulse() waiting for Pulse
- */
- virtual bool ArmEvent(struct sigevent* event) = 0;
- /**
- * @brief This method is invoked from threadMain() when Pulse comes
- */
- virtual void OnPulse() = 0;
-
- /**
- * This method is to be initialize child class
- * @return If this method returns false, thread will be stopped
- */
- virtual bool Init() {
- return true;
- }
-
- /**
- * Finalizes thread
- * Can free resources
- */
- virtual void Finalize() {}
-
- private:
- enum { PULSE_CODE = _PULSE_CODE_MINAVAIL + 1 };
-
- volatile bool run_;
- int chid_;
- int coid_;
-};
-
-} // namespace threads
-
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
diff --git a/src/components/utils/include/utils/threads/thread_manager.h b/src/components/utils/include/utils/threads/thread_manager.h
deleted file mode 100644
index 4f28d0cb15..0000000000
--- a/src/components/utils/include/utils/threads/thread_manager.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2013, 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_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
-#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
-
-#include "utils/threads/thread.h"
-
-#include <pthread.h>
-
-#include <list>
-#include <map>
-#include <set>
-#include <string>
-
-#include "utils/conditional_variable.h"
-#include "utils/lock.h"
-#include "utils/macro.h"
-#include "utils/message_queue.h"
-#include "utils/singleton.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-
-namespace threads {
-class Thread;
-
-/*
- * This class is here currently to remember names associated to threads.
- * It manages raw impl::PlatformHandles because Thread::Id's do not provide
- * comparison operator. Current linux implementation relies on fact that
- * pthread_t is just an integer and every thread has single unique value
- * associated with it.
- * OS provides it's own facilities to name threads but
- */
-class ThreadManager : public utils::Singleton<ThreadManager> {
- public:
- struct ThreadDesc {
- pthread_t handle;
- ThreadDelegate* delegate;
- };
- ThreadManager() {}
- MessageQueue<ThreadDesc> threads_to_terminate;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ThreadManager);
-
- FRIEND_BASE_SINGLETON_CLASS(ThreadManager);
-};
-
-} // namespace threads
-
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index f0c838a7f9..b2c1f44c53 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -458,25 +458,6 @@ bool file_system::ReadFile(const std::string& name, std::string& result) {
return true;
}
-const std::string file_system::ConvertPathForURL(const std::string& path) {
- SDL_LOG_AUTO_TRACE();
- const std::string reserved_symbols = "!#$&'()*+,:;=?@[] ";
- std::string converted_path;
-
- for (const auto symbol : path) {
- size_t pos = reserved_symbols.find_first_of(symbol);
- if (pos != std::string::npos) {
- const size_t size = 100;
- char percent_value[size];
- snprintf(percent_value, size, "%%%x", symbol);
- converted_path += percent_value;
- } else {
- converted_path += symbol;
- }
- }
- return converted_path;
-}
-
bool file_system::CreateFile(const std::string& path) {
SDL_LOG_AUTO_TRACE();
diff --git a/src/components/utils/src/lock_boost.cc b/src/components/utils/src/lock_boost.cc
index 735b31d882..53b8dc3ace 100644
--- a/src/components/utils/src/lock_boost.cc
+++ b/src/components/utils/src/lock_boost.cc
@@ -72,7 +72,7 @@ void Lock::AssertFreeAndMarkTaken() {
SDL_LOG_FATAL("Locking already taken not recursive mutex");
NOTREACHED();
}
- lock_taken_++;
+ ++lock_taken_;
}
void Lock::AssertTakenAndMarkFree() {
@@ -80,7 +80,7 @@ void Lock::AssertTakenAndMarkFree() {
SDL_LOG_FATAL("Unlocking a mutex that is not taken");
NOTREACHED();
}
- lock_taken_--;
+ --lock_taken_;
}
// Recursive lock looks the same on the surface, some code duplication is
@@ -112,7 +112,7 @@ bool RecursiveLock::Try() {
}
void RecursiveLock::AssertFreeAndMarkTaken() {
- lock_taken_++;
+ ++lock_taken_;
}
void RecursiveLock::AssertTakenAndMarkFree() {
@@ -120,7 +120,7 @@ void RecursiveLock::AssertTakenAndMarkFree() {
SDL_LOG_FATAL("Unlocking a recursive mutex that is not taken");
NOTREACHED();
}
- lock_taken_--;
+ --lock_taken_;
}
} // namespace sync_primitives
diff --git a/src/components/utils/src/logger/boostlogger.cc b/src/components/utils/src/logger/boostlogger.cc
new file mode 100644
index 0000000000..ea85186aae
--- /dev/null
+++ b/src/components/utils/src/logger/boostlogger.cc
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2020, 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 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 "utils/logger/boostlogger.h"
+
+#include <boost/format.hpp>
+#include <boost/log/core.hpp>
+#include <boost/log/expressions.hpp>
+#include <boost/log/sinks/sync_frontend.hpp>
+#include <boost/log/sinks/text_file_backend.hpp>
+#include <boost/log/sinks/text_ostream_backend.hpp>
+#include <boost/log/sources/logger.hpp>
+#include <boost/log/sources/record_ostream.hpp>
+#include <boost/log/sources/severity_channel_logger.hpp>
+#include <boost/log/sources/severity_logger.hpp>
+#include <boost/log/support/date_time.hpp>
+#include <boost/log/trivial.hpp>
+#include <boost/log/utility/setup/common_attributes.hpp>
+#include <boost/log/utility/setup/file.hpp>
+#include <boost/log/utility/setup/from_settings.hpp>
+#include <boost/log/utility/setup/settings_parser.hpp>
+#include <fstream>
+
+#include <boost/date_time/c_local_time_adjustor.hpp>
+#include <boost/date_time/local_time_adjustor.hpp>
+
+#include <boost/regex.hpp>
+
+namespace logger {
+
+namespace logging = boost::log;
+namespace src = boost::log::sources;
+namespace sinks = boost::log::sinks;
+namespace keywords = boost::log::keywords;
+namespace expr = boost::log::expressions;
+namespace attrs = boost::log::attributes;
+
+BoostLogger::BoostLogger(const std::string& filename) : filename_(filename) {}
+
+void BoostLogger::Init() {
+ // Add formatting parameters to INI file
+ // Allows %Severity% to be used in ini config file for property Format.
+ boost::log::register_simple_formatter_factory<
+ boost::log::trivial::severity_level,
+ char>("Severity");
+ boost::log::register_simple_formatter_factory<std::string, char>("Component");
+ boost::log::register_simple_formatter_factory<boost::posix_time::ptime, char>(
+ "TimeStamp");
+ boost::log::register_simple_formatter_factory<std::thread::id, char>(
+ "ThreadId");
+ boost::log::register_simple_formatter_factory<std::string, char>("FileName");
+ boost::log::register_simple_formatter_factory<int, char>("LineNum");
+ boost::log::register_simple_formatter_factory<std::string, char>("Trace");
+
+ // Add filter parameters to INI file
+ // Allows %Severity% to be used in ini config file for property Filter.
+ boost::log::
+ register_simple_filter_factory<boost::log::trivial::severity_level, char>(
+ "Severity");
+ boost::log::register_simple_filter_factory<std::string, char>("Component");
+ boost::log::register_simple_filter_factory<std::string, char>("Trace");
+
+ std::ifstream file(filename_);
+ boost::log::settings settings = boost::log::parse_settings(file);
+
+ // Custom Settings
+
+ if (settings.has_section("Sinks")) {
+ auto& sinks = settings.property_tree().get_child("Sinks");
+
+ for (auto it = sinks.begin(); it != sinks.end();) {
+ bool to_be_removed = false;
+ std::string sink_name = "Sinks." + it->first;
+
+ // Disable logging for particular sinks
+ if (boost::optional<std::string> param =
+ settings[sink_name]["DisableLogging"]) {
+ to_be_removed = (param.get() == "true");
+ }
+
+ if (to_be_removed) {
+ it = sinks.erase(it);
+ } else {
+ it++;
+ }
+ }
+ }
+
+ logging::init_from_settings(settings);
+}
+
+void BoostLogger::DeInit() {
+ logging::core::get()->remove_all_sinks();
+}
+
+logging::trivial::severity_level getBoostLogLevel(LogLevel log_level) {
+ switch (log_level) {
+ case LogLevel::TRACE_LEVEL:
+ return logging::trivial::severity_level::trace;
+ case LogLevel::DEBUG_LEVEL:
+ return logging::trivial::severity_level::debug;
+ case LogLevel::INFO_LEVEL:
+ return logging::trivial::severity_level::info;
+ case LogLevel::WARNING_LEVEL:
+ return logging::trivial::severity_level::warning;
+ case LogLevel::ERROR_LEVEL:
+ return logging::trivial::severity_level::error;
+ case LogLevel::FATAL_LEVEL:
+ return logging::trivial::severity_level::fatal;
+ default:
+ assert(false);
+ return logging::trivial::severity_level::trace;
+ }
+}
+
+boost::posix_time::ptime BoostLogger::GetLocalPosixTime(
+ const logger::TimePoint& timestamp) {
+ auto time = std::chrono::duration_cast<std::chrono::microseconds>(
+ timestamp.time_since_epoch())
+ .count();
+
+ boost::posix_time::ptime time_epoch(boost::gregorian::date(1970, 1, 1));
+ boost::posix_time::ptime utc_time =
+ time_epoch + boost::posix_time::microseconds(time);
+
+ typedef boost::date_time::c_local_adjustor<boost::posix_time::ptime>
+ local_adj;
+ auto local_time = local_adj::utc_to_local(utc_time);
+
+ return local_time;
+}
+
+std::string BoostLogger::GetFilteredFunctionTrace(
+ const std::string& full_function_signature) {
+ boost::regex function_pattern("([^\\s]*)\\((.*)\\)");
+ boost::smatch results;
+
+ if (!boost::regex_search(
+ full_function_signature, results, function_pattern)) {
+ // Invalid pattern
+ return std::string(full_function_signature);
+ }
+
+ // Get the function name(including namespaces) from the function signature
+ return std::string(results[1]);
+}
+
+bool BoostLogger::IsEnabledFor(const std::string& component,
+ LogLevel log_level) const {
+ // Basic filtering based on component name and log level is currently handled
+ // using the Filter attribute. This function should be implemented if we add
+ // custom attributes for filtering or additional logic for filtering based on
+ // component name and log level.
+ return true;
+}
+
+void BoostLogger::PushLog(const LogMessage& log_message) {
+ auto local_time = GetLocalPosixTime(log_message.timestamp_);
+ std::string func_name =
+ GetFilteredFunctionTrace(log_message.location_.function_name);
+
+ src::severity_logger<logging::trivial::severity_level> slg;
+ slg.add_attribute("TimeStamp",
+ attrs::constant<boost::posix_time::ptime>(local_time));
+ slg.add_attribute("ThreadId",
+ attrs::constant<std::thread::id>(log_message.thread_id_));
+ slg.add_attribute("Component",
+ attrs::constant<std::string>(log_message.component_));
+ slg.add_attribute(
+ "FileName",
+ attrs::constant<std::string>(log_message.location_.file_name));
+ slg.add_attribute("LineNum",
+ attrs::constant<int>(log_message.location_.line_number));
+ slg.add_attribute("Trace", attrs::constant<std::string>(func_name));
+
+ BOOST_LOG_SEV(slg, getBoostLogLevel(log_message.log_level_))
+ << log_message.log_event_;
+}
+
+} // namespace logger
diff --git a/src/components/utils/src/threads/pulse_thread_delegate.cc b/src/components/utils/src/threads/pulse_thread_delegate.cc
deleted file mode 100644
index 79174ae693..0000000000
--- a/src/components/utils/src/threads/pulse_thread_delegate.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2014, 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 <sys/netmgr.h>
-
-#include "utils/logger.h"
-#include "utils/threads/pulse_thread_delegate.h"
-
-namespace threads {
-
-SDL_CREATE_LOG_VARIABLE("Utils")
-
-PulseThreadDelegate::PulseThreadDelegate() : run_(false) {
- SDL_LOG_TRACE("Creating QNX channel");
- chid_ = ChannelCreate(0);
- if (chid_ == -1) {
- SDL_LOG_ERROR("Failed to create QNX channel");
- return;
- }
- SDL_LOG_DEBUG("Created QNX channel " << chid_);
-
- SDL_LOG_TRACE("Connecting to QNX channel " << chid_);
- coid_ = ConnectAttach(ND_LOCAL_NODE, 0, chid_, _NTO_SIDE_CHANNEL, 0);
- if (coid_ == -1) {
- SDL_LOG_ERROR("Failed to connect to QNX channel " << chid_);
- return;
- }
- SDL_LOG_DEBUG("Connected to QNX channel " << chid_);
-
- run_ = true;
-}
-
-void PulseThreadDelegate::threadMain() {
- if (!Init()) {
- SDL_LOG_ERROR("Failed to initialize thread for QNX channel " << chid_);
- return;
- }
- while (run_) {
- struct sigevent event;
- SIGEV_PULSE_INIT(&event, coid_, SIGEV_PULSE_PRIO_INHERIT, PULSE_CODE, 0);
- if (ArmEvent(&event)) {
- struct _pulse pulse;
- SDL_LOG_INFO("Waiting for pulse on QNX channel " << chid_);
- if (MsgReceivePulse(chid_, &pulse, sizeof(pulse), 0) != -1) {
- SDL_LOG_INFO("Received pulse on QNX channel " << chid_);
- switch (pulse.code) {
- case PULSE_CODE:
- OnPulse();
- break;
- }
- } else {
- if (run_) {
- SDL_LOG_WARN("Error occurred while waiting for pulse on QNX channel "
- << chid_);
- } else {
- SDL_LOG_INFO("QNX channel " << chid_ << " is apparently destroyed");
- }
- }
- }
- }
- Finalize();
-}
-
-void PulseThreadDelegate::exitThreadMain() {
- run_ = false;
-
- SDL_LOG_TRACE("Disconnecting from QNX channel " << chid_);
- if (ConnectDetach(coid_) != -1) {
- SDL_LOG_DEBUG("Disconnected from QNX channel " << chid_);
- } else {
- SDL_LOG_WARN("Failed to disconnect from QNX channel " << chid_);
- }
-
- SDL_LOG_TRACE("Destroying QNX channel " << chid_);
- if (ChannelDestroy(chid_) != -1) { // unblocks MsgReceivePulse()
- SDL_LOG_DEBUG("QNX channel " << chid_ << " destroyed");
- } else {
- SDL_LOG_WARN("Failed to destroy QNX channel " << chid_);
- }
-}
-
-} // namespace threads
diff --git a/src/components/utils/src/timer.cc b/src/components/utils/src/timer.cc
index ceade03afb..d5b0e9eb80 100644
--- a/src/components/utils/src/timer.cc
+++ b/src/components/utils/src/timer.cc
@@ -87,7 +87,9 @@ void timer::Timer::Start(const Milliseconds timeout,
single_shot_ = false;
break;
}
- default: { ASSERT("timer_type should be kSingleShot or kPeriodic"); }
+ default: {
+ ASSERT("timer_type should be kSingleShot or kPeriodic");
+ }
};
StartDelegate(timeout);
StartThread();
diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt
index 2db7d72d84..c09d2d7ce6 100644
--- a/src/components/utils/test/CMakeLists.txt
+++ b/src/components/utils/test/CMakeLists.txt
@@ -93,7 +93,12 @@ set(LIBRARIES
create_test(utils_test "${SOURCES}" "${LIBRARIES}")
file(COPY testscript.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+if (${LOGGER_NAME} STREQUAL "LOG4CXX")
+ file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+else()
+ file(COPY boostlogconfig.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(test_generator)
diff --git a/src/components/utils/test/boostlogconfig.ini b/src/components/utils/test/boostlogconfig.ini
new file mode 100644
index 0000000000..f33da81c93
--- /dev/null
+++ b/src/components/utils/test/boostlogconfig.ini
@@ -0,0 +1,51 @@
+# Core settings
+[Core]
+DisableLogging=false
+
+# Console Logging
+[Sinks.Console]
+DisableLogging=true
+Destination=Console
+Filter="%Severity% > trace"
+Format="%Severity% [%TimeStamp%][%Component%] %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# SDL log file
+[Sinks.AllMessages]
+DisableLogging=false
+Destination=TextFile
+FileName=SmartDeviceLinkCore.log
+Append=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for all TransportManager messages
+[Sinks.TransportManager]
+DisableLogging=false
+Destination=TextFile
+FileName=TransportManager.log
+Append=false
+Filter="%Component% = TransportManager"
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+# Log file for handling Ford protocol info (include ProtocolHandler, ConnectionHandler, SecurityManager)
+[Sinks.ProtocolFordHandling]
+DisableLogging=false
+Destination=TextFile
+FileName=ProtocolFordHandling.log
+Append=false
+Filter="%Component% = ConnectionHandler or %Component% = HeartBeatMonitor or %Component% = ProtocolHandler or %Component% = SecurityManager"
+Format="%Severity% [%TimeStamp%][%Component%] %Trace%: %Message%"
+AutoFlush=true
+Asynchronous=true
+
+[Sinks.Telnet]
+DisableLogging=true
+Destination=Syslog
+Asynchronous=true
+Format="%Severity% [%TimeStamp%][%ThreadId%][%Component%] %FileName%:%LineNum% %Trace%: %Message%"
+LocalAddress="http://127.0.0.1:6676/" \ No newline at end of file
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
index a94392f81c..9d4e943df6 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -47,8 +47,8 @@ typedef std::vector<std::string> StringArray;
using namespace file_system;
namespace {
-StringArray MergeStringsToArray(const std::string& first,
- const std::string& second) {
+StringArray MergeStringsToArray(const std::string first,
+ const std::string second) {
StringArray array_of_strings;
array_of_strings.reserve(2);
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 4b6f6d8dfa..4b6bf18046 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -28,6 +28,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(ENABLE_LOG)
+if(ENABLE_LOG AND ${LOGGER_NAME} STREQUAL "LOG4CXX")
add_subdirectory(appenders)
endif()
diff --git a/src/plugins/appenders/CMakeLists.txt b/src/plugins/appenders/CMakeLists.txt
index 3d18e62503..7ec235bece 100644
--- a/src/plugins/appenders/CMakeLists.txt
+++ b/src/plugins/appenders/CMakeLists.txt
@@ -30,15 +30,19 @@
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+if (${LOGGER_NAME} STREQUAL "LOG4CXX")
include_directories(
${LOG4CXX_INCLUDE_DIRECTORY}
)
+endif()
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+if (${LOGGER_NAME} STREQUAL "LOG4CXX")
set(LIBRARIES
log4cxx -L${LOG4CXX_LIBS_DIRECTORY}
)
+endif()
add_library(appenders SHARED ${SOURCES})
target_link_libraries(appenders ${LIBRARIES})
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
index 736a95f7ac..dffaa6c1b5 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
@@ -785,6 +785,7 @@ class CodeGenerator(object):
result_array.append(self._impl_code_item_decl_template.substitute(
comment="",
var_name=self._gen_schema_item_var_name(item),
+ var_type="std::shared_ptr<ISchemaItem>",
item_decl=self._impl_function_schema))
result_array.append(self._gen_function_history_vector_item_fill(item, member.name))
count += 1
@@ -811,6 +812,7 @@ class CodeGenerator(object):
return self._impl_code_item_decl_template.substitute(
comment=self._gen_comment(member, False),
var_name=self._gen_schema_item_var_name(member),
+ var_type="ISchemaItem*" if type(member.param_type) is Struct else "std::shared_ptr<ISchemaItem>",
item_decl=self._gen_schema_item_decl_code(
member.param_type,
member.name,
@@ -838,22 +840,37 @@ class CodeGenerator(object):
[[u"bool", None if param.default_value is None
else u"true" if param.default_value is True else u"false"]]))
elif type(param) is Integer:
- if not param.max_value or param.max_value and param.max_value < 2 ** 31:
+ if param.min_value is not None and param.min_value >= 0:
+ if param.max_value is None or param.max_value >= 2 ** 32:
+ code = self._impl_code_integer_item_template.substitute(
+ type=u"uint64_t",
+ params=self._gen_schema_item_param_values(
+ [[u"uint64_t", param.min_value],
+ [u"uint64_t", param.max_value],
+ [u"uint64_t", param.default_value]]))
+ else:
+ code = self._impl_code_integer_item_template.substitute(
+ type=u"uint32_t",
+ params=self._gen_schema_item_param_values(
+ [[u"uint32_t", param.min_value],
+ [u"uint32_t", param.max_value],
+ [u"uint32_t", param.default_value]]))
+ elif (param.min_value is not None and param.min_value >= -(2 ** 31)) and (param.max_value is not None and param.max_value < 2 ** 31):
code = self._impl_code_integer_item_template.substitute(
type=u"int32_t",
params=self._gen_schema_item_param_values(
[[u"int32_t", param.min_value],
[u"int32_t", param.max_value],
[u"int32_t", param.default_value]]))
- elif param.max_value < 2 ** 63:
+ elif (param.min_value is None or param.min_value >= -(2 ** 63)) and (param.max_value is None or param.max_value < 2 ** 63):
code = self._impl_code_integer_item_template.substitute(
type=u"int64_t",
params=self._gen_schema_item_param_values(
[[u"int64_t", param.min_value],
- [u"int64_t", str(param.max_value) + u"LL"],
+ [u"int64_t", param.max_value],
[u"int64_t", param.default_value]]))
else:
- raise GenerateError("Parameter value too large: " + str(param.max_value))
+ raise GenerateError("Parameter value too large/small: " + str(param.min_value) + "/" + str(param.max_value))
elif type(param) is Float:
code = self._impl_code_integer_item_template.substitute(
type=u"double",
@@ -1724,11 +1741,11 @@ class CodeGenerator(object):
u'''\n'''
u'''using namespace ns_smart_device_link::ns_smart_objects;\n'''
u'''\n'''
+ u'''$namespace::$class_name::TStructsSchemaItems $namespace::$class_name::struct_schema_items = {};\n\n'''
u'''$namespace::$class_name::$class_name()\n'''
u''' : ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, '''
u'''messageType::eType, StructIdentifiers::eType>() {\n'''
- u''' TStructsSchemaItems struct_schema_items;\n'''
- u''' InitStructSchemes(struct_schema_items);\n'''
+ u''' InitStructSchemes();\n'''
u'''\n'''
u''' std::set<FunctionID::eType> function_id_items;\n'''
u'''${function_id_items}'''
@@ -1736,7 +1753,7 @@ class CodeGenerator(object):
u''' std::set<messageType::eType> message_type_items;\n'''
u'''${message_type_items}'''
u'''\n'''
- u''' InitFunctionSchemes(struct_schema_items, function_id_items, '''
+ u''' InitFunctionSchemes(function_id_items, '''
u'''message_type_items);\n'''
u'''}\n'''
u'''\n'''
@@ -1780,13 +1797,11 @@ class CodeGenerator(object):
u''' InitFunctionSchema(function_id, message_type);\n'''
u'''}\n'''
u'''\n'''
- u'''void $namespace::$class_name::InitStructSchemes(\n'''
- u''' TStructsSchemaItems &struct_schema_items) {'''
+ u'''void $namespace::$class_name::InitStructSchemes() {'''
u'''$struct_schema_items'''
u'''}\n'''
u'''\n'''
u'''void $namespace::$class_name::InitFunctionSchemes(\n'''
- u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
u''' const std::set<messageType::eType> &message_type_items) {\n'''
u'''$pre_function_schemas'''
@@ -1797,8 +1812,6 @@ class CodeGenerator(object):
u''' const FunctionID::eType &function_id,\n'''
u''' const messageType::eType &message_type) {\n'''
u'''\n'''
- u''' TStructsSchemaItems struct_schema_items;\n'''
- u''' InitStructSchemes(struct_schema_items);\n'''
u'''\n'''
u''' std::set<FunctionID::eType> function_id_items { function_id };\n'''
u''' std::set<messageType::eType> message_type_items { message_type };\n'''
@@ -1873,13 +1886,13 @@ class CodeGenerator(object):
u''' ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType> shema_key(function_id, message_type);\n'''
u''' functions_schemes_[shema_key] = '''
u'''InitFunction_${function_id}_${message_type}('''
- u'''struct_schema_items, function_id_items, message_type_items);\n'''
+ u'''function_id_items, message_type_items);\n'''
u''' break;\n'''
u'''}\n''')
_struct_schema_item_template = string.Template(
u'''std::shared_ptr<ISchemaItem> struct_schema_item_${name} = '''
- u'''InitStructSchemaItem_${name}(struct_schema_items);\n'''
+ u'''InitStructSchemaItem_${name}();\n'''
u'''structs_schemes_.insert(std::make_pair('''
u'''StructIdentifiers::${name}, CSmartSchema('''
u'''struct_schema_item_${name})));\n''')
@@ -1890,12 +1903,11 @@ class CodeGenerator(object):
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>'''
u'''(FunctionID::$function_id, messageType::$message_type), '''
u'''InitFunction_${function_id}_${message_type}('''
- u'''struct_schema_items, function_id_items, message_type_items)));''')
+ u'''function_id_items, message_type_items)));''')
_struct_impl_template = string.Template(
u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
- u'''InitStructSchemaItem_${struct_name}(\n'''
- u''' TStructsSchemaItems &struct_schema_items) {\n'''
+ u'''InitStructSchemaItem_${struct_name}() {\n'''
u'''$code'''
u'''}\n''')
@@ -1932,7 +1944,7 @@ class CodeGenerator(object):
_impl_code_item_decl_template = string.Template(
u'''${comment}'''
- u'''std::shared_ptr<ISchemaItem> ${var_name} = ${item_decl};''')
+ u'''${var_type} ${var_name} = ${item_decl};''')
_impl_code_shared_ptr_vector_template = string.Template(
u'''std::vector<SMember> ${var_name}_history_vector;''')
@@ -1954,7 +1966,7 @@ class CodeGenerator(object):
_impl_code_struct_item_template = string.Template(
u'''ProvideObjectSchemaItemForStruct(struct_schema_items, '''
- u'''StructIdentifiers::${name})''')
+ u'''StructIdentifiers::${name}).get()''')
_impl_code_enum_item_template = string.Template(
u'''TEnumSchemaItem<${type}::eType>::create(${params})''')
@@ -1988,7 +2000,6 @@ class CodeGenerator(object):
_function_impl_template = string.Template(
u'''CSmartSchema $namespace::$class_name::'''
u'''InitFunction_${function_id}_${message_type}(\n'''
- u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
u''' const std::set<messageType::eType> &message_type_items) {\n'''
u'''$code'''
@@ -2066,20 +2077,17 @@ class CodeGenerator(object):
u''' /**\n'''
u''' * @brief Initializes all struct schemes.\n'''
u''' */\n'''
- u''' void InitStructSchemes('''
- u'''TStructsSchemaItems &struct_schema_items);\n'''
+ u''' void InitStructSchemes();\n'''
u'''\n'''
u''' /**\n'''
u''' * @brief Initializes all function schemes.\n'''
u''' *\n'''
- u''' * @param struct_schema_items Struct schema items.\n'''
u''' * @param function_id_items Set of all elements '''
u'''of FunctionID enum.\n'''
u''' * @param message_type_items Set of all elements '''
u'''of messageType enum.\n'''
u''' */\n'''
u''' void InitFunctionSchemes(\n'''
- u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
u''' const std::set<messageType::eType> '''
u'''&message_type_items);\n'''
@@ -2097,6 +2105,7 @@ class CodeGenerator(object):
u'''$init_function_decls'''
u'''\n'''
u''' public:\n'''
+ u''' static TStructsSchemaItems struct_schema_items;\n'''
u'''$init_struct_decls'''
u'''};''')
@@ -2107,7 +2116,6 @@ class CodeGenerator(object):
u'''$comment\n'''
u'''static ns_smart_device_link::ns_smart_objects::CSmartSchema '''
u'''InitFunction_${function_id}_${message_type}(\n'''
- u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
u''' const std::set<messageType::eType> &message_type_items);''')
@@ -2115,8 +2123,7 @@ class CodeGenerator(object):
u'''$comment\n'''
u'''static '''
u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
- u'''InitStructSchemaItem_${struct_name}(\n'''
- u''' TStructsSchemaItems &struct_schema_items);''')
+ u'''InitStructSchemaItem_${struct_name}();\n''')
_class_comment_template = string.Template(
u'''/**\n'''
diff --git a/tools/infrastructure/check_style.sh b/tools/infrastructure/check_style.sh
index 006dd340d9..139d7952ee 100755
--- a/tools/infrastructure/check_style.sh
+++ b/tools/infrastructure/check_style.sh
@@ -27,7 +27,7 @@
# 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.
-FORMATER=clang-format-6.0
+FORMATER=clang-format-8
INSTALL_CMD="sudo apt-get install -f $FORMATER"
if [ "$1" = "--help" ]
diff --git a/tools/infrastructure/git-hooks/pre-commit b/tools/infrastructure/git-hooks/pre-commit
index 710f0656c3..57fe1ae887 100755
--- a/tools/infrastructure/git-hooks/pre-commit
+++ b/tools/infrastructure/git-hooks/pre-commit
@@ -72,10 +72,10 @@ if [ "$?" -ne "0" ]; then
exit 1
fi
-# Auto update c++ files with clang-format-6.0
-CLANG_FORMAT=clang-format-6.0
+# Auto update c++ files with clang-format-8
+CLANG_FORMAT=clang-format-8
# Verify clang-format
-CLANG_FORMAT_REQUIRED_VERSION=6.0
+CLANG_FORMAT_REQUIRED_VERSION=8.0
CLANG_FORMAT_CURRENT_VERSION=$($CLANG_FORMAT -version)
if [[ $CLANG_FORMAT_CURRENT_VERSION != *$CLANG_FORMAT_REQUIRED_VERSION* ]]
then
diff --git a/tools/policy_table_validator/main.cpp b/tools/policy_table_validator/main.cpp
index 7e099c7ae1..cc1318d215 100644
--- a/tools/policy_table_validator/main.cpp
+++ b/tools/policy_table_validator/main.cpp
@@ -6,8 +6,13 @@
#include "utils/file_system.h"
#ifdef ENABLE_LOG
-#include "utils/logger/logger_impl.h"
+#ifdef LOG4CXX_LOGGER
#include "utils/logger/log4cxxlogger.h"
+#else // LOG4CXX_LOGGER
+#include "utils/logger/boostlogger.h"
+#endif // LOG4CXX_LOGGER
+
+#include "utils/logger/logger_impl.h"
#endif // ENABLE_LOG
#include "utils/logger.h"
@@ -55,7 +60,13 @@ int main(int argc, char** argv) {
// --------------------------------------------------------------------------
// Logger initialization
// Redefine for each paticular logger implementation
- auto logger = std::unique_ptr<logger::Log4CXXLogger>(new logger::Log4CXXLogger("log4cxx.properties"));
+#ifdef LOG4CXX_LOGGER
+ auto logger = std::unique_ptr<logger::Log4CXXLogger>(
+ new logger::Log4CXXLogger("log4cxx.properties"));
+#else // LOG4CXX_LOGGER
+ auto logger = std::unique_ptr<logger::BoostLogger>(
+ new logger::BoostLogger("boostlogconfig.ini"));
+#endif // LOG4CXX_LOGGER
auto logger_impl = std::unique_ptr<logger::LoggerImpl>(new logger::LoggerImpl());
logger::Logger::instance(logger_impl.get());
logger_impl->Init(std::move(logger));
diff --git a/tools/rpc_spec b/tools/rpc_spec
-Subproject 72632f946941d63a57ee5e99896e3eae3627f7d
+Subproject 6537500b45f65e02d884da9d73d6820ba7b0b1f