summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhit Adlakha <adlakhashobhit@gmail.com>2019-07-22 09:52:37 -0400
committerShobhit Adlakha <adlakhashobhit@gmail.com>2019-07-22 09:52:37 -0400
commita72e667bfc1df405ea9f8360e6b38c25323002f4 (patch)
tree70508453e876113454815af258390fe46dec1744
parent4c148aafa5a21ee11f69af75e37afbf961a8766d (diff)
parent5e6ea2c18e35b56a3109a0a5c1bb962b9445a094 (diff)
downloadsdl_core-a72e667bfc1df405ea9f8360e6b38c25323002f4.tar.gz
Fixed merge conflicts and updated branch
-rw-r--r--.github/ISSUE_TEMPLATE.md4
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md4
-rw-r--r--.travis.yml4
-rw-r--r--CMakeLists.txt9
-rw-r--r--src/3rd_party/CMakeLists.txt36
-rw-r--r--src/3rd_party/FindBSON.cmake26
-rw-r--r--src/appMain/CMakeLists.txt1
-rwxr-xr-xsrc/appMain/hmi_capabilities.json11
-rw-r--r--src/appMain/life_cycle.h60
-rw-r--r--src/appMain/life_cycle_impl.cc70
-rw-r--r--src/appMain/life_cycle_impl.h64
-rw-r--r--src/appMain/low_voltage_signals_handler.cc6
-rw-r--r--src/appMain/low_voltage_signals_handler.h2
-rw-r--r--src/appMain/main.cc16
-rw-r--r--src/appMain/sdl_preloaded_pt.json146
-rw-r--r--src/appMain/signal_handlers.cc60
-rw-r--r--src/appMain/signal_handlers.h60
-rw-r--r--src/appMain/smartDeviceLink.ini19
-rw-r--r--src/appMain/test/low_voltage_signals_handler_test.cc78
-rw-r--r--src/appMain/test/mock_life_cycle.h60
-rw-r--r--src/components/application_manager/CMakeLists.txt1
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h22
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h12
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/apps_launcher.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h6
-rw-r--r--src/components/application_manager/include/application_manager/app_service_manager.h266
-rw-r--r--src/components/application_manager/include/application_manager/application.h113
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h6
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h109
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h208
-rw-r--r--src/components/application_manager/include/application_manager/application_state.h14
-rw-r--r--src/components/application_manager/include/application_manager/command_factory.h13
-rw-r--r--src/components/application_manager/include/application_manager/command_holder_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h21
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h22
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h46
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/notification_from_hmi.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/pending.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_hmi.h50
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_to_hmi.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_from_hmi.h62
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event.h107
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h36
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h53
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_observer.h35
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager.h2
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager_impl.h16
-rw-r--r--src/components/application_manager/include/application_manager/helpers/application_helper.h12
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h6
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h3
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/hmi_language_handler.h8
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h12
-rw-r--r--src/components/application_manager/include/application_manager/message.h2
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h157
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h4
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h48
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h20
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h4
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h10
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h4
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h3
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h119
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h10
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h4
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h1
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h7
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h168
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h12
-rw-r--r--src/components/application_manager/include/application_manager/request_tracker.h56
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h2
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h18
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h2
-rw-r--r--src/components/application_manager/include/application_manager/rpc_handler_impl.h23
-rw-r--r--src/components/application_manager/include/application_manager/rpc_passing_handler.h123
-rw-r--r--src/components/application_manager/include/application_manager/rpc_service_impl.h29
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h67
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h24
-rw-r--r--src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/telemetry_observer.h4
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h4
-rw-r--r--src/components/application_manager/rpc_plugins/CMakeLists.txt1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt84
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h131
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h66
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h74
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h75
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h73
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h80
-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.h106
-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_to_hmi.h79
-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_response_from_hmi.h79
-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_response_to_hmi.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h80
-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.h99
-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_to_hmi.h80
-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_response_from_hmi.h80
-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_response_to_hmi.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h88
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h80
-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.h89
-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_to_mobile.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h80
-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.h89
-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_to_mobile.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h80
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc122
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc191
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc165
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc98
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc289
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc164
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc86
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc215
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc99
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc129
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc123
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc188
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt40
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc151
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc136
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc217
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h62
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h2
-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_get_interior_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h8
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h22
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h5
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h29
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h30
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h11
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h34
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h18
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc50
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc33
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc111
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc32
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc46
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc314
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc32
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc154
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h77
-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/button_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h2
-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/navi_subscribe_way_points_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h2
-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_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h2
-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_capabilities_response.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_language_response.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_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h2
-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/tts_set_global_properties_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.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_command_response.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_add_submenu_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.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_capabilities_response.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_language_response.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_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h2
-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/ui_set_global_properties_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h2
-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_add_command_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.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_capabilities_response.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_language_response.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_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h36
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h30
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h17
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc2
-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/get_system_info_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc2
-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/navi_subscribe_way_points_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc171
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc2
-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_get_capabilities_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc41
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc2
-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_capabilities_response.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_language_response.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_get_supported_languages_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc2
-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/tts_set_global_properties_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.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_command_response.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_add_submenu_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.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.cc2
-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_language_response.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_get_supported_languages_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc2
-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/ui_set_global_properties_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc2
-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_add_command_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.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_capabilities_response.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_language_response.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_get_supported_languages_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc356
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc46
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc181
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc42
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc30
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc23
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc267
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc43
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc31
-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_display_layout_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc308
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc174
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc40
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc4
-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/basic_communication_get_system_time_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc334
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc50
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc58
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc34
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc38
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc48
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc38
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc52
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc44
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc30
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc26
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc49
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc42
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h4
-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_get_vehicle_type_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h2
-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/hmi/vi_subscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h12
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h13
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc2
-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_get_vehicle_type_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc2
-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/hmi/vi_subscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc88
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc4
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc6
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc14
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc6
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_sql_queries.cc2
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc4
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc12
-rw-r--r--src/components/application_manager/src/app_service_manager.cc593
-rw-r--r--src/components/application_manager/src/application_impl.cc75
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc746
-rw-r--r--src/components/application_manager/src/application_state.cc2
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc2
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc2
-rw-r--r--src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc26
-rw-r--r--src/components/application_manager/src/commands/command_notification_impl.cc2
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc127
-rw-r--r--src/components/application_manager/src/commands/command_request_to_mobile.cc72
-rw-r--r--src/components/application_manager/src/commands/command_response_from_mobile.cc71
-rw-r--r--src/components/application_manager/src/commands/notification_from_hmi.cc20
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc213
-rw-r--r--src/components/application_manager/src/event_engine/event.cc12
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc77
-rw-r--r--src/components/application_manager/src/event_engine/event_observer.cc23
-rw-r--r--src/components/application_manager/src/help_prompt_manager_impl.cc8
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc6
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc54
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc14
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc21
-rw-r--r--src/components/application_manager/src/hmi_state.cc38
-rw-r--r--src/components/application_manager/src/message.cc2
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc316
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc8
-rw-r--r--src/components/application_manager/src/plugin_manager/plugin_keys.cc14
-rw-r--r--src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc13
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc6
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc380
-rw-r--r--src/components/application_manager/src/request_controller.cc2
-rw-r--r--src/components/application_manager/src/request_tracker.cc4
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc51
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc4
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc8
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc12
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc128
-rw-r--r--src/components/application_manager/src/rpc_passing_handler.cc441
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc160
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc64
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc89
-rw-r--r--src/components/application_manager/src/system_time/system_time_handler_impl.cc4
-rw-r--r--src/components/application_manager/src/usage_statistics.cc4
-rwxr-xr-xsrc/components/application_manager/test/CMakeLists.txt3
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc16
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc12
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc20
-rw-r--r--src/components/application_manager/test/app_service_manager_test.cc452
-rw-r--r--src/components/application_manager/test/application_helper_test.cc20
-rw-r--r--src/components/application_manager/test/application_impl_test.cc50
-rw-r--r--src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc14
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc346
-rw-r--r--src/components/application_manager/test/application_state_test.cc12
-rw-r--r--src/components/application_manager/test/command_holder_test.cc22
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt1
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc31
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc126
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc8
-rw-r--r--src/components/application_manager/test/event_engine_test.cc12
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc9
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc36
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc16
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h12
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h59
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_app_launch_data.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_app_service_manager.h95
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h79
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h21
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_observer.h5
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h58
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h20
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_request.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h66
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h18
-rw-r--r--src/components/application_manager/test/include/application_manager/test_resumption_data_db.h6
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt1
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc34
-rw-r--r--src/components/application_manager/test/mobile_event_engine_test.cc171
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc18
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc10
-rw-r--r--src/components/application_manager/test/mock_application_helper.cc11
-rw-r--r--src/components/application_manager/test/mock_hmi_command_factory.cc13
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc37
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc2
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc211
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc28
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc21
-rw-r--r--src/components/application_manager/test/request_info_test.cc4
-rw-r--r--src/components/application_manager/test/request_tracker_test.cc8
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc26
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc69
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc6
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc39
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc244
-rw-r--r--src/components/application_manager/test/rpc_passing_handler_test.cc440
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json4
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json12
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc191
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc4
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc10
-rw-r--r--src/components/config_profile/CMakeLists.txt1
-rw-r--r--src/components/config_profile/include/config_profile/profile.h133
-rw-r--r--src/components/config_profile/src/ini_file.cc10
-rw-r--r--src/components/config_profile/src/profile.cc155
-rw-r--r--src/components/config_profile/test/ini_file_test.cc2
-rw-r--r--src/components/config_profile/test/profile_test.cc2
-rw-r--r--src/components/connection_handler/CMakeLists.txt1
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h4
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h62
-rw-r--r--src/components/connection_handler/include/connection_handler/device.h8
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h8
-rw-r--r--src/components/connection_handler/src/connection.cc21
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc173
-rw-r--r--src/components/connection_handler/src/device.cc6
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc14
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc40
-rw-r--r--src/components/connection_handler/test/connection_test.cc6
-rw-r--r--src/components/connection_handler/test/device_test.cc4
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc10
-rw-r--r--src/components/formatters/CMakeLists.txt1
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.h48
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h18
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h16
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h26
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h12
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h40
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cc2
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cc18
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cc18
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc6
-rw-r--r--src/components/formatters/test/CFormatterJsonBase_test.cc8
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc2
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc4
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc12
-rw-r--r--src/components/formatters/test/generic_json_formatter_test.cc8
-rw-r--r--src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h9
-rw-r--r--src/components/formatters/test/include/formatters/create_smartSchema.h2
-rw-r--r--src/components/formatters/test/include/formatters/meta_formatter_test_helper.h4
-rw-r--r--src/components/formatters/test/meta_formatter_test.cc5
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h14
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h19
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h35
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc14
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc4
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc4
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc10
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_adapter_impl.h60
-rw-r--r--src/components/include/application_manager/app_launch_settings.h2
-rw-r--r--src/components/include/application_manager/application_manager.h87
-rw-r--r--src/components/include/application_manager/application_manager_settings.h9
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h14
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h126
-rw-r--r--src/components/include/application_manager/policies/policy_handler_observer.h5
-rw-r--r--src/components/include/application_manager/rpc_handler.h11
-rw-r--r--src/components/include/application_manager/rpc_service.h17
-rw-r--r--src/components/include/application_manager/state_controller.h17
-rw-r--r--src/components/include/connection_handler/connection_handler.h52
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h13
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler.h4
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h2
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h2
-rw-r--r--src/components/include/media_manager/media_manager.h2
-rw-r--r--src/components/include/media_manager/media_manager_settings.h2
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h10
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h139
-rw-r--r--src/components/include/policy/policy_external/policy/policy_settings.h10
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h22
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h136
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_settings.h10
-rw-r--r--src/components/include/protocol/bson_object_keys.h1
-rw-r--r--src/components/include/protocol/common.h18
-rw-r--r--src/components/include/protocol/raw_message.h4
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h28
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h2
-rw-r--r--src/components/include/rpc_base/validation_report.h2
-rw-r--r--src/components/include/security_manager/crypto_manager.h22
-rw-r--r--src/components/include/security_manager/security_manager.h2
-rw-r--r--src/components/include/security_manager/security_query.h8
-rw-r--r--src/components/include/security_manager/ssl_context.h14
-rw-r--r--src/components/include/test/application_manager/mock_app_extension.h2
-rw-r--r--src/components/include/test/application_manager/mock_app_launch_settings.h2
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h53
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h9
-rw-r--r--src/components/include/test/application_manager/mock_request_controller_settings.h2
-rw-r--r--src/components/include/test/application_manager/mock_rpc_handler.h41
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin.h2
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin_manager.h2
-rw-r--r--src/components/include/test/application_manager/mock_rpc_service.h17
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h13
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h28
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_observer.h5
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler.h19
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h10
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_settings.h2
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h2
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h35
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h7
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h39
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_settings.h4
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h36
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h5
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h37
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h4
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h2
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_observer.h2
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h2
-rw-r--r--src/components/include/test/security_manager/mock_security_manager.h4
-rw-r--r--src/components/include/test/telemetry_monitor/mock_telemetry_observable.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager.h19
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h4
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h5
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_device.h2
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h6
-rw-r--r--src/components/include/test/utils/test_async_waiter.h2
-rw-r--r--src/components/include/transport_manager/common.h6
-rw-r--r--src/components/include/transport_manager/error.h2
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h52
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h31
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h6
-rw-r--r--src/components/include/transport_manager/transport_manager.h28
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h21
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h13
-rw-r--r--src/components/include/transport_manager/transport_manager_mme_settings.h2
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h12
-rw-r--r--src/components/include/utils/custom_string.h4
-rw-r--r--src/components/include/utils/logger.h24
-rw-r--r--src/components/include/utils/macro.h14
-rw-r--r--src/components/include/utils/message_queue.h15
-rw-r--r--src/components/include/utils/prioritized_queue.h4
-rw-r--r--src/components/include/utils/rwlock.h24
-rw-r--r--src/components/include/utils/scope_guard.h2
-rw-r--r--src/components/include/utils/semantic_version.h2
-rw-r--r--src/components/include/utils/threads/async_runner.h6
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h2
-rw-r--r--src/components/include/utils/threads/thread.h4
-rw-r--r--src/components/include/utils/typed_enum_print.h2
-rw-r--r--src/components/interfaces/CMakeLists.txt1
-rw-r--r--src/components/interfaces/HMI_API.xml805
-rw-r--r--src/components/interfaces/MOBILE_API.xml845
-rw-r--r--src/components/media_manager/CMakeLists.txt1
-rw-r--r--src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h4
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h6
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h1
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h2
-rw-r--r--src/components/media_manager/include/media_manager/file_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h8
-rw-r--r--src/components/media_manager/include/media_manager/streamer_adapter.h4
-rw-r--r--src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h2
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc24
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc16
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_adapter.cc6
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_listener.cc10
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc6
-rw-r--r--src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc2
-rw-r--r--src/components/media_manager/src/file_streamer_adapter.cc4
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc26
-rw-r--r--src/components/media_manager/src/pipe_streamer_adapter.cc10
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc10
-rw-r--r--src/components/media_manager/src/video/video_stream_to_file_adapter.cc6
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter.h2
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc22
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt1
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote.h2
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h162
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h166
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h14
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h153
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table.h2
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h53
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h60
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml22
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h16
-rw-r--r--src/components/policy/policy_external/include/policy/pt_ext_representation.h8
-rw-r--r--src/components/policy/policy_external/include/policy/pt_representation.h14
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h2
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_queries.h9
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h8
-rw-r--r--src/components/policy/policy_external/include/policy/status.h88
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h9
-rw-r--r--src/components/policy/policy_external/include/policy/usage_statistics/counter.h4
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc228
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc20
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc124
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc93
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc222
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc20
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_queries.cc12
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc82
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc115
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc267
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc2
-rw-r--r--src/components/policy/policy_external/test/counter_test.cc8
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h4
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h4
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json4
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json12
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc6
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc7
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc6
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc39
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc10
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc2
-rw-r--r--src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc24
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc38
-rw-r--r--src/components/policy/policy_external/test/update_status_manager_test.cc8
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt1
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote.h2
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h117
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h124
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h2
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h144
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h52
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h61
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h16
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_representation.h16
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_queries.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/status.h88
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/usage_statistics/counter.h4
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc206
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc22
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc115
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc123
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc210
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc10
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc116
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc261
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc2
-rw-r--r--src/components/policy/policy_regular/test/PTU.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json4
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc2
-rw-r--r--src/components/policy/policy_regular/test/counter_test.cc4
-rw-r--r--src/components/policy/policy_regular/test/include/policy/driver_dbms.h2
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc70
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json4
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc78
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc2
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json12
-rw-r--r--src/components/protocol/src/bson_object_keys.cc1
-rw-r--r--src/components/protocol_handler/CMakeLists.txt1
-rw-r--r--src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h2
-rw-r--r--src/components/protocol_handler/include/protocol_handler/multiframe_builder.h38
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h74
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h20
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc2
-rw-r--r--src/components/protocol_handler/src/incoming_data_handler.cc2
-rw-r--r--src/components/protocol_handler/src/multiframe_builder.cc2
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc231
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc20
-rw-r--r--src/components/protocol_handler/src/protocol_payload.cc2
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/control_message_matcher.h6
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc18
-rw-r--r--src/components/protocol_handler/test/multiframe_builder_test.cc8
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc234
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc4
-rw-r--r--src/components/protocol_handler/test/protocol_packet_test.cc38
-rw-r--r--src/components/protocol_handler/test/protocol_payload_test.cc6
-rw-r--r--src/components/resumption/src/last_state_impl.cc2
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h2
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h27
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h3
-rw-r--r--src/components/rpc_base/test/rpc_base_test.cc2
-rw-r--r--src/components/rpc_base/test/validation_report_test.cc2
-rw-r--r--src/components/security_manager/CMakeLists.txt1
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h10
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h2
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h8
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc26
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc12
-rw-r--r--src/components/security_manager/src/security_query.cc2
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc12
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc6
-rw-r--r--src/components/security_manager/test/security_manager_test.cc52
-rw-r--r--src/components/security_manager/test/security_query_matcher.cc2
-rw-r--r--src/components/security_manager/test/security_query_test.cc6
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc16
-rw-r--r--src/components/smart_objects/CMakeLists.txt1
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h13
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h13
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h26
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h24
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h51
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h27
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h27
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h19
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h17
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h25
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h13
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc3
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc3
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc23
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc38
-rw-r--r--src/components/smart_objects/src/schema_item.cc8
-rw-r--r--src/components/smart_objects/src/smart_object.cc12
-rw-r--r--src/components/smart_objects/src/smart_schema.cc15
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc13
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc2
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc2
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc2
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc2
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc14
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc6
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc2
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc18
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc2
-rw-r--r--src/components/smart_objects/test/map_performance_test.cc4
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc4
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt1
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/json_keys.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h27
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h2
-rw-r--r--src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc2
-rw-r--r--src/components/telemetry_monitor/src/application_manager_observer.cc2
-rw-r--r--src/components/telemetry_monitor/src/metric_wrapper.cc2
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_observer.cc2
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc8
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc2
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_observer.cc2
-rw-r--r--src/components/telemetry_monitor/test/application_manager_metric_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/application_manager_observer_test.cc6
-rw-r--r--src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h4
-rw-r--r--src/components/telemetry_monitor/test/metric_wrapper_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_metric_test.cc6
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_observer_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc14
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_metric_test.cc6
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_observer_test.cc4
-rw-r--r--src/components/test_main.cc4
-rw-r--r--src/components/transport_manager/CMakeLists.txt16
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/cloud/cloud_device.h78
-rw-r--r--src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_connection_factory.h98
-rw-r--r--src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_transport_adapter.h107
-rw-r--r--src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h205
-rw-r--r--src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_device.h10
-rw-r--r--src/components/transport_manager/include/transport_manager/telemetry_observer.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h30
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h76
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h25
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h20
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_default.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h83
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/common.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h6
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc30
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc10
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc19
-rw-r--r--src/components/transport_manager/src/cloud/cloud_device.cc97
-rw-r--r--src/components/transport_manager/src/cloud/cloud_websocket_connection_factory.cc85
-rw-r--r--src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc144
-rw-r--r--src/components/transport_manager/src/cloud/websocket_client_connection.cc358
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc12
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc12
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc32
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc8
-rw-r--r--src/components/transport_manager/src/tcp/tcp_device.cc8
-rw-r--r--src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc6
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc6
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc12
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc220
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc40
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc17
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc196
-rw-r--r--src/components/transport_manager/src/usb/libusb/platform_usb_device.cc4
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc2
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_handler.cc6
-rw-r--r--src/components/transport_manager/src/usb/qnx/platform_usb_device.cc4
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc2
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_handler.cc8
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc4
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_device_scanner.cc8
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt12
-rw-r--r--src/components/transport_manager/test/include/transport_manager/cloud/sample_websocket_server.h162
-rw-r--r--src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h7
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h2
-rw-r--r--src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h17
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h3
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h26
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h6
-rw-r--r--src/components/transport_manager/test/network_interface_listener_test.cc4
-rw-r--r--src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc59
-rw-r--r--src/components/transport_manager/test/sample_websocket_server.cc378
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc42
-rw-r--r--src/components/transport_manager/test/tcp_device_test.cc2
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc14
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc9
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc450
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc30
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc67
-rw-r--r--src/components/transport_manager/test/websocket_connection_test.cc491
-rw-r--r--src/components/utils/CMakeLists.txt1
-rw-r--r--src/components/utils/include/utils/back_trace.h2
-rw-r--r--src/components/utils/include/utils/file_system.h15
-rw-r--r--src/components/utils/include/utils/helpers.h2
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h4
-rw-r--r--src/components/utils/include/utils/optional.h2
-rw-r--r--src/components/utils/include/utils/qdb_wrapper/sql_query.h4
-rw-r--r--src/components/utils/include/utils/resource_usage.h6
-rw-r--r--src/components/utils/include/utils/singleton.h2
-rw-r--r--src/components/utils/include/utils/sqlite_wrapper/sql_database.h2
-rw-r--r--src/components/utils/include/utils/sqlite_wrapper/sql_query.h2
-rw-r--r--src/components/utils/include/utils/system.h2
-rw-r--r--src/components/utils/include/utils/threads/pulse_thread_delegate.h22
-rw-r--r--src/components/utils/include/utils/threads/thread_manager.h10
-rw-r--r--src/components/utils/include/utils/timer.h22
-rw-r--r--src/components/utils/include/utils/timer_task_impl.h2
-rw-r--r--src/components/utils/src/back_trace.cc4
-rw-r--r--src/components/utils/src/conditional_variable_boost.cc2
-rw-r--r--src/components/utils/src/convert_utils.cc2
-rw-r--r--src/components/utils/src/custom_string.cc10
-rw-r--r--src/components/utils/src/file_system.cc20
-rw-r--r--src/components/utils/src/gen_hash.cc2
-rw-r--r--src/components/utils/src/logger.cc2
-rw-r--r--src/components/utils/src/qdb_wrapper/sql_database.cc2
-rw-r--r--src/components/utils/src/qdb_wrapper/sql_query.cc4
-rw-r--r--src/components/utils/src/resource_usage.cc4
-rw-r--r--src/components/utils/src/rwlock_posix.cc2
-rw-r--r--src/components/utils/src/signals_posix.cc2
-rw-r--r--src/components/utils/src/system.cc12
-rw-r--r--src/components/utils/src/threads/async_runner.cc2
-rw-r--r--src/components/utils/src/threads/pulse_thread_delegate.cc2
-rw-r--r--src/components/utils/src/threads/thread_delegate.cc2
-rw-r--r--src/components/utils/src/threads/thread_manager.cc8
-rw-r--r--src/components/utils/src/threads/thread_posix.cc14
-rw-r--r--src/components/utils/src/threads/thread_validator.cc17
-rw-r--r--src/components/utils/src/timer.cc25
-rw-r--r--src/components/utils/test/async_runner_test.cc10
-rw-r--r--src/components/utils/test/auto_trace_test.cc14
-rw-r--r--src/components/utils/test/back_trace_test.cc2
-rw-r--r--src/components/utils/test/bitstream_test.cc2
-rw-r--r--src/components/utils/test/custom_string_test.cc2
-rw-r--r--src/components/utils/test/data_accessor_test.cc2
-rw-r--r--src/components/utils/test/date_time_test.cc2
-rw-r--r--src/components/utils/test/file_system_test.cc4
-rw-r--r--src/components/utils/test/generated_code_with_sqlite_test.cc2
-rw-r--r--src/components/utils/test/include/utils/generated_code_with_sqlite_test.h2
-rw-r--r--src/components/utils/test/include/utils/mock_signals_posix.h4
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc4
-rw-r--r--src/components/utils/test/message_queue_test.cc2
-rw-r--r--src/components/utils/test/messagemeter_test.cc64
-rw-r--r--src/components/utils/test/mock_signals_posix.cc4
-rw-r--r--src/components/utils/test/posix_thread_test.cc2
-rw-r--r--src/components/utils/test/prioritized_queue_test.cc2
-rw-r--r--src/components/utils/test/qdb_wrapper/sql_database_test.cc4
-rw-r--r--src/components/utils/test/qdb_wrapper/sql_query_test.cc4
-rw-r--r--src/components/utils/test/resource_usage_test.cc4
-rw-r--r--src/components/utils/test/scope_guard_test.cc10
-rw-r--r--src/components/utils/test/singleton_test.cc2
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_database_test.cc62
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_query_test.cc6
-rw-r--r--src/components/utils/test/stl_utils_test.cc4
-rw-r--r--src/components/utils/test/system_test.cc2
-rw-r--r--src/components/utils/test/test_generator/generated_msg_version_test.cc4
-rw-r--r--src/components/utils/test/timer_test.cc4
-rw-r--r--tools/InterfaceGenerator/MsgVersionGenerate.py1
-rwxr-xr-xtools/infrastructure/check_style.sh2
-rwxr-xr-xtools/infrastructure/git-hooks/pre-commit6
1685 files changed, 34155 insertions, 7861 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 1b58b20e86..d62fd997a0 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -1,4 +1,4 @@
-[Delete any non-applicable sections, but we may ask for more information.]
+[Delete any non-applicable sections, but we may ask for more information. Please reference the [SmartDeviceLink GitHub Best Practices](https://d83tozu1c8tt6.cloudfront.net/media/resources/SDL_GitHub_BestPractices.pdf) for further instructions on how to enter an issue.]
### Bug Report
[Summary]
@@ -20,4 +20,4 @@
* Testing Against: [What you tested with to observe this behavior. Proxy, App, HMI etc.]
##### Test Case, Sample Code, and / or Example App
-[Paste a link to a PR, gist, or other code that exemplifies this behavior] \ No newline at end of file
+[Paste a link to a PR, gist, or other code that exemplifies this behavior]
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 83c3261f9b..301a22eafe 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,4 +1,4 @@
-[Things to note: Pull Requests **must** fix an issue. Discussion about the feature / bug takes place in the issue, discussion of the implementation takes place in the PR. Please also see the [Contributing Guide](https://github.com/smartdevicelink/sdl_core/blob/master/.github/CONTRIBUTING.md) for information on branch naming and the CLA.
+[Things to note: Pull Requests **must** fix an issue. Discussion about the feature / bug takes place in the issue, discussion of the implementation takes place in the PR. Please also see the [Contributing Guide](https://github.com/smartdevicelink/sdl_core/blob/master/.github/CONTRIBUTING.md) for information on branch naming and the CLA, and the [SmartDeviceLink GitHub Best Practices](https://d83tozu1c8tt6.cloudfront.net/media/resources/SDL_GitHub_BestPractices.pdf) document for more information on how to enter a pull request. Once this PR is ready for review, please request one from @theresalech.
Delete the above section when you've read it.]
@@ -30,4 +30,4 @@ This PR makes **[no / minor / major]** API changes.
- [ ] [Task 2]
### CLA
-- [ ] I have signed [the CLA](https://docs.google.com/forms/d/e/1FAIpQLSdsgJY33VByaX482zHzi-xUm49JNnmuJOyAM6uegPQ2LXYVfA/viewform) \ No newline at end of file
+- [ ] I have signed [the CLA](https://docs.google.com/forms/d/e/1FAIpQLSdsgJY33VByaX482zHzi-xUm49JNnmuJOyAM6uegPQ2LXYVfA/viewform)
diff --git a/.travis.yml b/.travis.yml
index 7f7df359b4..643597354c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: cpp
-dist: trusty
+dist: xenial
sudo: required
only:
- master
@@ -17,7 +17,7 @@ addons:
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
- - sudo apt-get install -f clang-format-3.6
+ - sudo apt-get install -f clang-format-6.0
script:
- cppcheck --force -isrc/3rd_party -isrc/3rd_party-static --quiet --error-exitcode=1 src
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a180b6cf9..38bb95c9fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,7 @@ option(EXTENDED_MEDIA_MODE "Turn on and off extended Madia Manager features rela
option(BUILD_SHARED_LIBS "Build all libraries as shared (if ON) or static (if OFF)" OFF)
option(BUILD_BT_SUPPORT "Bluetooth support" ON)
option(BUILD_USB_SUPPORT "libusb support" ON)
+option(BUILD_CLOUD_APP_SUPPORT "Cloud App Transport Support" ON)
option(BUILD_BACKTRACE_SUPPORT "backtrace support" ON)
option(BUILD_TESTS "Possibility to build and run tests" OFF)
option(TELEMETRY_MONITOR "Enable profiling time test util" ON)
@@ -235,7 +236,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla")
+set(EXCLUDE_ERROR_FLAGS "-Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations")
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror ${EXCLUDE_ERROR_FLAGS} -Wuninitialized -Wvla")
if (USE_GOLD_LD)
execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
@@ -315,6 +317,11 @@ if (BUILD_BT_SUPPORT)
message(STATUS "Bluetooth support enabled")
endif()
+if (BUILD_CLOUD_APP_SUPPORT)
+ add_definitions(-DCLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ message(STATUS "Cloud app websocket support enabled")
+endif()
+
if (BUILD_BACKTRACE_SUPPORT)
add_definitions(-DBACKTRACE_SUPPORT)
message(STATUS "Backtrace support enabled")
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index bdb96de417..951c437e59 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -169,12 +169,13 @@ if(ENABLE_LOG)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
-set(CMAKE_SOURCE_PREFIX ${CMAKE_SOURCE_PREFIX} "${3RD_PARTY_INSTALL_PREFIX}")
-find_package (BSON)
-message (STATUS "bson installed in " ${BSON_LIBS_DIRECTORY} " , " ${BSON_INCLUDE_DIRECTORY})
-message (STATUS "emhashmap installed in " ${EMHASHMAP_LIBS_DIRECTORY} " , " ${EMHASHMAP_INCLUDE_DIRECTORY})
+set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${3RD_PARTY_INSTALL_PREFIX}/etc")
+set(ENV{PKG_CONFIG_PATH} $ENV{CMAKE_PREFIX_PATH} "${3RD_PARTY_INSTALL_PREFIX}/etc")
+find_package(PkgConfig)
+pkg_check_modules(BSON libbson)
+message (STATUS "bson installed in " ${BSON_LIBDIR} ", " ${BSON_INCLUDEDIR})
-if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND")
+if ((NOT "${BSON_FOUND}") OR ("${BSON_VERSION}" VERSION_LESS "1.2.0"))
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)
@@ -188,20 +189,19 @@ if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND")
endif()
include(ExternalProject)
ExternalProject_Add(libbson
- GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git"
+ GIT_REPOSITORY "https://github.com/smartdevicelink/bson_c_lib.git"
GIT_TAG "master"
BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY}
INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY}
SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY}
- CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure config.h.in && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure config.h.in libbson.pc.in && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX}
BUILD_COMMAND make
- INSTALL_COMMAND ${BSON_INSTALL_COMMAND})
+ INSTALL_COMMAND ${BSON_INSTALL_COMMAND}
+ UPDATE_COMMAND git pull)
else()
- get_filename_component(BSON_LIBS_DIRECTORY ${BSON_LIB} DIRECTORY)
- get_filename_component(EMHASHMAP_LIBS_DIRECTORY ${EMHASHMAP_LIB} DIRECTORY)
- set(BSON_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of bson libraries" FORCE)
- set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
+ set(BSON_LIBS_DIRECTORY ${BSON_LIBDIR} CACHE INTERNAL "Installation path of bson libraries" FORCE)
+ set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBDIR} CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
add_custom_target(
libbson
DEPENDS ${BSON_LIBS_DIRECTORY}
@@ -209,11 +209,12 @@ else()
)
endif()
-find_package(Boost 1.66.0 COMPONENTS system thread date_time filesystem)
+set(BOOST_ROOT ${3RD_PARTY_INSTALL_PREFIX})
+find_package(Boost 1.66.0 COMPONENTS system thread date_time filesystem regex)
set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
+set(BOOST_INCLUDE_DIR ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE)
SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
-set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
if (NOT ${Boost_FOUND})
message(STATUS "Did not find boost. Downloading and installing boost 1.66")
set(BOOST_INSTALL_COMMAND ./b2 install)
@@ -226,15 +227,12 @@ if (NOT ${Boost_FOUND})
URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem,regex --prefix=${3RD_PARTY_INSTALL_PREFIX}
BUILD_COMMAND ./b2
- INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --with-filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
+ INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --with-filesystem --with-regex --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
BUILD_IN_SOURCE true
)
-
- set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
- set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
else()
add_custom_target(Boost) # empty target, Boost is already installed
endif()
diff --git a/src/3rd_party/FindBSON.cmake b/src/3rd_party/FindBSON.cmake
deleted file mode 100644
index 91d53624f1..0000000000
--- a/src/3rd_party/FindBSON.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-set(INCLUDE_PATH "${CMAKE_SOURCE_PREFIX}/include")
-set(LIB_PATH "${CMAKE_SOURCE_PREFIX}/lib")
-
-find_path(BSON_INCLUDE_DIRECTORY bson_object.h bson_array.h bson_util.h
- PATHS "${INCLUDE_PATH}")
-
-find_library(BSON_LIB
- NAMES bson
- PATHS ${LIB_PATH})
-
-find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h
- PATHS ${INCLUDE_PATH}
- PATH_SUFFIXES emhashmap)
-
-find_library(EMHASHMAP_LIB
- NAMES emhashmap
- PATHS ${LIB_PATH})
-
-
-include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB
- EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
-
-mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB)
-mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index fe9a6af3f7..d543280d75 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -76,6 +76,7 @@ include_directories(
# Create object library
add_library("LowVoltageHandlerObjLibrary" OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/low_voltage_signals_handler.cc
)
+add_dependencies("LowVoltageHandlerObjLibrary" Boost)
set (SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/main.cc
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 93292d1023..481c6d0c6b 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -6,7 +6,7 @@
"JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO"
],
"displayCapabilities": {
- "displayType": "GEN2_8_DMA",
+ "displayType": "SDL_GENERIC",
"displayName": "GENERIC_DISPLAY",
"textFields": [{
"name": "mainField1",
@@ -428,6 +428,7 @@
"acMaxEnableAvailable": true,
"autoModeEnableAvailable": true,
"circulateAirEnableAvailable": true,
+ "climateEnableAvailable": true,
"currentTemperatureAvailable": true,
"defrostZone": [
"FRONT",
@@ -455,7 +456,7 @@
],
"radioControlCapabilities": [
{
- "availableHDsAvailable": true,
+ "availableHdChannelsAvailable": true,
"hdChannelAvailable": true,
"moduleName": "radio",
"radioBandAvailable": true,
@@ -921,9 +922,9 @@
}
},
"VehicleInfo": {
- "make": "Ford",
- "model": "Fiesta",
- "modelYear": "2013",
+ "make": "SDL",
+ "model": "Generic",
+ "modelYear": "2019",
"trim": "SE"
},
"SyncMessageVersion": {
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index ff8fa2cc40..b2e3c39f37 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc
index b87191d937..10f0fc0d52 100644
--- a/src/appMain/life_cycle_impl.cc
+++ b/src/appMain/life_cycle_impl.cc
@@ -1,46 +1,46 @@
/*
-* 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.
-*/
+ * 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 "appMain/life_cycle_impl.h"
-#include "utils/signals.h"
-#include "config_profile/profile.h"
#include "application_manager/system_time/system_time_handler_impl.h"
+#include "config_profile/profile.h"
#include "resumption/last_state_impl.h"
+#include "utils/signals.h"
#ifdef ENABLE_SECURITY
-#include "security_manager/security_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/crypto_manager_settings_impl.h"
-#include "application_manager/policies/policy_handler.h"
+#include "security_manager/security_manager_impl.h"
#endif // ENABLE_SECURITY
#ifdef ENABLE_LOG
@@ -111,6 +111,7 @@ bool LifeCycleImpl::StartComponents() {
media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
app_manager_->set_connection_handler(connection_handler_);
+ app_manager_->AddPolicyObserver(protocol_handler_);
if (!app_manager_->Init(*last_state_, media_manager_)) {
LOG4CXX_ERROR(logger_, "Application manager init failed.");
return false;
@@ -134,7 +135,6 @@ bool LifeCycleImpl::StartComponents() {
security_manager_->AddListener(app_manager_);
app_manager_->AddPolicyObserver(security_manager_);
- app_manager_->AddPolicyObserver(protocol_handler_);
if (!crypto_manager_->Init()) {
LOG4CXX_ERROR(logger_, "CryptoManager initialization fail.");
return false;
diff --git a/src/appMain/life_cycle_impl.h b/src/appMain/life_cycle_impl.h
index 5dfc4641ab..5bddf6bff9 100644
--- a/src/appMain/life_cycle_impl.h
+++ b/src/appMain/life_cycle_impl.h
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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_APPMAIN_LIFE_CYCLE_IMPL_H_
#define SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
@@ -36,8 +36,8 @@
#include "appMain/life_cycle.h"
#include <unistd.h>
-#include <thread>
#include <memory>
+#include <thread>
#include "utils/macro.h"
#include "config_profile/profile.h"
@@ -47,10 +47,10 @@
#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
#include "application_manager/application_manager_impl.h"
#include "connection_handler/connection_handler_impl.h"
+#include "media_manager/media_manager_impl.h"
#include "protocol_handler/protocol_handler_impl.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_default.h"
-#include "media_manager/media_manager_impl.h"
#ifdef TELEMETRY_MONITOR
#include "telemetry_monitor/telemetry_monitor.h"
#endif
diff --git a/src/appMain/low_voltage_signals_handler.cc b/src/appMain/low_voltage_signals_handler.cc
index 936d91ba18..bb7bbfbac7 100644
--- a/src/appMain/low_voltage_signals_handler.cc
+++ b/src/appMain/low_voltage_signals_handler.cc
@@ -32,17 +32,17 @@
#include "appMain/low_voltage_signals_handler.h"
-#include <signal.h>
#include <fcntl.h>
+#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <iostream>
#include "appMain/life_cycle.h"
-#include "utils/signals.h"
+#include "config_profile/profile.h"
#include "utils/logger.h"
+#include "utils/signals.h"
#include "utils/typed_enum_print.h"
-#include "config_profile/profile.h"
namespace main_namespace {
diff --git a/src/appMain/low_voltage_signals_handler.h b/src/appMain/low_voltage_signals_handler.h
index 8c139c6836..bedde38c5c 100644
--- a/src/appMain/low_voltage_signals_handler.h
+++ b/src/appMain/low_voltage_signals_handler.h
@@ -35,8 +35,8 @@
#include <unistd.h>
#include <memory>
-#include "utils/threads/thread_delegate.h"
#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace main_namespace {
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index 752cfb7bb9..cb59f63b1d 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -30,29 +30,31 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <signal.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <signal.h>
#include <cstdio>
#include <cstdlib>
+#include <fstream> // cpplint: Streams are highly discouraged.
+#include <iostream> // cpplint: Streams are highly discouraged.
#include <memory>
-#include <vector>
#include <string>
-#include <iostream> // cpplint: Streams are highly discouraged.
-#include <fstream> // cpplint: Streams are highly discouraged.
+#include <vector>
// ----------------------------------------------------------------------------
+#ifdef ENABLE_LOG
#include "utils/log_message_loop_thread.h"
+#endif // ENABLE_LOG
#include "utils/logger.h"
#include "appMain/life_cycle_impl.h"
#include "signal_handlers.h"
-#include "utils/signals.h"
-#include "utils/system.h"
#include "config_profile/profile.h"
#include "utils/appenders_loader.h"
+#include "utils/signals.h"
+#include "utils/system.h"
#if defined(EXTENDED_MEDIA_MODE)
#include <gst/gst.h>
@@ -86,7 +88,7 @@ bool InitHmi(std::string hmi_link) {
.Execute();
}
#endif // WEB_HMI
-}
+} // namespace
/**
* \brief Entry point of the program.
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 8f8cafdc8f..2e7929597f 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -183,6 +183,12 @@
"LIMITED",
"NONE"]
},
+ "OnSystemCapabilityUpdated": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
"PerformAudioPassThru": {
"hmi_levels": ["FULL",
"LIMITED"]
@@ -196,7 +202,7 @@
"FULL",
"LIMITED",
"NONE"]
- },
+ },
"RegisterAppInterface": {
"hmi_levels": ["BACKGROUND",
"FULL",
@@ -268,6 +274,13 @@
"hmi_levels": ["BACKGROUND",
"FULL",
"LIMITED"]
+ },
+ "CloseApplication": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
}
}
},
@@ -415,6 +428,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -435,6 +449,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -455,6 +470,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -474,6 +490,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -532,6 +549,128 @@
}
}
},
+ "CloudAppStore": {
+ "rpcs": {
+ "SetCloudAppProperties":{
+ "hmi_levels":["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetCloudAppProperties":{
+ "hmi_levels":["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "CloudApp": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ }
+ }
+ },
+ "AppServiceProvider": {
+ "rpcs": {
+ "PublishAppService": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "GetAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "OnAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "PerformAppServiceInteraction": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ }
+ }
+ },
+ "AppServiceConsumer": {
+ "rpcs": {
+ "GetFile": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "GetAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "OnAppServiceData": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ },
+ "PerformAppServiceInteraction": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND",
+ "NONE"
+ ]
+ }
+ }
+ },
"RemoteControl": {
"rpcs": {
"ButtonPress": {
@@ -1018,6 +1157,11 @@
"hmi_levels": ["BACKGROUND",
"FULL",
"LIMITED"]
+ },
+ "OnWayPointChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
}
}
},
diff --git a/src/appMain/signal_handlers.cc b/src/appMain/signal_handlers.cc
index 649f162ec6..c9c09d10a2 100644
--- a/src/appMain/signal_handlers.cc
+++ b/src/appMain/signal_handlers.cc
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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 "appMain/signal_handlers.h"
#include "appMain/life_cycle.h"
diff --git a/src/appMain/signal_handlers.h b/src/appMain/signal_handlers.h
index f3adefb929..458a121d42 100644
--- a/src/appMain/signal_handlers.h
+++ b/src/appMain/signal_handlers.h
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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_APPMAIN_SIGNAL_HANDLERS_H_
#define SRC_APPMAIN_SIGNAL_HANDLERS_H_
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index b0513c076f..40c1bf08a7 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -202,6 +202,15 @@ TCPAdapterPort = 12345
; If the name is omitted, Core will listen on all network interfaces by binding to INADDR_ANY.
TCPAdapterNetworkInterface =
+; 128 bit uuid for bluetooth device discovery. Please format as 16 seperate bytes.
+;BluetoothUUID = 0x93, 0x6D, 0xA0, 0x1F, 0x9A, 0xBD, 0x4D, 0x9D, 0x80, 0xC7, 0x02, 0xAF, 0x85, 0xC8, 0x22, 0xA8
+
+[CloudAppConnections]
+; Value in milliseconds for time between retry attempts on a failed websocket connection
+CloudAppRetryTimeout = 1000
+; MaxNn number of retry attempts for a cloud websocket connection
+CloudAppMaxRetryAttempts = 5
+
[ProtocolHandler]
; SDL supported protocol version
MaxSupportedProtocolVersion = 5
@@ -363,3 +372,13 @@ EnableAppLaunchIOS = true
; Note: this configuration is applied even if multiple-transports feature is not enabled.
;AudioServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
;VideoServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
+
+[AppServices]
+; The ID used to fill the originApp field when the HMI sends a PerformAppServiceInteraction request
+HMIOriginID = "HMI_ID"
+
+; Services that exist on the module. Values are of AppServiceType in RPC Spec. These services will be used as default and app services will only become primary service publisher with direct user interaction. These services will also be a fallback if no app service publisher is registered with the system of that type.
+EmbeddedServices = MEDIA, WEATHER, NAVIGATION
+
+; Additional time added to RPC timeout when passing through to App service
+RpcPassThroughTimeout = 10000 \ No newline at end of file
diff --git a/src/appMain/test/low_voltage_signals_handler_test.cc b/src/appMain/test/low_voltage_signals_handler_test.cc
index 14210df71d..3dec0cc96d 100644
--- a/src/appMain/test/low_voltage_signals_handler_test.cc
+++ b/src/appMain/test/low_voltage_signals_handler_test.cc
@@ -1,49 +1,52 @@
/*
-* 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.
-*/
+ * 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 "appMain/low_voltage_signals_handler.h"
#include <memory>
-#include "gtest/gtest.h"
#include "appMain/test/mock_life_cycle.h"
-#include "utils/mock_signals_posix.h"
-#include "config_profile/profile.h"
+#include "gtest/gtest.h"
#include "utils/macro.h"
+#include "utils/mock_signals_posix.h"
namespace test {
using ::testing::_;
-using ::testing::Return;
using ::testing::InSequence;
+using ::testing::Return;
+
+const int kLowVoltageSignalOffset = 1;
+const int kWakeUpSignalOffset = 2;
+const int kIgnitionOffSignalOffset = 3;
class LowVoltageSignalsHandlerTest : public ::testing::Test {
protected:
@@ -52,10 +55,8 @@ class LowVoltageSignalsHandlerTest : public ::testing::Test {
, mock_signals_posix_(*utils::MockSignalsPosix::signals_posix_mock()) {}
void SetUp() OVERRIDE {
- profile_.set_config_file_name("smartDeviceLink.ini");
- signals_offset_ = {profile_.low_voltage_signal_offset(),
- profile_.wake_up_signal_offset(),
- profile_.ignition_off_signal_offset()};
+ signals_offset_ = {
+ kLowVoltageSignalOffset, kWakeUpSignalOffset, kIgnitionOffSignalOffset};
low_voltage_signals_handler_ =
std::unique_ptr<main_namespace::LowVoltageSignalsHandler>(
@@ -63,7 +64,6 @@ class LowVoltageSignalsHandlerTest : public ::testing::Test {
*mock_life_cycle_.get(), signals_offset_));
}
- profile::Profile profile_;
main_namespace::LowVoltageSignalsOffset signals_offset_;
std::unique_ptr<main_namespace::LowVoltageSignalsHandler>
low_voltage_signals_handler_;
diff --git a/src/appMain/test/mock_life_cycle.h b/src/appMain/test/mock_life_cycle.h
index fc24b26080..98973bd153 100644
--- a/src/appMain/test/mock_life_cycle.h
+++ b/src/appMain/test/mock_life_cycle.h
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
#define SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index 67a7136a62..625e119270 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -61,6 +61,7 @@ include_directories (
${ENCRYPTION_INCLUDE_DIRECTORY}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
${BSON_INCLUDE_DIRECTORY}
)
diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h
index e3231de347..5167aa88c0 100644
--- a/src/components/application_manager/include/application_manager/app_extension.h
+++ b/src/components/application_manager/include/application_manager/app_extension.h
@@ -33,11 +33,13 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
+#include <memory>
+
namespace ns_smart_device_link {
namespace ns_smart_objects {
class SmartObject;
}
-}
+} // namespace ns_smart_device_link
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
index a10963ad82..2dd64a2941 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
@@ -32,8 +32,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
-#include <string>
#include <memory>
+#include <string>
namespace application_manager {
class Application;
@@ -49,22 +49,22 @@ namespace app_launch {
class AppLaunchCtrl {
public:
/**
- * @brief OnAppRegistered should be called when application registered
- * Save application parameters to database
- * @param app application to save
- */
+ * @brief OnAppRegistered should be called when application registered
+ * Save application parameters to database
+ * @param app application to save
+ */
virtual void OnAppRegistered(const application_manager::Application& app) = 0;
/**
- * @brief OnDeviceConnected shoudl be called on device connected event
- * Start launching saaved applications on ios device
- * @param device_mac
- */
+ * @brief OnDeviceConnected shoudl be called on device connected event
+ * Start launching saaved applications on ios device
+ * @param device_mac
+ */
virtual void OnDeviceConnected(const std::string& device_mac) = 0;
/**
- * @brief OnMasterReset clear database of saved applications
- */
+ * @brief OnMasterReset clear database of saved applications
+ */
virtual void OnMasterReset() = 0;
virtual ~AppLaunchCtrl() {}
};
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
index 61f3480f77..986f4ad4ff 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
@@ -41,11 +41,11 @@
namespace connection_handler {
class ConnectionHandler;
-} // connection_handler
+} // namespace connection_handler
namespace resumption {
class ResumeCtrl;
-} // resumption
+} // namespace resumption
namespace app_launch {
// TODO(AK) Use unique pointer
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
index 73e9623b62..c1ad8d4003 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_
#include <stdint.h>
-#include <vector>
-#include <string>
#include <memory>
+#include <string>
+#include <vector>
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
index ccbf4c7c01..b232d1874c 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -104,8 +104,8 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
bool IsAppDataAlreadyExisted(const ApplicationData& app_data) const OVERRIDE;
/**
- * @brief returns pointer to data base
- */
+ * @brief returns pointer to data base
+ */
utils::dbms::SQLDatabase* db() const;
enum ApplicationDataDBIndexes {
@@ -151,13 +151,13 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
bool WriteDb();
/**
- * @brief returns pointer to data base
- */
+ * @brief returns pointer to data base
+ */
std::unique_ptr<utils::dbms::SQLDatabase> db_;
/**
- * @brief indicate initializing status of DB
- */
+ * @brief indicate initializing status of DB
+ */
bool init_successeful_;
DISALLOW_COPY_AND_ASSIGN(AppLaunchDataDB);
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
index a2b8630bcc..b28c7fdd3d 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_
+#include <memory>
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch_settings.h"
#include "utils/macro.h"
-#include <memory>
namespace app_launch {
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 a292b84fc0..9463a349d9 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
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_
+#include <memory>
#include "application_manager/app_launch/app_launch_data_impl.h"
-#include "smart_objects/smart_object.h"
#include "resumption/last_state.h"
+#include "smart_objects/smart_object.h"
#include "utils/lock.h"
#include "utils/macro.h"
-#include <memory>
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
index 6285514be9..7e360aa460 100644
--- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
@@ -1,9 +1,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_
+#include <memory>
#include "application_manager/app_launch/app_launch_data.h"
#include "connection_handler/connection_handler.h"
#include "utils/timer.h"
-#include <memory>
namespace app_launch {
class AppLaunchCtrlImpl;
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f156654215..f27e4569fc 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -1,12 +1,12 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_
#include <stdint.h>
-#include <vector>
-#include <string>
#include <memory>
+#include <string>
+#include <vector>
#include "application_manager/app_launch/app_launch_data.h"
-#include "application_manager/application_manager.h"
#include "application_manager/app_launch_settings.h"
+#include "application_manager/application_manager.h"
namespace app_launch {
class AppLaunchCtrlImpl;
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
new file mode 100644
index 0000000000..5080748f17
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_service_manager.h
@@ -0,0 +1,266 @@
+/*
+ * 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_APP_SERVICE_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_SERVICE_MANAGER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/rpc_passing_handler.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace resumption {
+class LastState;
+}
+
+namespace application_manager {
+
+struct AppService {
+ uint32_t connection_key;
+ bool mobile_service;
+ bool default_service = false;
+ smart_objects::SmartObject record;
+};
+
+class RPCPassingHandler;
+class ApplicationManager;
+/**
+ * @brief The AppServiceManager is TODO.
+ */
+class AppServiceManager {
+ public:
+ const std::string kEmbeddedService = "EMBEDDED_SERVICE";
+
+ /**
+ * @brief Class constructor
+ * @param app_manager
+ */
+ AppServiceManager(ApplicationManager& app_manager,
+ resumption::LastState& last_state);
+
+ /**
+ * @brief Class destructor
+ */
+ virtual ~AppServiceManager();
+
+ /**
+ * @brief Publish an app service. This service will be activated if it is the
+ * default service for its type, or if it is the first service to register of
+ * its type.
+ * @param manifest - The app service manifest of the service to be published
+ * @param mobile_service - True, if the service is being published by a mobile
+ * app. False, if published by the embedded system.
+ * @param connection_key - If mobile_service is true, the connection key of
+ * the app publishing this service.
+ * @return The app service record of the published app service on success, a
+ * Null SmartObject value on failure
+ */
+ virtual smart_objects::SmartObject PublishAppService(
+ const smart_objects::SmartObject& manifest,
+ const bool mobile_service,
+ const uint32_t connection_key = 0u);
+
+ /**
+ * @brief Unpublish an existing app service
+ * @param service_id - The ID of the app service to be deleted.
+ * @return True on success, false otherwise
+ */
+ virtual bool UnpublishAppService(const std::string service_id);
+
+ /**
+ * @brief Callback for when an application is activated. Will activate all
+ * services which were published by this app.
+ * @param app - The application that was activated.
+ */
+ virtual void OnAppActivated(ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Unpublish any published services for a given mobile application
+ * @param connection_key - The connection key of the application from which
+ * all published services should be deleted.
+ */
+ virtual void UnpublishServices(const uint32_t connection_key);
+
+ /**
+ * @brief Sets a service to the default service for its type
+ * @param service_id - The ID of the service to become the default
+ * @return True on success, false otherwise
+ */
+ virtual bool SetDefaultService(const std::string service_id);
+
+ /**
+ * @brief Removes a service from the list of default services.
+ * @param service_id - The ID of the existing default service.
+ * @return True on success, false otherwise
+ */
+ virtual bool RemoveDefaultService(const std::string service_id);
+
+ /**
+ * @brief Activate an existing service
+ * @param service_id - The ID of the service to be activated.
+ * @return True if the service is active, false otherwise
+ */
+ virtual bool ActivateAppService(const std::string service_id);
+
+ /**
+ * @brief Deactivate an existing active service
+ * @param service_id - The ID of the service to be deactivated.
+ * @return True if the service was deactivated, false otherwise
+ */
+ virtual bool DeactivateAppService(const std::string service_id);
+
+ /**
+ * @brief Get a list of all published service records.
+ * @return A list of all all published service records.
+ */
+ virtual std::vector<smart_objects::SmartObject> GetAllServiceRecords();
+
+ /**
+ * @brief Get a list of all active app services.
+ * @return A list of all all active app services.
+ */
+ virtual std::vector<AppService> GetActiveServices();
+
+ /**
+ * @brief Retrieve the active service provider for a given service type
+ * @param service_type - The service type of the provider to be retrieved
+ * @param mobile_consumer - True, if the consumer trying to communicate with
+ * the provider is a mobile application
+ * @param app - Output parameter that will be filled with the application
+ * providing the requested service on success, unchanged on failure
+ * @param hmi_service - Output parameter set to true if the service
+ * provider is the HMI, unchanged on failure
+ */
+ virtual void GetProviderByType(const std::string& service_type,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ /**
+ * @brief Retrieve the service provider with a given service ID
+ * @param service_type - The service type of the provider to be retrieved
+ * @param mobile_consumer - True, if the consumer trying to communicate with
+ * the provider is a mobile application
+ * @param app - Output parameter that will be filled with the application
+ * providing the requested service on success, unchanged on failure
+ * @param hmi_service - Output parameter set to true if the service
+ * provider is the HMI, unchanged on failure
+ */
+ virtual void GetProviderByID(const std::string& service_id,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ /**
+ * @brief Get the active service for a given service type.
+ * @param service_type - The service type
+ * @return A pointer to the active service for the given service type on
+ * success, NULL on failure
+ */
+ virtual AppService* ActiveServiceForType(const std::string service_type);
+
+ /**
+ * @brief Get the embedded service for a given service type.
+ * @param service_type - The service type
+ * @return A pointer to the embedded service for the given service type on
+ * success, NULL on failure
+ */
+ virtual AppService* EmbeddedServiceForType(const std::string service_type);
+
+ /**
+ * @brief Get the service with a given service ID.
+ * @param service_id - The service ID
+ * @return A pointer to requested service on success, NULL on failure
+ */
+ virtual AppService* FindServiceByID(const std::string service_id);
+
+ /**
+ * @brief Update a navigation system capability struct with the capabilities
+ * of the active navigation service.
+ * @param out_params - The struct to be modified
+ * @return True on success, false otherwise (if there was no active NAVIGATION
+ * service)
+ */
+ virtual bool UpdateNavigationCapabilities(
+ smart_objects::SmartObject& out_params);
+
+ /**
+ * @brief Get the RPCPassingHandler tied to this object
+ * @return The RPCPassingHandler tied to this object
+ */
+ virtual RPCPassingHandler& GetRPCPassingHandler();
+
+ private:
+ ApplicationManager& app_manager_;
+ resumption::LastState& last_state_;
+
+ sync_primitives::RecursiveLock published_services_lock_;
+ std::map<std::string, AppService> published_services_;
+ RPCPassingHandler rpc_passing_handler_;
+
+ void SetServicePublished(const std::string service_id,
+ bool service_published);
+ void AppServiceUpdated(
+ const smart_objects::SmartObject& service_record,
+ const mobile_apis::ServiceUpdateReason::eType update_reason,
+ smart_objects::SmartObject& msg_params);
+ void GetProviderFromService(const AppService& service,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ /**
+ * @brief Get the policy app ID of the default service provider for a given
+ * service type.
+ * @param service_type - The service type
+ * @return The policy app ID of the default service provider for the given
+ * service type on success, "" on failure
+ */
+ std::string DefaultServiceByType(const std::string service_type);
+ AppService* FindServiceByPolicyAppID(const std::string policy_app_id,
+ const std::string type);
+
+ /**
+ * @brief Get the service of a given type published by a given provider.
+ * @param connection_key - The connection key of the service provider
+ * @param service_type - The service type
+ * @return A pointer to requested service on success, NULL on failure
+ */
+ AppService* FindServiceByProvider(const uint32_t connection_key,
+ const std::string service_type);
+ AppService* FindServiceByName(std::string name);
+ std::string GetPolicyAppID(AppService service);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_SERVICE_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index ad7570955e..72122ff3ec 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -33,23 +33,23 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
-#include <string>
+#include <list>
#include <map>
+#include <memory>
#include <set>
-#include <list>
+#include <string>
#include <vector>
-#include <memory>
-#include "utils/data_accessor.h"
-#include "interfaces/MOBILE_API.h"
-#include "connection_handler/device.h"
#include "application_manager/app_extension.h"
-#include "application_manager/message.h"
-#include "application_manager/hmi_state.h"
#include "application_manager/application_state.h"
#include "application_manager/help_prompt_manager.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/message.h"
+#include "connection_handler/device.h"
+#include "interfaces/MOBILE_API.h"
#include "protocol_handler/protocol_handler.h"
#include "smart_objects/smart_object.h"
+#include "utils/data_accessor.h"
#include "utils/macro.h"
#include "utils/semantic_version.h"
@@ -236,8 +236,8 @@ class DynamicApplicationData {
virtual bool is_audio() const = 0;
/*
- * @brief Adds a command to the in application menu
- */
+ * @brief Adds a command to the in application menu
+ */
virtual void AddCommand(uint32_t cmd_id,
const smart_objects::SmartObject& command) = 0;
@@ -353,10 +353,10 @@ class DynamicApplicationData {
virtual uint32_t is_perform_interaction_active() const = 0;
/*
- * @brief Set perform interaction layout
- *
- * @param Current Interaction layout of the perform interaction
- */
+ * @brief Set perform interaction layout
+ *
+ * @param Current Interaction layout of the perform interaction
+ */
virtual void set_perform_interaction_layout(
mobile_api::LayoutMode::eType layout) = 0;
@@ -366,10 +366,10 @@ class DynamicApplicationData {
virtual mobile_api::LayoutMode::eType perform_interaction_layout() const = 0;
/*
- * @brief Sets the mode for perform interaction: UI/VR/BOTH
- *
- * @param mode Mode that was selected (MENU; VR; BOTH)
- */
+ * @brief Sets the mode for perform interaction: UI/VR/BOTH
+ *
+ * @param mode Mode that was selected (MENU; VR; BOTH)
+ */
virtual void set_perform_interaction_mode(int32_t mode) = 0;
/*
@@ -706,11 +706,11 @@ class Application : public virtual InitialApplicationData,
virtual void SetRegularState(HmiStatePtr state) = 0;
/**
- * @brief SetPostponedState sets postponed state to application.
- * This state could be set as regular later
- *
- * @param state state to setup
- */
+ * @brief SetPostponedState sets postponed state to application.
+ * This state could be set as regular later
+ *
+ * @param state state to setup
+ */
virtual void SetPostponedState(HmiStatePtr state) = 0;
virtual void RemovePostponedState() = 0;
@@ -946,6 +946,73 @@ class Application : public virtual InitialApplicationData,
*/
virtual const std::list<AppExtensionPtr>& Extensions() const = 0;
+ /**
+ * @brief Get cloud app endpoint for websocket connection
+ * @return cloud app endpoint
+ */
+ virtual const std::string& cloud_app_endpoint() const = 0;
+
+ /**
+ * @brief Get cloud app auth token to be used in connection handshake after
+ * websocket open.
+ * @return cloud app auth token
+ */
+ virtual const std::string& auth_token() const = 0;
+
+ /**
+ * @brief Get cloud app transport type. Defines the type of websocket
+ * connection used.
+ * @return cloud app transport type
+ */
+ virtual const std::string& cloud_app_transport_type() const = 0;
+
+ /**
+ * @brief Get hybrid app preference. Defines behaviour for when a similar
+ * mobile and cloud app are connected simultaneously.
+ * @return hybrid app preference
+ */
+ virtual const mobile_apis::HybridAppPreference::eType& hybrid_app_preference()
+ const = 0;
+
+ /**
+ * @brief Get cloud app certificate. Used for secured websocket connections.
+ * @return cloud app certificate.
+ */
+ virtual const std::string& cloud_app_certificate() const = 0;
+
+ /**
+ * @brief Check whether the given application is a cloud app.
+ * @return true if the application is a cloud application, false otherwise.
+ */
+ virtual bool is_cloud_app() const = 0;
+
+ /**
+ * @brief Set cloud app endpoint
+ */
+ virtual void set_cloud_app_endpoint(const std::string& endpoint) = 0;
+
+ /**
+ * @brief Set cloud app auth token
+ */
+ virtual void set_auth_token(const std::string& auth_token) = 0;
+
+ /**
+ * @brief Set cloud app transport type
+ */
+ virtual void set_cloud_app_transport_type(
+ const std::string& transport_type) = 0;
+
+ /**
+ * @brief Set hybrid app preference
+ */
+ virtual void set_hybrid_app_preference(
+ const mobile_apis::HybridAppPreference::eType& hybrid_app_preference) = 0;
+
+ /**
+ * @brief Set cloud app certificate
+ */
+ virtual void set_cloud_app_certificate(const std::string& certificate) = 0;
+
protected:
mutable sync_primitives::Lock hmi_states_lock_;
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 8f24f124f9..7852d6805b 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
@@ -34,11 +34,11 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
#include <string>
-#include "utils/lock.h"
-#include "utils/semantic_version.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
+#include "utils/semantic_version.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index 8dc3b2da20..fd9b77eb0f 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -33,28 +33,28 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+#include <stdint.h>
+#include <forward_list>
+#include <list>
#include <map>
#include <set>
-#include <vector>
#include <utility>
-#include <list>
-#include <forward_list>
-#include <stdint.h>
+#include <vector>
#include "application_manager/application.h"
#include "application_manager/application_data_impl.h"
-#include "application_manager/usage_statistics.h"
#include "application_manager/help_prompt_manager_impl.h"
#include "application_manager/hmi_state.h"
+#include "application_manager/usage_statistics.h"
#include "protocol_handler/protocol_handler.h"
-#include "connection_handler/device.h"
-#include "utils/lock.h"
#include <atomic>
+#include "connection_handler/device.h"
#include "utils/custom_string.h"
-#include "utils/timer.h"
-#include "utils/macro.h"
#include "utils/date_time.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/timer.h"
namespace usage_statistics {
@@ -304,18 +304,18 @@ class ApplicationImpl : public virtual Application,
void SetInitialState(HmiStatePtr state) FINAL;
/**
- * @brief SetRegularState set permanent state of application
- *
- * @param state state to setup
- */
+ * @brief SetRegularState set permanent state of application
+ *
+ * @param state state to setup
+ */
virtual void SetRegularState(HmiStatePtr state);
/**
- * @brief SetPostponedState sets postponed state to application.
- * This state could be set as regular later
- *
- * @param state state to setup
- */
+ * @brief SetPostponedState sets postponed state to application.
+ * This state could be set as regular later
+ *
+ * @param state state to setup
+ */
virtual void SetPostponedState(HmiStatePtr state);
virtual void RemovePostponedState();
@@ -409,6 +409,72 @@ class ApplicationImpl : public virtual Application,
void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) OVERRIDE;
+ /**
+ * @brief Get cloud app endpoint for websocket connection
+ * @return cloud app endpoint
+ */
+ const std::string& cloud_app_endpoint() const OVERRIDE;
+
+ /**
+ * @brief Get cloud app auth token to be used in connection handshake after
+ * websocket open.
+ * @return cloud app auth token
+ */
+ const std::string& auth_token() const OVERRIDE;
+
+ /**
+ * @brief Get cloud app transport type. Defines the type of websocket
+ * connection used.
+ * @return cloud app transport type
+ */
+ const std::string& cloud_app_transport_type() const OVERRIDE;
+
+ /**
+ * @brief Get hybrid app preference. Defines behaviour for when a similar
+ * mobile and cloud app are connected simultaneously.
+ * @return hybrid app preference
+ */
+ const mobile_apis::HybridAppPreference::eType& hybrid_app_preference()
+ const OVERRIDE;
+
+ /**
+ * @brief Get cloud app certificate. Used for secured websocket connections.
+ * @return cloud app certificate.
+ */
+ const std::string& cloud_app_certificate() const OVERRIDE;
+
+ /**
+ * @brief Check whether the given application is a cloud app.
+ * @return true if the application is a cloud application, false otherwise.
+ */
+ bool is_cloud_app() const OVERRIDE;
+
+ /**
+ * @brief Set cloud app endpoint
+ */
+ void set_cloud_app_endpoint(const std::string& endpoint) OVERRIDE;
+
+ /**
+ * @brief Set cloud app auth token
+ */
+ void set_auth_token(const std::string& auth_token) OVERRIDE;
+
+ /**
+ * @brief Set cloud app transport type
+ */
+ void set_cloud_app_transport_type(const std::string& transport_type) OVERRIDE;
+
+ /**
+ * @brief Set hybrid app preference
+ */
+ void set_hybrid_app_preference(const mobile_apis::HybridAppPreference::eType&
+ hybrid_app_preference) OVERRIDE;
+
+ /**
+ * @brief Set cloud app certificate
+ */
+ void set_cloud_app_certificate(const std::string& certificate) OVERRIDE;
+
protected:
/**
* @brief Clean up application folder. Persistent files will stay
@@ -513,6 +579,13 @@ class ApplicationImpl : public virtual Application,
std::list<AppExtensionPtr> extensions_;
+ // Cloud app properties
+ std::string endpoint_;
+ std::string auth_token_;
+ std::string cloud_transport_type_;
+ mobile_apis::HybridAppPreference::eType hybrid_app_preference_;
+ std::string certificate_;
+
/**
* @brief Defines number per time in seconds limits
*/
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 6c111dbbb3..c34affbf13 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
@@ -34,40 +34,41 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_IMPL_H_
#include <stdint.h>
-#include <vector>
-#include <map>
-#include <set>
-#include <deque>
#include <algorithm>
+#include <deque>
+#include <map>
#include <memory>
+#include <set>
+#include <vector>
+#include "application_manager/app_launch/app_launch_data.h"
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/command_factory.h"
+#include "application_manager/command_holder.h"
+#include "application_manager/event_engine/event_dispatcher_impl.h"
#include "application_manager/hmi_capabilities.h"
+#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/state_controller_impl.h"
-#include "application_manager/app_launch/app_launch_data.h"
-#include "application_manager/application_manager_settings.h"
-#include "application_manager/event_engine/event_dispatcher_impl.h"
-#include "application_manager/hmi_interfaces_impl.h"
-#include "application_manager/command_holder.h"
-#include "application_manager/command_factory.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/state_controller_impl.h"
-#include "protocol_handler/protocol_observer.h"
-#include "protocol_handler/protocol_handler.h"
-#include "hmi_message_handler/hmi_message_observer.h"
-#include "hmi_message_handler/hmi_message_sender.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_handler_observer.h"
#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
#include "connection_handler/device.h"
#include "formatters/CSmartFactory.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
#include "policies/policy_handler.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/protocol_observer.h"
#include "interfaces/HMI_API.h"
#include "interfaces/HMI_API_schema.h"
@@ -87,14 +88,14 @@
#include "utils/macro.h"
+#include "smart_objects/smart_object.h"
+#include "utils/data_accessor.h"
+#include "utils/lock.h"
#include "utils/message_queue.h"
#include "utils/prioritized_queue.h"
-#include "utils/threads/thread.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/lock.h"
-#include "utils/data_accessor.h"
+#include "utils/threads/thread.h"
#include "utils/timer.h"
-#include "smart_objects/smart_object.h"
struct BsonObject;
@@ -117,6 +118,14 @@ struct CommandParametersPermissions;
typedef std::map<std::string, hmi_apis::Common_TransportType::eType>
DeviceTypes;
+struct AppIconInfo {
+ std::string endpoint;
+ bool pending_request;
+ AppIconInfo();
+ AppIconInfo(std::string ws_endpoint, bool pending)
+ : endpoint(ws_endpoint), pending_request(pending) {}
+};
+
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
typedef std::shared_ptr<timer::Timer> TimerSPtr;
@@ -125,14 +134,14 @@ class ApplicationManagerImpl
public connection_handler::ConnectionHandlerObserver,
public policy::PolicyHandlerObserver
#ifdef ENABLE_SECURITY
- ,
+ ,
public security_manager::SecurityManagerListener
#endif // ENABLE_SECURITY
#ifdef TELEMETRY_MONITOR
- ,
+ ,
public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
#endif // TELEMETRY_MONITOR
- {
+{
friend class ResumeCtrl;
friend class CommandImpl;
@@ -156,6 +165,7 @@ class ApplicationManagerImpl
bool Stop() OVERRIDE;
DataAccessor<ApplicationSet> applications() const OVERRIDE;
+ DataAccessor<AppsWaitRegistrationSet> pending_applications() const OVERRIDE;
ApplicationSharedPtr application(uint32_t app_id) const OVERRIDE;
ApplicationSharedPtr active_application() const OVERRIDE;
@@ -164,6 +174,10 @@ class ApplicationManagerImpl
uint32_t hmi_app_id) const OVERRIDE;
ApplicationSharedPtr application_by_policy_id(
const std::string& policy_app_id) const OVERRIDE;
+ 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;
std::vector<ApplicationSharedPtr> applications_by_button(
uint32_t button) OVERRIDE;
@@ -194,6 +208,9 @@ class ApplicationManagerImpl
void SendDriverDistractionState(ApplicationSharedPtr application);
+ void SendGetIconUrlNotifications(const uint32_t connection_key,
+ ApplicationSharedPtr application);
+
ApplicationSharedPtr application(
const std::string& device_id,
const std::string& policy_app_id) const OVERRIDE;
@@ -213,6 +230,11 @@ class ApplicationManagerImpl
return *plugin_manager_;
}
+ virtual AppServiceManager& GetAppServiceManager() OVERRIDE {
+ DCHECK(app_service_manager_);
+ return *app_service_manager_;
+ }
+
std::vector<std::string> devices(
const std::string& policy_app_id) const OVERRIDE;
@@ -302,8 +324,9 @@ class ApplicationManagerImpl
void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
#endif // TELEMETRY_MONITOR
- ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
- smart_objects::SmartObject>& request_for_registration) OVERRIDE;
+ ApplicationSharedPtr RegisterApplication(
+ const std::shared_ptr<smart_objects::SmartObject>&
+ request_for_registration) OVERRIDE;
/*
* @brief Closes application by id
*
@@ -320,9 +343,9 @@ class ApplicationManagerImpl
bool is_unexpected_disconnect = false) OVERRIDE;
/**
- * @brief Handle sequence for unauthorized application
- * @param app_id Application id
- */
+ * @brief Handle sequence for unauthorized application
+ * @param app_id Application id
+ */
void OnAppUnauthorized(const uint32_t& app_id) OVERRIDE;
/*
@@ -360,6 +383,44 @@ class ApplicationManagerImpl
void ConnectToDevice(const std::string& device_mac) OVERRIDE;
void OnHMIStartedCooperation() OVERRIDE;
+ void DisconnectCloudApp(ApplicationSharedPtr app) OVERRIDE;
+
+ void RefreshCloudAppInformation() OVERRIDE;
+
+ void CreatePendingApplication(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info,
+ connection_handler::DeviceHandle device_id);
+
+ void SetPendingApplicationState(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info);
+
+ std::string PolicyIDByIconUrl(const std::string url) OVERRIDE;
+
+ void SetIconFileFromSystemRequest(const std::string policy_id) OVERRIDE;
+
+ /**
+ * @brief Notifies the applicaiton manager that a cloud connection status has
+ * updated and should trigger an UpdateAppList RPC to the HMI
+ */
+ void OnConnectionStatusUpdated();
+
+ /**
+ * @brief Retrieve the current connection status of a cloud app
+ * @param app A cloud application
+ * @return The current CloudConnectionStatus of app
+ */
+ hmi_apis::Common_CloudConnectionStatus::eType GetCloudAppConnectionStatus(
+ ApplicationConstSharedPtr app) const;
+
+ /*
+ * @brief Returns unique correlation ID for to mobile request
+ *
+ * @return Unique correlation ID
+ */
+ uint32_t GetNextMobileCorrelationID() OVERRIDE;
+
/*
* @brief Returns unique correlation ID for HMI request
*
@@ -476,18 +537,12 @@ class ApplicationManagerImpl
// typedef for Applications list
typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplictionSet;
- typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
- AppsWaitRegistrationSet;
-
// typedef for Applications list iterator
typedef ApplictionSet::iterator ApplictionSetIt;
// typedef for Applications list const iterator
typedef ApplictionSet::const_iterator ApplictionSetConstIt;
- DataAccessor<AppsWaitRegistrationSet> apps_waiting_for_registration() const;
- ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const;
-
/**
* @brief Notification from PolicyHandler about PTU.
* Compares AppHMIType between saved in app and received from PTU. If they are
@@ -678,6 +733,15 @@ class ApplicationManagerImpl
uint32_t new_timeout_value) OVERRIDE;
/**
+ * @brief TODO
+ *
+ * @param connection_key Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ */
+ void IncreaseForwardedRequestTimeout(uint32_t connection_key,
+ uint32_t mobile_correlation_id) OVERRIDE;
+
+ /**
* @brief AddPolicyObserver allows to subscribe needed component to events
* from policy.
*
@@ -764,9 +828,9 @@ class ApplicationManagerImpl
ApplicationConstSharedPtr application) const;
/**
- * Getter for resume_controller
- * @return Resume Controller
- */
+ * Getter for resume_controller
+ * @return Resume Controller
+ */
resumption::ResumeCtrl& resume_controller() OVERRIDE {
return *resume_ctrl_.get();
}
@@ -935,8 +999,7 @@ class ApplicationManagerImpl
AppV4DevicePredicate(const connection_handler::DeviceHandle handle)
: handle_(handle) {}
bool operator()(const ApplicationSharedPtr app) const {
- return app
- ? handle_ == app->device() &&
+ return app ? handle_ == app->device() &&
Message::is_sufficient_version(
protocol_handler::MajorProtocolVersion::
PROTOCOL_VERSION_4,
@@ -962,6 +1025,14 @@ class ApplicationManagerImpl
}
};
+ struct AppNamePredicate {
+ std::string app_name_;
+ AppNamePredicate(const std::string& app_name) : app_name_(app_name) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ return app ? app->name() == app_name_ : false;
+ }
+ };
+
/**
* @brief Sends UpdateAppList notification to HMI
*/
@@ -1004,14 +1075,14 @@ class ApplicationManagerImpl
}
/**
- * @brief ProcessReconnection handles reconnection flow for application on
- * transport switch
- * @param application Pointer to switched application, must be validated
- * before passing
- * @param connection_key Connection key from registration request of
- * switched
- * application
- */
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of
+ * switched
+ * application
+ */
void ProcessReconnection(ApplicationSharedPtr application,
const uint32_t connection_key) FINAL;
@@ -1078,7 +1149,8 @@ class ApplicationManagerImpl
mobile_apis::MOBILE_API& mobile_so_factory();
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
- Message& output);
+ Message& output,
+ const bool allow_unknown_parameters = false);
template <typename ApplicationList>
void PrepareApplicationListSO(ApplicationList app_list,
@@ -1382,6 +1454,7 @@ class ApplicationManagerImpl
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
+ std::unique_ptr<application_manager::AppServiceManager> app_service_manager_;
/**
* @brief Map contains apps with HMI state before incoming call
@@ -1404,6 +1477,7 @@ class ApplicationManagerImpl
hmi_apis::HMI_API* hmi_so_factory_;
mobile_apis::MOBILE_API* mobile_so_factory_;
+ static uint32_t mobile_corelation_id_;
static uint32_t corelation_id_;
static const uint32_t max_corelation_id_;
@@ -1449,6 +1523,13 @@ class ApplicationManagerImpl
DeviceMap secondary_transport_devices_cache_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ pending_device_map_lock_ptr_;
+ std::map<std::string, std::string> pending_device_map_;
+
+ sync_primitives::Lock app_icon_map_lock_ptr_;
+ std::map<std::string, AppIconInfo> app_icon_map_;
+
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -1478,18 +1559,47 @@ class ApplicationManagerImpl
void AddMockApplication(ApplicationSharedPtr mock_app);
/**
+ * @brief Add a mock application to the pending application list without going
+ * through the formal registration process. Only for unit testing.
+ * @param mock_app the mock app to be added to the pending application list
+ */
+ void AddMockPendingApplication(ApplicationSharedPtr mock_app);
+
+ /**
* @brief set a mock media manager without running Init(). Only for unit
* testing.
- * @param mock_app the mock app to be registered
+ * @param mock_media_manager the mock media manager to be assigned
*/
void SetMockMediaManager(media_manager::MediaManager* mock_media_manager);
+ /**
+ * @brief set a mock rpc service directly. Only for unit
+ * testing.
+ * @param mock_app the mock rpc service to be assigned
+ */
+ void SetMockRPCService(rpc_service::RPCService* rpc_service) {
+ rpc_service_.reset(rpc_service);
+ }
+
+ /**
+ * @brief set a mock rpc service directly. Only for unit
+ * testing.
+ * @param mock_app the mock rpc service to be assigned
+ */
+ void SetMockPolicyHandler(policy::PolicyHandlerInterface* policy_handler) {
+ policy_handler_.reset(policy_handler);
+ }
+
virtual void SetPluginManager(
std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager)
OVERRIDE {
plugin_manager_.reset(plugin_manager.release());
}
+ virtual void SetAppServiceManager(AppServiceManager* app_service_manager) {
+ app_service_manager_.reset(app_service_manager);
+ }
+
private:
#endif
diff --git a/src/components/application_manager/include/application_manager/application_state.h b/src/components/application_manager/include/application_manager/application_state.h
index bf894eaf94..d708a6188d 100644
--- a/src/components/application_manager/include/application_manager/application_state.h
+++ b/src/components/application_manager/include/application_manager/application_state.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_
#include <vector>
+#include "application_manager/hmi_state.h"
#include "utils/lock.h"
#include "utils/macro.h"
-#include "application_manager/hmi_state.h"
namespace application_manager {
@@ -119,11 +119,11 @@ class ApplicationState {
void SetRegularState(HmiStatePtr state);
/**
- * @brief Sets postponed state of application.
- * This state could be set as regular later on
- *
- * @param state state to setup
- */
+ * @brief Sets postponed state of application.
+ * This state could be set as regular later on
+ *
+ * @param state state to setup
+ */
void SetPostponedState(HmiStatePtr state);
/**
@@ -154,6 +154,6 @@ class ApplicationState {
DISALLOW_COPY_AND_ASSIGN(ApplicationState);
};
-}
+} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_
diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h
index 7dc8a0cfc1..f479ee7f37 100644
--- a/src/components/application_manager/include/application_manager/command_factory.h
+++ b/src/components/application_manager/include/application_manager/command_factory.h
@@ -33,10 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
-#include "application_manager/commands/command.h"
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/rpc_service.h"
#include "utils/macro.h"
namespace application_manager {
@@ -63,10 +64,10 @@ class CommandFactory {
const commands::MessageSharedPtr& message,
commands::Command::CommandSource source) = 0;
/**
- * @param int32_t command id
- * @param CommandSource source
- * @return return true if command can be create, else return false
- **/
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
virtual bool IsAbleToProcess(
const int32_t,
const application_manager::commands::Command::CommandSource source)
diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h
index 18a1de7526..8867336b3e 100644
--- a/src/components/application_manager/include/application_manager/command_holder_impl.h
+++ b/src/components/application_manager/include/application_manager/command_holder_impl.h
@@ -35,9 +35,9 @@
#include "application_manager/command_holder.h"
+#include <map>
#include <string>
#include <vector>
-#include <map>
#include "application_manager/application.h"
#include "application_manager/rpc_service.h"
#include "smart_objects/smart_object.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 f8ea7db24d..0693f9868d 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -100,19 +100,24 @@ class Command {
virtual void onTimeOut() = 0;
/**
- * @brief AllowedToTerminate tells if request controller is allowed
- * to terminate this command
- * @return
- */
+ * @brief AllowedToTerminate tells if request controller is allowed
+ * to terminate this command
+ * @return
+ */
virtual bool AllowedToTerminate() = 0;
/**
- * @brief SetAllowedToTerminate set up allowed to terminate flag.
- * If true, request controller will terminate request on response
- */
+ * @brief SetAllowedToTerminate set up allowed to terminate flag.
+ * If true, request controller will terminate request on response
+ */
virtual void SetAllowedToTerminate(const bool allowed) = 0;
- enum CommandSource { SOURCE_SDL, SOURCE_MOBILE, SOURCE_HMI };
+ enum CommandSource {
+ SOURCE_SDL,
+ SOURCE_MOBILE,
+ SOURCE_HMI,
+ SOURCE_SDL_TO_HMI
+ };
};
typedef smart_objects::SmartObjectSPtr MessageSharedPtr;
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 4859f73a55..4e52ac23ce 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
@@ -33,10 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+#include "application_manager/application_manager.h"
#include "application_manager/commands/command.h"
#include "application_manager/event_engine/event_observer.h"
-#include "application_manager/application_manager.h"
#include "application_manager/smart_object_keys.h"
+#include "policy/policy_types.h"
#include "utils/logger.h"
namespace application_manager {
@@ -124,18 +125,19 @@ class CommandImpl : public Command {
void onTimeOut() OVERRIDE;
/**
- * @brief AllowedToTerminate tells request Controller if it can terminate this
- * request by response.
- * By default, RequestCtrl should terminate all requests by their responses.
- * If request need to terminate itself, it should override this function false
- * @return allowed_to_terminate_ value
- */
+ * @brief AllowedToTerminate tells request Controller if it can terminate this
+ * request by response.
+ * By default, RequestCtrl should terminate all requests by their responses.
+ * If request need to terminate itself, it should override this function
+ * false
+ * @return allowed_to_terminate_ value
+ */
bool AllowedToTerminate() OVERRIDE;
/**
- * @brief SetAllowedToTerminate set up allowed to terminate flag.
- * If true, request controller will terminate request on response
- */
+ * @brief SetAllowedToTerminate set up allowed to terminate flag.
+ * If true, request controller will terminate request on response
+ */
void SetAllowedToTerminate(const bool allowed) OVERRIDE;
// members
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
index 8741dae540..e8485a3abc 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
@@ -53,6 +53,11 @@ class CommandNotificationFromMobileImpl : public CommandImpl {
virtual bool CleanUp();
virtual void Run();
void SendNotification();
+ void SendNotificationToMobile();
+ void SendNotificationToHMI(
+ const hmi_apis::FunctionID::eType& hmi_function_id);
+ void SendNotificationToConsumers(
+ const hmi_apis::FunctionID::eType& hmi_function_id);
private:
DISALLOW_COPY_AND_ASSIGN(CommandNotificationFromMobileImpl);
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 27aa93d1d8..b5a330d907 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
@@ -34,10 +34,10 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
#include "application_manager/commands/command_impl.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
-#include "utils/lock.h"
+#include "interfaces/MOBILE_API.h"
#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
namespace application_manager {
namespace commands {
@@ -149,6 +149,8 @@ class CommandRequestImpl : public CommandImpl,
*/
virtual void on_event(const event_engine::Event& event);
+ virtual void on_event(const event_engine::MobileEvent& event);
+
/*
* @brief Creates Mobile response
*
@@ -157,10 +159,12 @@ class CommandRequestImpl : public CommandImpl,
* @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);
+ 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 Check syntax of string from mobile
@@ -170,6 +174,16 @@ class CommandRequestImpl : public CommandImpl,
*/
bool CheckSyntax(const std::string& str, bool allow_empty_line = false);
+ 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);
+
/*
* @brief Sends HMI request
*
@@ -235,6 +249,14 @@ class CommandRequestImpl : public CommandImpl,
bool HasDisallowedParams() const;
/**
+ * @brief Checks result code from Mobile for single RPC
+ * @param result_code contains result code from Mobile response
+ * @return true if result code complies successful result codes,
+ * false otherwise.
+ */
+ bool IsMobileResultSuccess(mobile_apis::Result::eType result_code) 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
@@ -313,7 +335,7 @@ class CommandRequestImpl : public CommandImpl,
* @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
- */
+ */
bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const;
/**
@@ -324,7 +346,7 @@ class CommandRequestImpl : public CommandImpl,
void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
/**
- * @brief This set stores all the interfaces which are awaited by SDL to
+ * @brief This set stores all the interfaces which are awaited by SDL to
* return a response on some request
*/
std::set<HmiInterfaces::InterfaceID> awaiting_response_interfaces_;
@@ -365,10 +387,10 @@ class CommandRequestImpl : public CommandImpl,
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
- */
+ * @brief UpdateHash updates hash field for application and sends
+ * OnHashChanged notification to mobile side in case of approriate hash mode
+ * is set
+ */
void UpdateHash();
/**
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h b/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h
new file mode 100644
index 0000000000..430e549523
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h
@@ -0,0 +1,73 @@
+/*
+ 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_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_
+
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandRequestToMobile : public CommandImpl {
+ public:
+ CommandRequestToMobile(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ ~CommandRequestToMobile();
+ bool Init() OVERRIDE;
+ bool CleanUp() OVERRIDE;
+ void Run() OVERRIDE;
+ void SendRequest();
+
+ /*
+ * @brief Retrieves application ID
+ */
+ inline uint32_t application_id() const {
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandRequestToMobile);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h b/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h
new file mode 100644
index 0000000000..1401888890
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h
@@ -0,0 +1,73 @@
+/*
+ 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_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_
+
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandResponseFromMobile : public CommandImpl {
+ public:
+ CommandResponseFromMobile(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ ~CommandResponseFromMobile();
+ bool Init() OVERRIDE;
+ bool CleanUp() OVERRIDE;
+ void Run() OVERRIDE;
+ void SendResponse();
+
+ /*
+ * @brief Retrieves application ID
+ */
+ inline uint32_t application_id() const {
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandResponseFromMobile);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
index 8bbbd0e3de..25cfd7b207 100644
--- a/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
@@ -53,8 +53,14 @@ class NotificationFromHMI : public CommandImpl {
virtual bool CleanUp();
virtual void Run();
void SendNotificationToMobile(const MessageSharedPtr& message);
+ void SendNotificationToMobile(
+ const MessageSharedPtr& message,
+ const mobile_apis::FunctionID::eType& mobile_function_id);
+ void SendNotificationToHMI(MessageSharedPtr& message);
void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject& msg_params) const;
+ void SendNotificationToConsumers(
+ const mobile_apis::FunctionID::eType& mobile_function_id);
private:
DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
diff --git a/src/components/application_manager/include/application_manager/commands/pending.h b/src/components/application_manager/include/application_manager/commands/pending.h
index bbfc246659..9083d81d73 100644
--- a/src/components/application_manager/include/application_manager/commands/pending.h
+++ b/src/components/application_manager/include/application_manager/commands/pending.h
@@ -35,9 +35,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
#include <set>
-#include "utils/macro.h"
-#include "utils/lock.h"
#include "interfaces/HMI_API.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
namespace application_manager {
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 927a45c6a6..4464056175 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
@@ -55,16 +55,22 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
virtual bool CleanUp();
virtual void Run();
virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::MobileEvent& event) OVERRIDE;
/**
* @brief SendResponse allows to send response to hmi
* @param correlation_id the correlation id for the rfesponse.
* @param function_id the function id for which response will be sent
* @param result_code the result code.
+ * @param response_params extra response params.
+ * @param source command source.
*/
- void SendResponse(const bool success,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code);
+ void SendResponse(
+ const bool success,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const smart_objects::SmartObject* response_params = NULL,
+ commands::Command::CommandSource source = commands::Command::SOURCE_HMI);
/**
* @brief SendResponse allows to send error response to hmi
@@ -72,11 +78,39 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
* @param function_id the function id for which response will be sent
* @param result_code the result code.
* @param error_message info message for error.
+ * @param source command source.
*/
- void SendErrorResponse(const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code,
- const std::string error_message);
+ void SendErrorResponse(
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message,
+ commands::Command::CommandSource source = commands::Command::SOURCE_HMI);
+
+ 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,
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject* msg_params,
+ bool use_events);
+
+ void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params,
+ bool use_events);
+
+ bool ProcessHMIInterfacesAvailability(
+ 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:
/**
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 91586a74ce..e8850fbe8d 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_
-#include "application_manager/commands/command_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
index 605d04067e..6c00957d3f 100644
--- a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
@@ -1,40 +1,40 @@
/*
-* 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.
-*/
+ * 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_COMMANDS_RESPONSE_FROM_HMI_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
-#include "application_manager/commands/command_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
#include "interfaces/HMI_API.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/event_engine/event.h b/src/components/application_manager/include/application_manager/event_engine/event.h
index 68ee508a9b..e7382e01a4 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event.h
@@ -34,9 +34,10 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_H_
#include <interfaces/HMI_API.h>
+#include <interfaces/MOBILE_API.h>
-#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace event_engine {
@@ -130,9 +131,9 @@ int32_t Event::smart_object_function_id() const {
}
int32_t Event::smart_object_correlation_id() const {
- return response_so_.getElement(strings::params)
- .getElement(strings::correlation_id)
- .asInt();
+ return static_cast<int32_t>(response_so_.getElement(strings::params)
+ .getElement(strings::correlation_id)
+ .asInt());
}
int32_t Event::smart_object_type() const {
@@ -141,6 +142,104 @@ int32_t Event::smart_object_type() const {
.asInt();
}
+class MobileEvent {
+ public:
+ // Typedef for possible Event ID's from mobile_apis functionID enum
+ typedef mobile_apis::FunctionID::eType MobileEventID;
+
+ /*
+ * @brief Constructor with parameters
+ *
+ * @param id Event ID. Please see mobile_apis::FunctionID for possible ID's
+ */
+ explicit MobileEvent(const MobileEventID& id);
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~MobileEvent();
+
+ /*
+ * @brief Sends synchronously event to all subscribers.
+ *
+ */
+ void raise(EventDispatcher& event_dispatcher);
+
+ /*
+ * @brief Provides event ID
+ */
+ inline const MobileEventID& id() const;
+
+ /*
+ * @brief Sets event smart object
+ *
+ * @param so The smart_object received in Mobile response
+ */
+ void set_smart_object(const smart_objects::SmartObject& so);
+
+ /*
+ * @brief Retrieves event smart object
+ *
+ * @return The smart_object received in Mobile response
+ */
+ inline const smart_objects::SmartObject& smart_object() const;
+
+ /*
+ * @brief Retrieves smart object request ID
+ */
+ inline int32_t smart_object_function_id() const;
+
+ /*
+ * @brief Retrieves smart object correlation ID
+ */
+ inline int32_t smart_object_correlation_id() const;
+
+ /*
+ * @brief Retrieves smart_object response type
+ */
+ inline int32_t smart_object_type() const;
+
+ protected:
+ private:
+ MobileEventID id_;
+ smart_objects::SmartObject response_so_;
+
+ /*
+ * @brief Default constructor
+ *
+ * Unimplemented to avoid misusing
+ */
+ MobileEvent();
+
+ DISALLOW_COPY_AND_ASSIGN(MobileEvent);
+};
+
+const MobileEvent::MobileEventID& MobileEvent::id() const {
+ return id_;
+}
+
+const smart_objects::SmartObject& MobileEvent::smart_object() const {
+ return response_so_;
+}
+
+int32_t MobileEvent::smart_object_function_id() const {
+ return static_cast<int32_t>(response_so_.getElement(strings::params)
+ .getElement(strings::function_id)
+ .asInt());
+}
+
+int32_t MobileEvent::smart_object_correlation_id() const {
+ return static_cast<int32_t>(response_so_.getElement(strings::params)
+ .getElement(strings::correlation_id)
+ .asInt());
+}
+
+int32_t MobileEvent::smart_object_type() const {
+ return static_cast<int32_t>(response_so_.getElement(strings::params)
+ .getElement(strings::message_type)
+ .asInt());
+}
+
} // namespace event_engine
} // namespace 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 813dda0295..0656372f47 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
@@ -77,6 +77,42 @@ class EventDispatcher {
*/
virtual void remove_observer(EventObserver& observer) = 0;
+ // Mobile Events
+
+ /*
+ * @brief Delivers the event to all subscribers
+ *
+ * @param event Received event
+ */
+ virtual void raise_mobile_event(const MobileEvent& event) = 0;
+
+ /*
+ * @brief Subscribe the observer to event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ * @param observer The observer to subscribe for event
+ */
+ virtual void add_mobile_observer(const MobileEvent::MobileEventID& event_id,
+ int32_t mobile_correlation_id,
+ EventObserver& observer) = 0;
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ * @param observer The observer to be unsubscribed
+ */
+ virtual void remove_mobile_observer(
+ const MobileEvent::MobileEventID& event_id, EventObserver& observer) = 0;
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ virtual void remove_mobile_observer(EventObserver& observer) = 0;
+
/*
* @brief Destructor
*/
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 ed923369ac..3644299499 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_
-#include <vector>
#include <map>
+#include <vector>
#include "utils/lock.h"
@@ -52,6 +52,8 @@ class EventDispatcherImpl : public EventDispatcher {
typedef std::vector<EventObserver*> ObserverVector;
typedef std::map<int32_t, ObserverVector> ObserversMap;
typedef std::map<Event::EventID, ObserversMap> EventObserverMap;
+ typedef std::map<MobileEvent::MobileEventID, ObserversMap>
+ MobileEventObserverMap;
/*
* @brief Destructor
*/
@@ -66,6 +68,9 @@ class EventDispatcherImpl : public EventDispatcher {
EventObserverMap get_observers() const {
return observers_event_;
}
+ MobileEventObserverMap get_mobile_observers() const {
+ return mobile_observers_event_;
+ }
ObserverVector get_observers_list() const {
return observers_;
}
@@ -105,6 +110,41 @@ class EventDispatcherImpl : public EventDispatcher {
*/
void remove_observer(EventObserver& observer) OVERRIDE;
+ // Mobile requests
+ /*
+ * @brief Delivers the event to all subscribers
+ *
+ * @param event Received event
+ */
+ void raise_mobile_event(const MobileEvent& event) OVERRIDE;
+
+ /*
+ * @brief Subscribe the observer to event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ * @param observer The observer to subscribe for event
+ */
+ void add_mobile_observer(const MobileEvent::MobileEventID& event_id,
+ int32_t mobile_correlation_id,
+ EventObserver& observer) OVERRIDE;
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_mobile_observer(const MobileEvent::MobileEventID& event_id,
+ EventObserver& observer) OVERRIDE;
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_mobile_observer(EventObserver& observer) OVERRIDE;
+
private:
/*
* @brief removes observer
@@ -113,14 +153,25 @@ class EventDispatcherImpl : public EventDispatcher {
*/
void remove_observer_from_vector(EventObserver& observer);
+ /*
+ * @brief removes observer
+ * when occurs unsubscribe from event
+ * @param observer to be removed
+ */
+ void remove_mobile_observer_from_vector(EventObserver& observer);
+
DISALLOW_COPY_AND_ASSIGN(EventDispatcherImpl);
private:
// Members section
sync_primitives::Lock state_lock_;
+ sync_primitives::Lock mobile_state_lock_;
sync_primitives::RecursiveLock observer_lock_;
+ sync_primitives::RecursiveLock mobile_observer_lock_;
EventObserverMap observers_event_;
+ MobileEventObserverMap mobile_observers_event_;
ObserverVector observers_;
+ ObserverVector mobile_observers_;
};
} // namespace event_engine
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 593f1df657..7a7fe7c2ec 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
@@ -72,6 +72,8 @@ class EventObserver {
*/
virtual void on_event(const Event& event) = 0;
+ virtual void on_event(const MobileEvent& event);
+
protected:
/*
* @brief Subscribe to an event
@@ -94,7 +96,38 @@ class EventObserver {
* @brief Unsubscribes the observer from all events
*
*/
- void unsubscribe_from_all_events();
+ DEPRECATED void unsubscribe_from_all_events();
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ */
+ void unsubscribe_from_all_hmi_events();
+
+ // Mobile Events
+
+ /*
+ * @brief Subscribe to an event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param mobile_correlation_id The event mobile correlation ID.
+ * If param is omitted, it means subscription for mobile notification
+ */
+ void subscribe_on_event(const MobileEvent::MobileEventID& event_id,
+ int32_t mobile_correlation_id = 0);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ */
+ void unsubscribe_from_event(const MobileEvent::MobileEventID& event_id);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ */
+ void unsubscribe_from_all_mobile_events();
private:
ObserverID id_;
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager.h b/src/components/application_manager/include/application_manager/help_prompt_manager.h
index a0c34e77d7..eb45705d9f 100644
--- a/src/components/application_manager/include/application_manager/help_prompt_manager.h
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager.h
@@ -28,7 +28,7 @@
* 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_HELP_PROMPT_MANAGER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
index 81754a60b0..3cd22a6afc 100644
--- a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
@@ -28,7 +28,7 @@
* 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_HELP_PROMPT_MANAGER_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
@@ -56,7 +56,7 @@ class HelpPromptManagerImpl : public HelpPromptManager {
public:
/**
* @brief Container for buffering VR help commands
- */
+ */
typedef std::pair<uint32_t, smart_objects::SmartObjectSPtr> VRCommandPair;
typedef std::vector<VRCommandPair> VRCommandPairs;
@@ -94,12 +94,12 @@ class HelpPromptManagerImpl : public HelpPromptManager {
const bool is_resumption) OVERRIDE;
/**
- * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
- * message
- * @param msg containing GlobalProperties
- * @param is_response determines is the request or response for the for
- * the SetGlobalPropertiesRequest
- */
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg,
const bool is_response) OVERRIDE;
diff --git a/src/components/application_manager/include/application_manager/helpers/application_helper.h b/src/components/application_manager/include/application_manager/helpers/application_helper.h
index 145bef659e..18267c9e7f 100644
--- a/src/components/application_manager/include/application_manager/helpers/application_helper.h
+++ b/src/components/application_manager/include/application_manager/helpers/application_helper.h
@@ -57,6 +57,18 @@ ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor,
return app;
}
+template <class UnaryPredicate>
+ApplicationSharedPtr FindPendingApp(
+ DataAccessor<AppsWaitRegistrationSet> accessor, UnaryPredicate finder) {
+ AppsWaitRegistrationSet::iterator it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ if (accessor.GetData().end() == it) {
+ return ApplicationSharedPtr();
+ }
+ ApplicationSharedPtr app = *it;
+ return app;
+}
+
/**
* Helper function for lookup through applications list and returning all
* applications satisfying predicate logic
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 9380fb41ac..94fc293c3e 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
@@ -28,18 +28,18 @@
* 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_HMI_CAPABILITIES_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_
#include "application_manager/hmi_capabilities.h"
+#include "application_manager/hmi_language_handler.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "json/json.h"
-#include "utils/macro.h"
-#include "application_manager/hmi_language_handler.h"
#include "smart_objects/smart_object.h"
+#include "utils/macro.h"
namespace resumption {
class LastState;
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h
index 59ec32694a..5f172b415d 100644
--- a/src/components/application_manager/include/application_manager/hmi_interfaces.h
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -60,7 +60,8 @@ class HmiInterfaces {
HMI_INTERFACE_Navigation,
HMI_INTERFACE_VehicleInfo,
HMI_INTERFACE_SDL,
- HMI_INTERFACE_RC
+ HMI_INTERFACE_RC,
+ HMI_INTERFACE_AppService
};
/**
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
index 2b2d1e1361..3202d44e1e 100644
--- a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_
#include <map>
#include "application_manager/hmi_interfaces.h"
-#include "utils/macro.h"
#include "utils/lock.h"
+#include "utils/macro.h"
/**
* @brief The HmiInterfacesImpl class handles
* hmi interfaces states
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 6158cb4585..edf0759114 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
@@ -28,15 +28,15 @@
* 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_HMI_LANGUAGE_HANDLER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_LANGUAGE_HANDLER_H_
#include "application_manager/event_engine/event_observer.h"
-#include "utils/lock.h"
#include "interfaces/HMI_API.h"
#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
namespace resumption {
class LastState;
@@ -56,8 +56,8 @@ class HMILanguageHandler : public event_engine::EventObserver {
typedef std::map<uint32_t, bool> Apps;
/**
- * @brief System interfaces
- */
+ * @brief System interfaces
+ */
enum Interface { INTERFACE_UI, INTERFACE_VR, INTERFACE_TTS };
/**
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 07d9c8dc23..b6a4c180e6 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -48,11 +48,11 @@ class Application;
typedef std::shared_ptr<HmiState> HmiStatePtr;
/**
-* @brief The HmiState class
-* Handle Hmi state of application (hmi level,
-* audio streaming state, system context)
-*
-*/
+ * @brief The HmiState class
+ * Handle Hmi state of application (hmi level,
+ * audio streaming state, system context)
+ *
+ */
class HmiState {
friend std::ostream& operator<<(std::ostream& os, const HmiState& src);
@@ -207,7 +207,7 @@ class HmiState {
}
protected:
- std::shared_ptr<Application> app_;
+ uint32_t hmi_app_id_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index 1c319cf204..7525ff1aa3 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -36,9 +36,9 @@
#include <string>
#include <vector>
+#include "protocol/common.h"
#include "protocol/message_priority.h"
#include "protocol/rpc_type.h"
-#include "protocol/common.h"
#include "smart_objects/smart_object.h"
namespace application_manager {
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 609b240301..2671278442 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -37,20 +37,20 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
#include <map>
-#include <vector>
#include <string>
+#include <vector>
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/macro.h"
-#include "connection_handler/device.h"
+#include <application_manager/smart_object_keys.h>
#include "application_manager/application.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "connection_handler/device.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "policy/policy_types.h"
#include "protocol_handler/session_observer.h"
-#include "application_manager/policies/policy_handler_interface.h"
#include "smart_objects/smart_object.h"
#include "transport_manager/common.h"
-#include <application_manager/smart_object_keys.h>
+#include "utils/macro.h"
namespace policy {
class PolicyHandlerInterface;
@@ -73,18 +73,18 @@ typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
class MessageHelper {
public:
/**
- * @brief CreateNotification creates basic mobile notification smart object
- * @param function_id Notification function ID
- * @param app_id application to send notification
- * @return basic mobile notification smart object
- */
+ * @brief CreateNotification creates basic mobile notification smart object
+ * @param function_id Notification function ID
+ * @param app_id application to send notification
+ * @return basic mobile notification smart object
+ */
static smart_objects::SmartObjectSPtr CreateNotification(
mobile_apis::FunctionID::eType function_id, uint32_t app_id);
/**
- * @brief CreateHMINotification creates basic hmi notification smart object
- * @param function_id Notification function ID
- * @return basic hmi notification smart object
- */
+ * @brief CreateHMINotification creates basic hmi notification smart object
+ * @param function_id Notification function ID
+ * @return basic hmi notification smart object
+ */
static smart_objects::SmartObjectSPtr CreateHMINotification(
hmi_apis::FunctionID::eType function_id);
@@ -118,18 +118,18 @@ class MessageHelper {
static void SendOnLanguageChangeToMobile(uint32_t connection_key);
/**
- * @brief Sends DecryptCertificate request to HMI
- * @param file_name path to file containing encrypted certificate
- */
+ * @brief Sends DecryptCertificate request to HMI
+ * @param file_name path to file containing encrypted certificate
+ */
static void SendDecryptCertificateToHMI(const std::string& file_name,
ApplicationManager& app_mngr);
/**
- * @brief SendGetSystemTimeRequest sends mentioned request to HMI.
- * @param correlation_id the message correlation id, required for proper
- * response processing.
- * @param app_mngr
- */
+ * @brief SendGetSystemTimeRequest sends mentioned request to HMI.
+ * @param correlation_id the message correlation id, required for proper
+ * response processing.
+ * @param app_mngr
+ */
static void SendGetSystemTimeRequest(const uint32_t correlation_id,
ApplicationManager& app_mngr);
@@ -205,17 +205,17 @@ class MessageHelper {
const std::string& hmi_level);
/*
- * @brief Used to obtain string representation of app's
- * HMI Level.
- * @param hmi_level Desired HMI Level
- */
+ * @brief Used to obtain string representation of app's
+ * HMI Level.
+ * @param hmi_level Desired HMI Level
+ */
static std::string StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level);
/*
- * @brief Used to obtain function name by its id
- * @param function_id Function ID
- */
+ * @brief Used to obtain function name by its id
+ * @param function_id Function ID
+ */
static std::string StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id);
@@ -348,40 +348,41 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
- GetBCActivateAppRequestToHMI(
+ static smart_objects::SmartObjectSPtr GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr);
+ static smart_objects::SmartObjectSPtr GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr);
+
static void SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr);
/**
- * @brief Send SDL_ActivateApp response to HMI
- * @param permissions response parameters
- */
+ * @brief Send SDL_ActivateApp response to HMI
+ * @param permissions response parameters
+ */
static void SendSDLActivateAppResponse(policy::AppPermissions& permissions,
uint32_t correlation_id,
ApplicationManager& app_mngr);
/**
- * @brief Send OnSDLConsentNeeded to HMI for device data consent by user
- * @param device_info Device info, e.g. mac, handle, name
- */
+ * @brief Send OnSDLConsentNeeded to HMI for device data consent by user
+ * @param device_info Device info, e.g. mac, handle, name
+ */
static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info,
ApplicationManager& app_man);
/**
- * @brief Send request to SyncP process to read file and send
- * Policy Table Snapshot using Retry Strategy
- * @param file_path Path to file with PTS
- * @param timeout Timeout to wait for PTU in seconds
- * @param retries Seconds between retries
- */
+ * @brief Send request to SyncP process to read file and send
+ * Policy Table Snapshot using Retry Strategy
+ * @param file_path Path to file with PTS
+ * @param timeout Timeout to wait for PTU in seconds
+ * @param retries Seconds between retries
+ */
static void SendPolicyUpdate(const std::string& file_path,
const uint32_t timeout,
const std::vector<int>& retries,
@@ -445,13 +446,13 @@ class MessageHelper {
static void SendNaviStopStream(int32_t app_id, ApplicationManager& app_mngr);
/*
- * @brief Send notification for Update of Policy Table
- * with PT Snapshot.
- * @param connection_key Id of application to send message to
- * @param policy_data PT Snapshot
- * @param url If empty string, no URL is provided
- * @param timeout If -1 no timeout is provdied
- */
+ * @brief Send notification for Update of Policy Table
+ * with PT Snapshot.
+ * @param connection_key Id of application to send message to
+ * @param policy_data PT Snapshot
+ * @param url If empty string, no URL is provided
+ * @param timeout If -1 no timeout is provdied
+ */
static void SendPolicySnapshotNotification(
uint32_t connection_key,
const std::vector<uint8_t>& policy_data,
@@ -485,20 +486,20 @@ class MessageHelper {
ApplicationManager& app_man);
/*
- * @brief Send notification to mobile on application permissions update
- * @param connection_key Id of application to send message to
- * @param permissions updated permissions for application
- */
+ * @brief Send notification to mobile on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
static void SendOnPermissionsChangeNotification(
uint32_t connection_key,
const policy::Permissions& permissions,
ApplicationManager& app_mngr);
/*
- * @brief Send notification to HMI on application permissions update
- * @param connection_key Id of application to send message to
- * @param permissions updated permissions for application
- */
+ * @brief Send notification to HMI on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
static void SendOnAppPermissionsChangedNotification(
uint32_t connection_key,
const policy::AppPermissions& permissions,
@@ -610,12 +611,12 @@ class MessageHelper {
ApplicationManager& app_mngr);
/**
- * @brief Verify image and add image file full path
- * and add path, although the image doesn't exist
- * @param SmartObject with image
- * @param app current application
- * @return verification result
- */
+ * @brief Verify image and add image file full path
+ * and add path, although the image doesn't exist
+ * @param SmartObject with image
+ * @param app current application
+ * @return verification result
+ */
static void ApplyImagePath(smart_objects::SmartObject& image,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr);
@@ -636,10 +637,10 @@ class MessageHelper {
ApplicationManager& app_mngr);
/**
- * @brief Stores whether each choice in a set has the vrCommands parameter
- * MIXED means some choices have vrCommands and others don't
- * ALL means all do, NONE means none do
- */
+ * @brief Stores whether each choice in a set has the vrCommands parameter
+ * MIXED means some choices have vrCommands and others don't
+ * ALL means all do, NONE means none do
+ */
enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE };
/**
@@ -786,6 +787,14 @@ class MessageHelper {
static hmi_apis::Common_Language::eType CommonLanguageFromString(
const std::string& language);
+ /**
+ * @brief CommonLightNameFromString convert string to LightName enum value
+ * @param lightName string to convert
+ * @return value LightName enum value
+ */
+ static hmi_apis::Common_LightName::eType CommonLightNameFromString(
+ const std::string& lightName);
+
static smart_objects::SmartObjectSPtr
GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
@@ -878,6 +887,12 @@ class MessageHelper {
static smart_objects::SmartObjectSPtr CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id);
+ static smart_objects::SmartObject CreateAppServiceCapabilities(
+ std::vector<smart_objects::SmartObject>& all_services);
+
+ static void BroadcastCapabilityUpdate(smart_objects::SmartObject& msg_params,
+ ApplicationManager& app_mngr);
+
private:
/**
* @brief Allows to fill SO according to the current permissions.
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
index b2ad963f46..3b02424e1f 100644
--- a/src/components/application_manager/include/application_manager/mobile_message_handler.h
+++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_
-#include "utils/macro.h"
-#include "protocol/common.h"
#include "application_manager/message.h"
+#include "protocol/common.h"
+#include "utils/macro.h"
namespace application_manager {
typedef std::shared_ptr<application_manager::Message> MobileMessage;
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h b/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h
new file mode 100644
index 0000000000..96a7f27064
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H
+
+namespace application_manager {
+namespace plugin_manager {
+
+namespace plugin_names {
+extern const char* vehicle_info_rpc_plugin;
+extern const char* app_service_rpc_plugin;
+extern const char* rc_rpc_plugin;
+extern const char* sdl_rpc_plugin;
+} // namespace plugin_names
+
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H
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 09a412b2ac..aea0361f19 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
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
#include <memory>
-#include "utils/macro.h"
-#include "application_manager/commands/command.h"
#include "application_manager/application.h"
-#include "application_manager/rpc_service.h"
+#include "application_manager/commands/command.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/rpc_service.h"
+#include "utils/macro.h"
namespace application_manager {
class CommandFactory;
@@ -68,13 +68,13 @@ class RPCPlugin {
virtual ~RPCPlugin() {}
/**
- * @brief Command initialization function
- * @param app_manager ApplicationManager
- * @param rpc_service RPCService
- * @param hmi_capabilities HMICapabilities
- * @param policy_handler PolicyHandlerInterface
- * @return true in case initialization was succesful, false otherwise.
- **/
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
virtual bool Init(ApplicationManager& app_manager,
rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
index 692d296607..b658e40b1c 100644
--- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
#include <cstdint>
-#include <string>
+#include <functional>
#include <memory>
+#include <string>
#include <vector>
-#include <functional>
#include "application_manager/plugin_manager/rpc_plugin.h"
#include "utils/optional.h"
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 5f85d45b6e..885181e9c4 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
@@ -32,11 +32,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
-#include "application_manager/plugin_manager/rpc_plugin_manager.h"
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/hmi_capabilities.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/rpc_service.h"
#include "utils/optional.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
index f501598e0f..114b4e2d77 100644
--- a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
@@ -33,19 +33,19 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_
+#include "utils/conditional_variable.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "policy/policy_types.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "policy/policy_types.h"
namespace policy {
class PolicyHandler;
/**
-*@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
-*in async way.
-*/
+ *@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
+ *in async way.
+ */
class AppPermissionDelegate : public threads::ThreadDelegate {
public:
/**
diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h
index 2fe4265f54..38a60b29c4 100644
--- a/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h
@@ -35,10 +35,10 @@
#include <string>
+#include "application_manager/usage_statistics.h"
+#include "utils/conditional_variable.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "application_manager/usage_statistics.h"
namespace policy {
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 8c904bf513..7d71611a3c 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
-#include "smart_objects/smart_object.h"
#include "application_manager/event_engine/event_observer.h"
+#include "smart_objects/smart_object.h"
#include "utils/lock.h"
namespace policy {
@@ -48,6 +48,7 @@ class PolicyEventObserver
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 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 c8f3bcf888..abffd3eebb 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
@@ -33,28 +33,28 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_
-#include <string>
+#include <stdint.h>
+#include <list>
#include <map>
#include <set>
+#include <string>
#include <vector>
-#include <list>
-#include <stdint.h>
-#include "policy/policy_manager.h"
#include "application_manager/application.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/policies/policy_event_observer.h"
#include "application_manager/policies/delegates/statistics_delegate.h"
+#include "application_manager/policies/policy_event_observer.h"
+#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_handler_observer.h"
-#include "utils/logger.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
+#include "policy/policy_manager.h"
+#include "policy/policy_settings.h"
+#include "policy/usage_statistics/statistics_manager.h"
#include "utils/conditional_variable.h"
-#include "utils/rwlock.h"
#include "utils/custom_string.h"
-#include "policy/usage_statistics/statistics_manager.h"
+#include "utils/logger.h"
+#include "utils/rwlock.h"
#include "utils/threads/async_runner.h"
-#include "policy/policy_settings.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace Json {
class Value;
@@ -187,6 +187,8 @@ class PolicyHandler : public PolicyHandlerInterface,
void GetUpdateUrls(const uint32_t service_type,
EndpointUrls& out_end_points) OVERRIDE;
virtual std::string GetLockScreenIconUrl() const OVERRIDE;
+ virtual std::string GetIconUrl(
+ const std::string& policy_app_id) const OVERRIDE;
uint32_t NextRetryTimeout() OVERRIDE;
/**
@@ -398,6 +400,88 @@ class PolicyHandler : public PolicyHandlerInterface,
custom_str::CustomString GetAppName(
const std::string& policy_app_id) OVERRIDE;
+ /**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const OVERRIDE;
+
+ /**
+ * @brief Checks if a given application is an enabled cloud application
+ * @param policy_app_id Unique application id
+ * @return true, if the application is an enabled cloud application,
+ * otherwise - false
+ */
+ const bool CheckCloudAppEnabled(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ bool GetCloudAppParameters(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const OVERRIDE;
+
+ /**
+ * @brief Callback for when a SetCloudAppProperties message is received from a
+ * mobile app
+ * @param message The SetCloudAppProperties message
+ */
+ void OnSetCloudAppProperties(
+ const smart_objects::SmartObject& message) OVERRIDE;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ void GetAppServiceParameters(const std::string& policy_app_id,
+ policy_table::AppServiceParameters*
+ app_service_parameters) const OVERRIDE;
+ /**
+ * @brief Check app service parameters from an app against policies
+ * @param policy_app_id Unique application id
+ * @param requested_service_name Service name published by app service
+ * provider
+ * @param requested_service_type Service type published by app service
+ * provider
+ * @param requested_handled_rpcs Vector of requested function ids an app
+ * service wants to handle from consumers
+ */
+ bool CheckAppServiceParameters(
+ const std::string& policy_app_id,
+ const std::string& requested_service_name,
+ const std::string& requested_service_type,
+ smart_objects::SmartArray* requested_handled_rpcs) const OVERRIDE;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const OVERRIDE;
+
virtual void OnUpdateHMIAppType(
std::map<std::string, StringArray> app_hmi_types) OVERRIDE;
@@ -406,6 +490,9 @@ class PolicyHandler : public PolicyHandlerInterface,
#ifdef EXTERNAL_PROPRIETARY_MODE
void OnCertificateDecrypted(bool is_succeeded) OVERRIDE;
#endif // EXTERNAL_PROPRIETARY_MODE
+ void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token);
+
virtual bool CanUpdate() OVERRIDE;
virtual void OnDeviceConsentChanged(const std::string& device_id,
@@ -724,10 +811,10 @@ class PolicyHandler : public PolicyHandlerInterface,
static const std::string kLibrary;
/**
- * @brief Collects currently registered applications ids linked to their
- * device id
- * @param out_links Collection of device_id-to-app_id links
- */
+ * @brief Collects currently registered applications ids linked to their
+ * device id
+ * @param out_links Collection of device_id-to-app_id links
+ */
void GetRegisteredLinks(std::map<std::string, std::string>& out_links) const;
private:
diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h
index 6913f5038e..7e83aefe81 100644
--- a/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h
@@ -33,18 +33,18 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
+#include "utils/conditional_variable.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "policy/policy_types.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "policy/policy_types.h"
namespace policy {
/**
-*@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
-*in async way.
-*/
+ *@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
+ *in async way.
+ */
class AppPermissionDelegate : public threads::ThreadDelegate {
public:
/**
diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h
index 3dc9ad925c..74d88fac69 100644
--- a/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h
@@ -35,10 +35,10 @@
#include <string>
+#include "application_manager/usage_statistics.h"
+#include "utils/conditional_variable.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "application_manager/usage_statistics.h"
namespace policy {
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 f4924111b3..4a104812a4 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
@@ -48,6 +48,7 @@ class PolicyEventObserver
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 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_handler_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h
index 07d234f036..3c4dce2fbc 100644
--- a/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
-#include <vector>
-#include <string>
#include <map>
+#include <string>
+#include <vector>
namespace policy {
@@ -48,6 +48,9 @@ class PolicyHandlerObserver {
return false;
}
+ virtual void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) {}
+
virtual void OnPTUFinished(const bool ptu_result) {}
virtual ~PolicyHandlerObserver() {}
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
index ea8d95a92a..8a3c90061e 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -34,21 +34,21 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
#include <climits>
-#include <vector>
#include <list>
+#include <vector>
#include "utils/lock.h"
-#include "utils/threads/thread.h"
#include "utils/conditional_variable.h"
+#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
#include "utils/timer.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
-#include "application_manager/request_info.h"
#include "application_manager/request_controller_settings.h"
+#include "application_manager/request_info.h"
#include "application_manager/request_tracker.h"
namespace application_manager {
@@ -56,14 +56,14 @@ namespace application_manager {
namespace request_controller {
/**
-* @brief RequestController class is used to control currently active mobile
-* requests.
-*/
+ * @brief RequestController class is used to control currently active mobile
+ * requests.
+ */
class RequestController {
public:
/**
- * @brief Result code for addRequest
- */
+ * @brief Result code for addRequest
+ */
enum TResult {
SUCCESS = 0,
TOO_MANY_REQUESTS,
@@ -73,8 +73,8 @@ class RequestController {
};
/**
- * @brief Thread pool state
- */
+ * @brief Thread pool state
+ */
enum TPoolState {
UNDEFINED = 0,
STARTED,
@@ -84,121 +84,121 @@ class RequestController {
// Methods
/**
- * @brief Class constructor
- *
- */
+ * @brief Class constructor
+ *
+ */
RequestController(const RequestControlerSettings& settings);
/**
- * @brief Class destructor
- *
- */
+ * @brief Class destructor
+ *
+ */
virtual ~RequestController();
/**
- * @brief Initialize thread pool
- *
- */
+ * @brief Initialize thread pool
+ *
+ */
void InitializeThreadpool();
/**
- * @brief Destroy thread pool
- *
- */
+ * @brief Destroy thread pool
+ *
+ */
void DestroyThreadpool();
/**
- * @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
- *
- */
+ * @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);
/**
- * @brief Store HMI request until response or timeout won't remove it
- *
- * @param request Active hmi request
- * @return Result code
- *
- */
+ * @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);
/**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
void addNotification(const RequestPtr ptr);
/**
- * @brief Removes request from queue
- *
- * @param correlation_id Active request correlation ID,
- * @param connection_key Active request connection key (0 for HMI requersts)
- * @param function_id Active request function id
- * @param force_terminate if true, request controller will terminate
- * even if not allowed by request
- */
+ * @brief Removes request from queue
+ *
+ * @param correlation_id Active request correlation ID,
+ * @param connection_key Active request connection key (0 for HMI requersts)
+ * @param function_id Active request function id
+ * @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);
/**
- * @brief Removes request from queue
- *
- * @param mobile_correlation_id Active mobile request correlation ID
- *
- */
+ * @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);
/**
- * @brief Removes request from queue
- *
- * @param mobile_correlation_id Active mobile request correlation ID
- *
- */
+ * @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);
/**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
void removeNotification(const commands::Command* notification);
/**
- * @brief Removes all requests from queue for specified application
- *
- * @param app_id Mobile application ID (app_id)
- *
- */
+ * @brief Removes all requests from queue for specified application
+ *
+ * @param app_id Mobile application ID (app_id)
+ *
+ */
void terminateAppRequests(const uint32_t& app_id);
/**
- * @brief Terminates all requests from HMI
- */
+ * @brief Terminates all requests from HMI
+ */
void terminateAllHMIRequests();
/**
- * @brief Terminates all requests from Mobile
- */
+ * @brief Terminates all requests from Mobile
+ */
void terminateAllMobileRequests();
/**
- * @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
- */
+ * @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);
@@ -217,13 +217,13 @@ class RequestController {
protected:
/**
- * @brief Timer callback which handles all request timeouts
- */
+ * @brief Timer callback which handles all request timeouts
+ */
void TimeoutThread();
/**
- * @brief Signal timer condition variable
- */
+ * @brief Signal timer condition variable
+ */
void NotifyTimer();
void terminateWaitingForExecutionAppRequests(const uint32_t& app_id);
@@ -285,8 +285,8 @@ class RequestController {
RequestTracker request_tracker_;
/**
- * @brief Set of HMI notifications with timeout.
- */
+ * @brief Set of HMI notifications with timeout.
+ */
std::list<RequestPtr> notification_list_;
/**
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 be28bad63c..1b140e2108 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -29,9 +29,9 @@
* 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.
-*/
+ * 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_INFO_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
@@ -268,9 +268,9 @@ class RequestInfoSet {
};
/**
-* @brief Structure used in std algorithms to determine amount of request
-* during time scale
-*/
+ * @brief Structure used in std algorithms to determine amount of request
+ * during time scale
+ */
struct TimeScale {
TimeScale(const date_time::TimeDuration& start,
const date_time::TimeDuration& end,
diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h
index b351e716a7..72d04abf4a 100644
--- a/src/components/application_manager/include/application_manager/request_tracker.h
+++ b/src/components/application_manager/include/application_manager/request_tracker.h
@@ -1,39 +1,39 @@
/*
- * Copyright (c) 2017, 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)
+ * Copyright (c) 2017, 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_TRACKER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_
-#include <string>
#include <map>
+#include <string>
#include <vector>
#include "application_manager/request_controller_settings.h"
#include "interfaces/MOBILE_API.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 f9a60c862b..0b744eec7f 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
@@ -42,7 +42,7 @@ class ApplicationManager;
class Application;
typedef std::shared_ptr<Application> ApplicationSharedPtr;
typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
-}
+} // namespace application_manager
namespace app_mngr = application_manager;
namespace resumption {
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 e749118140..a70e2453de 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
@@ -36,18 +36,18 @@
#include "application_manager/resumption/resume_ctrl.h"
#include <stdint.h>
-#include <vector>
+#include <list>
#include <map>
#include <set>
-#include <list>
+#include <vector>
+#include "application_manager/application.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/resumption/resumption_data.h"
#include "interfaces/HMI_API.h"
#include "interfaces/HMI_API_schema.h"
#include "interfaces/MOBILE_API_schema.h"
-#include "application_manager/event_engine/event_observer.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/application.h"
-#include "application_manager/resumption/resumption_data.h"
#include "utils/timer.h"
namespace resumption {
@@ -322,10 +322,10 @@ class ResumeCtrlImpl : public ResumeCtrl,
#endif // BUILD_TESTS
private:
/**
- * @brief Returns Low Voltage signal timestamp
- * @return Low Voltage event timestamp if event LOW VOLTAGE event occures
- * otherwise 0
- */
+ * @brief Returns Low Voltage signal timestamp
+ * @return Low Voltage event timestamp if event LOW VOLTAGE event occures
+ * otherwise 0
+ */
time_t LowVoltageTime() const;
/**
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index c2634173a5..7db7a09cb4 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_DATA_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_DATA_H_
-#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
+#include "smart_objects/smart_object.h"
#include "utils/macro.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
index cc93e4213c..2909a38cf7 100644
--- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h
+++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
@@ -35,18 +35,18 @@
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
-#include "application_manager/rpc_handler.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/mobile_message_handler.h"
#include "application_manager/policies/policy_handler_observer.h"
+#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_service.h"
-#include "protocol_handler/protocol_observer.h"
#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_sender.h"
+#include "protocol_handler/protocol_observer.h"
-#include "formatters/formatter_json_rpc.h"
-#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/formatter_json_rpc.h"
#include "interfaces/HMI_API_schema.h"
#include "interfaces/MOBILE_API_schema.h"
#ifdef TELEMETRY_MONITOR
@@ -56,8 +56,8 @@
#include "interfaces/v4_protocol_v1_2_no_extra.h"
#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
-#include "utils/threads/message_loop_thread.h"
#include "utils/semantic_version.h"
+#include "utils/threads/message_loop_thread.h"
namespace application_manager {
namespace rpc_handler {
@@ -87,7 +87,7 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
FromMobileQueue;
typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
FromHmiQueue;
-}
+} // namespace impl
class RPCHandlerImpl : public RPCHandler,
public impl::FromMobileQueue::Handler,
@@ -154,11 +154,18 @@ class RPCHandlerImpl : public RPCHandler,
ns_smart_device_link::ns_smart_objects::SmartObject& output,
utils::SemanticVersion& message_version);
+ bool ValidateRpcSO(smart_objects::SmartObject& message,
+ utils::SemanticVersion& msg_version,
+ rpc::ValidationReport& report_out,
+ bool allow_unknown_parameters) OVERRIDE;
+
private:
void ProcessMessageFromMobile(const std::shared_ptr<Message> message);
void ProcessMessageFromHMI(const std::shared_ptr<Message> message);
bool ConvertMessageToSO(const Message& message,
- smart_objects::SmartObject& output);
+ smart_objects::SmartObject& output,
+ const bool allow_unknown_parameters = false,
+ const bool validate_params = true);
std::shared_ptr<Message> ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message);
hmi_apis::HMI_API& hmi_so_factory();
diff --git a/src/components/application_manager/include/application_manager/rpc_passing_handler.h b/src/components/application_manager/include/application_manager/rpc_passing_handler.h
new file mode 100644
index 0000000000..45fe4cad2f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_passing_handler.h
@@ -0,0 +1,123 @@
+/*
+ * 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_RPC_PASSING_HANDLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_PASSING_HANDLER_H_
+
+#include <deque>
+#include "application_manager/application.h"
+#include "application_manager/commands/command.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/timer.h"
+
+namespace application_manager {
+
+struct ServiceInfo {
+ std::string service_id;
+ uint32_t connection_key;
+};
+
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
+
+class AppServiceManager;
+
+class RPCPassingHandler {
+ public:
+ RPCPassingHandler(AppServiceManager& asm_ref, ApplicationManager& am_ref);
+
+ /**
+ * @brief Class destructor
+ */
+ ~RPCPassingHandler();
+
+ /**
+ * @brief Check if function id is in the handled_rpcs list of an active app
+ * service
+ * @param function_id RPC function id
+ * @return true if function id exists in handled_rpcs list of an active app
+ * service
+ */
+ bool CanHandleFunctionID(int32_t function_id);
+
+ /**
+ * @brief Check if app services or core is being used to handle the RPC
+ * @param correlation_id correlation id of RPC response
+ * @return true if an app service was used to handle the RPC
+ */
+ bool IsPassThroughMessage(uint32_t correlation_id,
+ commands::Command::CommandSource source,
+ int32_t message_type);
+ /**
+ * @brief Check if passthrough is allowed by policies for a given message
+ * @param rpc_message RPC message SmartObject
+ * @return true if the request is allowed to be passed through, false
+ * otherwise
+ */
+ bool IsPassthroughAllowed(smart_objects::SmartObject rpc_message);
+
+ /**
+ * @brief Function to handle sending and receiving RPC Passing
+ * requests/responses
+ * @param rpc_message RPC message SmartObject
+ * @return true if the request was handled, false otherwise
+ */
+ bool RPCPassThrough(smart_objects::SmartObject rpc_message);
+
+ private:
+ bool PerformNextRequest(uint32_t correlation_id);
+ void OnPassThroughRequestTimeout();
+ void AddRequestTimer(uint32_t correlation_id);
+ void RemoveRequestTimer(uint32_t correlation_id);
+ void ClearCompletedTimers();
+ void ForwardRequestToMobile(uint32_t correlation_id);
+ void ForwardRequestToCore(uint32_t correlation_id);
+ void ForwardResponseToMobile(uint32_t correlation_id,
+ smart_objects::SmartObject response_message);
+ void PopulateRPCRequestQueue(smart_objects::SmartObject request_message);
+ bool ExtractRPCParams(const smart_objects::SmartObject& s_map,
+ const ApplicationSharedPtr app,
+ const std::string& function_id_str);
+
+ AppServiceManager& app_service_manager_;
+ ApplicationManager& app_manager_;
+ sync_primitives::RecursiveLock rpc_request_queue_lock_;
+ std::map<uint32_t,
+ std::pair<smart_objects::SmartObject, std::deque<ServiceInfo> > >
+ rpc_request_queue;
+ sync_primitives::RecursiveLock timeout_queue_lock_;
+ std::vector<std::pair<TimerSPtr, uint32_t> > timeout_queue_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_PASSING_HANDLER_H_
diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h
index 1eaeb46255..ab71729b3f 100644
--- a/src/components/application_manager/include/application_manager/rpc_service_impl.h
+++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h
@@ -34,24 +34,24 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
-#include "application_manager/request_controller.h"
+#include "application_manager/command_holder_impl.h"
#include "application_manager/message_helper.h"
-#include "application_manager/usage_statistics.h"
#include "application_manager/mobile_message_handler.h"
-#include "application_manager/command_holder_impl.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/usage_statistics.h"
-#include "formatters/formatter_json_rpc.h"
-#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/formatter_json_rpc.h"
#include "interfaces/HMI_API_schema.h"
#include "interfaces/MOBILE_API_schema.h"
#include "interfaces/v4_protocol_v1_2_no_extra.h"
#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
-#include "utils/threads/message_loop_thread.h"
#include "utils/logger.h"
+#include "utils/threads/message_loop_thread.h"
namespace application_manager {
namespace rpc_service {
@@ -85,7 +85,7 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> >
ToMobileQueue;
typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
ToHmiQueue;
-}
+} // namespace impl
class RPCServiceImpl : public RPCService,
public impl::ToMobileQueue::Handler,
@@ -108,7 +108,9 @@ class RPCServiceImpl : public RPCService,
bool ManageMobileCommand(const commands::MessageSharedPtr message,
commands::Command::CommandSource source) OVERRIDE;
- bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
+ bool ManageHMICommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source =
+ commands::Command::SOURCE_HMI) OVERRIDE;
// CALLED ON messages_to_hmi_ thread!
void Handle(const impl::MessageToHmi message) OVERRIDE;
@@ -119,6 +121,9 @@ class RPCServiceImpl : public RPCService,
bool final_message = false) OVERRIDE;
void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
+ bool IsAppServiceRPC(int32_t function_id,
+ commands::Command::CommandSource source);
+
void set_protocol_handler(
protocol_handler::ProtocolHandler* handler) OVERRIDE;
void set_hmi_message_handler(
@@ -126,9 +131,13 @@ class RPCServiceImpl : public RPCService,
private:
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
- Message& output);
+ Message& output,
+ const bool allow_unknown_parameters = false);
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
+ void CheckSourceForUnsupportedRequest(
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source);
ApplicationManager& app_manager_;
request_controller::RequestController& request_ctrl_;
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 6e32853a3d..328d7f5e81 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2019, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -60,6 +60,7 @@ extern const char* app_launch_last_session;
extern const char* policy_app_id;
extern const char* hmi_app_id;
extern const char* device_id;
+extern const char* subscribe;
extern const char* subscribed_for_way_points;
extern const char* url;
extern const char* urlScheme;
@@ -76,7 +77,7 @@ extern const char* ngn_media_screen_app_name;
extern const char* vr_synonyms;
extern const char* uses_vehicle_data;
extern const char* is_media_application;
-extern const char* greyOut;
+extern const char* grey_out;
extern const char* language_desired;
extern const char* auto_activated_id;
extern const char* app_type;
@@ -178,6 +179,7 @@ extern const char* navigation_capability;
extern const char* phone_capability;
extern const char* video_streaming_capability;
extern const char* rc_capability;
+extern const char* app_services_capabilities;
extern const char* day_color_scheme;
extern const char* night_color_scheme;
extern const char* primary_color;
@@ -188,10 +190,19 @@ extern const char* green;
extern const char* blue;
extern const char* display_layout;
extern const char* icon_resumed;
+extern const char* nicknames;
+extern const char* enabled;
+extern const char* auth_token;
+extern const char* cloud_transport_type;
+extern const char* hybrid_app_preference;
+extern const char* is_cloud_application;
+extern const char* cloud_connection_status;
+extern const char* endpoint;
// PutFile
extern const char* sync_file_name;
extern const char* file_name;
+extern const char* file_path;
extern const char* file_type;
extern const char* file_size;
extern const char* crc32_check_sum;
@@ -205,6 +216,7 @@ extern const char* is_template;
extern const char* image;
extern const char* type;
extern const char* system_file;
+extern const char* is_system_file;
extern const char* offset;
extern const char* length;
extern const char* secondary_image;
@@ -253,6 +265,7 @@ extern const char* fuel_level;
extern const char* fuel_level_state;
extern const char* instant_fuel_consumption;
extern const char* fuel_range;
+extern const char* cloud_app_vehicle_id;
extern const char* external_temp;
extern const char* turn_signal;
extern const char* vin;
@@ -293,6 +306,49 @@ extern const char* system_software_version;
extern const char* priority;
extern const char* engine_oil_life;
+// app services
+extern const char* app_service_manifest;
+extern const char* service_name;
+extern const char* service_type;
+extern const char* service_icon;
+extern const char* allow_app_consumers;
+extern const char* rpc_spec_version;
+extern const char* handled_rpcs;
+extern const char* media_service_manifest;
+extern const char* app_service_record;
+extern const char* service_id;
+extern const char* service_manifest;
+extern const char* service_published;
+extern const char* service_active;
+extern const char* app_service_id;
+extern const char* service_data;
+extern const char* media_service_data;
+extern const char* media_image;
+extern const char* weather_service_data;
+extern const char* location;
+extern const char* current_forecast;
+extern const char* minute_forecast;
+extern const char* hourly_forecast;
+extern const char* multiday_forecast;
+extern const char* weather_icon;
+extern const char* navigation_service_data;
+extern const char* origin;
+extern const char* destination;
+extern const char* instructions;
+extern const char* location_details;
+extern const char* request_service_active;
+extern const char* app_services;
+extern const char* update_reason;
+extern const char* updated_app_service_record;
+extern const char* service_records;
+extern const char* activate;
+extern const char* set_as_default;
+extern const char* origin_app;
+
+// sis data
+extern const char* station_short_name;
+extern const char* station_location;
+
// resuming
extern const char* application_commands;
extern const char* application_submenus;
@@ -316,8 +372,11 @@ extern const char* global_ign_on_counter;
extern const char* connection_info;
extern const char* is_download_complete;
+extern const char* shifted;
+extern const char* altitude;
extern const char* longitude_degrees;
extern const char* latitude_degrees;
+
extern const char* address;
extern const char* country_name;
extern const char* country_code;
@@ -359,6 +418,8 @@ extern const char* const keyboard_layout_supported;
extern const char* const keypress_mode_supported;
extern const char* const limited_characters_list_supported;
extern const char* const auto_complete_text_supported;
+extern const char* const send_location_enabled;
+extern const char* const get_way_points_enabled;
extern const char* const entity_type;
extern const char* const entity_id;
extern const char* const status;
@@ -413,7 +474,7 @@ extern const char* instance_follow_redirect;
extern const char* charset;
extern const char* content_lenght;
extern const char* GET;
-} // http_request
+} // namespace http_request
namespace mobile_notification {
extern const char* state;
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 99113d6d00..77da28cc91 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
@@ -35,15 +35,15 @@
#include <list>
#include <map>
-#include "application_manager/hmi_state.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
-#include "event_engine/event_observer.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/hmi_state.h"
#include "application_manager/message_helper.h"
+#include "application_manager/state_controller.h"
+#include "event_engine/event_observer.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/lock.h"
#include "utils/helpers.h"
+#include "utils/lock.h"
namespace application_manager {
@@ -144,6 +144,7 @@ class StateControllerImpl : public event_engine::EventObserver,
// EventObserver interface
void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::MobileEvent& event);
/**
* @brief Sets default application state and apply currently active HMI states
@@ -185,9 +186,9 @@ class StateControllerImpl : public event_engine::EventObserver,
virtual bool IsStateActive(HmiState::StateID state_id) const;
private:
- int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority);
+ int64_t RequestHMIStateChange(ApplicationConstSharedPtr app,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority);
/**
* @brief The HmiLevelConflictResolver struct
* Move other application to HmiStates if applied moved to FULL or LIMITED
@@ -377,10 +378,11 @@ class StateControllerImpl : public event_engine::EventObserver,
const mobile_apis::VideoStreamingState::eType video_state);
/**
- * @brief OnActivateAppResponse calback for activate app response
+ * @brief OnHMIResponse callback for activate app or close application
+ * response
* @param message Smart Object
*/
- void OnActivateAppResponse(const smart_objects::SmartObject& message);
+ void OnHMIResponse(const smart_objects::SmartObject& message);
/**
* @brief OnAppDeactivated callback for OnAppDeactivated notification
@@ -448,9 +450,9 @@ class StateControllerImpl : public event_engine::EventObserver,
typedef std::list<HmiState::StateID> StateIDList;
StateIDList active_states_;
mutable sync_primitives::Lock active_states_lock_;
- std::map<uint32_t, HmiStatePtr> waiting_for_activate_;
+ std::map<uint32_t, HmiStatePtr> waiting_for_response_;
ApplicationManager& app_mngr_;
};
-}
+} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_
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 add440ad80..46aa98e6c1 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
@@ -36,11 +36,11 @@
#include <time.h>
#include <vector>
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event_observer.h"
#include "utils/lock.h"
#include "utils/macro.h"
#include "utils/system_time_handler.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/event_engine/event_observer.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h
index 49f15165db..afd5397db9 100644
--- a/src/components/application_manager/include/application_manager/telemetry_observer.h
+++ b/src/components/application_manager/include/application_manager/telemetry_observer.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
-#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "json/json.h"
+#include "smart_objects/smart_object.h"
#include "utils/date_time.h"
@@ -53,5 +53,5 @@ class AMTelemetryObserver {
virtual void OnMessage(MessageMetricSharedPtr) = 0;
virtual ~AMTelemetryObserver() {}
};
-} // application_manager
+} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index 6d0b5cd6bd..ebd8e4729b 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
-#include <string>
#include <memory>
-#include "policy/usage_statistics/counter.h"
+#include <string>
#include "policy/usage_statistics/app_stopwatch.h"
+#include "policy/usage_statistics/counter.h"
#include "utils/macro.h"
#include "interfaces/MOBILE_API.h"
diff --git a/src/components/application_manager/rpc_plugins/CMakeLists.txt b/src/components/application_manager/rpc_plugins/CMakeLists.txt
index c9ef282c12..8884b30532 100644
--- a/src/components/application_manager/rpc_plugins/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/CMakeLists.txt
@@ -32,3 +32,4 @@
add_subdirectory(vehicle_info_plugin)
add_subdirectory(sdl_rpc_plugin)
add_subdirectory(rc_rpc_plugin)
+add_subdirectory(app_service_rpc_plugin)
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
new file mode 100644
index 0000000000..1e23aac8ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
@@ -0,0 +1,84 @@
+# Copyright (c) 2019, Ford Motor Company, Livio
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(
+ include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include
+ )
+
+set (COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/hmi
+)
+
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+ sdl_rpc_plugin
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("app_service_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES})
+target_link_libraries("app_service_rpc_plugin" ${LIBRARIES})
+
+add_library("AppServiceRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
+target_link_libraries("AppServiceRpcPluginStaticLib" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS app_service_rpc_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+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
new file mode 100644
index 0000000000..b04edbe2f4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h
@@ -0,0 +1,131 @@
+/*
+ Copyright (c) 2018, 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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_APP_EXTENSION_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_APP_EXTENSION_H
+
+#include <application_manager/application_manager.h>
+#include "application_manager/app_extension.h"
+
+#include <set>
+#include <string>
+
+namespace app_service_rpc_plugin {
+class AppServiceRpcPlugin;
+
+namespace app_mngr = application_manager;
+
+typedef int AppExtensionUID;
+typedef mobile_apis::VehicleDataType::eType VehicleDataType;
+/**
+ * @brief Defines set of app service types
+ */
+typedef std::set<std::string> AppServiceSubscriptions;
+
+class AppServiceAppExtension : public app_mngr::AppExtension {
+ public:
+ /**
+ * @brief AppServiceAppExtension constructor
+ * @param plugin app service plugin
+ * @param app application that contains this plugin
+ */
+ AppServiceAppExtension(AppServiceRpcPlugin& plugin,
+ app_mngr::Application& app);
+ virtual ~AppServiceAppExtension();
+
+ /**
+ * @brief subscribeToAppService add vehicle_data to list of subscriptions of
+ * application extension
+ * @param vehicle_data data to subscribe
+ * @return true in case if subscription is successful
+ */
+ bool SubscribeToAppService(const std::string app_service_type);
+
+ /**
+ * @brief unsubscribeFromAppService remove vehicle_data from list of
+ * subscriptions of application extension
+ * @param vehicle_data data to unsubscribe
+ * @return true in case if unsubscription is successful
+ */
+ bool UnsubscribeFromAppService(const std::string app_service_type);
+ /**
+ * @brief unsubscribeFromAppService unsubscribe from all app service types
+ */
+ void UnsubscribeFromAppService();
+
+ /**
+ * @brief isSubscribedToAppService checks if extension is subscribed to
+ * app service type
+ * @param app_service_type data type to check subscription
+ * @return true if extension is subscribed this app_service_type, otherwise
+ * return false
+ */
+ bool IsSubscribedToAppService(const std::string app_service_type) const;
+
+ /**
+ * @brief Subscriptions get list of subscriptions for application extension
+ * @return list of subscriptions for application extension
+ */
+ AppServiceSubscriptions Subscriptions();
+
+ /**
+ * @brief SaveResumptionData saves vehicle info data
+ * @param resumption_data plase to store resumption data
+ */
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+
+ /**
+ * @brief ProcessResumption load resumtion data back to plugin during
+ * resumption
+ * @param resumption_data resumption data
+ */
+ void ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) OVERRIDE;
+
+ /**
+ * @brief ExtractVIExtension utility function to extract application extension
+ * from application
+ * @param app : applicaiton that contains vehicle info app_extension
+ * @return application extension extracted from application
+ */
+ static AppServiceAppExtension& ExtractASExtension(
+ application_manager::Application& app);
+
+ private:
+ AppServiceSubscriptions subscribed_data_;
+ AppServiceRpcPlugin& plugin_;
+ app_mngr::Application& app_;
+};
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_APP_EXTENSION_H
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h
new file mode 100644
index 0000000000..193b79e26f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+
+#include "app_service_rpc_plugin/app_service_hmi_command_factory.h"
+#include "app_service_rpc_plugin/app_service_mobile_command_factory.h"
+#include "application_manager/application_manager.h"
+
+namespace app_service_rpc_plugin {
+namespace commands = application_manager::commands;
+namespace app_mngr = application_manager;
+
+class AppServiceCommandFactory : public app_mngr::CommandFactory {
+ public:
+ AppServiceCommandFactory(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~AppServiceCommandFactory();
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ std::unique_ptr<AppServiceHmiCommandFactory> hmi_command_factory_;
+ std::unique_ptr<AppServiceMobileCommandFactory> mobile_command_factory_;
+};
+} // namespace app_service_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h
new file mode 100644
index 0000000000..c42b64f559
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info hmi command factory.
+ */
+class AppServiceHmiCommandFactory : public app_mngr::CommandFactory {
+ public:
+ AppServiceHmiCommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id,
+ const int32_t message_type,
+ const app_mngr::commands::Command::CommandSource source) const;
+
+ DISALLOW_COPY_AND_ASSIGN(AppServiceHmiCommandFactory);
+};
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h
new file mode 100644
index 0000000000..bd1e10f267
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info mobile command factory.
+ */
+class AppServiceMobileCommandFactory : public app_mngr::CommandFactory {
+ public:
+ AppServiceMobileCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id,
+ const int32_t message_type,
+ const app_mngr::commands::Command::CommandSource source) const;
+
+ DISALLOW_COPY_AND_ASSIGN(AppServiceMobileCommandFactory);
+};
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H
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
new file mode 100644
index 0000000000..c9cb98cdfb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_RPC_PLUGIN_H
+
+#include "application_manager/command_factory.h"
+
+namespace app_service_rpc_plugin {
+// class AppServiceAppExtension;
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class AppServiceRpcPlugin : public plugins::RPCPlugin {
+ public:
+ AppServiceRpcPlugin();
+
+ bool Init(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ std::string PluginName() OVERRIDE;
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
+ void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE;
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ private:
+ void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app);
+
+ std::unique_ptr<app_mngr::CommandFactory> command_factory_;
+ app_mngr::ApplicationManager* application_manager_;
+};
+} // namespace app_service_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h
new file mode 100644
index 0000000000..c98979da0f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASAppServiceActivationRequest command class
+ **/
+class ASAppServiceActivationRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASAppServiceActivationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASAppServiceActivationRequest(
+ 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 ASAppServiceActivationRequest class destructor
+ **/
+ virtual ~ASAppServiceActivationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASAppServiceActivationRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h
new file mode 100644
index 0000000000..68b77cb7e3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASAppServiceActivationResponse command class
+ **/
+class ASAppServiceActivationResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASAppServiceActivationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASAppServiceActivationResponse(
+ 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 ASAppServiceActivationResponse class destructor
+ **/
+ virtual ~ASAppServiceActivationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASAppServiceActivationResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h
new file mode 100644
index 0000000000..2286d4c67c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetActiveServiceConsentRequest command class
+ **/
+class ASGetActiveServiceConsentRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ASGetActiveServiceConsentRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetActiveServiceConsentRequest(
+ 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 ASGetActiveServiceConsentRequest class destructor
+ **/
+ virtual ~ASGetActiveServiceConsentRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetActiveServiceConsentRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h
new file mode 100644
index 0000000000..f69152208c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetActiveServiceConsentResponse command class
+ **/
+class ASGetActiveServiceConsentResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ASGetActiveServiceConsentResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetActiveServiceConsentResponse(
+ 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 ASGetActiveServiceConsentResponse class destructor
+ **/
+ virtual ~ASGetActiveServiceConsentResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetActiveServiceConsentResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_
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
new file mode 100644
index 0000000000..d9eb7528e4
--- /dev/null
+++ 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
@@ -0,0 +1,106 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_FROM_HMI_H_
+#define 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_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceDataRequestFromHMI command class
+ **/
+class ASGetAppServiceDataRequestFromHMI
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceDataRequestFromHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceDataRequestFromHMI(
+ 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 ASGetAppServiceDataRequestFromHMI class destructor
+ **/
+ virtual ~ASGetAppServiceDataRequestFromHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief onTimeOut from request controller
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ void on_event(const app_mngr::event_engine::MobileEvent& event) OVERRIDE;
+
+ private:
+ void GetWeatherImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ void GetNavigationImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ void GetMediaImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ bool ValidateResponse(smart_objects::SmartObject& message_params);
+
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataRequestFromHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_FROM_HMI_H_
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_to_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_to_hmi.h
new file mode 100644
index 0000000000..c4b3026176
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_TO_HMI_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceDataRequestToHMI command class
+ **/
+class ASGetAppServiceDataRequestToHMI
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceDataRequestToHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceDataRequestToHMI(
+ 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 ASGetAppServiceDataRequestToHMI class destructor
+ **/
+ virtual ~ASGetAppServiceDataRequestToHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataRequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_TO_HMI_REQUEST_H_
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_response_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_response_from_hmi.h
new file mode 100644
index 0000000000..b46626a56b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceDataResponseFromHMI command class
+ **/
+class ASGetAppServiceDataResponseFromHMI
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceDataResponseFromHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceDataResponseFromHMI(
+ 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 ASGetAppServiceDataResponseFromHMI class destructor
+ **/
+ virtual ~ASGetAppServiceDataResponseFromHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataResponseFromHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_
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_response_to_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_response_to_hmi.h
new file mode 100644
index 0000000000..e48a9d1429
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceDataResponseToHMI command class
+ **/
+class ASGetAppServiceDataResponseToHMI
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceDataResponseToHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceDataResponseToHMI(
+ 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 ASGetAppServiceDataResponseToHMI class destructor
+ **/
+ virtual ~ASGetAppServiceDataResponseToHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataResponseToHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h
new file mode 100644
index 0000000000..79ea0922a8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceRecordsRequest command class
+ **/
+class ASGetAppServiceRecordsRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceRecordsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceRecordsRequest(
+ 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 ASGetAppServiceRecordsRequest class destructor
+ **/
+ virtual ~ASGetAppServiceRecordsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceRecordsRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h
new file mode 100644
index 0000000000..6db24132af
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASGetAppServiceRecordsResponse command class
+ **/
+class ASGetAppServiceRecordsResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASGetAppServiceRecordsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASGetAppServiceRecordsResponse(
+ 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 ASGetAppServiceRecordsResponse class destructor
+ **/
+ virtual ~ASGetAppServiceRecordsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceRecordsResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_
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
new file mode 100644
index 0000000000..36acf116f4
--- /dev/null
+++ 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
@@ -0,0 +1,99 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_FROM_HMI_H_
+#define 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_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPerformAppServiceInteractionRequestFromHMI command class
+ **/
+class ASPerformAppServiceInteractionRequestFromHMI
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASPerformAppServiceInteractionRequestFromHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPerformAppServiceInteractionRequestFromHMI(
+ 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 ASPerformAppServiceInteractionRequestFromHMI class destructor
+ **/
+ virtual ~ASPerformAppServiceInteractionRequestFromHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ void on_event(const app_mngr::event_engine::MobileEvent& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from request controller
+ */
+ virtual void onTimeOut();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionRequestFromHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_FROM_HMI_H_
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_to_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_to_hmi.h
new file mode 100644
index 0000000000..0b67dd5624
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPerformAppServiceInteractionRequestToHMI command class
+ **/
+class ASPerformAppServiceInteractionRequestToHMI
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ASPerformAppServiceInteractionRequestToHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPerformAppServiceInteractionRequestToHMI(
+ 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 ASPerformAppServiceInteractionRequestToHMI class destructor
+ **/
+ virtual ~ASPerformAppServiceInteractionRequestToHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionRequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_
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_response_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_response_from_hmi.h
new file mode 100644
index 0000000000..f807348833
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPerformAppServiceInteractionResponseFromHMI command class
+ **/
+class ASPerformAppServiceInteractionResponseFromHMI
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ASPerformAppServiceInteractionResponseFromHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPerformAppServiceInteractionResponseFromHMI(
+ 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 ASPerformAppServiceInteractionResponseFromHMI class destructor
+ **/
+ virtual ~ASPerformAppServiceInteractionResponseFromHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionResponseFromHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_
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_response_to_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_response_to_hmi.h
new file mode 100644
index 0000000000..7ce05bdba1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPerformAppServiceInteractionResponseToHMI command class
+ **/
+class ASPerformAppServiceInteractionResponseToHMI
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASPerformAppServiceInteractionResponseToHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPerformAppServiceInteractionResponseToHMI(
+ 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 ASPerformAppServiceInteractionResponseToHMI class destructor
+ **/
+ virtual ~ASPerformAppServiceInteractionResponseToHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionResponseToHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h
new file mode 100644
index 0000000000..4433444602
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPublishAppServiceRequest command class
+ **/
+class ASPublishAppServiceRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief ASPublishAppServiceRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPublishAppServiceRequest(
+ 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 ASPublishAppServiceRequest class destructor
+ **/
+ virtual ~ASPublishAppServiceRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h
new file mode 100644
index 0000000000..519d57c609
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ASPublishAppServiceResponse command class
+ **/
+class ASPublishAppServiceResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief ASPublishAppServiceResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ASPublishAppServiceResponse(
+ 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 ASPublishAppServiceResponse class destructor
+ **/
+ virtual ~ASPublishAppServiceResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h
new file mode 100644
index 0000000000..2dcd5ec251
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h
@@ -0,0 +1,88 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnASAppServiceDataNotification command class
+ **/
+class OnASAppServiceDataNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnASAppServiceDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnASAppServiceDataNotification(
+ 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 OnASAppServiceDataNotification class destructor
+ **/
+ virtual ~OnASAppServiceDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void GetMediaImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ void GetWeatherImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ void GetNavigationImagePaths(smart_objects::SmartObject& data,
+ application_manager::ApplicationSharedPtr app);
+ bool ValidateParams(smart_objects::SmartObject& message_params);
+
+ DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotification);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h
new file mode 100644
index 0000000000..5a23e35df0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnASAppServiceDataNotificationFromHMI command class
+ **/
+class OnASAppServiceDataNotificationFromHMI
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnASAppServiceDataNotificationFromHMI class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnASAppServiceDataNotificationFromHMI(
+ 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 OnASAppServiceDataNotificationFromHMI class destructor
+ **/
+ virtual ~OnASAppServiceDataNotificationFromHMI();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_
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
new file mode 100644
index 0000000000..7c80ec5e03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h
@@ -0,0 +1,89 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_
+#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"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetAppServiceDataRequest command class
+ **/
+class GetAppServiceDataRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetAppServiceDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetAppServiceDataRequest(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 GetAppServiceDataRequest class destructor
+ **/
+ virtual ~GetAppServiceDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ 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);
+
+ virtual void on_event(const app_mngr::event_engine::MobileEvent& event);
+
+ private:
+ void HandleSubscribe();
+
+ DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_
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_to_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h
new file mode 100644
index 0000000000..279cf15055
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_
+
+#include "application_manager/commands/command_request_to_mobile.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetAppServiceDataRequestToMobile command class
+ **/
+class GetAppServiceDataRequestToMobile
+ : public app_mngr::commands::CommandRequestToMobile {
+ public:
+ /**
+ * @brief GetAppServiceDataRequestToMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetAppServiceDataRequestToMobile(
+ 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 GetAppServiceDataRequestToMobile class destructor
+ **/
+ virtual ~GetAppServiceDataRequestToMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataRequestToMobile);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h
new file mode 100644
index 0000000000..f5758e1c39
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetAppServiceDataResponse command class
+ **/
+class GetAppServiceDataResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetAppServiceDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetAppServiceDataResponse(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 GetAppServiceDataResponse class destructor
+ **/
+ virtual ~GetAppServiceDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h
new file mode 100644
index 0000000000..7e2b26d8fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_response_from_mobile.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetAppServiceDataResponseFromMobile command class
+ **/
+class GetAppServiceDataResponseFromMobile
+ : public app_mngr::commands::CommandResponseFromMobile {
+ public:
+ /**
+ * @brief GetAppServiceDataResponseFromMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetAppServiceDataResponseFromMobile(
+ 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 GetAppServiceDataResponseFromMobile class destructor
+ **/
+ virtual ~GetAppServiceDataResponseFromMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataResponseFromMobile);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h
new file mode 100644
index 0000000000..719f5ebf5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppServiceDataNotification command class
+ **/
+class OnAppServiceDataNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAppServiceDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppServiceDataNotification(
+ 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 OnAppServiceDataNotification class destructor
+ **/
+ virtual ~OnAppServiceDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotification);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h
new file mode 100644
index 0000000000..c41fabf7b1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_notification_from_mobile_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppServiceDataNotificationFromMobile command class
+ **/
+class OnAppServiceDataNotificationFromMobile
+ : public app_mngr::commands::CommandNotificationFromMobileImpl {
+ public:
+ /**
+ * @brief OnAppServiceDataNotificationFromMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppServiceDataNotificationFromMobile(
+ 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 OnAppServiceDataNotificationFromMobile class destructor
+ **/
+ virtual ~OnAppServiceDataNotificationFromMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotificationFromMobile);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_
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
new file mode 100644
index 0000000000..854ed3c6aa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h
@@ -0,0 +1,89 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_
+#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"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAppServiceInteractionRequest command class
+ **/
+class PerformAppServiceInteractionRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformAppServiceInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAppServiceInteractionRequest(
+ 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 PerformAppServiceInteractionRequest class destructor
+ **/
+ virtual ~PerformAppServiceInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ 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);
+
+ virtual void on_event(const app_mngr::event_engine::MobileEvent& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_
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_to_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h
new file mode 100644
index 0000000000..5c38e6a71e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_request_to_mobile.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAppServiceInteractionRequestToMobile command class
+ **/
+class PerformAppServiceInteractionRequestToMobile
+ : public app_mngr::commands::CommandRequestToMobile {
+ public:
+ /**
+ * @brief PerformAppServiceInteractionRequestToMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAppServiceInteractionRequestToMobile(
+ 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 PerformAppServiceInteractionRequestToMobile class destructor
+ **/
+ virtual ~PerformAppServiceInteractionRequestToMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionRequestToMobile);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h
new file mode 100644
index 0000000000..b4c422fac6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_response_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAppServiceInteractionResponse command class
+ **/
+class PerformAppServiceInteractionResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformAppServiceInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAppServiceInteractionResponse(
+ 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 PerformAppServiceInteractionResponse class destructor
+ **/
+ virtual ~PerformAppServiceInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h
new file mode 100644
index 0000000000..4530cb2dfd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_response_from_mobile.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAppServiceInteractionResponseFromMobile command class
+ **/
+class PerformAppServiceInteractionResponseFromMobile
+ : public app_mngr::commands::CommandResponseFromMobile {
+ public:
+ /**
+ * @brief PerformAppServiceInteractionResponseFromMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAppServiceInteractionResponseFromMobile(
+ 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 PerformAppServiceInteractionResponseFromMobile class destructor
+ **/
+ virtual ~PerformAppServiceInteractionResponseFromMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionResponseFromMobile);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_
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
new file mode 100644
index 0000000000..d70f279658
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_
+#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"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PublishAppServiceRequest command class
+ **/
+class PublishAppServiceRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PublishAppServiceRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PublishAppServiceRequest(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 PublishAppServiceRequest class destructor
+ **/
+ virtual ~PublishAppServiceRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PublishAppServiceRequest);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h
new file mode 100644
index 0000000000..9275f9e468
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/commands/command_response_impl.h"
+
+namespace app_service_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PublishAppServiceResponse command class
+ **/
+class PublishAppServiceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PublishAppServiceResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PublishAppServiceResponse(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 PublishAppServiceResponse class destructor
+ **/
+ virtual ~PublishAppServiceResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PublishAppServiceResponse);
+};
+
+} // namespace commands
+
+} // namespace app_service_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_
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
new file mode 100644
index 0000000000..91d57cb952
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
+
+namespace app_service_rpc_plugin {
+
+const AppExtensionUID AppServiceAppExtensionUID = 455;
+
+AppServiceAppExtension::AppServiceAppExtension(
+ AppServiceRpcPlugin& plugin, application_manager::Application& app)
+ : app_mngr::AppExtension(AppServiceAppExtensionUID)
+ , plugin_(plugin)
+ , app_(app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+AppServiceAppExtension::~AppServiceAppExtension() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool AppServiceAppExtension::SubscribeToAppService(
+ const std::string app_service_type) {
+ LOG4CXX_DEBUG(logger_, "Subscribe to app service: " << app_service_type);
+ return subscribed_data_.insert(app_service_type).second;
+}
+
+bool AppServiceAppExtension::UnsubscribeFromAppService(
+ const std::string app_service_type) {
+ LOG4CXX_DEBUG(logger_, app_service_type);
+ auto it = subscribed_data_.find(app_service_type);
+ if (it != subscribed_data_.end()) {
+ subscribed_data_.erase(it);
+ return true;
+ }
+ return false;
+}
+
+void AppServiceAppExtension::UnsubscribeFromAppService() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribed_data_.clear();
+}
+
+bool AppServiceAppExtension::IsSubscribedToAppService(
+ const std::string app_service_type) const {
+ LOG4CXX_DEBUG(logger_,
+ "isSubscribedToAppService for type: " << app_service_type);
+ return subscribed_data_.find(app_service_type) != subscribed_data_.end();
+}
+
+AppServiceSubscriptions AppServiceAppExtension::Subscriptions() {
+ return subscribed_data_;
+}
+
+void AppServiceAppExtension::SaveResumptionData(
+ smart_objects::SmartObject& resumption_data) {
+ const char* app_service_info = "appService";
+ resumption_data[app_service_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int i = 0;
+ for (const auto& subscription : subscribed_data_) {
+ resumption_data[app_service_info][i] = subscription;
+ i++;
+ }
+}
+
+void AppServiceAppExtension::ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) {
+ const char* app_service_info = "appService";
+ if (resumption_data.keyExists(app_service_info)) {
+ const smart_objects::SmartObject& subscriptions_app_services =
+ resumption_data[app_service_info];
+ for (size_t i = 0; i < subscriptions_app_services.length(); ++i) {
+ std::string service_type = resumption_data[i].asString();
+ SubscribeToAppService(service_type);
+ }
+ }
+}
+
+AppServiceAppExtension& AppServiceAppExtension::ExtractASExtension(
+ application_manager::Application& app) {
+ auto ext_ptr = app.QueryInterface(AppServiceAppExtensionUID);
+ DCHECK(ext_ptr);
+ DCHECK(dynamic_cast<AppServiceAppExtension*>(ext_ptr.get()));
+ auto vi_app_extension =
+ std::static_pointer_cast<AppServiceAppExtension>(ext_ptr);
+ DCHECK(vi_app_extension);
+ return *vi_app_extension;
+}
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc
new file mode 100644
index 0000000000..8ce4d10b6e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/app_service_command_factory.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
+
+namespace app_service_rpc_plugin {
+
+AppServiceCommandFactory::AppServiceCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : hmi_command_factory_(new AppServiceHmiCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler))
+ , mobile_command_factory_(new AppServiceMobileCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+AppServiceCommandFactory::~AppServiceCommandFactory() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr AppServiceCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) {
+ return hmi_command_factory_->CreateCommand(message, source);
+ } else {
+ return mobile_command_factory_->CreateCommand(message, source);
+ }
+}
+
+bool AppServiceCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource source) const {
+ LOG4CXX_DEBUG(logger_,
+ "AppServiceCommandFactory::IsAbleToProcess" << function_id
+ << " " << source);
+ return (commands::Command::SOURCE_HMI == source ||
+ commands::Command::SOURCE_SDL_TO_HMI == source)
+ ? hmi_command_factory_->IsAbleToProcess(function_id, source)
+ : mobile_command_factory_->IsAbleToProcess(function_id, source);
+}
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
new file mode 100644
index 0000000000..1cec2ccdce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
@@ -0,0 +1,191 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/app_service_hmi_command_factory.h"
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h"
+#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h"
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h"
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h"
+#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h"
+#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h"
+#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h"
+#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
+
+namespace app_service_rpc_plugin {
+namespace strings = app_mngr::strings;
+
+AppServiceHmiCommandFactory::AppServiceHmiCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (hmi_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (hmi_apis::messageType::error_response == message_type) {
+ message_type_str = "error response";
+ } else if (hmi_apis::messageType::notification == message_type) {
+ message_type_str = "notification";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type, source).create(message);
+}
+
+bool AppServiceHmiCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ LOG4CXX_DEBUG(logger_,
+ "HMI App Service Plugin IsAbleToProcess: " << function_id);
+ UNUSED(source);
+ return buildCommandCreator(
+ function_id, hmi_apis::messageType::INVALID_ENUM, source)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator(
+ const int32_t function_id,
+ const int32_t message_type,
+ const app_mngr::commands::Command::CommandSource source) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ LOG4CXX_DEBUG(logger_,
+ "buildCommandCreator: " << function_id << " " << source);
+
+ switch (function_id) {
+ case hmi_apis::FunctionID::AppService_PublishAppService:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ASPublishAppServiceRequest>()
+ : factory.GetCreator<commands::ASPublishAppServiceResponse>();
+ case hmi_apis::FunctionID::AppService_OnAppServiceData:
+ return app_mngr::commands::Command::CommandSource::SOURCE_HMI == source
+ ? factory.GetCreator<
+ commands::OnASAppServiceDataNotificationFromHMI>()
+ : factory
+ .GetCreator<commands::OnASAppServiceDataNotification>();
+ case hmi_apis::FunctionID::AppService_GetAppServiceData:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_HMI == source) {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::ASGetAppServiceDataRequestFromHMI>()
+ : factory.GetCreator<
+ commands::ASGetAppServiceDataResponseFromHMI>();
+ } else if (app_mngr::commands::Command::CommandSource::
+ SOURCE_SDL_TO_HMI == source) {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::ASGetAppServiceDataRequestToHMI>()
+ : factory.GetCreator<
+ commands::ASGetAppServiceDataResponseToHMI>();
+ }
+ break;
+ case hmi_apis::FunctionID::AppService_GetAppServiceRecords:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ASGetAppServiceRecordsRequest>()
+ : factory
+ .GetCreator<commands::ASGetAppServiceRecordsResponse>();
+ case hmi_apis::FunctionID::AppService_AppServiceActivation:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ASAppServiceActivationRequest>()
+ : factory
+ .GetCreator<commands::ASAppServiceActivationResponse>();
+ case hmi_apis::FunctionID::AppService_PerformAppServiceInteraction:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_HMI == source) {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::
+ ASPerformAppServiceInteractionRequestFromHMI>()
+ : factory.GetCreator<
+ commands::
+ ASPerformAppServiceInteractionResponseFromHMI>();
+ } else if (app_mngr::commands::Command::CommandSource::
+ SOURCE_SDL_TO_HMI == source) {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::ASPerformAppServiceInteractionRequestToHMI>()
+ : factory.GetCreator<
+ commands::
+ ASPerformAppServiceInteractionResponseToHMI>();
+ }
+ break;
+ case hmi_apis::FunctionID::AppService_GetActiveServiceConsent:
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::ASGetActiveServiceConsentRequest>()
+ : factory.GetCreator<
+ commands::ASGetActiveServiceConsentResponse>();
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported HMI function_id: " << function_id);
+ }
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+}
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
new file mode 100644
index 0000000000..76be96cf8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
@@ -0,0 +1,165 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/app_service_mobile_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h"
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h"
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h"
+#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h"
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h"
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h"
+#include "app_service_rpc_plugin/commands/mobile/publish_app_service_response.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
+
+namespace app_service_rpc_plugin {
+namespace strings = app_mngr::strings;
+
+AppServiceMobileCommandFactory::AppServiceMobileCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr AppServiceMobileCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (mobile_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (mobile_apis::messageType::notification == message_type) {
+ message_type_str = "notification";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type, source).create(message);
+}
+
+bool AppServiceMobileCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ UNUSED(source);
+ return buildCommandCreator(
+ function_id, mobile_apis::messageType::INVALID_ENUM, source)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& AppServiceMobileCommandFactory::buildCommandCreator(
+ const int32_t function_id,
+ const int32_t message_type,
+ const app_mngr::commands::Command::CommandSource source) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (function_id) {
+ case mobile_apis::FunctionID::PublishAppServiceID:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source &&
+ mobile_apis::messageType::response != message_type) {
+ return factory.GetCreator<commands::PublishAppServiceRequest>();
+ } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL ==
+ source &&
+ mobile_apis::messageType::request != message_type) {
+ return factory.GetCreator<commands::PublishAppServiceResponse>();
+ }
+ break;
+ case mobile_apis::FunctionID::OnAppServiceDataID:
+ return app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source
+ ? factory.GetCreator<
+ commands::OnAppServiceDataNotificationFromMobile>()
+ : factory.GetCreator<commands::OnAppServiceDataNotification>();
+ case mobile_apis::FunctionID::GetAppServiceDataID:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) {
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetAppServiceDataRequest>()
+ : factory.GetCreator<
+ commands::GetAppServiceDataResponseFromMobile>();
+ } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL ==
+ source) {
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::GetAppServiceDataRequestToMobile>()
+ : factory.GetCreator<commands::GetAppServiceDataResponse>();
+ }
+ break;
+ case mobile_apis::FunctionID::PerformAppServiceInteractionID:
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) {
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::PerformAppServiceInteractionRequest>()
+ : factory.GetCreator<
+ commands::
+ PerformAppServiceInteractionResponseFromMobile>();
+ } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL ==
+ source) {
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::
+ PerformAppServiceInteractionRequestToMobile>()
+ : factory.GetCreator<
+ commands::PerformAppServiceInteractionResponse>();
+ }
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
+ }
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+}
+} // namespace app_service_rpc_plugin
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
new file mode 100644
index 0000000000..3b1b0715d4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
@@ -0,0 +1,98 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "app_service_rpc_plugin/app_service_command_factory.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace app_service_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
+
+namespace strings = application_manager::strings;
+namespace plugins = application_manager::plugin_manager;
+
+AppServiceRpcPlugin::AppServiceRpcPlugin() : application_manager_(nullptr) {}
+
+bool AppServiceRpcPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ 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);
+}
+
+std::string AppServiceRpcPlugin::PluginName() {
+ return plugins::plugin_names::app_service_rpc_plugin;
+}
+
+app_mngr::CommandFactory& AppServiceRpcPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+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);
+ }
+}
+
+void AppServiceRpcPlugin::DeleteSubscriptions(
+ application_manager::ApplicationSharedPtr app) {
+ auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
+ auto subscriptions = ext.Subscriptions();
+ for (auto& service_type : subscriptions) {
+ ext.UnsubscribeFromAppService(service_type);
+ }
+}
+
+} // namespace app_service_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new app_service_rpc_plugin::AppServiceRpcPlugin();
+}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc
new file mode 100644
index 0000000000..fd7312ca98
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc
@@ -0,0 +1,89 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h"
+
+#include "application_manager/app_service_manager.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASAppServiceActivationRequest::ASAppServiceActivationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASAppServiceActivationRequest::~ASAppServiceActivationRequest() {}
+
+void ASAppServiceActivationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AppServiceManager& service_manager =
+ application_manager_.GetAppServiceManager();
+ smart_objects::SmartObject params = (*message_)[strings::msg_params];
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ std::string service_id = params[strings::service_id].asString();
+ response_params[strings::service_id] = service_id;
+ if (params[strings::activate].asBool()) {
+ response_params[strings::activate] =
+ service_manager.ActivateAppService(service_id);
+ } else {
+ service_manager.DeactivateAppService(service_id);
+ response_params[strings::activate] = false;
+ }
+
+ if (params.keyExists(strings::set_as_default)) {
+ if (params[strings::set_as_default].asBool()) {
+ response_params[strings::set_as_default] =
+ service_manager.SetDefaultService(service_id);
+ } else {
+ service_manager.RemoveDefaultService(service_id);
+ response_params[strings::set_as_default] = false;
+ }
+ }
+
+ SendResponse(true,
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_AppServiceActivation,
+ hmi_apis::Common_Result::SUCCESS,
+ &response_params);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc
new file mode 100644
index 0000000000..c77d3ed381
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASAppServiceActivationResponse::ASAppServiceActivationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASAppServiceActivationResponse::~ASAppServiceActivationResponse() {}
+
+void ASAppServiceActivationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc
new file mode 100644
index 0000000000..b1f3d6fdbf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetActiveServiceConsentRequest::ASGetActiveServiceConsentRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetActiveServiceConsentRequest::~ASGetActiveServiceConsentRequest() {}
+
+void ASGetActiveServiceConsentRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc
new file mode 100644
index 0000000000..038c2922ad
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetActiveServiceConsentResponse::ASGetActiveServiceConsentResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetActiveServiceConsentResponse::~ASGetActiveServiceConsentResponse() {}
+
+void ASGetActiveServiceConsentResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::AppService_GetActiveServiceConsent);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
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
new file mode 100644
index 0000000000..e03c0ad15a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc
@@ -0,0 +1,289 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+
+#include "application_manager/message_helper.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceDataRequestFromHMI::ASGetAppServiceDataRequestFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceDataRequestFromHMI::~ASGetAppServiceDataRequestFromHMI() {}
+
+void ASGetAppServiceDataRequestFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_type].asString();
+
+ LOG4CXX_DEBUG(logger_, "Get Service Type: " << service_type);
+
+ SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*message_),
+ true);
+}
+
+void ASGetAppServiceDataRequestFromHMI::GetWeatherImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data[strings::location].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(data[strings::location][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::current_forecast) &&
+ data[strings::current_forecast].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(
+ data[strings::current_forecast][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+
+ 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++) {
+ if (minute_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+
+ 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++) {
+ if (hourly_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+
+ 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++) {
+ if (multiday_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+}
+
+void ASGetAppServiceDataRequestFromHMI::GetNavigationImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data.keyExists(strings::origin) &&
+ data[strings::origin].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(data[strings::origin][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::destination) &&
+ data[strings::destination].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(
+ data[strings::destination][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::instructions)) {
+ smart_objects::SmartObject& instructions = data[strings::instructions];
+ for (size_t i = 0; i < instructions.length(); i++) {
+ if (instructions[i].keyExists(strings::image)) {
+ MessageHelper::VerifyImage(
+ instructions[i][strings::image], app, application_manager_);
+ }
+
+ if (instructions[i].keyExists(strings::location_details) &&
+ instructions[i][strings::location_details].keyExists(
+ strings::location_image)) {
+ MessageHelper::VerifyImage(
+ instructions[i][strings::location_details][strings::location_image],
+ app,
+ application_manager_);
+ }
+ }
+ }
+}
+
+void ASGetAppServiceDataRequestFromHMI::GetMediaImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data.keyExists(strings::media_image)) {
+ MessageHelper::VerifyImage(
+ data[strings::media_image], app, application_manager_);
+ }
+}
+
+bool ASGetAppServiceDataRequestFromHMI::ValidateResponse(
+ smart_objects::SmartObject& message_params) {
+ if (!message_params.keyExists(strings::service_data)) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "GASD response received without any service data, passing through");
+ return true;
+ }
+ smart_objects::SmartObject& service_data =
+ message_params[strings::service_data];
+ std::string service_type = service_data[strings::service_type].asString();
+ mobile_apis::AppServiceType::eType service_type_value;
+ const std::string& service_id = service_data[strings::service_id].asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ LOG4CXX_ERROR(logger_,
+ "GASD response received with an unpublished service ID");
+ SendErrorResponse(
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ hmi_apis::Common_Result::GENERIC_ERROR,
+ "The provider responded with incorrect data",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return false;
+ }
+
+ using namespace ns_smart_device_link::ns_smart_objects;
+ if (service && service->mobile_service &&
+ EnumConversionHelper<mobile_apis::AppServiceType::eType>::StringToEnum(
+ service_type, &service_type_value)) {
+ auto app = application_manager_.application(service->connection_key);
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to find service provider for GASD response");
+ SendErrorResponse(
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ hmi_apis::Common_Result::GENERIC_ERROR,
+ "The provider responded with incorrect data",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return false;
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::WEATHER &&
+ service_data.keyExists(strings::weather_service_data)) {
+ GetWeatherImagePaths(service_data[strings::weather_service_data], app);
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::NAVIGATION &&
+ service_data.keyExists(strings::navigation_service_data)) {
+ GetNavigationImagePaths(service_data[strings::navigation_service_data],
+ app);
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::MEDIA &&
+ service_data.keyExists(strings::media_service_data)) {
+ GetMediaImagePaths(service_data[strings::media_service_data], app);
+ }
+ }
+ return true;
+}
+
+void ASGetAppServiceDataRequestFromHMI::on_event(
+ const event_engine::Event& event) {
+ smart_objects::SmartObject event_message(event.smart_object());
+
+ auto& msg_params = event_message[strings::msg_params];
+
+ 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);
+ if (ValidateResponse(msg_params)) {
+ SendResponse(success,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ result,
+ &msg_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ }
+}
+
+void ASGetAppServiceDataRequestFromHMI::on_event(
+ const event_engine::MobileEvent& event) {
+ smart_objects::SmartObject event_message(event.smart_object());
+
+ auto& msg_params = event_message[strings::msg_params];
+
+ mobile_apis::Result::eType mobile_result =
+ static_cast<mobile_apis::Result::eType>(
+ msg_params[strings::result_code].asInt());
+ hmi_apis::Common_Result::eType result =
+ MessageHelper::MobileToHMIResult(mobile_result);
+ bool success = IsMobileResultSuccess(mobile_result);
+
+ if (ValidateResponse(msg_params)) {
+ SendResponse(success,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ result,
+ &msg_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ }
+}
+
+void ASGetAppServiceDataRequestFromHMI::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendErrorResponse(correlation_id(),
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ hmi_apis::Common_Result::GENERIC_ERROR,
+ "The provider did not respond to the request",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc
new file mode 100644
index 0000000000..635cd7319a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceDataRequestToHMI::ASGetAppServiceDataRequestToHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceDataRequestToHMI::~ASGetAppServiceDataRequestToHMI() {}
+
+void ASGetAppServiceDataRequestToHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc
new file mode 100644
index 0000000000..c0b1b274fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+#include "application_manager/message_helper.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceDataResponseFromHMI::ASGetAppServiceDataResponseFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceDataResponseFromHMI::~ASGetAppServiceDataResponseFromHMI() {}
+
+void ASGetAppServiceDataResponseFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::AppService_GetAppServiceData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc
new file mode 100644
index 0000000000..b489ec4765
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceDataResponseToHMI::ASGetAppServiceDataResponseToHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceDataResponseToHMI::~ASGetAppServiceDataResponseToHMI() {}
+
+void ASGetAppServiceDataResponseToHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/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
new file mode 100644
index 0000000000..fa704c1995
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h"
+
+#include "application_manager/app_service_manager.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceRecordsRequest::ASGetAppServiceRecordsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceRecordsRequest::~ASGetAppServiceRecordsRequest() {}
+
+void ASGetAppServiceRecordsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string type;
+ if ((*message_)[strings::msg_params].keyExists(strings::service_type)) {
+ type = (*message_)[strings::msg_params][strings::service_type].asString();
+ }
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject records =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ std::vector<smart_objects::SmartObject> service_records =
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
+
+ int index = 0;
+ for (auto& record : service_records) {
+ if (!type.empty() &&
+ record[strings::service_manifest][strings::service_type].asString() !=
+ type) {
+ continue;
+ }
+ records[index] = record;
+ index++;
+ }
+
+ if (!records.empty()) {
+ response_params[strings::service_records] = records;
+ }
+ SendResponse(true,
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_GetAppServiceRecords,
+ hmi_apis::Common_Result::SUCCESS,
+ &response_params);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc
new file mode 100644
index 0000000000..0479aa8d31
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASGetAppServiceRecordsResponse::ASGetAppServiceRecordsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASGetAppServiceRecordsResponse::~ASGetAppServiceRecordsResponse() {}
+
+void ASGetAppServiceRecordsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/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
new file mode 100644
index 0000000000..6499b08c28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc
@@ -0,0 +1,164 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/message_helper.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPerformAppServiceInteractionRequestFromHMI::
+ ASPerformAppServiceInteractionRequestFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPerformAppServiceInteractionRequestFromHMI::
+ ~ASPerformAppServiceInteractionRequestFromHMI() {}
+
+void ASPerformAppServiceInteractionRequestFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ std::string hmi_origin_id =
+ application_manager_.get_settings().hmi_origin_id();
+ if (!msg_params.keyExists(strings::origin_app)) {
+ if (hmi_origin_id.empty()) {
+ SendErrorResponse(
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ hmi_apis::Common_Result::INVALID_DATA,
+ "No HMI origin ID to use for interaction passthrough",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return;
+ }
+ msg_params[strings::origin_app] = hmi_origin_id;
+ }
+
+ std::string service_id = msg_params[strings::service_id].asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ SendErrorResponse(
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ hmi_apis::Common_Result::INVALID_ID,
+ "The requested service ID does not exist",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return;
+ }
+
+ bool request_service_active = false;
+ if (msg_params.keyExists(strings::request_service_active)) {
+ request_service_active =
+ msg_params[strings::request_service_active].asBool();
+ msg_params.erase(strings::request_service_active);
+ }
+
+ // Only activate service if it is not already active
+ bool activate_service = request_service_active &&
+ !service->record[strings::service_active].asBool();
+ if (activate_service) {
+ application_manager_.GetAppServiceManager().ActivateAppService(service_id);
+ }
+
+ SendProviderRequest(
+ mobile_apis::FunctionID::PerformAppServiceInteractionID,
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ &(*message_),
+ true);
+}
+
+void ASPerformAppServiceInteractionRequestFromHMI::on_event(
+ const event_engine::Event& event) {
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ 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);
+ SendResponse(success,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ result,
+ &msg_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+void ASPerformAppServiceInteractionRequestFromHMI::on_event(
+ const event_engine::MobileEvent& event) {
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ mobile_apis::Result::eType mobile_result =
+ static_cast<mobile_apis::Result::eType>(
+ msg_params[strings::result_code].asInt());
+ hmi_apis::Common_Result::eType result =
+ MessageHelper::MobileToHMIResult(mobile_result);
+ bool success = IsMobileResultSuccess(mobile_result);
+ SendResponse(success,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ result,
+ &msg_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+void ASPerformAppServiceInteractionRequestFromHMI::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject response_params;
+ response_params[strings::info] =
+ "The provider did not respond to the request";
+ SendErrorResponse(
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ hmi_apis::Common_Result::GENERIC_ERROR,
+ "The provider did not respond to the request",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc
new file mode 100644
index 0000000000..22876328de
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPerformAppServiceInteractionRequestToHMI::
+ ASPerformAppServiceInteractionRequestToHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPerformAppServiceInteractionRequestToHMI::
+ ~ASPerformAppServiceInteractionRequestToHMI() {}
+
+void ASPerformAppServiceInteractionRequestToHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc
new file mode 100644
index 0000000000..a2ffa65a73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPerformAppServiceInteractionResponseFromHMI::
+ ASPerformAppServiceInteractionResponseFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPerformAppServiceInteractionResponseFromHMI::
+ ~ASPerformAppServiceInteractionResponseFromHMI() {}
+
+void ASPerformAppServiceInteractionResponseFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc
new file mode 100644
index 0000000000..5ddef55c2a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPerformAppServiceInteractionResponseToHMI::
+ ASPerformAppServiceInteractionResponseToHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPerformAppServiceInteractionResponseToHMI::
+ ~ASPerformAppServiceInteractionResponseToHMI() {}
+
+void ASPerformAppServiceInteractionResponseToHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc
new file mode 100644
index 0000000000..35a3e8a6b3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/message_helper.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPublishAppServiceRequest::ASPublishAppServiceRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPublishAppServiceRequest::~ASPublishAppServiceRequest() {}
+
+void ASPublishAppServiceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Received a PublishAppService request from HMI");
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject manifest =
+ (*message_)[strings::msg_params][strings::app_service_manifest];
+ smart_objects::SmartObject service_record =
+ application_manager_.GetAppServiceManager().PublishAppService(manifest,
+ false);
+ if (service_record.empty()) {
+ SendErrorResponse(
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_PublishAppService,
+ hmi_apis::Common_Result::REJECTED,
+ "Failed to publish service",
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+ return;
+ }
+
+ response_params[strings::app_service_record] = service_record;
+ SendResponse(true,
+ (*message_)[strings::params][strings::correlation_id].asUInt(),
+ hmi_apis::FunctionID::AppService_PublishAppService,
+ hmi_apis::Common_Result::SUCCESS,
+ &response_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc
new file mode 100644
index 0000000000..c143315b8c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h"
+#include "application_manager/message_helper.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+ASPublishAppServiceResponse::ASPublishAppServiceResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ASPublishAppServiceResponse::~ASPublishAppServiceResponse() {}
+
+void ASPublishAppServiceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/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
new file mode 100644
index 0000000000..db1716ecb8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
@@ -0,0 +1,215 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnASAppServiceDataNotification::OnASAppServiceDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnASAppServiceDataNotification::~OnASAppServiceDataNotification() {}
+
+void OnASAppServiceDataNotification::GetMediaImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data.keyExists(strings::media_image)) {
+ MessageHelper::VerifyImage(
+ data[strings::media_image], app, application_manager_);
+ }
+}
+
+void OnASAppServiceDataNotification::GetWeatherImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data[strings::location].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(data[strings::location][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::current_forecast) &&
+ data[strings::current_forecast].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(
+ data[strings::current_forecast][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+
+ 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++) {
+ if (minute_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+
+ 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++) {
+ if (hourly_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+
+ 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++) {
+ if (multiday_forecast[i].keyExists(strings::weather_icon)) {
+ MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon],
+ app,
+ application_manager_);
+ }
+ }
+ }
+}
+
+void OnASAppServiceDataNotification::GetNavigationImagePaths(
+ smart_objects::SmartObject& data, ApplicationSharedPtr app) {
+ if (data.keyExists(strings::origin) &&
+ data[strings::origin].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(data[strings::origin][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::destination) &&
+ data[strings::destination].keyExists(strings::location_image)) {
+ MessageHelper::VerifyImage(
+ data[strings::destination][strings::location_image],
+ app,
+ application_manager_);
+ }
+
+ if (data.keyExists(strings::instructions)) {
+ smart_objects::SmartObject& instructions = data[strings::instructions];
+ for (size_t i = 0; i < instructions.length(); i++) {
+ if (instructions[i].keyExists(strings::image)) {
+ MessageHelper::VerifyImage(
+ instructions[i][strings::image], app, application_manager_);
+ }
+
+ if (instructions[i].keyExists(strings::location_details) &&
+ instructions[i][strings::location_details].keyExists(
+ strings::location_image)) {
+ MessageHelper::VerifyImage(
+ instructions[i][strings::location_details][strings::location_image],
+ app,
+ application_manager_);
+ }
+ }
+ }
+}
+
+bool OnASAppServiceDataNotification::ValidateParams(
+ smart_objects::SmartObject& message_params) {
+ if (!message_params.keyExists(strings::service_data)) {
+ LOG4CXX_DEBUG(logger_,
+ "OASD notification received without any service data");
+ return false;
+ }
+ smart_objects::SmartObject& service_data =
+ message_params[strings::service_data];
+ std::string service_type = service_data[strings::service_type].asString();
+ mobile_apis::AppServiceType::eType service_type_value;
+ const std::string& service_id = service_data[strings::service_id].asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ LOG4CXX_ERROR(logger_,
+ "OASD notification received with an unpublished service ID");
+ return false;
+ }
+
+ using namespace ns_smart_device_link::ns_smart_objects;
+ if (service && service->mobile_service &&
+ EnumConversionHelper<mobile_apis::AppServiceType::eType>::StringToEnum(
+ service_type, &service_type_value)) {
+ auto app = application_manager_.application(service->connection_key);
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to find service provider for OASD message");
+ return false;
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::WEATHER &&
+ service_data.keyExists(strings::weather_service_data)) {
+ GetWeatherImagePaths(service_data[strings::weather_service_data], app);
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::NAVIGATION &&
+ service_data.keyExists(strings::navigation_service_data)) {
+ GetNavigationImagePaths(service_data[strings::navigation_service_data],
+ app);
+ }
+
+ if (service_type_value == mobile_apis::AppServiceType::MEDIA &&
+ service_data.keyExists(strings::media_service_data)) {
+ GetMediaImagePaths(service_data[strings::media_service_data], app);
+ }
+ }
+ return true;
+}
+
+void OnASAppServiceDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Sending AS data to HMI");
+ if (ValidateParams((*message_)[strings::msg_params])) {
+ SendNotification();
+ }
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc
new file mode 100644
index 0000000000..1c73fc73f4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc
@@ -0,0 +1,99 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h"
+
+#include "application_manager/app_service_manager.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnASAppServiceDataNotificationFromHMI::OnASAppServiceDataNotificationFromHMI(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnASAppServiceDataNotificationFromHMI::
+ ~OnASAppServiceDataNotificationFromHMI() {}
+
+void OnASAppServiceDataNotificationFromHMI::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData from HMI");
+
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_id]
+ .asString();
+ AppService* service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ LOG4CXX_ERROR(
+ logger_, "No published services exist with service ID: " << service_id);
+ return;
+ } else if (service->mobile_service) {
+ LOG4CXX_ERROR(logger_, "Service was not published by the HMI");
+ return;
+ } else if (!service->record[strings::service_active].asBool()) {
+ LOG4CXX_ERROR(logger_, "Service is not active");
+ return;
+ }
+
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_type]
+ .asString();
+ std::string published_service_type =
+ service->record[strings::service_manifest][strings::service_type]
+ .asString();
+ if (published_service_type != service_type) {
+ LOG4CXX_ERROR(logger_,
+ "Service type mismatch, expected "
+ << service_type
+ << ", but service was published with type "
+ << published_service_type);
+ return;
+ }
+
+ SendNotificationToConsumers(
+ mobile_apis::FunctionID::eType::OnAppServiceDataID);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
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
new file mode 100644
index 0000000000..7c2e62abe2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc
@@ -0,0 +1,129 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h"
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetAppServiceDataRequest::GetAppServiceDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetAppServiceDataRequest::~GetAppServiceDataRequest() {}
+
+void GetAppServiceDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*message_),
+ true);
+}
+
+void GetAppServiceDataRequest::HandleSubscribe() {
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_type].asString();
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app && (*message_)[strings::msg_params].keyExists(strings::subscribe)) {
+ bool subscribe =
+ (*message_)[strings::msg_params][strings::subscribe].asBool();
+ auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
+ if (subscribe) {
+ ext.SubscribeToAppService(service_type);
+ } else {
+ ext.UnsubscribeFromAppService(service_type);
+ }
+ }
+}
+
+void GetAppServiceDataRequest::on_event(
+ const event_engine::MobileEvent& event) {
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>(
+ msg_params[strings::result_code].asInt());
+ bool success = IsMobileResultSuccess(result);
+ if (success) {
+ HandleSubscribe();
+ }
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+void GetAppServiceDataRequest::on_event(const event_engine::Event& event) {
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ event_message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_AppService);
+ if (success) {
+ HandleSubscribe();
+ }
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc
new file mode 100644
index 0000000000..0af1a5436b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetAppServiceDataRequestToMobile::GetAppServiceDataRequestToMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestToMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetAppServiceDataRequestToMobile::~GetAppServiceDataRequestToMobile() {}
+
+void GetAppServiceDataRequestToMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc
new file mode 100644
index 0000000000..32ad8e014d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetAppServiceDataResponse::GetAppServiceDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetAppServiceDataResponse::~GetAppServiceDataResponse() {}
+
+void GetAppServiceDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc
new file mode 100644
index 0000000000..90fca04eb2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetAppServiceDataResponseFromMobile::GetAppServiceDataResponseFromMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseFromMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetAppServiceDataResponseFromMobile::~GetAppServiceDataResponseFromMobile() {}
+
+void GetAppServiceDataResponseFromMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::MobileEvent event(mobile_apis::FunctionID::GetAppServiceDataID);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc
new file mode 100644
index 0000000000..1ffe99462d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h"
+
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "smart_objects/enum_schema_item.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAppServiceDataNotification::OnAppServiceDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAppServiceDataNotification::~OnAppServiceDataNotification() {}
+
+void OnAppServiceDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Sending OnAppServiceData to consumer");
+
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_id]
+ .asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+
+ if (!service) {
+ LOG4CXX_ERROR(logger_, "Service sending OnAppServiceData is not published");
+ return;
+ } else if (!service
+ ->record[strings::service_manifest]
+ [strings::allow_app_consumers]
+ .asBool()) {
+ LOG4CXX_ERROR(logger_,
+ "Service does not allow for app consumers, skipping mobile "
+ "OnAppServiceData notification");
+ return;
+ }
+
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_type]
+ .asString();
+
+ auto subscribed_to_app_service_predicate =
+ [service_type](const ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
+ LOG4CXX_DEBUG(logger_, "Check subscription for type: " << service_type);
+ return ext.IsSubscribedToAppService(service_type);
+ };
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ application_manager::FindAllApps(application_manager_.applications(),
+ subscribed_to_app_service_predicate);
+
+ std::vector<ApplicationSharedPtr>::const_iterator app_it =
+ applications.begin();
+
+ for (; applications.end() != app_it; ++app_it) {
+ const ApplicationSharedPtr app = *app_it;
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Sending OnAppServiceDataNotification to mobile connection: "
+ << app->app_id());
+ (*message_)[app_mngr::strings::params][app_mngr::strings::connection_key] =
+ app->app_id();
+ SendNotification();
+ }
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc
new file mode 100644
index 0000000000..5caacc9801
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc
@@ -0,0 +1,119 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAppServiceDataNotificationFromMobile::OnAppServiceDataNotificationFromMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAppServiceDataNotificationFromMobile::
+ ~OnAppServiceDataNotificationFromMobile() {}
+
+void OnAppServiceDataNotificationFromMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData");
+ MessageHelper::PrintSmartObject(*message_);
+
+ uint32_t app_connection_key = connection_key();
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_type]
+ .asString();
+
+ ApplicationSharedPtr app =
+ application_manager_.application(app_connection_key);
+
+ bool result = policy_handler_.CheckAppServiceParameters(
+ app->policy_app_id(), std::string(), service_type, NULL);
+
+ if (!result) {
+ LOG4CXX_DEBUG(logger_,
+ "Incorrect service type received in "
+ "OnAppServiceDataNotificationFromMobile");
+ return;
+ }
+
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::service_data]
+ [strings::service_id]
+ .asString();
+ AppService* service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ LOG4CXX_ERROR(
+ logger_, "No published services exist with service ID: " << service_id);
+ return;
+ } else if (!service->mobile_service ||
+ service->connection_key != app_connection_key) {
+ LOG4CXX_ERROR(logger_, "Service was not published by this application");
+ return;
+ } else if (!service->record[strings::service_active].asBool()) {
+ LOG4CXX_ERROR(logger_, "Service is not active");
+ return;
+ }
+
+ std::string published_service_type =
+ service->record[strings::service_manifest][strings::service_type]
+ .asString();
+ if (published_service_type != service_type) {
+ LOG4CXX_ERROR(logger_,
+ "Service type mismatch, expected "
+ << service_type
+ << ", but service was published with type "
+ << published_service_type);
+ return;
+ }
+
+ SendNotificationToConsumers(
+ hmi_apis::FunctionID::eType::AppService_OnAppServiceData);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
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
new file mode 100644
index 0000000000..63b6e47d8e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc
@@ -0,0 +1,188 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PerformAppServiceInteractionRequest::PerformAppServiceInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformAppServiceInteractionRequest::~PerformAppServiceInteractionRequest() {}
+
+void PerformAppServiceInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto app = application_manager_.application(connection_key());
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ std::string service_id = msg_params[strings::service_id].asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (!service) {
+ SendResponse(false,
+ mobile_apis::Result::INVALID_ID,
+ "The requested service ID does not exist");
+ return;
+ }
+
+ if (!service->record[strings::service_manifest][strings::allow_app_consumers]
+ .asBool()) {
+ SendResponse(
+ false,
+ mobile_apis::Result::REJECTED,
+ "The requested service ID does not allow mobile app consumers");
+ return;
+ }
+
+ bool request_service_active = false;
+ if (msg_params.keyExists(strings::request_service_active)) {
+ request_service_active =
+ msg_params[strings::request_service_active].asBool();
+ msg_params.erase(strings::request_service_active);
+ }
+
+ // Only activate service if it is not already active
+ bool activate_service = request_service_active &&
+ !service->record[strings::service_active].asBool();
+ if (activate_service) {
+ if (app->IsFullscreen()) {
+ // App is in foreground, we can just activate the service
+ application_manager_.GetAppServiceManager().ActivateAppService(
+ service_id);
+ } else {
+ // App is not in foreground, we need to prompt the user to activate the
+ // service
+ smart_objects::SmartObject request_params;
+ request_params[strings::service_id] = service_id;
+ application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
+ correlation_id());
+ SendHMIRequest(hmi_apis::FunctionID::AppService_GetActiveServiceConsent,
+ &request_params,
+ true);
+ return;
+ }
+ }
+
+ SendProviderRequest(
+ mobile_apis::FunctionID::PerformAppServiceInteractionID,
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ &(*message_),
+ true);
+}
+
+void PerformAppServiceInteractionRequest::on_event(
+ const event_engine::Event& event) {
+ LOG4CXX_DEBUG(logger_, "HMI PerformAppServiceInteraction on_event");
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ event_message[strings::params][hmi_response::code].asInt());
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_AppService);
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::AppService_PerformAppServiceInteraction:
+ SendResponse(success, result, info, &msg_params);
+ break;
+ case hmi_apis::FunctionID::AppService_GetActiveServiceConsent:
+ if (msg_params[strings::activate].asBool()) {
+ // User agreed to activate service, we can now send the provider request
+ application_manager_.GetAppServiceManager().ActivateAppService(
+ (*message_)[strings::msg_params][strings::service_id].asString());
+ SendProviderRequest(
+ mobile_apis::FunctionID::PerformAppServiceInteractionID,
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ &(*message_),
+ true);
+ } else if (mobile_apis::Result::SUCCESS == result) {
+ // Request was successful, but user denied the request to activate the
+ // service
+ SendResponse(false,
+ mobile_apis::Result::USER_DISALLOWED,
+ "Request to activate service was denied by driver");
+ } else {
+ SendResponse(success, result, info);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void PerformAppServiceInteractionRequest::on_event(
+ const event_engine::MobileEvent& event) {
+ LOG4CXX_DEBUG(logger_, "Mobile PerformAppServiceInteraction on_event");
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ auto msg_params = event_message[strings::msg_params];
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+ mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>(
+ msg_params[strings::result_code].asInt());
+ bool success = IsMobileResultSuccess(result);
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc
new file mode 100644
index 0000000000..2a7b644cb3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "application_manager/application_impl.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PerformAppServiceInteractionRequestToMobile::
+ PerformAppServiceInteractionRequestToMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestToMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformAppServiceInteractionRequestToMobile::
+ ~PerformAppServiceInteractionRequestToMobile() {}
+
+void PerformAppServiceInteractionRequestToMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc
new file mode 100644
index 0000000000..5e84f42c34
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h"
+#include "application_manager/application_impl.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PerformAppServiceInteractionResponse::PerformAppServiceInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformAppServiceInteractionResponse::~PerformAppServiceInteractionResponse() {}
+
+void PerformAppServiceInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc
new file mode 100644
index 0000000000..9912df84ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PerformAppServiceInteractionResponseFromMobile::
+ PerformAppServiceInteractionResponseFromMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseFromMobile(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformAppServiceInteractionResponseFromMobile::
+ ~PerformAppServiceInteractionResponseFromMobile() {}
+
+void PerformAppServiceInteractionResponseFromMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::MobileEvent event(
+ mobile_apis::FunctionID::PerformAppServiceInteractionID);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
new file mode 100644
index 0000000000..c168b4bf2f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
@@ -0,0 +1,135 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PublishAppServiceRequest::PublishAppServiceRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PublishAppServiceRequest::~PublishAppServiceRequest() {}
+
+void PublishAppServiceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Received a PublishAppService " << connection_key());
+ MessageHelper::PrintSmartObject(*message_);
+
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject manifest =
+ (*message_)[strings::msg_params][strings::app_service_manifest];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ std::string requested_service_name = "";
+
+ if ((*message_)[strings::msg_params][strings::app_service_manifest].keyExists(
+ strings::service_name)) {
+ requested_service_name =
+ (*message_)[strings::msg_params][strings::app_service_manifest]
+ [strings::service_name]
+ .asString();
+ }
+
+ std::string requested_service_type =
+ (*message_)[strings::msg_params][strings::app_service_manifest]
+ [strings::service_type]
+ .asString();
+
+ smart_objects::SmartArray* requested_handled_rpcs = NULL;
+ if ((*message_)[strings::msg_params][strings::app_service_manifest].keyExists(
+ strings::handled_rpcs)) {
+ requested_handled_rpcs =
+ (*message_)[strings::msg_params][strings::app_service_manifest]
+ [strings::handled_rpcs]
+ .asArray();
+ }
+
+ bool result =
+ policy_handler_.CheckAppServiceParameters(app->policy_app_id(),
+ requested_service_name,
+ requested_service_type,
+ requested_handled_rpcs);
+
+ if (!result) {
+ SendResponse(false,
+ mobile_apis::Result::DISALLOWED,
+ "Service disallowed by policies");
+ return;
+ }
+
+ auto& ext =
+ sdl_rpc_plugin::SystemCapabilityAppExtension::ExtractExtension(*app);
+ ext.SubscribeTo(mobile_apis::SystemCapabilityType::APP_SERVICES);
+
+ smart_objects::SmartObject service_record =
+ application_manager_.GetAppServiceManager().PublishAppService(
+ manifest, true, connection_key());
+
+ if (service_record.empty()) {
+ SendResponse(
+ false, mobile_apis::Result::REJECTED, "Failed to publish service");
+ return;
+ }
+
+ if (app->IsFullscreen()) {
+ // Service should be activated if app is in the foreground
+ application_manager_.GetAppServiceManager().ActivateAppService(
+ service_record[strings::service_id].asString());
+ }
+
+ response_params[strings::app_service_record] = service_record;
+
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc
new file mode 100644
index 0000000000..d1bfc6e154
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "app_service_rpc_plugin/commands/mobile/publish_app_service_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+PublishAppServiceResponse::PublishAppServiceResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PublishAppServiceResponse::~PublishAppServiceResponse() {}
+
+void PublishAppServiceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace app_service_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..0b56ddb7e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,40 @@
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
+ ${COMPONENTS_DIR}/resumption/include
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ app_service_rpc_plugin
+ sdl_rpc_plugin
+ jsoncpp
+ Policy
+ Resumption
+)
+
+create_cotired_test("app_services_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..f64f353767
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,151 @@
+/*
+ * 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 "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "hmi/as_app_service_activation_request.h"
+#include "hmi/as_app_service_activation_response.h"
+#include "hmi/as_get_active_service_consent_request.h"
+#include "hmi/as_get_active_service_consent_response.h"
+#include "hmi/as_get_app_service_data_request_from_hmi.h"
+#include "hmi/as_get_app_service_data_request_to_hmi.h"
+#include "hmi/as_get_app_service_data_response_from_hmi.h"
+#include "hmi/as_get_app_service_data_response_to_hmi.h"
+#include "hmi/as_get_app_service_records_request.h"
+#include "hmi/as_get_app_service_records_response.h"
+#include "hmi/as_perform_app_service_interaction_request_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_request_to_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_from_hmi.h"
+#include "hmi/as_perform_app_service_interaction_response_to_hmi.h"
+#include "hmi/as_publish_app_service_request.h"
+#include "hmi/as_publish_app_service_response.h"
+#include "hmi/on_as_app_service_data_notification.h"
+#include "hmi/on_as_app_service_data_notification_from_hmi.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+
+using ::application_manager::ApplicationSharedPtr;
+using application_manager::commands::MessageSharedPtr;
+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;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ 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_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::ASAppServiceActivationRequest,
+ commands::ASAppServiceActivationResponse,
+ commands::ASGetActiveServiceConsentRequest,
+ commands::ASGetActiveServiceConsentResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASGetAppServiceDataRequestToHMI,
+ commands::ASGetAppServiceDataResponseFromHMI,
+ commands::ASGetAppServiceDataResponseToHMI,
+ commands::ASGetAppServiceRecordsRequest,
+ commands::ASGetAppServiceRecordsResponse,
+ commands::ASPerformAppServiceInteractionRequestFromHMI,
+ commands::ASPerformAppServiceInteractionRequestToHMI,
+ commands::ASPerformAppServiceInteractionResponseFromHMI,
+ commands::ASPerformAppServiceInteractionResponseToHMI,
+ commands::ASPublishAppServiceRequest,
+ commands::ASPublishAppServiceResponse,
+ commands::OnASAppServiceDataNotification,
+ commands::OnASAppServiceDataNotificationFromHMI>
+ HMICommandsListFirst;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
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
new file mode 100644
index 0000000000..e77b21ca6d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,136 @@
+/*
+ * 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 "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/get_app_service_data_request.h"
+#include "mobile/get_app_service_data_request_to_mobile.h"
+#include "mobile/get_app_service_data_response.h"
+#include "mobile/get_app_service_data_response_from_mobile.h"
+#include "mobile/on_app_service_data_notification.h"
+#include "mobile/on_app_service_data_notification_from_mobile.h"
+#include "mobile/perform_app_service_interaction_request.h"
+#include "mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "mobile/perform_app_service_interaction_response.h"
+#include "mobile/perform_app_service_interaction_response_from_mobile.h"
+#include "mobile/publish_app_service_request.h"
+#include "mobile/publish_app_service_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = app_service_rpc_plugin::commands;
+using am::commands::MessageSharedPtr;
+using ::application_manager::ApplicationSharedPtr;
+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;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ 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_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::GetAppServiceDataRequest,
+ commands::GetAppServiceDataRequestToMobile,
+ commands::GetAppServiceDataResponse,
+ commands::GetAppServiceDataResponseFromMobile,
+ commands::OnAppServiceDataNotification,
+ commands::OnAppServiceDataNotificationFromMobile,
+ commands::PerformAppServiceInteractionRequest,
+ commands::PerformAppServiceInteractionRequestToMobile,
+ commands::PerformAppServiceInteractionResponse,
+ commands::PerformAppServiceInteractionResponseFromMobile,
+ commands::PublishAppServiceRequest,
+ commands::PublishAppServiceResponse>
+ MobileCommandsListFirst;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_NE(command.use_count(), 0);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc
new file mode 100644
index 0000000000..3e88d4eaf3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc
@@ -0,0 +1,217 @@
+/*
+ * 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 "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h"
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_app_service_manager.h"
+#include "application_manager/mock_application.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+#include "resumption/last_state_impl.h"
+
+namespace am = application_manager;
+using am::ApplicationSet;
+using am::commands::MessageSharedPtr;
+using app_service_rpc_plugin::commands::OnAppServiceDataNotification;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::application_manager_test::MockAppServiceManager;
+using test::components::commands_test::CommandsTest;
+using test::components::commands_test::CommandsTestMocks;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnNull;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+
+namespace {
+const uint32_t kAppId = 0u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+const int kModuleId = 153u;
+} // namespace
+
+namespace app_service_plugin_test {
+using namespace app_service_rpc_plugin;
+using application_manager::ApplicationSet;
+
+class OnAppServiceDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnAppServiceDataNotificationTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , app_service_app_extension_(
+ std::make_shared<app_service_rpc_plugin::AppServiceAppExtension>(
+ app_service_plugin_, *mock_app_))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_)
+ , last_state_("app_storage_folder", "app_info_storage")
+ , app_service_manager_(app_mngr_, last_state_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(app_service_app_extension_));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::OnAppServiceDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::app_id] = kAppId;
+
+ return message;
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<AppServiceAppExtension> app_service_app_extension_;
+ app_service_rpc_plugin::AppServiceRpcPlugin app_service_plugin_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+ resumption::LastStateImpl last_state_;
+ MockAppServiceManager app_service_manager_;
+};
+
+TEST_F(OnAppServiceDataNotificationTest, Run_SendMessageToMobile_Notification) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_type] = "MEDIA";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_id] = "mediaid1234";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ ["mediaServiceData"]["mediaTitle"] = "media title";
+
+ apps_.insert(mock_app_);
+ app_service_app_extension_->SubscribeToAppService("MEDIA");
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ am::AppService service;
+ service.connection_key = 1;
+ service.mobile_service = true;
+ service
+ .record[am::strings::service_manifest][am::strings::allow_app_consumers] =
+ true;
+ EXPECT_CALL(app_service_manager_, FindServiceByID(_))
+ .WillOnce(Return(&service));
+
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager_));
+
+ std::shared_ptr<OnAppServiceDataNotification> command =
+ CreateCommand<OnAppServiceDataNotification>(mobile_message);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&mobile_message));
+ // Act
+ command->Run();
+
+ // Assertions
+ ASSERT_TRUE(mobile_message.get());
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+TEST_F(OnAppServiceDataNotificationTest, Run_NoService) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_type] = "MEDIA";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_id] = "mediaid1234";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ ["mediaServiceData"]["mediaTitle"] = "media title";
+
+ apps_.insert(mock_app_);
+ app_service_app_extension_->SubscribeToAppService("MEDIA");
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ EXPECT_CALL(app_service_manager_, FindServiceByID(_)).WillOnce(ReturnNull());
+
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager_));
+
+ std::shared_ptr<OnAppServiceDataNotification> command =
+ CreateCommand<OnAppServiceDataNotification>(mobile_message);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)).Times(0);
+ command->Run();
+
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+TEST_F(OnAppServiceDataNotificationTest, Run_NoSubscribedApps) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_type] = "MEDIA";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ [am::strings::service_id] = "mediaid1234";
+ (*mobile_message)[am::strings::msg_params][am::strings::service_data]
+ ["mediaServiceData"]["mediaTitle"] = "media title";
+
+ apps_.insert(mock_app_);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ am::AppService service;
+ service.connection_key = 1;
+ service.mobile_service = true;
+ service
+ .record[am::strings::service_manifest][am::strings::allow_app_consumers] =
+ true;
+ EXPECT_CALL(app_service_manager_, FindServiceByID(_))
+ .WillOnce(Return(&service));
+
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager_));
+
+ std::shared_ptr<OnAppServiceDataNotification> command =
+ CreateCommand<OnAppServiceDataNotification>(mobile_message);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)).Times(0);
+ command->Run();
+
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+} // namespace app_service_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
index 3bc34be8d1..08082d98bb 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/request_to_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
index 939d5fa468..5ed2236d9c 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/response_from_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
index 97df5e8390..9a6cf9e290 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
@@ -1,42 +1,42 @@
/*
-* 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.
-*/
+ * 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_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
#include "application_manager/commands/request_to_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
index 46232987a5..677e3ad1f0 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/response_from_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
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 a88a39aa7a..a75020956c 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
@@ -35,8 +35,8 @@
#include "application_manager/commands/request_to_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
index c9e5d39d1d..059164dc9f 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/response_from_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
index aeb0a06d22..2a15f3816a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/notification_from_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
index 69b48bfecf..aeba2f1440 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/request_to_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
index 8a63503220..8369941c30 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/response_from_hmi.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
index 0f3964494e..69122c19f3 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
index 01588cc6b7..cfb5e72c95 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
-#include "rc_rpc_plugin/commands/rc_command_request.h"
#include <string>
+#include "rc_rpc_plugin/commands/rc_command_request.h"
namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
@@ -76,9 +76,9 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest {
bool HasRequestExcessiveSubscription();
/**
- * @brief Handle subscription to vehicle data
- * @param hmi_response json message with response from HMI
- */
+ * @brief Handle subscription to vehicle data
+ * @param hmi_response json message with response from HMI
+ */
void ProccessSubscription(const smart_objects::SmartObject& hmi_response);
/**
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
index bf8208edc2..58dac85633 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/command_response_impl.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
index 931e79366c..2a7362510d 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
@@ -35,9 +35,9 @@
#include <string>
#include "application_manager/commands/command_notification_impl.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
-#include "rc_rpc_plugin/interior_data_cache.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
index 1ab5ccc6bc..f54418fc08 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
-#include "rc_rpc_plugin/interior_data_cache.h"
#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
index 8e7ed9c667..0ca7789791 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
@@ -39,7 +39,7 @@ namespace rpc_service {
class RPCService;
}
class HMICapabilities;
-}
+} // namespace application_manager
namespace policy {
class PolicyHandlerInterface;
@@ -60,5 +60,5 @@ struct RCCommandParams {
rc_rpc_plugin::InteriorDataCache& interior_data_cache_;
rc_rpc_plugin::InteriorDataManager& interior_data_manager_;
};
-}
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
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 ce95617b6c..b4e34c083e 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,11 +33,11 @@
#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 "rc_rpc_plugin/resource_allocation_manager.h"
-#include "rc_rpc_plugin/rc_app_extension.h"
#include "application_manager/commands/command_request_impl.h"
-#include "rc_rpc_plugin/interior_data_cache.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"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
@@ -166,7 +166,7 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
std::string disallowed_info_;
};
-}
-}
+} // namespace commands
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
index bb45247fae..c7dda761bf 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
@@ -81,6 +81,6 @@ class InteriorDataCache {
*/
virtual void Clear() = 0;
};
-} // rc_rpc_plugin
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
index f2971e3d72..b40ce4eb4b 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
@@ -35,9 +35,9 @@
#include <map>
-#include "utils/macro.h"
-#include "utils/lock.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
namespace rc_rpc_plugin {
class InteriorDataCacheImpl : public InteriorDataCache {
@@ -59,6 +59,6 @@ class InteriorDataCacheImpl : public InteriorDataCache {
mutable sync_primitives::Lock cached_data_lock_;
};
-} // rc_rpc_plugin
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
index f28c388055..157e031869 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
@@ -50,10 +50,10 @@ class InteriorDataManager {
virtual void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) = 0;
/**
- * @brief OnApplicationEvent Notifies modules on certain application events
- * @param event Event
- * @param application Pointer to application struct
- */
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
virtual void OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) = 0;
@@ -71,13 +71,13 @@ class InteriorDataManager {
virtual void StoreRequestToHMITime(const std::string& module_type) = 0;
/**
- * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed of
- * bounce during current time frame.
- * calculate amount of requests per module type in time frame and checks if it
- * bigger then allowed by ini file
- * @param module_type moduletype to calculate frequency on
- * @return true if amount of requests was not exceeded, otherwise return false.
- */
+ * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed
+ * of bounce during current time frame. calculate amount of requests per
+ * module type in time frame and checks if it bigger then allowed by ini file
+ * @param module_type moduletype to calculate frequency on
+ * @return true if amount of requests was not exceeded, otherwise return
+ * false.
+ */
virtual bool CheckRequestsToHMIFrequency(const std::string& module_type) = 0;
};
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
index 9b16a2c4da..b98ba596fb 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
@@ -40,7 +40,7 @@ class ApplicationManager;
namespace rpc_service {
class RPCService;
}
-}
+} // namespace application_manager
namespace rc_rpc_plugin {
class InteriorDataCache;
@@ -94,7 +94,8 @@ class InteriorDataManagerImpl : public InteriorDataManager {
* @brief AppsModules mapping from applications to list of modules
*/
typedef std::map<application_manager::ApplicationSharedPtr,
- std::vector<std::string> > AppsModules;
+ std::vector<std::string> >
+ AppsModules;
/**
* @brief AppsSubscribedModules get mapping of application to list of
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 e36968fc4b..36fe9f5bdb 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
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
-#include <string>
-#include <set>
#include <memory>
-#include "utils/macro.h"
+#include <set>
+#include <string>
#include "application_manager/app_extension.h"
+#include "utils/macro.h"
namespace rc_rpc_plugin {
class RCAppExtension : public application_manager::AppExtension {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
index 56be342b56..aa01b608b4 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
@@ -34,15 +34,14 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
#include <memory>
-#include "application_manager/command_factory.h"
#include "application_manager/application_manager.h"
#include "application_manager/command_factory.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
-#include "rc_rpc_plugin/interior_data_cache.h"
+#include "application_manager/rpc_service.h"
#include "rc_rpc_plugin/commands/rc_command_params.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -64,10 +63,10 @@ class RCCommandFactory : public application_manager::CommandFactory {
app_mngr::commands::Command::CommandSource source) OVERRIDE;
/**
- * @param int32_t command id
- * @param CommandSource source
- * @return return true if command can be create, else return false
- **/
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
virtual bool IsAbleToProcess(
const int32_t,
const application_manager::commands::Command::CommandSource)
@@ -75,12 +74,18 @@ class RCCommandFactory : public application_manager::CommandFactory {
private:
app_mngr::CommandCreator& get_mobile_creator_factory(
- mobile_apis::FunctionID::eType id,
- mobile_apis::messageType::eType message_type) const;
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const;
+ app_mngr::CommandCreator& get_mobile_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const;
+ app_mngr::CommandCreator& get_mobile_notification_creator(
+ const mobile_apis::FunctionID::eType id) const;
app_mngr::CommandCreator& get_hmi_creator_factory(
- hmi_apis::FunctionID::eType id,
- hmi_apis::messageType::eType message_type) const;
+ const hmi_apis::FunctionID::eType id,
+ const hmi_apis::messageType::eType message_type) const;
RCCommandParams params_;
};
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
index cf3c6cd5e4..e85ab758ad 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
@@ -49,18 +49,18 @@ class RCRPCPlugin;
class RCHelpers {
public:
/**
- * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
- * actual module data filed name
- * @return module mapping from enum naming to filed name
- */
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module data filed name
+ * @return module mapping from enum naming to filed name
+ */
static const std::function<std::string(const std::string& module_type)>
GetModuleTypeToDataMapping();
/**
- * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
- * actual module capabilities key
- * @return module mapping from enum naming to capabilities key
- */
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module capabilities key
+ * @return module mapping from enum naming to capabilities key
+ */
static const std::function<std::string(const std::string& module_type)>
GetModuleTypeToCapabilitiesMapping();
@@ -87,10 +87,20 @@ class RCHelpers {
const std::string& module_type);
typedef std::map<application_manager::ApplicationSharedPtr,
- std::vector<std::string> > AppsModules;
+ std::vector<std::string> >
+ AppsModules;
static AppsModules GetApplicationsAllowedModules(
application_manager::ApplicationManager& app_mngr);
+
+ /**
+ * @brief RemoveRedundantGPSDataFromVIDataMsg removes redundant GPS data
+ * params from interior vehicle data response message if one contains radio
+ * station location data
+ * @param msg_params Params of the interior vehicle data response message
+ */
+ static void RemoveRedundantGPSDataFromIVDataMsg(
+ smart_objects::SmartObject& msg_params);
};
-} // rc_rpc_plugin
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
index 18014e6270..b9f922a1be 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
@@ -58,7 +58,7 @@ const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable";
// RadioControlCapabilities
const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable";
-} // strings
+} // namespace strings
namespace result_codes {
const char kSuccess[] = "SUCCESS";
@@ -84,7 +84,7 @@ const char kWrongLanguage[] = "WRONG_LANGUAGE";
const char kGenericError[] = "GENERIC_ERROR";
const char kUserDisallowed[] = "USER_DISALLOWED";
const char kReadOnly[] = "READ_ONLY";
-} // result_codes
+} // namespace result_codes
namespace json_keys {
const char kParams[] = "params";
@@ -100,7 +100,7 @@ const char kMessage[] = "message";
const char kData[] = "data";
const char kAppId[] = "appID";
const char kCode[] = "code";
-} // json_keys
+} // namespace json_keys
namespace message_params {
const char kName[] = "name";
@@ -152,6 +152,7 @@ const char kBand[] = "band";
const char kRdsData[] = "rdsData";
const char kHdRadioEnable[] = "hdRadioEnable";
const char kAvailableHDs[] = "availableHDs";
+const char kAvailableHdChannels[] = "availableHdChannels";
const char kHdChannel[] = "hdChannel";
const char kSignalStrength[] = "signalStrength";
const char kSignalChangeThreshold[] = "signalChangeThreshold";
@@ -176,6 +177,8 @@ const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable";
const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable";
const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable";
const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable";
+const char kClimateEnable[] = "climateEnable";
+const char kClimateEnableAvailable[] = "climateEnableAvailable";
// ClimateControlData struct
// LightControlData
@@ -274,6 +277,6 @@ const char kAskDriver[] = "ASK_DRIVER";
} // namespace enums_value
-} // namespace remote_control
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
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 ae88ed9cc0..303b31f857 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
@@ -35,11 +35,11 @@
#include <memory>
-#include "application_manager/plugin_manager/rpc_plugin.h"
#include "application_manager/command_factory.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
#include "rc_rpc_plugin/interior_data_cache.h"
#include "rc_rpc_plugin/interior_data_manager.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
namespace rc_rpc_plugin {
namespace plugins = application_manager::plugin_manager;
@@ -48,22 +48,22 @@ namespace app_mngr = application_manager;
class RCRPCPlugin : public plugins::RPCPlugin {
public:
/**
- * @brief Command initialization function
- * @param app_manager ApplicationManager
- * @param rpc_service RPCService
- * @param hmi_capabilities HMICapabilities
- * @param policy_handler PolicyHandlerInterface
- * @return true in case initialization was succesful, false otherwise.
- **/
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
bool Init(app_mngr::ApplicationManager& app_manager,
app_mngr::rpc_service::RPCService& rpc_service,
app_mngr::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
/**
- * @param int32_t command id
- * @param CommandSource source
- * @return return true if command can be create, else return false
- **/
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
bool IsAbleToProcess(
const int32_t function_id,
const app_mngr::commands::Command::CommandSource message_source) OVERRIDE;
@@ -85,10 +85,10 @@ class RCRPCPlugin : public plugins::RPCPlugin {
*/
void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
/**
- * @brief OnApplicationEvent Notifies modules on certain application events
- * @param event Event
- * @param application Pointer to application struct
- */
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
void OnApplicationEvent(plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) OVERRIDE;
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 67598b667b..6dfc794648 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
@@ -35,8 +35,8 @@
#include <string>
#include "utils/macro.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "interfaces/HMI_API.h"
#include "rc_rpc_plugin/rc_app_extension.h"
namespace rc_rpc_plugin {
@@ -66,7 +66,7 @@ namespace NotificationTrigger {
* MODULE_ALLOCATION module allocation/deallocation event
*/
enum eType { APP_REGISTRATION = 0, MODULE_ALLOCATION, RC_STATE_CHANGING };
-}
+} // namespace NotificationTrigger
/**
* @brief Resources defines list of resources
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 b359ee4d29..c0ef971235 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
@@ -32,11 +32,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "application_manager/application_impl.h"
#include "rc_rpc_plugin/rc_app_extension.h"
-#include "utils/macro.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/lock.h"
+#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -67,12 +67,12 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
const uint32_t app_id) FINAL;
/**
- * @brief SetResourceState changes resource state. Resource must be acquired
- * beforehand.
- * @param module_type Resource to change its state
- * @param app_id Application aquired resource before
- * @param state State to set for resource
- */
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
void SetResourceState(const std::string& module_type,
const uint32_t app_id,
const ResourceState::eType state) FINAL;
@@ -219,6 +219,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
application_manager::rpc_service::RPCService& rpc_service_;
bool is_rc_enabled_;
};
-} // rc_rpc_plugin
+} // namespace rc_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
index e56f9088bc..a366aa65fa 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
@@ -31,8 +31,8 @@
*/
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
#include "application_manager/event_engine/event.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
namespace rc_rpc_plugin {
namespace commands {
@@ -53,8 +53,9 @@ void RCGetInteriorVehicleDataResponse::Run() {
app_mngr::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
- smart_objects::SmartObject& module_data = (*message_)
- [application_manager::strings::msg_params][message_params::kModuleData];
+ smart_objects::SmartObject& module_data =
+ (*message_)[application_manager::strings::msg_params]
+ [message_params::kModuleData];
if (module_data.keyExists(message_params::kAudioControlData)) {
smart_objects::SmartObject& audio_control_data =
module_data[message_params::kAudioControlData];
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
index 0117003f11..c6cf1b0d5a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,8 +54,9 @@ void RCOnInteriorVehicleDataNotification::Run() {
(*message_)[app_mngr::strings::params][app_mngr::strings::function_id] =
static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID);
- smart_objects::SmartObject& module_data = (*message_)
- [application_manager::strings::msg_params][message_params::kModuleData];
+ smart_objects::SmartObject& module_data =
+ (*message_)[application_manager::strings::msg_params]
+ [message_params::kModuleData];
if (module_data.keyExists(rc_rpc_plugin::message_params::kAudioControlData)) {
smart_objects::SmartObject& audio_control_data =
module_data[message_params::kAudioControlData];
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 91cb6cb7ee..643e98213c 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
@@ -31,10 +31,10 @@
*/
#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/interior_data_manager.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -115,7 +115,8 @@ void RCOnRemoteControlSettingsNotification::Run() {
message_params::kAccessMode)) {
access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
(*message_)[app_mngr::strings::msg_params]
- [message_params::kAccessMode].asUInt());
+ [message_params::kAccessMode]
+ .asUInt());
LOG4CXX_DEBUG(
logger_,
"Setting up access mode : " << AccessModeToString(access_mode));
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 5ce047071c..b85f092252 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
@@ -31,12 +31,12 @@
*/
#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "smart_objects/enum_schema_item.h"
-#include "utils/macro.h"
-#include "json/json.h"
#include "utils/helpers.h"
-#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
namespace rc_rpc_plugin {
namespace commands {
@@ -130,9 +130,9 @@ bool CheckIfButtonExistInRCCaps(
const mobile_apis::ButtonName::eType current_button =
static_cast<mobile_apis::ButtonName::eType>(current_id);
if (current_button == button) {
- LOG4CXX_TRACE(logger_,
- "Button id " << current_button
- << " exist in capabilities");
+ LOG4CXX_TRACE(
+ logger_,
+ "Button id " << current_button << " exist in capabilities");
return true;
}
}
@@ -177,7 +177,8 @@ void ButtonPressRequest::Execute() {
EnumConversionHelper<mobile_apis::ButtonName::eType>::EnumToCString(
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[app_mngr::strings::msg_params]
- [message_params::kButtonName].asUInt()),
+ [message_params::kButtonName]
+ .asUInt()),
&button_name);
const std::string module_type = ModuleType();
@@ -276,10 +277,11 @@ void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) {
}
std::string ButtonPressRequest::ModuleType() {
- mobile_apis::ModuleType::eType module_type = static_cast<
- mobile_apis::ModuleType::eType>(
- (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
- .asUInt());
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleType]
+ .asUInt());
const char* str;
const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
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 4d12b4f375..ded96461f5 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
@@ -31,12 +31,12 @@
*/
#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
+#include "interfaces/MOBILE_API.h"
#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/macro.h"
-#include "interfaces/MOBILE_API.h"
namespace rc_rpc_plugin {
namespace commands {
@@ -109,6 +109,7 @@ void GetInteriorVehicleDataRequest::FilterDisabledModuleData(
module_data[message_params::kHdRadioEnable].asBool() == false) {
module_data.erase(message_params::kHdChannel);
module_data.erase(message_params::kAvailableHDs);
+ module_data.erase(message_params::kAvailableHdChannels);
module_data.erase(message_params::kSisData);
}
}
@@ -297,7 +298,8 @@ void GetInteriorVehicleDataRequest::ProccessSubscription(
static_cast<mobile_apis::ModuleType::eType>(
hmi_response[app_mngr::strings::msg_params]
[message_params::kModuleData]
- [message_params::kModuleType].asUInt()),
+ [message_params::kModuleType]
+ .asUInt()),
&module_type);
if (excessive_subscription_occured_) {
is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type);
@@ -390,10 +392,11 @@ void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription() {
}
std::string GetInteriorVehicleDataRequest::ModuleType() {
- mobile_apis::ModuleType::eType module_type = static_cast<
- mobile_apis::ModuleType::eType>(
- (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
- .asUInt());
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleType]
+ .asUInt());
const char* str;
const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
index a7572f1d62..b1fa8d6ea0 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
@@ -31,6 +31,7 @@
*/
#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -49,6 +50,9 @@ GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {}
void GetInteriorVehicleDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
+
+ RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ (*message_)[app_mngr::strings::msg_params]);
application_manager_.GetRPCService().SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
index 37890b7979..06b5218bb3 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
@@ -31,9 +31,9 @@
*/
#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/macro.h"
@@ -75,6 +75,8 @@ void OnInteriorVehicleDataNotification::Run() {
typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_);
+ RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ (*message_)[app_mngr::strings::msg_params]);
for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
DCHECK(*it);
application_manager::Application& app = **it;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
index edc45670ce..44d302276d 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
@@ -31,14 +31,14 @@
*/
#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_helpers.h"
#include "smart_objects/enum_schema_item.h"
-#include "utils/macro.h"
-#include "json/json.h"
#include "utils/helpers.h"
-#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
namespace rc_rpc_plugin {
namespace commands {
@@ -55,6 +55,7 @@ std::vector<std::string> GetModuleReadOnlyParams(
} else if (enums_value::kRadio == module_type) {
module_ro_params.push_back(kRdsData);
module_ro_params.push_back(kAvailableHDs);
+ module_ro_params.push_back(kAvailableHdChannels);
module_ro_params.push_back(kSignalStrength);
module_ro_params.push_back(kSignalChangeThreshold);
module_ro_params.push_back(kState);
@@ -92,6 +93,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable";
mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable";
mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable";
+ mapping["climateEnable"] = "climateEnableAvailable";
+ mapping["climateEnableAvailable"] = "climateEnableAvailable";
// radio
mapping["band"] = "radioBandAvailable";
@@ -99,7 +102,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["frequencyFraction"] = "radioFrequencyAvailable";
mapping["rdsData"] = "rdsDataAvailable";
mapping["availableHDs"] = "availableHDsAvailable";
- mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["availableHdChannels"] = "availableHdChannelsAvailable";
+ mapping["hdChannel"] = "availableHdChannelsAvailable";
mapping["hdRadioEnable"] = "hdRadioEnableAvailable";
mapping["signalStrength"] = "signalStrengthAvailable";
mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
@@ -175,9 +179,9 @@ capabilitiesStatus GetItemCapability(
const auto it = mapping.find(request_parameter);
if (it == mapping.end()) {
- LOG4CXX_DEBUG(logger_,
- "Parameter " << request_parameter
- << " doesn't exist in capabilities.");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Parameter " << request_parameter << " doesn't exist in capabilities.");
return capabilitiesStatus::missedParam;
}
@@ -525,9 +529,9 @@ void SetInteriorVehicleDataRequest::Execute() {
return;
} else if (module_data[message_params::kAudioControlData].keyExists(
message_params::kKeepContext)) {
- app->set_keep_context(
- module_data[message_params::kAudioControlData]
- [message_params::kKeepContext].asBool());
+ app->set_keep_context(module_data[message_params::kAudioControlData]
+ [message_params::kKeepContext]
+ .asBool());
}
}
@@ -716,21 +720,6 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
const smart_objects::SmartObject& module_type_params =
ControlData(module_data);
const std::string module_type = ModuleType();
- std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
-
- for (auto& it : ro_params) {
- if (module_type_params.keyExists(it)) {
- if (enums_value::kClimate == module_type) {
- module_data[message_params::kClimateControlData].erase(it);
- } else if (enums_value::kRadio == module_type) {
- module_data[message_params::kRadioControlData].erase(it);
- } else {
- continue;
- }
-
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
- }
- }
if (enums_value::kAudio == module_type) {
auto& equalizer_settings = module_data[message_params::kAudioControlData]
@@ -745,6 +734,15 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
}
}
}
+
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ for (const auto& param : ro_params) {
+ if (module_type_params.keyExists(param)) {
+ module_data[data_mapping(module_type)].erase(param);
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << param);
+ }
+ }
}
std::string SetInteriorVehicleDataRequest::ModuleType() {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
index c24529d720..065425dd02 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,11 +31,11 @@
*/
#include "rc_rpc_plugin/commands/rc_command_request.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "application_manager/message_helper.h"
#include "application_manager/hmi_interfaces.h"
-#include "smart_objects/enum_schema_item.h"
+#include "application_manager/message_helper.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "smart_objects/enum_schema_item.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
@@ -264,5 +264,5 @@ void RCCommandRequest::SendGetUserConsent(const std::string& module_type) {
&msg_params,
true);
}
-}
-}
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
index 780aab537b..2c8683f84a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include <chrono>
#include <iostream>
#include <thread>
-#include <chrono>
-#include "rc_rpc_plugin/interior_data_cache_impl.h"
#include "application_manager/smart_object_keys.h"
#include "utils/date_time.h"
#include "utils/logger.h"
@@ -110,17 +110,16 @@ smart_objects::SmartObject MergeArray(const smart_objects::SmartObject& data1,
smart_objects::SmartArray* result_array = result.asArray();
smart_objects::SmartArray* data_array = data2.asArray();
auto data_it = data_array->begin();
- auto find_by_id =
- [](smart_objects::SmartArray* array, const smart_objects::SmartObject& id)
- -> smart_objects::SmartArray::iterator {
- auto it = std::find_if(
- array->begin(),
- array->end(),
- [&id](smart_objects::SmartObject& obj) -> bool {
- return obj[application_manager::strings::id] == id;
- });
- return it;
- };
+ auto find_by_id = [](smart_objects::SmartArray* array,
+ const smart_objects::SmartObject& id)
+ -> smart_objects::SmartArray::iterator {
+ auto it = std::find_if(array->begin(),
+ array->end(),
+ [&id](smart_objects::SmartObject& obj) -> bool {
+ return obj[application_manager::strings::id] == id;
+ });
+ return it;
+ };
for (; data_it != data_array->end(); ++data_it) {
const smart_objects::SmartObject element_id =
@@ -167,9 +166,9 @@ bool InteriorDataCacheImpl::Contains(const std::string& module_type) const {
sync_primitives::AutoLock autolock(cached_data_lock_);
auto it = cached_data_.find(module_type);
const bool contains = it != cached_data_.end();
- LOG4CXX_TRACE(logger_,
- "module_type : " << module_type << " "
- << (contains ? "true" : "false"));
+ LOG4CXX_TRACE(
+ logger_,
+ "module_type : " << module_type << " " << (contains ? "true" : "false"));
return contains;
}
@@ -189,4 +188,4 @@ void InteriorDataCacheImpl::Clear() {
sync_primitives::AutoLock autolock(cached_data_lock_);
cached_data_.clear();
}
-}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
index 0c42f6e3de..cb800a6081 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
@@ -1,8 +1,8 @@
#include "rc_rpc_plugin/interior_data_manager_impl.h"
-#include "rc_rpc_plugin/rc_helpers.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
namespace rc_rpc_plugin {
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
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 ecfc1dcda4..93c230dfc3 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
@@ -31,36 +31,36 @@
*/
#include <iostream>
-#include "rc_rpc_plugin/rc_command_factory.h"
-#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
-#include "rc_rpc_plugin/commands/mobile/button_press_response.h"
-#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
-#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
-#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
-#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
-#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
-#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
-#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h"
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h"
#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_response.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
-#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
namespace application_manager {
-using rc_rpc_plugin::ResourceAllocationManager;
using rc_rpc_plugin::InteriorDataCache;
using rc_rpc_plugin::RCCommandParams;
+using rc_rpc_plugin::ResourceAllocationManager;
template <typename RCCommandType>
class RCCommandCreator : public CommandCreator {
@@ -113,7 +113,7 @@ struct RCCommandCreatorFactory {
}
const RCCommandParams params_;
};
-}
+} // namespace application_manager
namespace rc_rpc_plugin {
using namespace application_manager;
@@ -124,7 +124,8 @@ RCCommandFactory::RCCommandFactory(const RCCommandParams& params)
CommandSharedPtr RCCommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::commands::Command::CommandSource source) {
- if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) {
hmi_apis::messageType::eType message_type =
static_cast<hmi_apis::messageType::eType>(
(*message)[strings::params][strings::message_type].asInt());
@@ -143,7 +144,7 @@ CommandSharedPtr RCCommandFactory::CreateCommand(
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asInt());
- return get_mobile_creator_factory(function_id, message_type)
+ return get_mobile_creator_factory(function_id, message_type, source)
.create(message);
}
}
@@ -153,56 +154,98 @@ bool RCCommandFactory::IsAbleToProcess(
const application_manager::commands::Command::CommandSource message_source)
const {
using app_mngr::commands::Command;
- if (Command::SOURCE_HMI == message_source) {
+ if (Command::SOURCE_HMI == message_source ||
+ Command::SOURCE_SDL_TO_HMI == message_source) {
return get_hmi_creator_factory(
static_cast<hmi_apis::FunctionID::eType>(function_id),
- hmi_apis::messageType::INVALID_ENUM).CanBeCreated();
+ hmi_apis::messageType::INVALID_ENUM)
+ .CanBeCreated();
} else {
- return get_mobile_creator_factory(
- static_cast<mobile_api::FunctionID::eType>(function_id),
- mobile_api::messageType::INVALID_ENUM).CanBeCreated();
+ auto id = static_cast<mobile_apis::FunctionID::eType>(function_id);
+ return get_mobile_command_creator(id,
+ mobile_apis::messageType::INVALID_ENUM)
+ .CanBeCreated() ||
+ get_mobile_notification_creator(id).CanBeCreated();
}
}
-CommandCreator& RCCommandFactory::get_mobile_creator_factory(
- mobile_api::FunctionID::eType id,
- mobile_api::messageType::eType message_type) const {
+CommandCreator& RCCommandFactory::get_mobile_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const {
LOG4CXX_DEBUG(logger_,
- "CreateMobileCommand function_id: " << id << " message_type: "
- << message_type);
+ "get_mobile_command_creator function_id: "
+ << id << " message_type: " << message_type);
RCCommandCreatorFactory rc_factory(params_);
-
switch (id) {
case mobile_apis::FunctionID::ButtonPressID: {
- return mobile_api::messageType::request == message_type
+ return mobile_apis::messageType::request == message_type
? rc_factory.GetCreator<commands::ButtonPressRequest>()
: rc_factory.GetCreator<commands::ButtonPressResponse>();
}
case mobile_apis::FunctionID::GetInteriorVehicleDataID: {
- return mobile_api::messageType::request == message_type
+ return mobile_apis::messageType::request == message_type
? rc_factory
.GetCreator<commands::GetInteriorVehicleDataRequest>()
: rc_factory
.GetCreator<commands::GetInteriorVehicleDataResponse>();
}
case mobile_apis::FunctionID::SetInteriorVehicleDataID: {
- return mobile_api::messageType::request == message_type
+ return mobile_apis::messageType::request == message_type
? rc_factory
.GetCreator<commands::SetInteriorVehicleDataRequest>()
: rc_factory
.GetCreator<commands::SetInteriorVehicleDataResponse>();
}
+ default: {}
+ }
+ return rc_factory.GetCreator<RCInvalidCommand>();
+}
+
+CommandCreator& RCCommandFactory::get_mobile_notification_creator(
+ const mobile_apis::FunctionID::eType id) const {
+ RCCommandCreatorFactory rc_factory(params_);
+ switch (id) {
case mobile_apis::FunctionID::OnInteriorVehicleDataID: {
return rc_factory
.GetCreator<commands::OnInteriorVehicleDataNotification>();
}
- default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ default: {}
}
+ return rc_factory.GetCreator<RCInvalidCommand>();
+}
+
+CommandCreator& RCCommandFactory::get_mobile_creator_factory(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const {
+ RCCommandCreatorFactory rc_factory(params_);
+ switch (message_type) {
+ case mobile_apis::messageType::request: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) {
+ return get_mobile_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_apis::messageType::response: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_mobile_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_apis::messageType::notification: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_mobile_notification_creator(id);
+ }
+ break;
+ }
+ default: {}
+ }
+ return rc_factory.GetCreator<RCInvalidCommand>();
}
CommandCreator& RCCommandFactory::get_hmi_creator_factory(
- hmi_apis::FunctionID::eType id,
- hmi_apis::messageType::eType message_type) const {
+ const hmi_apis::FunctionID::eType id,
+ const hmi_apis::messageType::eType message_type) const {
LOG4CXX_DEBUG(logger_,
"CreateHMICommand function_id: " << id << " message_type: "
<< message_type);
@@ -247,4 +290,4 @@ CommandCreator& RCCommandFactory::get_hmi_creator_factory(
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 0bdec55733..5785e58e5b 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
@@ -1,9 +1,9 @@
#include "rc_rpc_plugin/rc_helpers.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/message.h"
+#include "application_manager/smart_object_keys.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
namespace rc_rpc_plugin {
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
@@ -115,4 +115,30 @@ RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules(
}
return result;
}
+
+void RCHelpers::RemoveRedundantGPSDataFromIVDataMsg(
+ smart_objects::SmartObject& msg_params) {
+ using namespace message_params;
+ using namespace application_manager::strings;
+
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto& module_data = msg_params[kModuleData];
+ if (!module_data.keyExists(kRadioControlData) ||
+ !module_data[kRadioControlData].keyExists(kSisData) ||
+ !module_data[kRadioControlData][kSisData].keyExists(station_location)) {
+ return;
+ }
+
+ auto& location_data =
+ module_data[kRadioControlData][kSisData][station_location];
+ auto new_location_data =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ new_location_data[latitude_degrees] = location_data[latitude_degrees];
+ new_location_data[longitude_degrees] = location_data[longitude_degrees];
+ if (location_data.keyExists(altitude)) {
+ new_location_data[altitude] = location_data[altitude];
+
+ location_data = new_location_data;
+ }
}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
index fd6b4e86ac..026e03eeff 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
@@ -29,16 +29,16 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_command_factory.h"
-#include "rc_rpc_plugin/rc_app_extension.h"
-#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include <memory>
+#include "application_manager/plugin_manager/plugin_keys.h"
#include "rc_rpc_plugin/interior_data_cache_impl.h"
#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
#include "utils/helpers.h"
-#include <memory>
namespace rc_rpc_plugin {
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
@@ -77,7 +77,7 @@ bool RCRPCPlugin::IsAbleToProcess(
}
std::string RCRPCPlugin::PluginName() {
- return "RC RPC Plugin";
+ return plugins::plugin_names::rc_rpc_plugin;
}
application_manager::CommandFactory& RCRPCPlugin::GetCommandFactory() {
@@ -121,8 +121,8 @@ void RCRPCPlugin::OnApplicationEvent(
RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications(
application_manager::ApplicationManager& app_mngr) {
- using application_manager::ApplicationSharedPtr;
using application_manager::ApplicationSet;
+ using application_manager::ApplicationSharedPtr;
ApplicationSet accessor = app_mngr.applications().GetData();
std::vector<ApplicationSharedPtr> result;
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 ecd263b77a..cf1df2cb68 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
@@ -33,14 +33,14 @@
#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
-#include "smart_objects/enum_schema_item.h"
-#include "application_manager/message_helper.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/rc_helpers.h"
#include "json/json.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "smart_objects/enum_schema_item.h"
#include "utils/helpers.h"
namespace rc_rpc_plugin {
@@ -80,16 +80,16 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
}
if (app_id == allocated_resources_[module_type]) {
- LOG4CXX_DEBUG(logger_,
- "App: " << app_id << " is already acquired resource "
- << module_type);
+ LOG4CXX_DEBUG(
+ logger_,
+ "App: " << app_id << " is already acquired resource " << module_type);
return AcquireResult::ALLOWED;
}
if (IsModuleTypeRejected(module_type, app_id)) {
- LOG4CXX_DEBUG(logger_,
- "Driver disallowed app: " << app_id << " to acquire "
- << module_type);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Driver disallowed app: " << app_id << " to acquire " << module_type);
return AcquireResult::REJECTED;
}
@@ -196,8 +196,8 @@ void ConstructOnRCStatusNotificationParams(
namespace strings = application_manager::strings;
namespace message_params = rc_rpc_plugin::message_params;
using smart_objects::SmartObject;
- using smart_objects::SmartType_Map;
using smart_objects::SmartType_Array;
+ using smart_objects::SmartType_Map;
LOG4CXX_AUTO_TRACE(logger_);
auto modules_inserter = [](SmartObject& result_modules) {
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 59d038a790..f2b86f43da 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
@@ -30,22 +30,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
-#include "rc_rpc_plugin/rc_command_factory.h"
-#include "rc_rpc_plugin/rc_app_extension.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "gtest/gtest.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using application_manager::commands::MessageSharedPtr;
+using ::protocol_handler::MessagePriority;
using test::components::application_manager_test::MockApplication;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
@@ -57,17 +61,13 @@ using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using application_manager::commands::MessageSharedPtr;
-using ::protocol_handler::MessagePriority;
namespace {
const int kModuleId = 153u;
const uint32_t kConnectionKey = 1u;
const uint32_t kAppId = 0u;
const std::string kPolicyAppId = "Test";
-}
+} // namespace
namespace rc_rpc_plugin_test {
@@ -129,7 +129,8 @@ class ButtonPressRequestTest
ON_CALL(mock_policy_handler_,
CheckHMIType(kPolicyAppId,
mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
- nullptr)).WillByDefault(Return(true));
+ nullptr))
+ .WillByDefault(Return(true));
ON_CALL(mock_allocation_manager_, is_rc_enabled())
.WillByDefault(Return(true));
}
@@ -194,9 +195,10 @@ TEST_F(ButtonPressRequestTest,
EXPECT_CALL(
mock_allocation_manager_,
SetResourceState(resource, kAppId, rc_rpc_plugin::ResourceState::BUSY));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress), _))
.WillOnce(Return(true));
// Act
@@ -229,9 +231,11 @@ TEST_F(
EXPECT_CALL(mock_allocation_manager_, SetResourceState(resource, kAppId, _))
.Times(2);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_ButtonPress))).Times(0);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress), _))
+ .Times(0);
MessageSharedPtr command_result;
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
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 25dad2dc04..123c22b944 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2019, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,42 +31,43 @@
*/
#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
-#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/message_helper.h"
#include "application_manager/mock_application.h"
+#include "gtest/gtest.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "application_manager/message_helper.h"
-#include "rc_rpc_plugin/rc_command_factory.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/commands/command_request_test.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
-#include <thread>
+#include <stdint.h>
#include <chrono>
+#include <thread>
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::StrictMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
+using application_manager::ApplicationSet;
+using ::application_manager::ApplicationSharedPtr;
using ::application_manager::Message;
using ::application_manager::MessageType;
-using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
-using ::application_manager::ApplicationSharedPtr;
using ::protocol_handler::MessagePriority;
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
-using test::components::commands_test::MockApplicationManager;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
using test::components::commands_test::HMIResultCodeIs;
using test::components::commands_test::MobileResultCodeIs;
+using test::components::commands_test::MockApplicationManager;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::testing::StrictMock;
namespace {
const int32_t kConnectionKey = 5u;
@@ -76,7 +77,7 @@ const int kModuleId = 153u;
const auto module_type = mobile_apis::ModuleType::RADIO;
const int32_t time_frame_of_allowed_requests = 1;
const uint32_t max_request_in_time_frame = 5u;
-}
+} // namespace
namespace rc_rpc_plugin_test {
@@ -193,17 +194,20 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillByDefault(Return(false));
ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
.WillByDefault(Return(true));
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
// Expectations
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
+
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -219,17 +223,19 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillByDefault(Return(false));
ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
.WillByDefault(Return(true));
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
// Expectations
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -242,10 +248,22 @@ TEST_F(
(*mobile_message)[application_manager::strings::msg_params]
[message_params::kModuleType] = module_type;
smart_objects::SmartObject radio_data;
+ smart_objects::SmartObject sis_data;
+ smart_objects::SmartObject gps_data;
+
+ gps_data[application_manager::strings::longitude_degrees] = 1.0;
+ gps_data[application_manager::strings::latitude_degrees] = 1.0;
+
+ sis_data[application_manager::strings::station_short_name] =
+ "dummy_short_name";
+ sis_data[application_manager::strings::station_location] = gps_data;
+
radio_data[message_params::kBand] = enums_value::kAM;
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ radio_data[message_params::kSisData] = sis_data;
+
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
// Expectations
@@ -253,7 +271,7 @@ TEST_F(
.WillOnce(Return(true));
EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
.WillOnce(Return(radio_data));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
MessageSharedPtr command_result;
EXPECT_CALL(
mock_rpc_service_,
@@ -261,6 +279,7 @@ TEST_F(
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -295,9 +314,10 @@ TEST_F(
.WillByDefault(Return(true));
// Expectations
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
EXPECT_CALL(
mock_rpc_service_,
@@ -307,10 +327,11 @@ TEST_F(
EXPECT_CALL(mock_interior_data_cache_, Remove(enums_value::kRadio));
// Act
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -336,9 +357,9 @@ TEST_F(GetInteriorVehicleDataRequestTest,
radio_data[message_params::kBand] = enums_value::kAM;
ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
// Expectations
@@ -347,7 +368,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
.WillOnce(Return(radio_data));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
MessageSharedPtr command_result;
EXPECT_CALL(
mock_rpc_service_,
@@ -355,6 +376,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
// Assert
@@ -374,21 +396,23 @@ TEST_F(
ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
smart_objects::SmartObject rc_capabilities;
ON_CALL(mock_hmi_capabilities_, rc_capability())
.WillByDefault(Return(&rc_capabilities));
// Expectations
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(mock_rpc_service_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE),
- _)).WillOnce((Return(true)));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _))
+ .WillOnce((Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -400,20 +424,21 @@ TEST_F(
ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(false));
// Expectations
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::DISALLOWED), _))
.WillOnce((Return(true)));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -443,9 +468,10 @@ TEST_F(GetInteriorVehicleDataRequestTest,
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
// Act
@@ -453,6 +479,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_response_message);
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -478,9 +505,10 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillByDefault(Return(true));
// Expectations
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
@@ -492,6 +520,7 @@ TEST_F(GetInteriorVehicleDataRequestTest,
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_message);
auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
command->on_event(event);
}
@@ -519,9 +548,10 @@ TEST_F(GetInteriorVehicleDataRequestTest,
.WillByDefault(Return(true));
// Expectations
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _))
.WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
@@ -531,10 +561,11 @@ TEST_F(GetInteriorVehicleDataRequestTest,
EXPECT_CALL(mock_interior_data_cache_, Clear()).Times(0);
// Act
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
@@ -555,9 +586,9 @@ TEST_F(GetInteriorVehicleDataRequestTest,
[message_params::kModuleType] = module_type;
smart_objects::SmartObject radio_data;
radio_data[message_params::kBand] = enums_value::kAM;
- std::shared_ptr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
size_t i = 0;
for (; i <= max_request_in_time_frame; ++i) {
@@ -569,11 +600,14 @@ TEST_F(GetInteriorVehicleDataRequestTest,
StoreRequestToHMITime(enums_value::kRadio));
EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
.WillRepeatedly(Return(false));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData),
+ _))
.WillRepeatedly(Return(true));
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -585,9 +619,133 @@ TEST_F(GetInteriorVehicleDataRequestTest,
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), _))
.WillOnce(Return(false));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
// Act
+ ASSERT_TRUE(command->Init());
command->Run();
}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_AvailableHDChanelsIsArrayWithHDChanels) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ const uint32_t chanel1_index = 1u;
+ const uint32_t chanel2_index = 2u;
+ const uint32_t chanel3_index = 3u;
+
+ const uint32_t expected_array_length = 3u;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kAppId;
+
+ auto& msg_params = (*hmi_response_message)[strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ auto available_hd_chanels =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ available_hd_chanels[0] = chanel1_index;
+ available_hd_chanels[1] = chanel2_index;
+ available_hd_chanels[2] = chanel3_index;
+
+ msg_params[message_params::kModuleData][message_params::kRadioControlData]
+ [message_params::kAvailableHdChannels] = available_hd_chanels;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr message_to_mob = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true)));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ event.set_smart_object(*hmi_response_message);
+ command->on_event(event);
+
+ auto& hd_chanels =
+ (*message_to_mob)[strings::msg_params][message_params::kModuleData]
+ [message_params::kRadioControlData]
+ [message_params::kAvailableHdChannels];
+ const size_t array_length = hd_chanels.length();
+
+ EXPECT_EQ(expected_array_length, array_length);
+
+ EXPECT_EQ(chanel1_index, hd_chanels[0].asUInt());
+ EXPECT_EQ(chanel2_index, hd_chanels[1].asUInt());
+ EXPECT_EQ(chanel3_index, hd_chanels[2].asUInt());
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ClimateEnableAvailable) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kAppId;
+
+ auto& msg_params = (*hmi_response_message)[strings::msg_params];
+
+ auto climate_control_data =
+ smart_objects::SmartObject(smart_objects::SmartType_Boolean);
+ climate_control_data = true;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData]
+ [message_params::kClimateEnableAvailable] = climate_control_data;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ auto message_to_mob = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true)));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ event.set_smart_object(*hmi_response_message);
+ command->on_event(event);
+
+ const bool climate_enable_available =
+ (*message_to_mob)[strings::msg_params][message_params::kModuleData]
+ [message_params::kClimateControlData]
+ [message_params::kClimateEnableAvailable]
+ .asBool();
+
+ EXPECT_TRUE(climate_enable_available);
+}
+
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/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 b344471254..dcf36a34a0 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
@@ -30,36 +30,36 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application.h"
#include "application_manager/commands/commands_test.h"
-#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "application_manager/mock_application.h"
#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
-using ::testing::_;
-using ::testing::Return;
-using ::testing::NiceMock;
-using ::testing::SaveArg;
-using ::testing::Mock;
using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::commands_test::CommandsTest;
using test::components::commands_test::CommandsTestMocks;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::SaveArg;
namespace {
const uint32_t kAppId = 0u;
const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "Test";
const int kModuleId = 153u;
-}
+} // namespace
namespace rc_rpc_plugin_test {
using namespace rc_rpc_plugin;
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 b95725e0b4..6fbff118a4 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
@@ -32,34 +32,34 @@
#include "application_manager/application.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
-#include "gtest/gtest.h"
-#include "interfaces/MOBILE_API.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
-using ::testing::_;
-using ::testing::Return;
-using ::testing::NiceMock;
-using ::testing::SaveArg;
-using ::testing::Mock;
using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::commands_test::CommandsTest;
using test::components::commands_test::CommandsTestMocks;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::SaveArg;
namespace {
const uint32_t kAppId = 0u;
const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "Test";
-}
+} // namespace
namespace rc_rpc_plugin_test {
using namespace rc_rpc_plugin;
@@ -124,8 +124,8 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest,
SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
// Act
std::shared_ptr<
- rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
- CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>
+ command = CreateRCCommand<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
mobile_message);
@@ -144,8 +144,8 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest,
// Act
std::shared_ptr<
- rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
- CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>
+ command = CreateRCCommand<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
mobile_message);
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 567d4b1e20..b28f2c972a 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
@@ -31,59 +31,58 @@
*/
#include "application_manager/application.h"
-#include "application_manager/mock_application.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/rpc_service_impl.h"
-#include "application_manager/mock_request_controller_settings.h"
#include "application_manager/include/application_manager/command_holder_impl.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/request_controller.h"
-#include "application_manager/mock_rpc_plugin_manager.h"
-#include "application_manager/mock_rpc_plugin.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_command_factory.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/message.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
-#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
-#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
-#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
-#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/rpc_service_impl.h"
#include "hmi_message_handler/mock_hmi_message_handler.h"
-#include "interfaces/MOBILE_API.h"
#include "include/test/protocol_handler/mock_protocol_handler.h"
+#include "interfaces/MOBILE_API.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "test/application_manager/mock_application_manager_settings.h"
using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
using ::testing::SaveArg;
-using ::testing::Mock;
-using ::testing::NiceMock;
namespace am = ::application_manager;
using am::ApplicationSet;
-using am::commands::MessageSharedPtr;
using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::plugin_manager::MockRPCPlugin;
+using am::plugin_manager::MockRPCPluginManager;
using am::plugin_manager::RPCPlugin;
-using ::smart_objects::SmartObject;
+using rc_rpc_plugin::RCRPCPlugin;
using rc_rpc_plugin::commands::ButtonPressRequest;
-using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse;
using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentRequest;
-using rc_rpc_plugin::RCRPCPlugin;
-using test::components::commands_test::CommandsTestMocks;
-using test::components::commands_test::CommandRequestTest;
-using am::plugin_manager::MockRPCPluginManager;
-using am::plugin_manager::MockRPCPlugin;
+using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse;
+using ::smart_objects::SmartObject;
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::protocol_handler_test::MockProtocolHandler;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
using test::components::hmi_message_handler_test::MockHMIMessageHandler;
-using test::components::application_manager_test::MockHMICapabilities;
-using test::components::application_manager_test::MockCommandFactory;
using test::components::policy_test::MockPolicyHandlerInterface;
+using test::components::protocol_handler_test::MockProtocolHandler;
namespace rc_rpc_plugin_test {
using namespace rc_rpc_plugin;
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 b1cb8271f5..f7718a7248 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -30,34 +30,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
#include "application_manager/application.h"
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
-#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
-#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "interfaces/MOBILE_API.h"
#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+
+#include <stdint.h>
#include "gtest/gtest.h"
-#include "interfaces/MOBILE_API.h"
-using ::testing::_;
-using ::testing::Return;
-using ::testing::NiceMock;
using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::commands_test::CommandRequestTest;
using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
+using ::testing::_;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::SaveArg;
namespace {
const uint32_t kAppId = 0u;
const int kModuleId = 153u;
const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "Test";
-}
+} // namespace
namespace rc_rpc_plugin_test {
using namespace rc_rpc_plugin;
@@ -90,7 +94,8 @@ class SetInteriorVehicleDataRequestTest
ON_CALL(mock_policy_handler_,
CheckHMIType(kPolicyAppId,
mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
- nullptr)).WillByDefault(Return(true));
+ nullptr))
+ .WillByDefault(Return(true));
ON_CALL(mock_allocation_manager_, is_rc_enabled())
.WillByDefault(Return(true));
}
@@ -139,8 +144,11 @@ TEST_F(SetInteriorVehicleDataRequestTest,
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::CLIMATE;
+ smart_objects::SmartObject climate_control_data(smart_objects::SmartType_Map);
+ climate_control_data[message_params::kFanSpeed] = 10;
+
msg_params[message_params::kModuleData][message_params::kClimateControlData] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
+ climate_control_data;
// Expectations
EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
.WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
@@ -150,14 +158,15 @@ TEST_F(SetInteriorVehicleDataRequestTest,
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::READ_ONLY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
- std::shared_ptr<
- rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -188,15 +197,16 @@ TEST_F(
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
- mobile_apis::Result::OUT_OF_MEMORY),
- application_manager::commands::Command::SOURCE_SDL));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _))
+ .WillOnce(Return(true));
// Act
- std::shared_ptr<
- rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
@@ -224,11 +234,103 @@ TEST_F(
application_manager::commands::Command::SOURCE_SDL));
// Act
- std::shared_ptr<
- rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
+ ASSERT_TRUE(command->Init());
command->Run();
}
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableParams_SUCCESSSendToHMI) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData]
+ [message_params::kClimateEnable] = true;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ MessageSharedPtr message_from_mobile = CreateBasicMessage();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true)));
+
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ auto& msg_params_from_mobile =
+ (*message_from_mobile)[application_manager::strings::msg_params];
+
+ const bool climate_enable =
+ msg_params_from_mobile[message_params::kModuleData]
+ [message_params::kClimateControlData]
+ [message_params::kClimateEnable]
+ .asBool();
+ EXPECT_TRUE(climate_enable);
+}
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableParams_SUCCESSSendToHMI_HDChannel) {
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+
+ msg_params[message_params::kModuleData][message_params::kRadioControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ const std::uint32_t hd_channel = 2u;
+ msg_params[message_params::kModuleData][message_params::kRadioControlData]
+ [message_params::kHdChannel] = hd_channel;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ auto message_from_mobile = CreateBasicMessage();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true)));
+
+ std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ command->Init();
+ command->Run();
+
+ auto& msg_params_from_mobile =
+ (*message_from_mobile)[application_manager::strings::msg_params];
+
+ const uint64_t hd_channel_from_hmi =
+ msg_params_from_mobile[message_params::kModuleData]
+ [message_params::kRadioControlData]
+ [message_params::kHdChannel]
+ .asUInt();
+
+ EXPECT_EQ(hd_channel, hd_channel_from_hmi);
+}
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/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 72ace1432a..828e2eea11 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
-#include "gmock/gmock.h"
#include "application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h"
+#include "gmock/gmock.h"
namespace rc_rpc_plugin_test {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
index e6922a4c83..b7eb4a554a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
@@ -157,4 +157,4 @@ TEST_F(InteriorDataCacheTest, Exist2ModuleTypesRemoveOneAnotherOneLeft) {
EXPECT_EQ(data2, retrieved_data2);
}
-} // rc_rpc_plugin_test
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
index 86c58b9d46..a72b89b9de 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
@@ -32,34 +32,34 @@
#include <algorithm>
#include "gtest/gtest.h"
-#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
-#include "rc_rpc_plugin/rc_module_constants.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_rpc_service.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
using test::components::application_manager_test::MockApplication;
using test::components::application_manager_test::MockApplicationManager;
using test::components::application_manager_test::MockRPCService;
+using ::application_manager::ApplicationSharedPtr;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::protocol_handler::MessagePriority;
using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Eq;
using ::testing::Mock;
using ::testing::NiceMock;
-using ::testing::StrictMock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SaveArg;
-using ::testing::Eq;
-using ::testing::DoAll;
using ::testing::SetArgPointee;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
+using ::testing::StrictMock;
namespace {
const bool kDeviceHandle = 1u;
@@ -72,7 +72,7 @@ const uint32_t kHMIAppId1 = 1u;
const uint32_t kAppId2 = 22u;
const std::string policy_app_id_1_ = "policy_id_1";
const uint32_t kSizeOfModules = 6u;
-}
+} // namespace
namespace rc_rpc_plugin_test {
@@ -665,4 +665,4 @@ TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) {
kHMIAppId1);
}
-} // namespace rc_rpc_plugin
+} // namespace rc_rpc_plugin_test
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 11dd35d061..fdf02b57cb 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
@@ -42,8 +42,12 @@ set (HMI_COMMANDS_SOURCE_DIR
${COMMANDS_SOURCE_DIR}/hmi
)
+set (EXTENSIONS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/extensions
+)
collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(APP_EXTENSIONS "${EXTENSIONS_SOURCE_DIR}")
collect_sources(RPC_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(LIBRARIES
@@ -60,7 +64,7 @@ if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES})
+add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES} ${APP_EXTENSIONS})
target_link_libraries("sdl_rpc_plugin" ${LIBRARIES})
set(INSTALL_DESTINATION bin)
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
index 7b0911fef9..6d8f5e4b2b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
@@ -72,6 +72,6 @@ class ActivateAppRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
index f937b4f63b..93be297bf6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
@@ -72,6 +72,6 @@ class ActivateAppResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
index 4e9e4d54d7..6e7ef63cf4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
@@ -74,6 +74,6 @@ class AddStatisticsInfoNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
index 45acb3a424..54a81f50f3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
@@ -72,6 +72,6 @@ class AllowAllAppsRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
index 41d1c9e752..ffd60a61d8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
@@ -72,6 +72,6 @@ class AllowAllAppsResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
index b3a2d88d7d..c8c0198cc8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
@@ -72,6 +72,6 @@ class AllowAppRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
index 55637e1756..5f6ee670ec 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
@@ -72,6 +72,6 @@ class AllowAppResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
new file mode 100644
index 0000000000..9847f567e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationCloseApplicationRequest command class
+ **/
+class BasicCommunicationCloseApplicationRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationCloseApplicationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationCloseApplicationRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationCloseApplicationRequest class destructor
+ **/
+ ~BasicCommunicationCloseApplicationRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
new file mode 100644
index 0000000000..9576684b77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationCloseApplicationResponse command class
+ **/
+class BasicCommunicationCloseApplicationResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationCloseApplicationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationCloseApplicationResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationCloseApplicationResponse class destructor
+ **/
+ ~BasicCommunicationCloseApplicationResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
index 90160d9953..e90e6cd20f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
#include "utils/macro.h"
-#include "application_manager/application_manager_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
index 2ac1be2580..82ac7b0efa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
@@ -72,6 +72,6 @@ class OnAwakeSDLNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
index a7eb820146..71eb9e4105 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
@@ -74,6 +74,6 @@ class BasicCommunicationSystemRequest
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
index 20483a45e3..c76993cc6f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
@@ -74,6 +74,6 @@ class BasicCommunicationSystemResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h
new file mode 100644
index 0000000000..fd241da3c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BCGetFilePathRequest command class
+ **/
+class BCGetFilePathRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BCGetFilePathRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BCGetFilePathRequest(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 BCGetFilePathRequest class destructor
+ **/
+ virtual ~BCGetFilePathRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BCGetFilePathRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_sdl_RPC_PLUGIN_INCLUDE_sdl_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h
new file mode 100644
index 0000000000..2a6025cbdf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BCGetFilePathResponse command class
+ **/
+class BCGetFilePathResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BCGetFilePathResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BCGetFilePathResponse(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 BCGetFilePathResponse class destructor
+ **/
+ virtual ~BCGetFilePathResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BCGetFilePathResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_
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 5c650fb8e4..9bb3d9a6fb 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
@@ -73,6 +73,6 @@ class ButtonGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
index bf2f15c18a..4431ea1224 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
@@ -74,6 +74,6 @@ class ButtonGetCapabilitiesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
index 635b0579f4..bfcf478930 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
@@ -72,6 +72,6 @@ class ClosePopupRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
index 199b40f070..7477bda854 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
@@ -72,6 +72,6 @@ class ClosePopupResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
index a70bff2553..f59b36fe09 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
@@ -67,6 +67,6 @@ class DecryptCertificateRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
index 88b216eeea..9844ed9165 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
@@ -73,6 +73,6 @@ class DecryptCertificateResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
index fa0efb90e6..bafe9c1e91 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
@@ -75,6 +75,6 @@ class DialNumberRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
index 33d4788eca..9097757ab2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
@@ -76,6 +76,6 @@ class DialNumberResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
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 d771167798..8d3be68539 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
@@ -72,6 +72,6 @@ class GetSystemInfoRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
index 5bf5f41b73..d4f35a4e2a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
-#include "application_manager/commands/response_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -82,6 +82,6 @@ class GetSystemInfoResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
index 93b414c8c4..c3f7453583 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
@@ -91,6 +91,6 @@ class GetUrls : public app_mngr::commands::RequestFromHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
index 1ff38194b8..06af3c6ea5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
@@ -67,6 +67,6 @@ class GetUrlsResponse : public app_mngr::commands::ResponseToHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
index 34c10cedf1..46aa575eb5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
@@ -73,6 +73,6 @@ class MixingAudioSupportedRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
index 5c67666225..32dd23d352 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
@@ -74,6 +74,6 @@ class MixingAudioSupportedResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
index 3f63ef883d..a04488df76 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
@@ -72,6 +72,6 @@ class NaviAlertManeuverRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
index 7d7c4de85e..610af3fbfc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
@@ -72,6 +72,6 @@ class NaviAlertManeuverResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
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 80e948ad25..fa9eee485e 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
@@ -63,8 +63,8 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
virtual ~AudioStartStreamRequest();
/**
- * @brief onTimeOut from requrst Controller
- */
+ * @brief onTimeOut from requrst Controller
+ */
virtual void onTimeOut();
/**
@@ -78,9 +78,9 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
virtual void on_event(const app_mngr::event_engine::Event& event);
/**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set audio_stream_retry_number counter to 0
- */
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set audio_stream_retry_number counter to 0
+ */
void RetryStartSession();
private:
@@ -90,6 +90,6 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
index 926cfc36ed..0f669084cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
@@ -71,6 +71,6 @@ class AudioStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
index 7c5fbbdd3d..9f3aa8c312 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
@@ -71,6 +71,6 @@ class AudioStopStreamRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
index 8eb091dd92..740efc2d19 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
@@ -71,6 +71,6 @@ class AudioStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
index dab5fc1022..0e2ad8b9a3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
@@ -70,6 +70,6 @@ class NaviGetWayPointsRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
index fb93c2c64a..9fef4f041e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
@@ -72,6 +72,6 @@ class NaviGetWayPointsResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
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 404ddc9f00..17d4eb483f 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
@@ -78,6 +78,6 @@ class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
index 7f94312d04..5dcbdd46df 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
@@ -72,6 +72,6 @@ class NaviIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
index 7bdf0e4787..02068779a9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
@@ -72,6 +72,6 @@ class NaviSendLocationRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
index 6a65eb00a1..e322177e45 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
@@ -72,6 +72,6 @@ class NaviSendLocationResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
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 a981b8ff81..437d58861c 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
@@ -84,6 +84,6 @@ class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
index f5f9e7a5ee..3cf3ca17ae 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
@@ -74,6 +74,6 @@ class NaviSetVideoConfigResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
index f64bdf6ce0..efe6743d88 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
@@ -73,6 +73,6 @@ class NaviShowConstantTBTRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
index fd4da08cf0..a77d2b9dbb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
@@ -73,6 +73,6 @@ class NaviShowConstantTBTResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
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 d5aae67661..afad744eb3 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
@@ -47,10 +47,10 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
public app_mngr::event_engine::EventObserver {
public:
/**
- * @brief NaviStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
+ * @brief NaviStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
NaviStartStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -78,9 +78,9 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
virtual void onTimeOut();
/**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set video_stream_retry_number counter to 0
- */
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set video_stream_retry_number counter to 0
+ */
void RetryStartSession();
private:
@@ -90,6 +90,6 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
index b4770e82fe..38d9ba905c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
@@ -71,6 +71,6 @@ class NaviStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
index 400c61ba07..0d14d0595f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
@@ -71,6 +71,6 @@ class NaviStopStreamRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
index 39512ac2bb..10b5ef0f80 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
@@ -71,6 +71,6 @@ class NaviStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
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 052c3c7151..3def06ba9a 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
@@ -71,6 +71,6 @@ class NaviSubscribeWayPointsRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
index 73aab4633f..c424ae0857 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
@@ -74,6 +74,6 @@ class NaviSubscribeWayPointsResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
index f20386a246..be1ccbb45b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
@@ -72,6 +72,6 @@ class NaviUnsubscribeWayPointsRequest
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
index ec4f4eb963..d4f98a871c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
@@ -74,5 +74,5 @@ class NaviUnsubscribeWayPointsResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
index db269a65d3..a80d111dae 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
@@ -72,6 +72,6 @@ class NaviUpdateTurnListRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
index 20295485a3..8f715ac33d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
@@ -73,6 +73,6 @@ class NaviUpdateTurnListResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
index 42bf877f2d..3f9d096625 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -74,6 +74,6 @@ class OnAllowSDLFunctionalityNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
index cc21d699fb..f856ce966e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
@@ -74,6 +74,6 @@ class OnAppActivatedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
index 9b4a6ba5a0..6a7fd00632 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
@@ -74,6 +74,6 @@ class OnAppDeactivatedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
index 6008a8ce51..afed4bfa39 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
@@ -74,6 +74,6 @@ class OnAppPermissionChangedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
index a751b25d85..1f06e38ccd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
@@ -74,6 +74,6 @@ class OnAppPermissionConsentNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
index 3548786d1d..00c75d2c23 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
@@ -74,6 +74,6 @@ class OnAppRegisteredNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
index 097eb1eb28..791374f6f4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
@@ -64,13 +64,13 @@ class OnAppUnregisteredNotification
~OnAppUnregisteredNotification() FINAL;
/**
- * @brief Init overrides and skips replacement of app id with hmi id since
- * 1) at the moment this notification is being sent there is no application
- * registered in application manager
- * 2) hmi id is already used whenever this message is being constructed, so
- * its already there
- * @return True in any case
- */
+ * @brief Init overrides and skips replacement of app id with hmi id since
+ * 1) at the moment this notification is being sent there is no application
+ * registered in application manager
+ * 2) hmi id is already used whenever this message is being constructed, so
+ * its already there
+ * @return True in any case
+ */
bool Init() FINAL;
/**
@@ -84,6 +84,6 @@ class OnAppUnregisteredNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
index cac306f760..8f51a822a2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
@@ -74,6 +74,6 @@ class OnAudioDataStreamingNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h
new file mode 100644
index 0000000000..0e956e8688
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnASSystemCapabilityUpdatedNotification command class
+ **/
+class OnBCSystemCapabilityUpdatedNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnASSystemCapabilityUpdatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnBCSystemCapabilityUpdatedNotification(
+ 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 OnASSystemCapabilityUpdatedNotification class destructor
+ **/
+ virtual ~OnBCSystemCapabilityUpdatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnBCSystemCapabilityUpdatedNotification);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
index b83fe1bfe0..955249bd4b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
@@ -74,6 +74,6 @@ class OnButtonEventNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
index e996c9952c..9de86d1d9c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
@@ -74,6 +74,6 @@ class OnButtonPressNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
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/on_button_subscription_notification.h
index 4ed60f9a07..0a0a8c3c5d 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/on_button_subscription_notification.h
@@ -78,6 +78,6 @@ class OnButtonSubscriptionNotification
} // namespace commands
-} // namespace application_manager
+} // 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_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
index 99c165c12f..7fe0b2a8c3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
@@ -74,6 +74,6 @@ class OnDeviceChosenNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
index 7701e2a601..df1efb4d30 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
@@ -74,6 +74,6 @@ class OnDeviceStateChangedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
index 51fb49c6bc..df8dd3d401 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
@@ -80,6 +80,6 @@ class OnDriverDistractionNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
index cff0a0e617..4fcde5f7d0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
@@ -74,6 +74,6 @@ class OnEventChangedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
index 116932d87a..dbbbe925fe 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
@@ -79,6 +79,6 @@ class OnExitAllApplicationsNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
index 11c397bfe7..403642f64d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
@@ -74,6 +74,6 @@ class OnExitApplicationNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
index 38c5dcf535..7658017364 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
@@ -72,6 +72,6 @@ class OnFileRemovedNotification : public app_mngr::commands::NotificationToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
index 672ded9dcf..bf3a9d530e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
@@ -72,6 +72,6 @@ class OnFindApplications : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
index 85b7ed356e..d215b3d07d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnIgnitionCycleOverNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
index 075dc2cb5c..a07af99df1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnNaviTBTClientStateNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
index 3efde9c8c1..74058e246c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,5 +75,5 @@ class OnNaviWayPointChangeNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
index 331e352795..ede78dd362 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
@@ -66,6 +66,6 @@ class OnPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
index 503013ff58..e64edd51bc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
-#include "application_manager/commands/notification_to_hmi.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/notification_to_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnPutFileNotification : public app_mngr::commands::NotificationToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
index c4adc20090..f540abbf4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnReadyNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
index c1e1b01a18..1ffe038a82 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
@@ -43,10 +43,10 @@ namespace commands {
class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
public:
/**
- * @brief OnReceivedPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
+ * @brief OnReceivedPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
OnReceivedPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -69,6 +69,6 @@ class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
index c5755a364c..68cc5ca487 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
@@ -74,6 +74,6 @@ class OnRecordStartdNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
index ef2b5a34eb..63ea659747 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
-#include "application_manager/commands/notification_to_hmi.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/notification_to_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnResumeAudioSourceNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
index 34fe41de81..a40872b578 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
@@ -72,6 +72,6 @@ class OnSDLCloseNotification : public app_mngr::commands::NotificationToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
index 9fe736a595..00bc6c9a05 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
@@ -74,6 +74,6 @@ class OnSDLConsentNeededNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
index 96f63845e1..6ae9aee1f5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -74,6 +74,6 @@ class OnSDLPersistenceCompleteNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
index da049b1dc4..38bb1db03e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
@@ -72,6 +72,6 @@ class OnStartDeviceDiscovery : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
index 7c61fac041..7a6e8b871a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
@@ -74,6 +74,6 @@ class OnStatusUpdateNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
index d4c940bac7..a239203053 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -76,6 +76,6 @@ class OnSystemContextNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
index 76325b078f..3993eefd8b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
@@ -73,6 +73,6 @@ class OnSystemErrorNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
index 1e4046b83b..a5ab636464 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
@@ -74,6 +74,6 @@ class OnSystemInfoChangedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
index 1e1e1818b8..6f9f63b517 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnSystemRequestNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
index 0beba8dc6b..799af1e134 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
+#include "application_manager/application_manager.h"
#include "application_manager/commands/notification_from_hmi.h"
-#include "application_manager/application_manager_impl.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
index 33c7d98b6f..0462925f71 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
@@ -74,6 +74,6 @@ class OnTTSLanguageChangeNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_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
index 70050a667e..c8bd159064 100644
--- 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
@@ -78,6 +78,6 @@ class OnTTSResetTimeoutNotification
} // namespace commands
-} // namespace application_manager
+} // 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_tts_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
index 93dac3f292..315acf3a5f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
@@ -73,6 +73,6 @@ class OnTTSStartedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
index 362e96f4be..0dafd61c58 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
@@ -73,6 +73,6 @@ class OnTTSStoppedNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
index 0cc4e9e772..f468ce5b0a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
@@ -72,6 +72,6 @@ class OnUICommandNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
index c487894770..31b7eef3a3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -79,6 +79,6 @@ class OnUIKeyBoardInputNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
index f30b8573aa..2495aa2b96 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
@@ -74,6 +74,6 @@ class OnUILanguageChangeNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
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_ui_reset_timeout_notification.h
index bbdf4d04ef..1c87f82349 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_ui_reset_timeout_notification.h
@@ -78,6 +78,6 @@ class OnUIResetTimeoutNotification
} // namespace commands
-} // namespace application_manager
+} // 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_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
index 5c7dd0128b..26c25f437a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -79,6 +79,6 @@ class OnUITouchEventNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
index 2942c36053..d638629b3a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
@@ -72,6 +72,6 @@ class OnUpdateDeviceList : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_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
index ed0b1572ff..c848233497 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIAccPedalPositionNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index cc81160ccb..0cb3e04f4e 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIBeltStatusNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 2b46b69f55..6ab920204d 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIBodyInformationNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 05da9a775d..b3afeb82b3 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIDeviceStatusNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 6640d7953a..a1885c5e29 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIDriverBrakingNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index f8c0526f8c..feb6cc6060 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIEngineTorqueNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 900aecd845..734420aaee 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIExternalTemperatureNotification
} // namespace commands
-} // namespace application_manager
+} // 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_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
index 7374de9ad9..a5588901f7 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/on_vi_fuel_level_notification.h
@@ -33,8 +33,8 @@
#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_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -74,6 +74,6 @@ class OnVIFuelLevelNotification
} // namespace commands
-} // namespace application_manager
+} // 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_
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
index a705fcbd04..5ed661cdbf 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIFuelLevelStateNotification
} // namespace commands
-} // namespace application_manager
+} // 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_gps_data_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
index 984e1e4c0b..70ee5f6c00 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/on_vi_gps_data_notification.h
@@ -33,8 +33,8 @@
#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_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVIGpsDataNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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_
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
index 1dfda8a9e0..5ef1e3ed92 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIHeadLampStatusNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index fd8743907c..7bb7756fc5 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIInstantFuelConsumptionNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 25ace2821d..cdebc99768 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVIMyKeyNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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_odometer_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
index ad141e733c..1da26dd316 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/on_vi_odometer_notification.h
@@ -33,8 +33,8 @@
#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_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -74,6 +74,6 @@ class OnVIOdometerNotification
} // namespace commands
-} // namespace application_manager
+} // 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_
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
index 95fb873957..7d03c62633 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVIPrndlNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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
index d4b121a96f..60a0ce0782 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVIRpmNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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
index 4afaafc9ff..4920fbd661 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVISpeedNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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
index 0d0aeadad8..cff99ecf8e 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVISteeringWheelAngleNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index c358ed37e9..0399780869 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVITirePressureNotification
} // namespace commands
-} // namespace application_manager
+} // 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
index 75062a51e1..60b686683f 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVIVinNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // 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
index de7a5dfc9e..a6e1ba9921 100644
--- 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
@@ -33,8 +33,8 @@
#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/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -75,6 +75,6 @@ class OnVIWiperStatusNotification
} // namespace commands
-} // namespace application_manager
+} // 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/on_video_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
index 7a7cf3cd96..6d6d4a69db 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
@@ -74,6 +74,6 @@ class OnVideoDataStreamingNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
index 3ef21fc568..58ea2e07b5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class OnVRCommandNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
index e6bd39d46e..f583d1e2fe 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
@@ -74,6 +74,6 @@ class OnVRLanguageChangeNotification
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
index abca9db91d..98ed40101b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
@@ -72,6 +72,6 @@ class OnVRStartedNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
index 9b53214f8f..e16b440da7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
@@ -72,6 +72,6 @@ class OnVRStoppedNotification : public app_mngr::commands::NotificationFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_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 8f94d4876a..57a90955f4 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
@@ -72,6 +72,6 @@ class RCGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
index dec31c9ea1..e0c305f796 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
@@ -72,6 +72,6 @@ class RCGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
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 3ba614f823..305a866659 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
@@ -89,6 +89,6 @@ class RCIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
index 93f30e795c..5f4af23527 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
@@ -72,6 +72,6 @@ class RCIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
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 e97312b881..2751104486 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
-#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/request_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -109,6 +109,6 @@ class SDLActivateAppRequest : public app_mngr::commands::RequestFromHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
index 7a3f5157da..fd8b885e88 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
@@ -71,6 +71,6 @@ class SDLActivateAppResponse : public app_mngr::commands::ResponseToHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
index 61426e0af3..acf390cfbc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -73,6 +73,6 @@ class SDLGetListOfPermissionsRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
index e2556bac3d..4fc1775c72 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -74,6 +74,6 @@ class SDLGetListOfPermissionsResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
index b6376bacc6..fae0b6480d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
@@ -71,6 +71,6 @@ class SDLGetStatusUpdateRequest : public app_mngr::commands::RequestFromHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
index 4e6da22370..1c10142c99 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
@@ -72,6 +72,6 @@ class SDLGetStatusUpdateResponse : public app_mngr::commands::ResponseToHMI {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
index 75902e2733..18ad1fa535 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/request_from_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -74,6 +74,6 @@ class SDLGetUserFriendlyMessageRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
index a02d6894e3..101a13b218 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -74,6 +74,6 @@ class SDLGetUserFriendlyMessageResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
index f164aed775..e330e847b0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
@@ -43,10 +43,10 @@ namespace commands {
class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI {
public:
/**
- * @brief SDLPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
+ * @brief SDLPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
SDLPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -66,6 +66,6 @@ class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
index 63f33477b6..ce7125f251 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
@@ -69,6 +69,6 @@ class SDLPolicyUpdateResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
index 229ed92947..0905e90b45 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
@@ -73,6 +73,6 @@ class TTSChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
index 8462178283..1988a7ee62 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
@@ -74,6 +74,6 @@ class TTSChangeRegistratioResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_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 df6cf3b4a4..d636485915 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
@@ -72,6 +72,6 @@ class TTSGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
index 7919f213a4..5c9b60e2f8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
@@ -73,6 +73,6 @@ class TTSGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
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 09345c02d7..73ef8c5234 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
@@ -72,6 +72,6 @@ class TTSGetLanguageRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
index e52dbf1ada..b29b3e7314 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
@@ -72,6 +72,6 @@ class TTSGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
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 c42d0257d3..a24a6446b3 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
@@ -74,6 +74,6 @@ class TTSGetSupportedLanguagesRequest
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
index cc24db22b9..25850de5f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
@@ -74,6 +74,6 @@ class TTSGetSupportedLanguagesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
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 b7dffd5bde..dd360eeb4a 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
@@ -88,6 +88,6 @@ class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
index 268edd0eeb..881cd98179 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
@@ -72,6 +72,6 @@ class TTSIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
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 f416b3a787..009ee8f0be 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
@@ -73,6 +73,6 @@ class TTSSetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
index ff5622296c..d7ac422e57 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
@@ -74,6 +74,6 @@ class TTSSetGlobalPropertiesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
index 9e8915a440..efb67243fa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
@@ -72,6 +72,6 @@ class TTSSpeakRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
index e4b2c8adbd..d516a9df1e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
@@ -72,6 +72,6 @@ class TTSSpeakResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
index 8eb6a66c95..f3ce24d928 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
@@ -72,6 +72,6 @@ class TTSStopSpeakingRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
index d433fe2280..6399193ae6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
@@ -72,6 +72,6 @@ class TTSStopSpeakingResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
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 e5d2483576..2d1e84fbec 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
@@ -72,6 +72,6 @@ class UIAddCommandRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
index 90a9666561..cf69368551 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
@@ -72,6 +72,6 @@ class UIAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
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 5de5e41cd6..0cd120b3cd 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
@@ -72,6 +72,6 @@ class UIAddSubmenuRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
index 20f830be27..5e951600bd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
@@ -72,6 +72,6 @@ class UIAddSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
index 6235a51c7d..3c0423e35e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
@@ -72,6 +72,6 @@ class UIAlertRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
index b43185af78..0392da0c7b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
@@ -72,6 +72,6 @@ class UIAlertResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
index c504c55727..44440bf49d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
@@ -73,6 +73,6 @@ class UIChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
index d7fca83d3e..e0077744a1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
@@ -73,6 +73,6 @@ class UIChangeRegistratioResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
index ecc0b44495..4af8b91793 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
@@ -72,6 +72,6 @@ class UIDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
index f9601b7491..1eda0d362a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
@@ -72,6 +72,6 @@ class UIDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
index 3161c84b7c..9a7cd97ec7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
@@ -72,6 +72,6 @@ class UIDeleteSubmenuRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
index 7c73a53c3e..3edb8489e0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
@@ -72,6 +72,6 @@ class UIDeleteSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
index 8d34e1852b..90bf6f7dbc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -73,6 +73,6 @@ class UIEndAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
index b1c3bfd87a..69a7959e53 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -73,6 +73,6 @@ class UIEndAudioPassThruResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
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 47782cc7a9..58d8d0f732 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
@@ -72,6 +72,6 @@ class UIGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
index 421844560d..d83d5f211b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
@@ -72,6 +72,6 @@ class UIGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
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 7c82584178..842a97a717 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
@@ -72,6 +72,6 @@ class UIGetLanguageRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
index 7354e87ee4..ec02b6fde9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
@@ -72,6 +72,6 @@ class UIGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
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 7fd456b92b..42ea555358 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
@@ -73,6 +73,6 @@ class UIGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
index 26d8e98892..45137ba518 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
@@ -74,6 +74,6 @@ class UIGetSupportedLanguagesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
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 2e7806cd2b..18536032b7 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
@@ -88,6 +88,6 @@ class UIIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
index f2b4f201f3..790c0115aa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
@@ -72,6 +72,6 @@ class UIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
index 6d4e870228..be7d384583 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -73,6 +73,6 @@ class UIPerformAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
index e36a292573..05f2cc84fd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -74,6 +74,6 @@ class UIPerformAudioPassThruResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
index ff4540de23..15cec6c17e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
@@ -73,6 +73,6 @@ class UIPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
index caf5716e18..2d13e15ad2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
@@ -74,6 +74,6 @@ class UIPerformInteractionResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
index f5acf41c8d..bc25259662 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
@@ -73,6 +73,6 @@ class UIScrollableMessageRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
index e46265c0e4..f7f92600cd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
@@ -73,6 +73,6 @@ class UIScrollableMessageResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
index 4e260a99ff..56ffe40c21 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
@@ -73,6 +73,6 @@ class UISendHapticDataRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
index 1bf38939be..439c2f2682 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
@@ -73,6 +73,6 @@ class UISendHapticDataResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
index ea526df135..a7d07628e3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
@@ -72,6 +72,6 @@ class UISetAppIconRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
index af2c4fafea..3e4b338439 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
@@ -72,6 +72,6 @@ class UISetAppIconResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
index f60f7325fd..446b77b997 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
@@ -71,6 +71,6 @@ class UiSetDisplayLayoutRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
index ce404a4049..ade6aa1c13 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
@@ -73,6 +73,6 @@ class UiSetDisplayLayoutResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
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 44e8bba450..8df60a318a 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
@@ -73,6 +73,6 @@ class UISetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
index a9c27a423b..a189093fc7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
@@ -74,6 +74,6 @@ class UISetGlobalPropertiesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
index 24f4d76d89..b1b196a25f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
@@ -73,6 +73,6 @@ class UISetMediaClockTimerRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
index c664bd04f9..23b6d3aefa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
@@ -74,6 +74,6 @@ class UISetMediaClockTimerResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
index 7ba950d530..6024243481 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
@@ -72,6 +72,6 @@ class UIShowRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
index f9f7a61056..4d19667153 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
@@ -72,6 +72,6 @@ class UIShowResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
index 3de1b4e775..c41e02b44f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
@@ -72,6 +72,6 @@ class UISliderRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
index 17d1f8a8ed..f4e4465568 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
@@ -72,6 +72,6 @@ class UISliderResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
index dc0166e33f..b352a3b273 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
@@ -72,6 +72,6 @@ class UpdateAppListRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
index 2e3bb79233..a31621dbd5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
@@ -72,6 +72,6 @@ class UpdateAppListResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
index c4c9f11e06..db4f265a9f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/request_to_hmi.h"
#include "application_manager/event_engine/event_observer.h"
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -92,6 +92,6 @@ class UpdateDeviceListRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
index c33518a545..5f7afed2c3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
@@ -72,6 +72,6 @@ class UpdateDeviceListResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
index e30b045fcb..3e001b2582 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
-#include "application_manager/commands/request_to_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/request_to_hmi.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class UpdateSDLRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
index f71921ea3a..a6fc917872 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
@@ -72,6 +72,6 @@ class UpdateSDLResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_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 0abb37adbc..b40245256e 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
@@ -72,6 +72,6 @@ class VRAddCommandRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
index 5f9c99a483..dc123bc82f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
@@ -72,6 +72,6 @@ class VRAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
index 4af28cb542..418842395d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
@@ -73,6 +73,6 @@ class VRChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
index a80df0968b..08f3dfa501 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
@@ -74,6 +74,6 @@ class VRChangeRegistrationResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
index 0ed9521ec5..2e1aa7c0d1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
@@ -72,6 +72,6 @@ class VRDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
index 63efcab355..a7d45ed5ea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
@@ -72,6 +72,6 @@ class VRDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
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 f8ac83af58..254d00452f 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
@@ -72,6 +72,6 @@ class VRGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
index 9c9bb55b1b..781e38cda2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
@@ -72,6 +72,6 @@ class VRGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
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 e764cbef91..441795cfb5 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
@@ -72,6 +72,6 @@ class VRGetLanguageRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
index 470fe3ebdc..2bc08e5173 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
@@ -72,6 +72,6 @@ class VRGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
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 8d9e9e2a61..ad87415a87 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
@@ -73,6 +73,6 @@ class VRGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
index 735844cd99..16a67d6468 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
@@ -74,6 +74,6 @@ class VRGetSupportedLanguagesResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
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 0b580f6c1d..2dba80065a 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
@@ -89,6 +89,6 @@ class VRIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
index 42c47f5077..f901147094 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
@@ -72,6 +72,6 @@ class VRIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
index 6f206c010f..8cbd2e346e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
@@ -73,6 +73,6 @@ class VRPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
index 9e8599419f..60cb4cb80c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
@@ -74,6 +74,6 @@ class VRPerformInteractionResponse
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
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 745fb3ec18..8cac0d686d 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
@@ -164,6 +164,6 @@ class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
index fb3f172b0b..811bda2cc7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
@@ -73,6 +73,6 @@ class AddCommandResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
index 37ba9a5990..2da94ae67e 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
@@ -92,6 +92,6 @@ class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
index 253556f899..ba15f04cd0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
@@ -73,6 +73,6 @@ class AddSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
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 93f716cb65..8b7e86fb3f 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
@@ -105,6 +105,6 @@ class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
index 8b21aa64eb..2f21fadb54 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
@@ -73,6 +73,6 @@ class AlertManeuverResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
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 e34653daf4..dfc7b73487 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
@@ -149,6 +149,6 @@ class AlertRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
index 4ae95fb979..51de24fd41 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
@@ -73,6 +73,6 @@ class AlertResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
index bd5c34ebd1..01f20a68e3 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
@@ -38,8 +38,8 @@
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/pending.h"
-#include "utils/macro.h"
#include "utils/custom_string.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -146,11 +146,11 @@ class ChangeRegistrationRequest
std::string& ResponseInfo);
/**
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * @return TRUE if there is coincidence of VR, otherwise FALSE
- */
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
struct CoincidencePredicateVR {
CoincidencePredicateVR(const custom_str::CustomString& newItem)
: newItem_(newItem) {}
@@ -186,6 +186,6 @@ class ChangeRegistrationRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
index 4cb8c394c7..8c3b7f0be3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
@@ -75,6 +75,6 @@ class ChangeRegistrationResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
new file mode 100644
index 0000000000..b965e880b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CloseApplicationRequest command class
+ **/
+class CloseApplicationRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief CloseApplicationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CloseApplicationRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CloseApplicationRequest class destructor
+ **/
+ ~CloseApplicationRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CloseApplicationRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
new file mode 100644
index 0000000000..c7b649f4e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CloseApplicationResponse command class
+ **/
+class CloseApplicationResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief CloseApplicationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CloseApplicationResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief CloseApplicationResponse class destructor
+ **/
+ ~CloseApplicationResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CloseApplicationResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_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 1ad1c07b2a..a1bc866347 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
@@ -162,11 +162,11 @@ class CreateInteractionChoiceSetRequest
app_mngr::ApplicationConstSharedPtr app);
/*
- * @brief Predicate for using with CheckChoiceSet method to compare choice ID
- *param
- *
- * return TRUE if there is coincidence of choice ID, otherwise FALSE
- */
+ * @brief Predicate for using with CheckChoiceSet method to compare choice ID
+ *param
+ *
+ * return TRUE if there is coincidence of choice ID, otherwise FALSE
+ */
struct CoincidencePredicateChoiceID {
CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {}
@@ -178,11 +178,11 @@ class CreateInteractionChoiceSetRequest
};
/*
- * @brief Predicate for using with CheckChoiceSet method to compare menu name
- *param
- *
- * return TRUE if there is coincidence of menu name, otherwise FALSE
- */
+ * @brief Predicate for using with CheckChoiceSet method to compare menu name
+ *param
+ *
+ * return TRUE if there is coincidence of menu name, otherwise FALSE
+ */
struct CoincidencePredicateMenuName {
CoincidencePredicateMenuName(const std::string& newItem)
: newItem_(newItem) {}
@@ -195,11 +195,11 @@ class CreateInteractionChoiceSetRequest
};
/*
- * @brief Predicate for using with CheckChoiceSet method to compare VR commands
- *param
- *
- * return TRUE if there is coincidence of VR commands, otherwise FALSE
- */
+ * @brief Predicate for using with CheckChoiceSet method to compare VR
+ *commands param
+ *
+ * return TRUE if there is coincidence of VR commands, otherwise FALSE
+ */
struct CoincidencePredicateVRCommands {
CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
: newItem_(newItem) {}
@@ -219,7 +219,7 @@ class CreateInteractionChoiceSetRequest
*
* return Return TRUE if there are similar VR synonyms in choice set,
* otherwise FALSE
- */
+ */
bool compareSynonyms(
const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
const ns_smart_device_link::ns_smart_objects::SmartObject& choice2);
@@ -232,7 +232,7 @@ class CreateInteractionChoiceSetRequest
*
* return Return TRUE if there are similar VR synonyms in choice set,
* otherwise FALSE
- */
+ */
static bool compareStr(
const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
const ns_smart_device_link::ns_smart_objects::SmartObject& str2);
@@ -273,6 +273,6 @@ class CreateInteractionChoiceSetRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
index 76718bc2c3..0bfc0e5cdf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
@@ -75,6 +75,6 @@ class CreateInteractionChoiceSetResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
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 a21b1928d0..45864ca3aa 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
@@ -114,6 +114,6 @@ class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
index f81f119792..a91012a934 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
@@ -73,6 +73,6 @@ class DeleteCommandResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
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 02cd0086b6..8e4d63df4a 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
@@ -78,6 +78,6 @@ class DeleteFileRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
index fbdc70c9bc..8fbc79ba9f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
@@ -73,6 +73,6 @@ class DeleteFileResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
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 4dec11a67b..c1d8759962 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,8 @@
#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 "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -90,6 +90,6 @@ class DeleteInteractionChoiceSetRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
index 0fce16ea9f..bd67f9c556 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
@@ -75,6 +75,6 @@ class DeleteInteractionChoiceSetResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
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 c947fda78a..2f85065ee7 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -104,6 +104,6 @@ class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
index e5b0c58a34..c569d61258 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
@@ -73,6 +73,6 @@ class DeleteSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
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 3e313602c7..750288f5e8 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
@@ -61,13 +61,13 @@ class DialNumberRequest : public app_mngr::commands::CommandRequestImpl {
~DialNumberRequest() OVERRIDE;
/**
- * @brief Initialize request params
+ * @brief Initialize request params
**/
bool Init() OVERRIDE;
/**
- * @brief Execute command
- **/
+ * @brief Execute command
+ **/
void Run() OVERRIDE;
/**
@@ -90,6 +90,6 @@ class DialNumberRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
index 6181231458..9c47537c6f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
@@ -73,6 +73,6 @@ class DialNumberResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
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 319a20958e..1c18de3237 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
@@ -80,6 +80,6 @@ class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
index e2a667f272..1003d9d2d7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
@@ -74,6 +74,6 @@ class EndAudioPassThruResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
index b780daaf03..6516d3cef1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
@@ -72,6 +72,6 @@ class GenericResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
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
new file mode 100644
index 0000000000..3d74a80dc2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h
@@ -0,0 +1,31 @@
+#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"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetCloudAppPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ GetCloudAppPropertiesRequest(
+ 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);
+ virtual ~GetCloudAppPropertiesRequest();
+ virtual void Run();
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetCloudAppPropertiesRequest);
+}; // GetCloudAppPropertiesRequest
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h
new file mode 100644
index 0000000000..f716c7dcb5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h
@@ -0,0 +1,31 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetCloudAppPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ GetCloudAppPropertiesResponse(
+ 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);
+ virtual ~GetCloudAppPropertiesResponse();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetCloudAppPropertiesResponse);
+
+}; // GetCloudAppPropertiesResponse
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_
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
new file mode 100644
index 0000000000..d4182ea004
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h
@@ -0,0 +1,87 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_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/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetFileRequest command class
+ **/
+class GetFileRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetFileRequest(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 GetFileRequest class destructor
+ **/
+ virtual ~GetFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ bool GetFilePath(std::string& file_path, bool& forward_to_hmi);
+
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ private:
+ std::string file_name_;
+ mobile_apis::FileType::eType file_type_;
+ uint32_t length_;
+ uint32_t offset_;
+
+ DISALLOW_COPY_AND_ASSIGN(GetFileRequest);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h
new file mode 100644
index 0000000000..bc191d224c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetFileResponse command class
+ **/
+class GetFileResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetFileResponse(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 GetFileResponse class destructor
+ **/
+ virtual ~GetFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetFileResponse);
+};
+
+} // namespace commands
+
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_
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 b8da061870..a5d1611f02 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
@@ -61,7 +61,7 @@ class GetSystemCapabilityRequest
DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
}; // GetSystemCapabilityRequest
-} // commands
-} // application_manager
+} // namespace commands
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
index 9fa954c89f..61079b3ac2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
@@ -60,7 +60,7 @@ class GetSystemCapabilityResponse
DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse);
}; // GetSystemCapabilityResponse
-} // commands
-} // application_manager
+} // namespace commands
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
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 7197874475..ec656820e5 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
@@ -76,6 +76,6 @@ class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
index bb480a7ac0..1b8f055e9c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
@@ -71,6 +71,6 @@ class GetWayPointsResponse : public app_mngr::commands::CommandResponseImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
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 53d75819f8..d98fa433b4 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
@@ -73,6 +73,6 @@ class ListFilesRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
index 1b3cdf1b02..d259b27ecf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
@@ -73,6 +73,6 @@ class ListFilesResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
index ba01d4bb28..28508d386c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
@@ -75,6 +75,6 @@ class OnAppInterfaceUnregisteredNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
index e3410bd873..a6de6b929c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
@@ -77,6 +77,6 @@ class OnAudioPassThruNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
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 6afdc0e1cf..afde9bac92 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
-#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -87,6 +87,6 @@ class OnButtonEventNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
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 fe9bc449be..57fda49be7 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
-#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -86,6 +86,6 @@ class OnButtonPressNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
index 367b280e73..76ee0b4052 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
@@ -77,6 +77,6 @@ class OnCommandNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
index 82e6097d84..9c7fb5e91b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
@@ -79,6 +79,6 @@ class OnDriverDistractionNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
index 76c9cf34c5..b62f74e199 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
@@ -76,6 +76,6 @@ class OnHashChangeNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
index 0e1919676b..ef040de3de 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
@@ -74,6 +74,6 @@ class OnHMIStatusNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
index 12e3b54be9..6f3ef40076 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
-#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"
@@ -77,6 +77,6 @@ class OnHMIStatusNotificationFromMobile
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
index d34815ff2f..52f6e5d487 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
@@ -78,6 +78,6 @@ class OnKeyBoardInputNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
index b234b93796..1bc1e94b1f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
@@ -75,6 +75,6 @@ class OnLanguageChangeNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
index f586a0d36c..eca3cebf31 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
@@ -75,6 +75,6 @@ class OnPermissionsChangeNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h
new file mode 100644
index 0000000000..f29c7dcf2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h
@@ -0,0 +1,84 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
+
+#include <vector>
+#include "application_manager/commands/command_notification_impl.h"
+#include "policy/policy_table/enums.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnSystemCapabilityUpdatedNotification class
+ **/
+class OnSystemCapabilityUpdatedNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ typedef std::vector<uint8_t> BinaryMessage;
+ /**
+ * @brief OnSystemCapabilityUpdatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemCapabilityUpdatedNotification(
+ 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 OnSystemCapabilityUpdatedNotification class destructor
+ **/
+ ~OnSystemCapabilityUpdatedNotification() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemCapabilityUpdatedNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
index b369ad38f2..a0148a4abd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#include <vector>
#include "application_manager/commands/command_notification_impl.h"
#include "policy/policy_table/enums.h"
-#include <vector>
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -88,6 +88,6 @@ class OnSystemRequestNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
index 39b12fea15..cbb7525092 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
@@ -75,6 +75,6 @@ class OnTBTClientStateNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
index 858759b793..48872d9b27 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
@@ -77,6 +77,6 @@ class OnTouchEventNotification
} // namespace mobile
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
index c379fceb02..ed7cbccf4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
@@ -71,5 +71,5 @@ class OnWayPointChangeNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
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 1a4c248a02..434b6de028 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
@@ -35,8 +35,8 @@
#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 "utils/macro.h"
#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -184,6 +184,6 @@ class PerformAudioPassThruRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
index 6654762067..300ea6531f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
@@ -75,6 +75,6 @@ class PerformAudioPassThruResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
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 2d4cbc9afc..0572679c85 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
@@ -36,8 +36,8 @@
#include <string>
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -246,6 +246,6 @@ class PerformInteractionRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
index 6bb9135dcc..113757a1ad 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
@@ -75,6 +75,6 @@ class PerformInteractionResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
index 2783280f87..b3e04f7796 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
@@ -34,9 +34,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
+#include "application_manager/application_manager.h"
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
-#include "application_manager/application_manager.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -76,11 +76,11 @@ class PutFileRequest : public app_mngr::commands::CommandRequestImpl {
mobile_apis::FileType::eType file_type_;
bool is_persistent_file_;
- void SendOnPutFileNotification();
+ void SendOnPutFileNotification(bool is_system_file);
DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
index 22dbf1b5d5..348a217eba 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
@@ -73,6 +73,6 @@ class PutFileResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
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 542fdac5f8..8a80db9cdf 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
@@ -36,8 +36,8 @@
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
-#include "utils/macro.h"
#include "utils/custom_string.h"
+#include "utils/macro.h"
namespace policy {
struct DeviceInfo;
@@ -124,11 +124,14 @@ class RegisterAppInterfaceRequest
/**
* @brief Sends OnAppRegistered notification to HMI
*
- *@param application_impl application with changed HMI status
- *
+ * @param app application with changed HMI status
+ * @param resumption If true, resumption-related parameters will be sent to
+ *the HMI
+ * @param need_restore_vr If resumption is true, whether or not VR commands
+ *should be resumed
**/
void SendOnAppRegisteredNotificationToHMI(
- const app_mngr::Application& application_impl,
+ app_mngr::ApplicationConstSharedPtr app,
bool resumption = false,
bool need_restore_vr = false);
/*
@@ -141,18 +144,21 @@ class RegisterAppInterfaceRequest
/*
* @brief Check new application parameters (name, tts, vr) for
* coincidence with already known parameters of registered applications
+ * @param out_duplicate_apps In the case other apps was found with duplicate
+ * names, this field will be filled with a list of said apps
*
* return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
* otherwise appropriate error code returns
- */
- mobile_apis::Result::eType CheckCoincidence();
+ */
+ mobile_apis::Result::eType CheckCoincidence(
+ std::vector<app_mngr::ApplicationSharedPtr>& out_duplicate_apps);
/*
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * return TRUE if there is coincidence of VR, otherwise FALSE
- */
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * return TRUE if there is coincidence of VR, otherwise FALSE
+ */
struct CoincidencePredicateVR {
CoincidencePredicateVR(const custom_str::CustomString& newItem)
: newItem_(newItem) {}
@@ -219,6 +225,6 @@ class RegisterAppInterfaceRequest
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
index d591d67794..2a6e847067 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
@@ -79,6 +79,6 @@ class RegisterAppInterfaceResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
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 6f7e330bf5..880fced6ba 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -144,6 +144,6 @@ class ResetGlobalPropertiesRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
index b33ef41426..6d9b604b41 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
@@ -75,6 +75,6 @@ class ResetGlobalPropertiesResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
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 a641fa0cd4..58b7b4491a 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
@@ -85,6 +85,6 @@ class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
index 8bc8a36363..e5c668b424 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
@@ -68,6 +68,6 @@ class ScrollableMessageResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
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 e3ed6ef28b..2f00b58d9e 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,8 @@
#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/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_request_impl.h"
#include "application_manager/event_engine/event.h"
#include "smart_objects/smart_object.h"
@@ -83,6 +83,6 @@ class SendHapticDataRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
index 53e8766241..515fe3f74d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
@@ -72,6 +72,6 @@ class SendHapticDataResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
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 6626da4c9d..5a0dc67f35 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
@@ -75,10 +75,10 @@ class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
private:
/**
- * @brief CheckFieldsCompatibility checks if fields are compatible with each
- * other.
- * @return true if compatible, otherwise return false
- */
+ * @brief CheckFieldsCompatibility checks if fields are compatible with each
+ * other.
+ * @return true if compatible, otherwise return false
+ */
bool CheckFieldsCompatibility();
/**
@@ -95,6 +95,6 @@ class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
index cb461f9a60..a2e9d1eb0a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
@@ -66,6 +66,6 @@ class SendLocationResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
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 1075999af9..86ca2fb126 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
@@ -111,6 +111,6 @@ class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
index e4ce0725dc..a9b203bec7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
@@ -73,6 +73,6 @@ class SetAppIconResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
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
new file mode 100644
index 0000000000..a3a3ea12f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h
@@ -0,0 +1,31 @@
+#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"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SetCloudAppPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ SetCloudAppPropertiesRequest(
+ 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);
+ virtual ~SetCloudAppPropertiesRequest();
+ virtual void Run();
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest);
+}; // 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
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h
new file mode 100644
index 0000000000..df71a2aaf5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h
@@ -0,0 +1,31 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SetCloudAppPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ SetCloudAppPropertiesResponse(
+ 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);
+ virtual ~SetCloudAppPropertiesResponse();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesResponse);
+
+}; // SetCloudAppPropertiesResponse
+
+} // 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_RESPONSE_H_ \ No newline at end of file
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 4bd800988c..2f9c0946d3 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
@@ -80,6 +80,6 @@ class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
index 73f57fc187..7b43613ac4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
@@ -74,6 +74,6 @@ class SetDisplayLayoutResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
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 674de4731a..e84bf6e5e6 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,9 +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 "utils/macro.h"
-#include "application_manager/application.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -153,6 +153,6 @@ class SetGlobalPropertiesRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
index 778dc9b7d7..f8d8117250 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
@@ -75,6 +75,6 @@ class SetGlobalPropertiesResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
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 ef674f1c38..adced13d73 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
@@ -81,6 +81,6 @@ class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
index 2fb3f25839..240d1be8d1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
@@ -69,6 +69,6 @@ class SetMediaClockTimerResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
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 cadc87cef6..7694070a72 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
@@ -89,6 +89,6 @@ class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
index 4129a7640e..4b2136ad11 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
@@ -73,6 +73,6 @@ class ShowConstantTBTResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
index 2277a38f11..586004b783 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
@@ -98,6 +98,6 @@ class ShowRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
index c78820a26e..97843c2148 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
@@ -67,6 +67,6 @@ class ShowResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
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 f1e06e8d8d..5dbcbb7d41 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
@@ -91,6 +91,6 @@ class SliderRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
index 2a93103632..842e52f595 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
@@ -67,6 +67,6 @@ class SliderResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
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 d6d47bb869..68e35fcd1d 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
@@ -93,6 +93,6 @@ class SpeakRequest : public app_mngr::commands::CommandRequestImpl {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
index 30eda07810..02b7baae54 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
@@ -67,6 +67,6 @@ class SpeakResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
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 011c0aa359..2b9887daad 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_impl.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
namespace sdl_rpc_plugin {
@@ -98,6 +98,6 @@ class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
index 28e942ec17..b42ccb91e1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
@@ -73,6 +73,6 @@ class SubscribeButtonResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
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 6105f08750..8b88a1c884 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
@@ -80,8 +80,8 @@ class SubscribeWayPointsRequest
DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
};
-} // commands
+} // namespace commands
-} // application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
index cd27e96d25..4039f21f8e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
@@ -71,8 +71,8 @@ class SubscribeWayPointsResponse
DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse);
};
-} // commands
+} // namespace commands
-} // application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
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 c34db34506..eb2398f279 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
@@ -35,8 +35,8 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
#include <string>
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_request_impl.h"
#include "application_manager/event_engine/event.h"
#include "smart_objects/smart_object.h"
@@ -93,6 +93,6 @@ class SystemRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
index afbd557d12..5c3f69d757 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
@@ -72,6 +72,6 @@ class SystemResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
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 172f934a15..0bc01f2aaa 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
@@ -80,6 +80,6 @@ class UnregisterAppInterfaceRequest
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
index 13d8b549e8..d1ac004ca0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
@@ -76,6 +76,6 @@ class UnregisterAppInterfaceResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
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 8cbaafbfe1..51c10642cf 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
@@ -84,6 +84,6 @@ class UnsubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
index 1db067acce..efd5478363 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
@@ -74,6 +74,6 @@ class UnsubscribeButtonResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
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 fe14f5c7eb..e83e9b7509 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
@@ -79,8 +79,8 @@ class UnsubscribeWayPointsRequest
DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest);
};
-} // commands
+} // namespace commands
-} // application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
index c578bf9f99..9ab167284a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
@@ -71,8 +71,8 @@ class UnsubscribeWayPointsResponse
DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse);
};
-} // commands
+} // namespace commands
-} // application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
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 8766339f96..e1e5df2289 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
@@ -97,6 +97,6 @@ class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
index 59d3bf0b2c..80e143644f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
@@ -73,6 +73,6 @@ class UpdateTurnListResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
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
new file mode 100644
index 0000000000..935716aa30
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h
@@ -0,0 +1,83 @@
+/*
+ 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_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H
+#include <application_manager/application_manager.h>
+#include <set>
+#include <string>
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+
+namespace sdl_rpc_plugin {
+class SDLRPCPlugin;
+
+namespace app_mngr_ = application_manager;
+
+typedef mobile_apis::SystemCapabilityType::eType SystemCapabilityType;
+typedef std::set<mobile_apis::SystemCapabilityType::eType>
+ SystemCapabilitySubscriptions;
+
+class SystemCapabilityAppExtension : public app_mngr_::AppExtension {
+ public:
+ SystemCapabilityAppExtension(SDLRPCPlugin& plugin,
+ app_mngr_::Application& app);
+ virtual ~SystemCapabilityAppExtension();
+
+ bool SubscribeTo(const SystemCapabilityType system_capability_type);
+
+ bool UnsubscribeFrom(const SystemCapabilityType system_capability_type);
+
+ void UnsubscribeFromAll();
+
+ bool IsSubscribedTo(const SystemCapabilityType system_capability_type) const;
+
+ SystemCapabilitySubscriptions Subscriptions();
+
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+
+ void ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) OVERRIDE;
+
+ static const app_mngr_::AppExtensionUID SystemCapabilityAppExtensionUID;
+
+ static SystemCapabilityAppExtension& ExtractExtension(
+ app_mngr_::Application& app);
+
+ private:
+ SystemCapabilitySubscriptions subscribed_data_;
+ SDLRPCPlugin& plugin_;
+ app_mngr_::Application& app_;
+};
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
index eee454fb00..95bb253120 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
-#include "application_manager/command_factory.h"
#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -70,6 +70,6 @@ class HMICommandFactory : public app_mngr::CommandFactory {
DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
};
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
index f0840dde41..132b68aaec 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
-#include "application_manager/command_factory.h"
#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -59,9 +59,16 @@ class MobileCommandFactory : public app_mngr::CommandFactory {
private:
app_mngr::CommandCreator& get_creator_factory(
- mobile_apis::FunctionID::eType id,
- mobile_apis::messageType::eType message_type,
- app_mngr::commands::Command::CommandSource source) const;
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const;
+ app_mngr::CommandCreator& get_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const;
+ app_mngr::CommandCreator& get_notification_creator(
+ const mobile_apis::FunctionID::eType id) const;
+ app_mngr::CommandCreator& get_notification_from_mobile_creator(
+ const mobile_apis::FunctionID::eType id) const;
app_mngr::ApplicationManager& application_manager_;
app_mngr::rpc_service::RPCService& rpc_service_;
@@ -70,6 +77,6 @@ class MobileCommandFactory : public app_mngr::CommandFactory {
DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
};
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
index 5b5f0ae49f..edbfe1bdc0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
@@ -36,11 +36,11 @@
#include <memory>
#include "application_manager/application_manager.h"
#include "application_manager/command_factory.h"
-#include "sdl_rpc_plugin/hmi_command_factory.h"
-#include "sdl_rpc_plugin/mobile_command_factory.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/rpc_service.h"
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+#include "sdl_rpc_plugin/mobile_command_factory.h"
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -69,5 +69,5 @@ class SDLCommandFactory : public app_mngr::CommandFactory {
std::unique_ptr<HMICommandFactory> hmi_command_factory_;
std::unique_ptr<MobileCommandFactory> mobile_command_factory_;
};
-}
+} // namespace sdl_rpc_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
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 6ae3a0b6bc..7d482709cb 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
@@ -32,36 +32,39 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
-#include "application_manager/plugin_manager/rpc_plugin.h"
#include "application_manager/command_factory.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
namespace plugins = application_manager::plugin_manager;
+
+class SystemCapabilityAppExtension;
+
class SDLRPCPlugin : public plugins::RPCPlugin {
// RPCPlugin interface
public:
- bool Init(application_manager::ApplicationManager& app_manager,
- application_manager::rpc_service::RPCService& rpc_service,
- application_manager::HMICapabilities& hmi_capabilities,
+ bool Init(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
bool IsAbleToProcess(
const int32_t function_id,
- const application_manager::commands::Command::CommandSource
- message_source) OVERRIDE;
+ const app_mngr::commands::Command::CommandSource message_source) OVERRIDE;
std::string PluginName() OVERRIDE;
- application_manager::CommandFactory& GetCommandFactory() OVERRIDE;
- void OnPolicyEvent(
- application_manager::plugin_manager::PolicyEvent event) OVERRIDE;
- void OnApplicationEvent(
- application_manager::plugin_manager::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) OVERRIDE;
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+ void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE;
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
private:
+ void ClearSubscriptions(app_mngr::ApplicationSharedPtr app);
+
std::unique_ptr<application_manager::CommandFactory> command_factory_;
};
-}
+} // namespace sdl_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
index 19d01b594f..c6d181bf57 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
@@ -75,4 +75,4 @@ void ActivateAppRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
index d7e38c5d5b..b829ef711e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
@@ -63,4 +63,4 @@ void ActivateAppResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
index 3e46bd353a..93999f704d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
@@ -64,4 +64,4 @@ void AddStatisticsInfoNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
index b227dd79dc..68c7896a7f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
@@ -59,4 +59,4 @@ void AllowAllAppsRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
index 2fdf29a7dd..c2182f4853 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
@@ -59,4 +59,4 @@ void AllowAllAppsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
index 0c6e5145c7..6b5af76fb1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
@@ -59,4 +59,4 @@ void AllowAppRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
index 4853c3764a..c62645c6c0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
@@ -70,4 +70,4 @@ void AllowAppResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc
new file mode 100644
index 0000000000..b021faefd8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationCloseApplicationRequest::
+ BasicCommunicationCloseApplicationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BasicCommunicationCloseApplicationRequest::
+ ~BasicCommunicationCloseApplicationRequest() {}
+
+void BasicCommunicationCloseApplicationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc
new file mode 100644
index 0000000000..2e56271cf2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc
@@ -0,0 +1,65 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationCloseApplicationResponse::
+ BasicCommunicationCloseApplicationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BasicCommunicationCloseApplicationResponse::
+ ~BasicCommunicationCloseApplicationResponse() {}
+
+void BasicCommunicationCloseApplicationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_CloseApplication);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
index c067debf36..e26753b3f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
@@ -62,4 +62,4 @@ void BasicCommunicationGetSystemTimeResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
index 0c39389116..361dc5fea6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
@@ -79,4 +79,4 @@ void OnAwakeSDLNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
index 04e44a6979..052a40a888 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
@@ -58,4 +58,4 @@ void BasicCommunicationSystemRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
index 5f8221fdbe..0b052de88d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
@@ -63,4 +63,4 @@ void BasicCommunicationSystemResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc
new file mode 100644
index 0000000000..b735cd9bdf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BCGetFilePathRequest::BCGetFilePathRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BCGetFilePathRequest::~BCGetFilePathRequest() {}
+
+void BCGetFilePathRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc
new file mode 100644
index 0000000000..58cda68a2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BCGetFilePathResponse::BCGetFilePathResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+BCGetFilePathResponse::~BCGetFilePathResponse() {}
+
+void BCGetFilePathResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_GetFilePath);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
index cf2fbd9761..6696689174 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
@@ -60,4 +60,4 @@ void ButtonGetCapabilitiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
index 863e179040..b6ab822c47 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
@@ -68,10 +68,14 @@ void ButtonGetCapabilitiesResponse::Run() {
hmi_capabilities.set_button_capabilities(
(*message_)[strings::msg_params][hmi_response::capabilities]);
- hmi_capabilities.set_preset_bank_capabilities(
- (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::preset_bank_capabilities)) {
+ hmi_capabilities.set_preset_bank_capabilities(
+ (*message_)[strings::msg_params]
+ [hmi_response::preset_bank_capabilities]);
+ }
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
index 84a47b9deb..988794f668 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
@@ -58,4 +58,4 @@ void ClosePopupRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
index 25396af337..072e1960e9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
@@ -58,4 +58,4 @@ void ClosePopupResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
index 0e09c14650..71782ef575 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
@@ -59,4 +59,4 @@ void DecryptCertificateRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
index 694298ed91..cf2a4d092c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
@@ -64,5 +64,5 @@ void DecryptCertificateResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
index 63f5c2e815..97b5109642 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
@@ -61,4 +61,4 @@ void DialNumberRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
index 6d37ece2bf..4ff6785052 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
@@ -63,4 +63,4 @@ void DialNumberResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 c06c90973d..8546252119 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,4 +61,4 @@ void GetSystemInfoRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
index aef428b39f..3dbdf528a5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
@@ -90,4 +90,4 @@ const SystemInfo GetSystemInfoResponse::GetSystemInfo(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
index ae375e4087..54a9633a37 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
@@ -31,10 +31,10 @@
*/
#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
-#include "application_manager/message.h"
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
+#include "application_manager/message.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/rpc_service.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -227,4 +227,4 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
#endif // PROPRIETARY_MODE
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
index 57c925e08f..77d90ec8bb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
@@ -60,4 +60,4 @@ void GetUrlsResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
index 39f7e61c06..b8c61ca902 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
@@ -59,4 +59,4 @@ void MixingAudioSupportedRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
index 26fa967844..089e56e598 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
@@ -60,4 +60,4 @@ void MixingAudioSupportedResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
index ae3695b68e..8390fea5bc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
@@ -59,4 +59,4 @@ void NaviAlertManeuverRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
index 6a6307038a..a1603f069d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
@@ -63,4 +63,4 @@ void NaviAlertManeuverResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 a9698d36ab..371f47a759 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
@@ -79,8 +79,8 @@ void AudioStartStreamRequest::Run() {
application_manager_.application_by_hmi_app(application_id());
if (!app) {
LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << " does not exist");
+ "Application with hmi_app_id " << application_id()
+ << " does not exist");
return;
}
SetAllowedToTerminate(false);
@@ -189,4 +189,4 @@ void AudioStartStreamRequest::RetryStartSession() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
index 362a46cc19..61d49577f6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
@@ -60,4 +60,4 @@ void AudioStartStreamResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
index ba2b8c8157..a5d436f015 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
@@ -62,4 +62,4 @@ void AudioStopStreamRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
index 87ddc81696..98023ab571 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
@@ -56,4 +56,4 @@ void AudioStopStreamResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
index 77ef3e3369..edc4afe1e4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
@@ -59,4 +59,4 @@ void NaviGetWayPointsRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
index 0aad5e5724..0f0b652d01 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
@@ -63,4 +63,4 @@ void NaviGetWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 781b8d3045..15e5b46b36 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
@@ -84,4 +84,4 @@ void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
index b4e64e2a3e..073513eda9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
@@ -58,4 +58,4 @@ void NaviIsReadyResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
index a10f61310d..360870e21c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
@@ -59,4 +59,4 @@ void NaviSendLocationRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
index f93e2e17c3..dc60f2fbf0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
@@ -61,4 +61,4 @@ void NaviSendLocationResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 5e4426bd20..764315f37f 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
@@ -65,9 +65,9 @@ void NaviSetVideoConfigRequest::Run() {
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with hmi_app_id " << application_id()
- << "does not exist");
+ LOG4CXX_ERROR(
+ logger_,
+ "Application with hmi_app_id " << application_id() << "does not exist");
return;
}
@@ -100,9 +100,9 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response");
result = true;
} else {
- LOG4CXX_DEBUG(logger_,
- "Received SetVideoConfig failure response (" << event.id()
- << ")");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Received SetVideoConfig failure response (" << event.id() << ")");
result = false;
if (message[strings::msg_params].keyExists(strings::rejected_params)) {
const smart_objects::SmartArray* list =
@@ -153,4 +153,4 @@ void NaviSetVideoConfigRequest::onTimeOut() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
index c5f1c5307f..e4a30c9da5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
@@ -61,4 +61,4 @@ void NaviSetVideoConfigResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
index 22d604ab0d..95dd4561fc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
@@ -59,4 +59,4 @@ void NaviShowConstantTBTRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
index d2ff26b645..f73099d29a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
@@ -63,4 +63,4 @@ void NaviShowConstantTBTResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 f3d971acba..7f643d6130 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
@@ -79,9 +79,9 @@ void NaviStartStreamRequest::Run() {
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
if (!app) {
- LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << "does not exist");
+ LOG4CXX_ERROR(
+ logger_,
+ "Application with hmi_app_id " << application_id() << "does not exist");
return;
}
SetAllowedToTerminate(false);
@@ -190,4 +190,4 @@ void NaviStartStreamRequest::RetryStartSession() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
index f09a334f51..eafd81148a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
@@ -60,4 +60,4 @@ void NaviStartStreamResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
index 3e27692d62..ad09b0aee1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
@@ -62,4 +62,4 @@ void NaviStopStreamRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
index 61b8d5a1e2..ff8c0bddff 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
@@ -56,4 +56,4 @@ void NaviStopStreamResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 a4445ebce8..ba29f552b7 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
@@ -59,4 +59,4 @@ void NaviSubscribeWayPointsRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
index ae5f236f6f..ddf8f75e58 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
@@ -64,4 +64,4 @@ void NaviSubscribeWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
index ec22c93d8f..d3c998cfdf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
@@ -59,4 +59,4 @@ void NaviUnsubscribeWayPointsRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
index c084bd52d3..beed29e1e2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
@@ -32,8 +32,8 @@
#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -65,4 +65,4 @@ void NaviUnsubscribeWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
index 9c507c3637..a8a258b1c0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
@@ -59,4 +59,4 @@ void NaviUpdateTurnListRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
index eb232e6d01..a2f737df38 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
@@ -63,4 +63,4 @@ void NaviUpdateTurnListResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
index 398c2dac30..204cc7d347 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
@@ -66,4 +66,4 @@ void OnAllowSDLFunctionalityNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
index 189596c58a..e882020f8b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
@@ -64,4 +64,4 @@ void OnAppActivatedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
index ee45f9bf1e..18b796eaa8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
@@ -66,4 +66,4 @@ void OnAppDeactivatedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
index e13299ece7..a1eb412c66 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
@@ -58,4 +58,4 @@ void OnAppPermissionChangedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
index cf83c48a5a..0033b392d2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
@@ -32,12 +32,12 @@
*/
#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
#include <algorithm>
#include <functional>
#include <string>
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
@@ -178,5 +178,5 @@ void OnAppPermissionConsentNotification::Run() {
policy_handler_.OnAppPermissionConsent(connection_key, permission_consent);
#endif
}
-} // commands
-} // namespace application_manager
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
index 24c5a94272..51c3125921 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
@@ -64,4 +64,4 @@ void OnAppRegisteredNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
index 001b9fa5e0..07aadada81 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
@@ -73,4 +73,4 @@ void OnAppUnregisteredNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
index e2cd6d2cbf..d9c1120409 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
@@ -58,4 +58,4 @@ void OnAudioDataStreamingNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
new file mode 100644
index 0000000000..37dca47793
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc
@@ -0,0 +1,171 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnBCSystemCapabilityUpdatedNotification::
+ OnBCSystemCapabilityUpdatedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnBCSystemCapabilityUpdatedNotification::
+ ~OnBCSystemCapabilityUpdatedNotification() {}
+
+void OnBCSystemCapabilityUpdatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Sending BasicCommunication.OnSystemCapabilityUpdated "
+ "Notification to HMI");
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ hmi_apis::Common_SystemCapabilityType::eType system_capability_type =
+ static_cast<hmi_apis::Common_SystemCapabilityType::eType>(
+ msg_params[strings::system_capability]
+ [strings::system_capability_type]
+ .asInt());
+ switch (system_capability_type) {
+ case hmi_apis::Common_SystemCapabilityType::NAVIGATION: {
+ smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map);
+ bool has_nav_capability = false;
+ if (hmi_capabilities_.navigation_capability()) {
+ has_nav_capability = true;
+ nav_capability = *hmi_capabilities_.navigation_capability();
+ }
+ has_nav_capability = application_manager_.GetAppServiceManager()
+ .UpdateNavigationCapabilities(nav_capability) ||
+ has_nav_capability;
+
+ if (has_nav_capability) {
+ msg_params[strings::system_capability][strings::navigation_capability] =
+ nav_capability;
+ } else {
+ return;
+ }
+ break;
+ }
+ case hmi_apis::Common_SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities_.phone_capability()) {
+ msg_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities_.phone_capability();
+ } else {
+ return;
+ }
+ break;
+ }
+ case hmi_apis::Common_SystemCapabilityType::REMOTE_CONTROL: {
+ if (!hmi_capabilities_.is_rc_cooperating()) {
+ return;
+ }
+ if (hmi_capabilities_.rc_capability()) {
+ msg_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities_.rc_capability();
+ } else {
+ return;
+ }
+ break;
+ }
+ case hmi_apis::Common_SystemCapabilityType::VIDEO_STREAMING:
+ if (hmi_capabilities_.video_streaming_capability()) {
+ msg_params[strings::system_capability]
+ [strings::video_streaming_capability] =
+ *hmi_capabilities_.video_streaming_capability();
+ } else {
+ return;
+ }
+ break;
+ case hmi_apis::Common_SystemCapabilityType::APP_SERVICES: {
+ auto all_services =
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
+ auto app_service_caps =
+ MessageHelper::CreateAppServiceCapabilities(all_services);
+
+ smart_objects::SmartArray* app_services =
+ app_service_caps[strings::app_services].asArray();
+ 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++) {
+ std::string service_id =
+ updated_capabilities[i][strings::updated_app_service_record]
+ [strings::service_id]
+ .asString();
+ auto matching_service_predicate =
+ [&service_id](
+ const smart_objects::SmartObject& app_service_capability) {
+ return service_id ==
+ app_service_capability[strings::updated_app_service_record]
+ [strings::service_id]
+ .asString();
+ };
+
+ auto it = std::find_if(app_services->begin(),
+ app_services->end(),
+ matching_service_predicate);
+ if (it != app_services->end()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Replacing updated record with service_id " << service_id);
+ app_services->erase(it);
+ }
+ app_services->push_back(updated_capabilities[i]);
+ }
+ msg_params[strings::system_capability]
+ [strings::app_services_capabilities] = app_service_caps;
+ break;
+ }
+ default:
+ return;
+ }
+ SendNotification();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
index 1f052b865b..f25e6202cd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
@@ -67,4 +67,4 @@ void OnButtonEventNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
index 6c5d8f5a43..fee6b1b485 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
#include "application_manager/application_impl.h"
-#include "utils/logger.h"
#include "application_manager/event_engine/event.h"
+#include "utils/logger.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -69,4 +69,4 @@ void OnButtonPressNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
index 70ff1c3fad..4ac752d6c5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
@@ -63,4 +63,4 @@ void OnButtonSubscriptionNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
index 2c4f9a1ccc..f27c1fe5e5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
@@ -63,4 +63,4 @@ void OnDeviceChosenNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
index 307dccd09b..9ddd822b1c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include <algorithm>
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
-#include "interfaces/HMI_API.h"
#include "encryption/hashing.h"
+#include "interfaces/HMI_API.h"
namespace {
// TODO(AOleynik) : replace this !!!
@@ -72,7 +72,7 @@ std::string convert_to_bt_mac(std::string& deviceInternalId) {
return bt_mac;
}
-}
+} // namespace
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -121,4 +121,4 @@ void OnDeviceStateChangedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
index a5fb9b206e..2f3ee60a16 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <set>
#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+#include <set>
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -90,7 +90,7 @@ struct OnDriverDistractionProcessor {
ApplicationManager& application_manager_;
std::string stringified_function_id_;
};
-}
+} // namespace
OnDriverDistractionNotification::OnDriverDistractionNotification(
const application_manager::commands::MessageSharedPtr& message,
@@ -139,4 +139,4 @@ void OnDriverDistractionNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
index cd3f2c23e6..f6ea22ae34 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
@@ -61,4 +61,4 @@ void OnEventChangedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
index 9d250d288e..4c168f9eff 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -32,13 +32,13 @@
#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
-#include <signal.h>
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/HMI_API.h"
namespace sdl_rpc_plugin {
@@ -122,4 +122,4 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
index 681390fbf4..11647e2140 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
@@ -33,11 +33,11 @@
#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/state_controller.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -106,6 +106,13 @@ void OnExitApplicationNotification::Run() {
application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
return;
}
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ case Common_ApplicationExitReason::CLOSE_CLOUD_CONNECTION: {
+ application_manager_.DisconnectCloudApp(app_impl);
+ break;
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
default: {
LOG4CXX_WARN(logger_, "Unhandled reason");
return;
@@ -122,4 +129,4 @@ void OnExitApplicationNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
index ec680c667d..e1f0e2b104 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
@@ -59,4 +59,4 @@ void OnFileRemovedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
index c74dd70c84..2e8f15387f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
@@ -59,4 +59,4 @@ void OnFindApplications::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
index 9ff1851e3f..9c2c68989f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
@@ -59,4 +59,4 @@ void OnIgnitionCycleOverNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
index 20f20ece08..f611b81764 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
@@ -64,4 +64,4 @@ void OnNaviTBTClientStateNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
index fa8819ca5b..2a1a9c29fb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
@@ -60,4 +60,4 @@ void OnNaviWayPointChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
index e069bea740..67352fbc4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
@@ -57,4 +57,4 @@ void OnPolicyUpdate::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
index 1524aa9ea2..441e36a385 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
@@ -59,4 +59,4 @@ void OnPutFileNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
index 76c9115662..da3612b043 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
@@ -62,4 +62,4 @@ void OnReadyNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
index 1eaef0b5e1..4a8c8df0ee 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include <string>
#include "application_manager/application_manager.h"
#include "utils/file_system.h"
@@ -74,4 +74,4 @@ void OnReceivedPolicyUpdate::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
index 60699e5b9c..dbef717539 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
@@ -59,4 +59,4 @@ void OnRecordStartdNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
index 9f8a713ffe..11d549655e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
@@ -59,4 +59,4 @@ void OnResumeAudioSourceNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
index 65879edce6..d0c584c66c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
@@ -59,4 +59,4 @@ void OnSDLCloseNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
index cf8feb4ca1..314a9e8f71 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
@@ -59,4 +59,4 @@ void OnSDLConsentNeededNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
index 0ac4afd4d2..5db38d070b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
@@ -58,4 +58,4 @@ void OnSDLPersistenceCompleteNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
index 2cee7926bd..035def10e0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
@@ -59,4 +59,4 @@ void OnStartDeviceDiscovery::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
index 4cb01e7e90..5ee2ede198 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
@@ -58,4 +58,4 @@ void OnStatusUpdateNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
index 242fb1d8cd..38b87f23d3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
+#include "application_manager/state_controller.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -85,4 +85,4 @@ void OnSystemContextNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
index 5591d59355..6a5ee4fce4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
@@ -64,4 +64,4 @@ void OnSystemErrorNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
index 11b2471294..b7ba6951fb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
@@ -66,4 +66,4 @@ void OnSystemInfoChangedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
index d795896764..a9670681b2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
@@ -32,9 +32,9 @@
#include "application_manager/application_impl.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "interfaces/MOBILE_API.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
#include "utils/macro.h"
using policy::PolicyHandlerInterface;
@@ -121,4 +121,4 @@ void OnSystemRequestNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
index b5fd1a007e..b068835545 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
@@ -59,4 +59,4 @@ void OnSystemTimeReadyNotification::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 5b5cfeefb1..f89baad737 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
@@ -100,4 +100,4 @@ void OnTTSLanguageChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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_tts_reset_timeout_notification.cc
index 701dbe0538..8b60762b31 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_tts_reset_timeout_notification.cc
@@ -66,4 +66,4 @@ void OnTTSResetTimeoutNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
index 34ba82df1d..2d215b2ec9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
@@ -60,4 +60,4 @@ void OnTTSStartedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
index 0935a36848..6910b188f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
@@ -63,4 +63,4 @@ void OnTTSStoppedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
index 21cf0d9628..6cc9f85d6f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
@@ -65,4 +65,4 @@ void OnUICommandNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
index fbdd4fce2b..f069e4ed65 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
@@ -67,4 +67,4 @@ void OnUIKeyBoardInputNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 3bf5a5aed4..697b2036c4 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
@@ -99,4 +99,4 @@ void OnUILanguageChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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/on_ui_reset_timeout_notification.cc
index 953932cdb6..bd1e1b8ea7 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/on_ui_reset_timeout_notification.cc
@@ -67,4 +67,4 @@ void OnUIResetTimeoutNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
index e5b321e1ff..193c3666d2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
@@ -67,4 +67,4 @@ void OnUITouchEventNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
index 2a5e6ba797..e6275adab2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
@@ -56,4 +56,4 @@ void OnUpdateDeviceList::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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
index c8ecba458a..99c6520fee 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIAccPedalPositionNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index ee909d19dc..dbfd9487e3 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIBeltStatusNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index f0386646ce..b8e66b9c0f 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIBodyInformationNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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/on_vi_device_status_notification.cc
index 549c73065a..418c751d1c 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/on_vi_device_status_notification.cc
@@ -64,4 +64,4 @@ void OnVIDeviceStatusNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 23f0d37068..29545fcd87 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIDriverBrakingNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 735a225225..4c2fb94400 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIEngineTorqueNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 0b4bfa893f..6ac26a74fc 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIExternalTemperatureNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index a5e84f1108..1f1cad5b8b 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIFuelLevelNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 950b5a36f1..31c80860fd 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIFuelLevelStateNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 0d94194f76..43ae3524ad 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIGpsDataNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 80edb88e38..282a173b69 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIHeadLampStatusNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index a2b0b1a8fd..f9bb3eca3f 100644
--- 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
@@ -65,4 +65,4 @@ void OnVIInstantFuelConsumptionNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 5e3555bbc4..8f5e845c02 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIMyKeyNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 1dbef77fa3..ea5d8be9ca 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIOdometerNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index d4ae93b324..73231ff4de 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIPrndlNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 77f694c92e..4587939b8f 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIRpmNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index e5860c9eec..df0bfd5cd7 100644
--- 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
@@ -64,4 +64,4 @@ void OnVISpeedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index db591d9da3..b7eaad7edf 100644
--- 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
@@ -64,4 +64,4 @@ void OnVISteeringWheelAngleNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index b5c7e18803..5f438ef8d1 100644
--- 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
@@ -64,4 +64,4 @@ void OnVITirePressureNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 323fe5b885..1b40da4c40 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIVinNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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
index 6a3b863e7c..7221e88ef1 100644
--- 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
@@ -64,4 +64,4 @@ void OnVIWiperStatusNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
index 701dee5385..7d5c0165aa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
@@ -59,4 +59,4 @@ void OnVideoDataStreamingNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
index 386ef1d1c7..7680b74426 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
@@ -32,13 +32,13 @@
#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
#include "application_manager/state_controller.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -110,4 +110,4 @@ void OnVRCommandNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 6a58ab9ffa..55c6eb8881 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
@@ -33,9 +33,9 @@
#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
+#include "application_manager/state_controller.h"
#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
@@ -98,4 +98,4 @@ void OnVRLanguageChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
index 04eb9a9ed0..bfc033a865 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
@@ -61,4 +61,4 @@ void OnVRStartedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
index 8fea5ddd1c..ede1efab85 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
@@ -61,4 +61,4 @@ void OnVRStoppedNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 5947454517..d8ad6087a6 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,4 +59,4 @@ void RCGetCapabilitiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
index b14c28426c..f4651ee0cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
@@ -66,4 +66,4 @@ void RCGetCapabilitiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 d538878dc8..5e4af1503a 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
@@ -105,4 +105,4 @@ void RCIsReadyRequest::SendMessageToHMI() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
index 7534567204..71e16a831c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
@@ -58,4 +58,4 @@ void RCIsReadyResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 f89ae1f697..30184be7a1 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
@@ -31,8 +31,8 @@
*/
#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
+#include "application_manager/state_controller.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -45,8 +45,7 @@ struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle)
: handle_(handle) {}
bool operator()(const ApplicationSharedPtr app) const {
- return app
- ? handle_ == app->device() &&
+ return app ? handle_ == app->device() &&
Message::is_sufficient_version(
protocol_handler::MajorProtocolVersion::
PROTOCOL_VERSION_4,
@@ -80,7 +79,7 @@ struct SendLaunchApp
return;
}
};
-}
+} // namespace
SDLActivateAppRequest::SDLActivateAppRequest(
const application_manager::commands::MessageSharedPtr& message,
@@ -115,6 +114,8 @@ void SDLActivateAppRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace hmi_apis::FunctionID;
+ ApplicationConstSharedPtr app =
+ application_manager_.WaitingApplicationByID(app_id());
if (application_manager_.state_controller().IsStateActive(
HmiState::STATE_ID_DEACTIVATE_HMI)) {
LOG4CXX_DEBUG(logger_,
@@ -124,6 +125,16 @@ 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()) {
+ LOG4CXX_DEBUG(logger_, "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();
policy_handler_.OnActivateApp(application_id, correlation_id());
@@ -181,6 +192,18 @@ void SDLActivateAppRequest::Run() {
LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
policy_handler_.OnActivateApp(application_id, correlation_id());
return;
+ } else if (app_to_activate->is_cloud_app()) {
+ LOG4CXX_DEBUG(logger_, "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_to_activate->device());
+ return;
}
connection_handler::DeviceHandle device_handle = app_to_activate->device();
@@ -225,8 +248,10 @@ void SDLActivateAppRequest::onTimeOut() {
using namespace hmi_apis::Common_Result;
using namespace application_manager;
unsubscribe_from_event(BasicCommunication_OnAppRegistered);
- SendErrorResponse(
- correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
+ SendErrorResponse(correlation_id(),
+ SDL_ActivateApp,
+ APPLICATION_NOT_REGISTERED,
+ "App registration timed out");
}
void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
@@ -262,7 +287,7 @@ uint32_t SDLActivateAppRequest::hmi_app_id(
LOG4CXX_DEBUG(logger_, application << " section is absent in the message.");
return 0;
}
- if (so[msg_params][application].keyExists(strings::app_id)) {
+ if (!so[msg_params][application].keyExists(strings::app_id)) {
LOG4CXX_DEBUG(logger_,
strings::app_id << " section is absent in the message.");
return 0;
@@ -291,4 +316,4 @@ ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app(
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
index 3262b12759..560b75213c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
@@ -61,4 +61,4 @@ void SDLActivateAppResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
index 6b983d566a..095ffbd9c7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
@@ -64,4 +64,4 @@ void SDLGetListOfPermissionsRequest::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
index 784b4922d4..280d2cb071 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
@@ -61,4 +61,4 @@ void SDLGetListOfPermissionsResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
index 9a6c0fd520..7200f6918c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
@@ -59,4 +59,4 @@ void SDLGetStatusUpdateRequest::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
index 8fc85da481..4b0f3d0ca8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
@@ -61,4 +61,4 @@ void SDLGetStatusUpdateResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
index ab8ec4e3d9..28167df047 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
@@ -93,4 +93,4 @@ void SDLGetUserFriendlyMessageRequest::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
index c5b3450723..b95591c4fa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
@@ -61,4 +61,4 @@ void SDLGetUserFriendlyMessageResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
index aef2e286d7..5f69903548 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
@@ -64,4 +64,4 @@ void SDLPolicyUpdate::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
index d16fc578ab..12cdfb4ad9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
@@ -56,4 +56,4 @@ void SDLPolicyUpdateResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
index 163d749426..988be68a80 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
@@ -59,4 +59,4 @@ void TTSChangeRegistrationRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
index 2c28d615d3..e5e38ef34a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
@@ -63,4 +63,4 @@ void TTSChangeRegistratioResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 49623e01d7..9baaabf401 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,4 +59,4 @@ void TTSGetCapabilitiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
index 1cef3daf15..c0581a6380 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
@@ -69,4 +69,4 @@ void TTSGetCapabilitiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 5533537b33..7d2c15a9bf 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,4 +59,4 @@ void TTSGetLanguageRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
index ac423a2bf3..627056dce1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
@@ -77,4 +77,4 @@ void TTSGetLanguageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 8b87b9c6ea..2cb47380d5 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,4 +59,4 @@ void TTSGetSupportedLanguagesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
index a4e97d9d70..a70d1c89a3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
@@ -69,4 +69,4 @@ void TTSGetSupportedLanguagesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 c7e2c0c4cb..89b5961895 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
@@ -31,8 +31,8 @@
*/
#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -112,4 +112,4 @@ void TTSIsReadyRequest::SendMessageToHMI() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
index c7d634bee2..67e0fb6396 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
@@ -59,4 +59,4 @@ void TTSIsReadyResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 8c7443d465..0b3d9a77bf 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
@@ -59,4 +59,4 @@ void TTSSetGlobalPropertiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
index dae06d75f9..0901378c4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
@@ -63,4 +63,4 @@ void TTSSetGlobalPropertiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
index 96b93b724f..6dce94f931 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
@@ -59,4 +59,4 @@ void TTSSpeakRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
index cb2346083b..69be5ab160 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
@@ -32,8 +32,8 @@
#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -64,4 +64,4 @@ void TTSSpeakResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
index 25a05f085b..43c595040c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
@@ -59,4 +59,4 @@ void TTSStopSpeakingRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
index a2620c1340..892b3e6295 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
@@ -62,4 +62,4 @@ void TTSStopSpeakingResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 749b3ad56b..7c95e8a919 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
@@ -59,4 +59,4 @@ void UIAddCommandRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
index 266dffd225..72d841a878 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
@@ -62,4 +62,4 @@ void UIAddCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 de338d4670..15342c6ecb 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
@@ -59,4 +59,4 @@ void UIAddSubmenuRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
index 85e600c87d..ae699dc2bd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
@@ -63,4 +63,4 @@ void UIAddSubmenuResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
index ae5f861ba6..bf449db808 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
@@ -59,4 +59,4 @@ void UIAlertRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
index 3076eabc4c..f53f14e050 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
@@ -63,4 +63,4 @@ void UIAlertResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
index d109987009..bb001b37c7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
@@ -59,4 +59,4 @@ void UIChangeRegistrationRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
index 6557269e49..8acd654488 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
@@ -63,4 +63,4 @@ void UIChangeRegistratioResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
index 9e52f5fc18..1d741bba74 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
@@ -59,4 +59,4 @@ void UIDeleteCommandRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
index a8f5b59d39..40a5ec8a73 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
@@ -63,4 +63,4 @@ void UIDeleteCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
index 1b84df8bed..fdca37cee6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
@@ -59,4 +59,4 @@ void UIDeleteSubmenuRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
index ec4025bea1..9d522431dc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
@@ -63,4 +63,4 @@ void UIDeleteSubmenuResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
index fe11185c62..92f51bc9cf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
@@ -59,4 +59,4 @@ void UIEndAudioPassThruRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
index 3a6d4efbe4..b6639dcbb9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
@@ -63,4 +63,4 @@ void UIEndAudioPassThruResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 3bd56a0682..5f8704b3e5 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,4 +59,4 @@ void UIGetCapabilitiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
index cd5f3c9a42..909e3bae47 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
@@ -118,4 +118,4 @@ void UIGetCapabilitiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 8acba42493..d3b44d1168 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,4 +59,4 @@ void UIGetLanguageRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
index 27e46e52b4..2a5c0ab016 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
@@ -78,4 +78,4 @@ void UIGetLanguageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 2f8ef12a25..0665612525 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,4 +59,4 @@ void UIGetSupportedLanguagesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
index d20dd8545f..19ee62e51d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
@@ -69,4 +69,4 @@ void UIGetSupportedLanguagesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 2eab211690..2546b704b2 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
@@ -112,4 +112,4 @@ void UIIsReadyRequest::SendMessageToHMI() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
index e25e8ee8ab..96a2d1212c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
@@ -60,4 +60,4 @@ void UIIsReadyResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
index cca89e3073..18d5376b25 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
@@ -59,4 +59,4 @@ void UIPerformAudioPassThruRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
index 057448ab33..afbd1bbed7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
@@ -62,4 +62,4 @@ void UIPerformAudioPassThruResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
index d5696a39e7..aa5878590b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
@@ -59,4 +59,4 @@ void UIPerformInteractionRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
index 7629faa131..4cbc58d278 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
@@ -61,4 +61,4 @@ void UIPerformInteractionResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
index dbe0ceb529..de639420fb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
@@ -59,4 +59,4 @@ void UIScrollableMessageRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
index a96b9fa3ee..4e844095b4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
@@ -62,4 +62,4 @@ void UIScrollableMessageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
index f5f8f7bafd..4a538ac992 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
@@ -58,4 +58,4 @@ void UISendHapticDataRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
index 4555d81a0a..92afdaaa4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
@@ -62,4 +62,4 @@ void UISendHapticDataResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
index d25bbd1cd9..821f78a046 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
@@ -59,4 +59,4 @@ void UISetAppIconRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
index 711b5767f2..68e96725d4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
@@ -62,4 +62,4 @@ void UISetAppIconResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
index 73b813d0eb..63166157c8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
@@ -58,4 +58,4 @@ void UiSetDisplayLayoutRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
index d5d2e02e33..f35427895e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
@@ -63,4 +63,4 @@ void UiSetDisplayLayoutResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 0664404361..0aaaae7cc7 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
@@ -59,4 +59,4 @@ void UISetGlobalPropertiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
index 2e5fecf2af..48d73d146c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
@@ -62,4 +62,4 @@ void UISetGlobalPropertiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
index 4e87b9ccc3..4c8fcefcdf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
@@ -59,4 +59,4 @@ void UISetMediaClockTimerRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
index 39e7e1c232..fb5b25fc2b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
@@ -62,4 +62,4 @@ void UISetMediaClockTimerResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
index 5b7568abfe..d7160dc70b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
@@ -59,4 +59,4 @@ void UIShowRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
index 3e3c0b79d8..768069bf3a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
@@ -61,4 +61,4 @@ void UIShowResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
index 4df3adbe14..56fca3d062 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
@@ -59,4 +59,4 @@ void UISliderRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
index 2431c65ddf..9cf7224ddb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
@@ -62,4 +62,4 @@ void UISliderResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
index 05b08cb723..c5966fcb36 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
@@ -59,4 +59,4 @@ void UpdateAppListRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
index 3dd03993ef..7fc830b4e6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
@@ -59,4 +59,4 @@ void UpdateAppListResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
index 7736f2b1e6..3a014480c1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
@@ -100,4 +100,4 @@ bool UpdateDeviceListRequest::CleanUp() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
index 25dc9be5bd..d69e683f2b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
@@ -58,4 +58,4 @@ void UpdateDeviceListResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
index cafacea28f..96d454d4ee 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
@@ -61,4 +61,4 @@ void UpdateSDLRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
index a35571ec26..c02cde4111 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
@@ -61,4 +61,4 @@ void UpdateSDLResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 72ce387f77..788eda5a87 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
@@ -59,4 +59,4 @@ void VRAddCommandRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
index 19d43616ff..37b3e4696d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
@@ -63,4 +63,4 @@ void VRAddCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
index 9ba5fa3571..d1be04ad44 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
@@ -59,4 +59,4 @@ void VRChangeRegistrationRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
index 42c5b6d65b..27bde2bafa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
@@ -62,4 +62,4 @@ void VRChangeRegistrationResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
index efc09dc157..ebcfe78fa9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
@@ -59,4 +59,4 @@ void VRDeleteCommandRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
index f8f7535e68..d1d725b356 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
@@ -62,4 +62,4 @@ void VRDeleteCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 7e9c846857..b06bfa0e77 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,4 +59,4 @@ void VRGetCapabilitiesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
index 47ffb3a675..80c308ea40 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
@@ -61,4 +61,4 @@ void VRGetCapabilitiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 d57faa08fd..84179f6357 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,4 +59,4 @@ void VRGetLanguageRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
index 469452d108..6b7fec736d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
@@ -78,4 +78,4 @@ void VRGetLanguageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 bb27168a77..351940bf68 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,4 +59,4 @@ void VRGetSupportedLanguagesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
index 722040388d..4c725267fa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
@@ -31,8 +31,8 @@
*/
#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -69,4 +69,4 @@ void VRGetSupportedLanguagesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 22afb03945..12414eab10 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
@@ -112,4 +112,4 @@ void VRIsReadyRequest::SendMessageToHMI() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
index 48d9c3e075..373f97bf80 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
@@ -59,4 +59,4 @@ void VRIsReadyResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
index 26e308a0bc..ae94019b25 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
@@ -59,4 +59,4 @@ void VRPerformInteractionRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
index dec371e889..16378ab55a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
@@ -60,4 +60,4 @@ void VRPerformInteractionResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 155f819761..a57d222765 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
@@ -31,14 +31,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+#include <string>
#include "application_manager/application.h"
#include "application_manager/message_helper.h"
+#include "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
-#include "utils/custom_string.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -126,9 +126,9 @@ void AddCommandRequest::Run() {
}
if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
hmi_request::parent_id)) &&
- (0 !=
- (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt())) {
+ (0 != (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id]
+ .asUInt())) {
if (!CheckCommandParentId(app)) {
SendResponse(
false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist");
@@ -224,7 +224,8 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
if ((*message_)[strings::msg_params][strings::menu_params].keyExists(
hmi_request::parent_id)) {
parent_id = (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt();
+ [hmi_request::parent_id]
+ .asUInt();
}
for (; commands.end() != i; ++i) {
@@ -239,7 +240,8 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
}
if (((*i->second)[strings::menu_params][strings::menu_name].asString() ==
(*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asString()) &&
+ [strings::menu_name]
+ .asString()) &&
(saved_parent_id == parent_id)) {
LOG4CXX_INFO(logger_,
"AddCommandRequest::CheckCommandName received"
@@ -293,7 +295,8 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
const int32_t parent_id =
(*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asInt();
+ [hmi_request::parent_id]
+ .asInt();
smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
if (!parent) {
@@ -524,7 +527,8 @@ bool AddCommandRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
str = (*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asCharArray();
+ [strings::menu_name]
+ .asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
return true;
@@ -624,4 +628,4 @@ void AddCommandRequest::RemoveCommand() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
index ccb84cecbb..24ff3b5a28 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
@@ -61,4 +61,4 @@ void AddCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
index 183b445326..fbfcd4d38a 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
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
-#include "application_manager/message_helper.h"
#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -114,10 +114,12 @@ void AddSubMenuRequest::Run() {
msg_params[strings::menu_params][strings::position] =
received_msg_params[strings::position];
}
+ if (received_msg_params.keyExists(strings::menu_icon)) {
+ msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
+ }
msg_params[strings::menu_params][strings::menu_name] =
received_msg_params[strings::menu_name];
msg_params[strings::app_id] = app->app_id();
- msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
@@ -183,4 +185,4 @@ bool AddSubMenuRequest::CheckSubMenuName() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
index d0ec635dd0..d91f13f1df 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -62,4 +62,4 @@ void AddSubMenuResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 5dda34b743..9f36f260ae 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
@@ -25,12 +25,12 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
#include <cstring>
#include <string>
-#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -107,9 +107,9 @@ void AlertManeuverRequest::Run() {
MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
SendResponse(false,
mobile_apis::Result::FILE_NOT_FOUND,
"One or more files needed for tts_chunks are not present");
@@ -288,4 +288,4 @@ bool AlertManeuverRequest::IsWhiteSpaceExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
index d3e527f6ae..97c93d7455 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
@@ -62,4 +62,4 @@ void AlertManeuverResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 2806ac1d93..7173aaf2d0 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
@@ -35,12 +35,12 @@
#include <string.h>
-#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler.h"
-#include "utils/helpers.h"
#include "smart_objects/smart_object.h"
+#include "utils/helpers.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -298,9 +298,9 @@ bool AlertRequest::Validate(uint32_t app_id) {
MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
SendResponse(false,
mobile_apis::Result::FILE_NOT_FOUND,
"One or more files needed for tts_chunks are not present");
@@ -450,4 +450,4 @@ bool AlertRequest::HasHmiResponsesToWait() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
index bab5e5a5d8..b709d13958 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
@@ -32,10 +32,10 @@
*/
#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -64,4 +64,4 @@ void AlertResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 6af930ea53..ef81babdd6 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
@@ -31,14 +31,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
#include <string.h>
#include <algorithm>
-#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
-#include "application_manager/application_manager.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace {
namespace custom_str = utils::custom_string;
@@ -51,7 +51,7 @@ struct IsSameNickname {
private:
const custom_str::CustomString& app_id_;
};
-}
+} // namespace
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -194,9 +194,9 @@ void ChangeRegistrationRequest::Run() {
MessageHelper::VerifyTtsFiles(tts_name, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
SendResponse(false,
mobile_apis::Result::FILE_NOT_FOUND,
"One or more files needed for tts_name are not present");
@@ -216,9 +216,9 @@ void ChangeRegistrationRequest::Run() {
hmi_interfaces.GetInterfaceState(
HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+ using helpers::ALL;
using helpers::Compare;
using helpers::EQ;
- using helpers::ALL;
if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>(
HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE,
@@ -638,9 +638,9 @@ bool ChangeRegistrationRequest::IsNicknameAllowed(
ApplicationSharedPtr app = application_manager_.application(connection_key());
if (!app) {
- LOG4CXX_ERROR(logger_,
- "Can't find appication with connection key "
- << connection_key());
+ LOG4CXX_ERROR(
+ logger_,
+ "Can't find appication with connection key " << connection_key());
return false;
}
@@ -681,4 +681,4 @@ bool ChangeRegistrationRequest::IsNicknameAllowed(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
index 2dae92cd9b..78c60bc746 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
@@ -61,4 +61,4 @@ void ChangeRegistrationResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
new file mode 100644
index 0000000000..736f0355dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
@@ -0,0 +1,118 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/close_application_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CloseApplicationRequest::CloseApplicationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CloseApplicationRequest::~CloseApplicationRequest() {}
+
+void CloseApplicationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::app_id] = connection_key();
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_CloseApplication,
+ &msg_params,
+ true);
+}
+
+void CloseApplicationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ auto msg_params = message[strings::msg_params];
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ if (success) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ auto on_app_exit = [app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationExit, app);
+ };
+
+ application_manager_.GetPluginManager().ForEachPlugin(on_app_exit);
+ application_manager_.state_controller().SetRegularState(
+ app,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false);
+ }
+
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(success, result, info, &msg_params);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc
new file mode 100644
index 0000000000..934804e1b1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/close_application_response.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+CloseApplicationResponse::CloseApplicationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CloseApplicationResponse::~CloseApplicationResponse() {}
+
+void CloseApplicationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_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 416f4f2085..258aefd63f 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
@@ -31,11 +31,11 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
-#include <cstring>
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
#include <algorithm>
+#include <cstring>
+#include <string>
#include <vector>
-#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
@@ -218,9 +218,9 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms(
CreateInteractionChoiceSetRequest::compareStr);
if (it != vr_cmds_1->end()) {
- LOG4CXX_INFO(logger_,
- "Incoming choice set has duplicated VR synonyms "
- << it->asString());
+ LOG4CXX_INFO(
+ logger_,
+ "Incoming choice set has duplicated VR synonyms " << it->asString());
return true;
}
@@ -332,9 +332,9 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
VRCommandInfo vr_command(vr_cmd_id);
sent_commands_map_[vr_corr_id] = vr_command;
- LOG4CXX_DEBUG(logger_,
- "VR_command sent corr_id " << vr_corr_id << " cmd_id "
- << vr_corr_id);
+ LOG4CXX_DEBUG(
+ logger_,
+ "VR_command sent corr_id " << vr_corr_id << " cmd_id " << vr_corr_id);
}
expected_chs_count_ = chs_num;
LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
@@ -480,4 +480,4 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
index 807770ed12..43dba2f238 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
@@ -72,4 +72,4 @@ void CreateInteractionChoiceSetResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 38069c341e..363b14f92f 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
@@ -35,8 +35,8 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -204,8 +204,9 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
if (!command) {
LOG4CXX_ERROR(logger_,
- "Command id " << cmd_id << " not found for "
- "application with connection key "
+ "Command id " << cmd_id
+ << " not found for "
+ "application with connection key "
<< connection_key());
return;
}
@@ -232,4 +233,4 @@ bool DeleteCommandRequest::IsPendingResponseExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
index 8f85d50e28..919385ee50 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
@@ -61,4 +61,4 @@ void DeleteCommandResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 cf8a6d259f..b2c9a3377f 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
@@ -129,4 +129,4 @@ void DeleteFileRequest::SendFileRemovedNotification(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
index 66c61c9e4a..732a1e56b5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
@@ -72,4 +72,4 @@ void DeleteFileResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 a9db3975db..7950595b1c 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
@@ -34,9 +34,9 @@
#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -63,9 +63,9 @@ void DeleteInteractionChoiceSetRequest::Run() {
ApplicationSharedPtr app = application_manager_.application(connection_key());
if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
+ LOG4CXX_ERROR(
+ logger_,
+ "No application associated with connection key " << connection_key());
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
@@ -165,4 +165,4 @@ void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
index 18ca60f255..cf5ad3a2c2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
@@ -34,8 +34,8 @@
#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -81,4 +81,4 @@ void DeleteInteractionChoiceSetResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 9a01163702..6aaa2406e8 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
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
-#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
#include "interfaces/HMI_API.h"
#include "utils/helpers.h"
@@ -200,4 +200,4 @@ bool DeleteSubMenuRequest::Init() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
index 6831a66e1e..3cefef5c38 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
@@ -61,4 +61,4 @@ void DeleteSubMenuResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 ee0297ded6..1de7a3ea03 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
@@ -30,9 +30,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
#include <algorithm>
#include <string>
-#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
#include "application_manager/application_impl.h"
@@ -153,4 +153,4 @@ void DialNumberRequest::StripNumberParam(std::string& number) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
index a264f96e0d..4385b3fe90 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
@@ -60,4 +60,4 @@ void DialNumberResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 3650a8226c..66ff7b48d5 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
@@ -97,4 +97,4 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
index f9f9f89d11..6c9bd05e09 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
@@ -61,4 +61,4 @@ void EndAudioPassThruResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
index b0715225e4..fda6cc64e5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
@@ -63,4 +63,4 @@ void GenericResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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
new file mode 100644
index 0000000000..34ed30c243
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc
@@ -0,0 +1,98 @@
+#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetCloudAppPropertiesRequest::GetCloudAppPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetCloudAppPropertiesRequest::~GetCloudAppPropertiesRequest() {}
+
+void GetCloudAppPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ std::string policy_app_id =
+ (*message_)[strings::msg_params][strings::app_id].asString();
+
+ bool enabled = true;
+ std::string endpoint;
+ std::string auth_token;
+ std::string certificate;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference;
+
+ bool result = policy_handler_.GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+
+ if (!result) {
+ SendResponse(false,
+ mobile_apis::Result::DATA_NOT_AVAILABLE,
+ "Cloud app does not exist on module");
+ return;
+ }
+
+ policy::StringArray nicknames;
+ policy::StringArray app_hmi_types;
+
+ policy_handler_.GetInitialAppData(policy_app_id, &nicknames, &app_hmi_types);
+
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ smart_objects::SmartObject properties(smart_objects::SmartType_Map);
+ smart_objects::SmartObject nicknames_array(smart_objects::SmartType_Array);
+ size_t i = 0;
+ for (std::string nickname : nicknames) {
+ nicknames_array[i] = nickname;
+ ++i;
+ }
+ properties[strings::nicknames] = nicknames_array;
+ properties[strings::app_id] = policy_app_id;
+ properties[strings::enabled] = enabled;
+
+ if (!auth_token.empty()) {
+ properties[strings::auth_token] = auth_token;
+ }
+ if (!cloud_transport_type.empty()) {
+ properties[strings::cloud_transport_type] = cloud_transport_type;
+ }
+ if (!hybrid_app_preference.empty()) {
+ properties[strings::hybrid_app_preference] = hybrid_app_preference;
+ }
+ if (!endpoint.empty()) {
+ properties[strings::endpoint] = endpoint;
+ }
+
+ response_params[strings::properties] = properties;
+
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+}
+
+void GetCloudAppPropertiesRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetCloudAppPropertiesRequest on_event");
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc
new file mode 100644
index 0000000000..f50897303a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc
@@ -0,0 +1,31 @@
+#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetCloudAppPropertiesResponse::GetCloudAppPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetCloudAppPropertiesResponse::~GetCloudAppPropertiesResponse() {}
+
+void GetCloudAppPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
new file mode 100644
index 0000000000..75263494c2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
@@ -0,0 +1,356 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/get_file_request.h"
+
+#include <boost/crc.hpp>
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+
+namespace {
+/**
+ * Calculates CRC32 checksum
+ * @param binary_data - input data for which CRC32 should be calculated
+ * @return calculated CRC32 checksum
+ */
+uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
+ const std::size_t file_size = binary_data.size();
+ boost::crc_32_type result;
+ result.process_bytes(&binary_data[0], file_size);
+ return result.checksum();
+}
+
+} // namespace
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetFileRequest::GetFileRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , file_name_("")
+ , file_type_(mobile_apis::FileType::INVALID_ENUM)
+ , length_(0)
+ , offset_(0) {}
+
+GetFileRequest::~GetFileRequest() {}
+
+bool GetFileRequest::GetFilePath(std::string& file_path, bool& forward_to_hmi) {
+ std::string path = application_manager_.get_settings().app_storage_folder();
+ auto connect_key = connection_key();
+ forward_to_hmi = false;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_service_id)) {
+ std::string service_id =
+ (*message_)[strings::msg_params][strings::app_service_id].asString();
+ LOG4CXX_DEBUG(logger_,
+ "Finding storage directory for service id: " << service_id);
+
+ AppService* app_service_info =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (app_service_info) {
+ if (app_service_info->mobile_service) {
+ connect_key = app_service_info->connection_key;
+ } else {
+ forward_to_hmi = true;
+ return true;
+ }
+ } else {
+ return false;
+ }
+ } else {
+ LOG4CXX_DEBUG(logger_, "Using current storage directory");
+ }
+
+ ApplicationSharedPtr app = application_manager_.application(connect_key);
+ file_path = path + "/" + app->folder_name();
+ return true;
+}
+
+void GetFileRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Received GetFile request");
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ file_name_ = (*message_)[strings::msg_params][strings::file_name].asString();
+
+ if (!file_system::IsFileNameValid(file_name_)) {
+ LOG4CXX_ERROR(logger_,
+ "File name " << file_name_ << " contains forbidden symbols.");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "File name contains forbidden symbols",
+ &response_params);
+ return;
+ }
+
+ // Initialize other params with default values. If exists overwrite the values
+ LOG4CXX_DEBUG(logger_, "Intialize non manadatory params with default values");
+
+ if ((*message_)[strings::msg_params].keyExists(strings::file_type)) {
+ file_type_ = static_cast<mobile_apis::FileType::eType>(
+ (*message_)[strings::msg_params][strings::file_type].asInt());
+ }
+
+ // Check if file exists on system (may have to use app service id to get the
+ // correct app folder)
+ LOG4CXX_DEBUG(logger_, "Check if file exists on system");
+ std::string file_path;
+ bool forward_to_hmi;
+
+ if (GetFilePath(file_path, forward_to_hmi)) {
+ if (forward_to_hmi) {
+ LOG4CXX_DEBUG(logger_, "Forwarding GetFile request to HMI");
+ application_manager_.IncreaseForwardedRequestTimeout(connection_key(),
+ correlation_id());
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_GetFilePath,
+ &(*message_)[strings::msg_params],
+ true);
+ return;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Could not get file path");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Could not get file path",
+ &response_params);
+ return;
+ }
+
+ const std::string full_path = file_path + "/" + file_name_;
+ if (!file_system::FileExists(full_path)) {
+ LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist");
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "File does not exist",
+ &response_params);
+ return;
+ }
+
+ // Handle offset
+ LOG4CXX_DEBUG(logger_, "Handle offset and length parameters");
+ const uint64_t file_size = file_system::FileSize(full_path);
+
+ if ((*message_)[strings::msg_params].keyExists(strings::offset)) {
+ offset_ = (*message_)[strings::msg_params][strings::offset].asUInt();
+ }
+
+ length_ = file_size - offset_;
+ if ((*message_)[strings::msg_params].keyExists(strings::length)) {
+ length_ = std::min(
+ static_cast<uint32_t>(
+ (*message_)[strings::msg_params][strings::length].asUInt()),
+ length_);
+ }
+
+ if (offset_ > file_size) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Offset " << offset_ << " greater than file size " << file_size);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Offset greater than file size",
+ &response_params);
+ return;
+ }
+ if (length_ > file_size - offset_) {
+ LOG4CXX_ERROR(logger_,
+ "Length " << length_ << " greater than file size - offset"
+ << file_size);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Length greater than file size - offset",
+ &response_params);
+ return;
+ }
+
+ // Load data from file as binary data
+ LOG4CXX_DEBUG(logger_, "Load binary data from file");
+ std::vector<uint8_t> bin_data;
+ if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) {
+ LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path);
+ SendResponse(false,
+ mobile_apis::Result::GENERIC_ERROR,
+ "Unable to read from file",
+ &response_params);
+ return;
+ }
+
+ // Construct response message
+ if ((*message_)[strings::msg_params].keyExists(strings::offset)) {
+ response_params[strings::offset] = offset_;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::length)) {
+ response_params[strings::length] = length_;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::file_type)) {
+ response_params[strings::file_type] = file_type_;
+ }
+ const uint32_t crc_calculated = GetCrc32CheckSum(bin_data);
+ response_params[strings::crc32_check_sum] = crc_calculated;
+
+ SendResponse(true,
+ mobile_apis::Result::SUCCESS,
+ "File uploaded",
+ &response_params,
+ bin_data);
+}
+
+void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (hmi_apis::FunctionID::BasicCommunication_GetFilePath != event.id()) {
+ return;
+ }
+ const smart_objects::SmartObject& event_message = event.smart_object();
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ event_message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result =
+ MessageHelper::HMIToMobileResult(hmi_result);
+ bool success = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_AppService);
+
+ if (!success) {
+ auto msg_params = event_message[strings::msg_params];
+ const char* info = msg_params.keyExists(strings::info)
+ ? msg_params[strings::info].asCharArray()
+ : NULL;
+
+ SendResponse(false, result, info, &msg_params);
+ return;
+ }
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::vector<uint8_t> bin_data;
+
+ if (event_message[strings::msg_params].keyExists(strings::file_type)) {
+ response_params[strings::file_type] =
+ event_message[strings::msg_params][strings::file_type];
+ }
+
+ if (event_message[strings::msg_params].keyExists(strings::file_path)) {
+ std::string full_path =
+ event_message[strings::msg_params][strings::file_path].asString();
+
+ if (!file_system::FileExists(full_path)) {
+ LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist");
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "File does not exist",
+ &response_params);
+ return;
+ }
+
+ const uint64_t file_size = file_system::FileSize(full_path);
+ if ((*message_)[strings::msg_params].keyExists(strings::offset)) {
+ offset_ = (*message_)[strings::msg_params][strings::offset].asUInt();
+ }
+
+ length_ = file_size - offset_;
+ if ((*message_)[strings::msg_params].keyExists(strings::length)) {
+ length_ = std::min(
+ static_cast<uint32_t>(
+ (*message_)[strings::msg_params][strings::length].asUInt()),
+ length_);
+ }
+
+ if (offset_ > file_size) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Offset " << offset_ << " greater than file size " << file_size);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Offset greater than file size",
+ &response_params);
+ return;
+ }
+ if (length_ > file_size - offset_) {
+ LOG4CXX_ERROR(logger_,
+ "Length " << length_ << " greater than file size - offset"
+ << file_size);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Length greater than file size - offset",
+ &response_params);
+ return;
+ }
+ if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) {
+ LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path);
+ SendResponse(false,
+ mobile_apis::Result::GENERIC_ERROR,
+ "Failed to read from file",
+ &response_params);
+ return;
+ }
+
+ const uint32_t crc_calculated = GetCrc32CheckSum(bin_data);
+ response_params[strings::crc32_check_sum] = crc_calculated;
+
+ } else {
+ LOG4CXX_ERROR(logger_, "HMI did not return a file path: ");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "HMI did not return a file path",
+ &response_params);
+ return;
+ }
+
+ SendResponse(true, result, "File uploaded", &response_params, bin_data);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc
new file mode 100644
index 0000000000..2ea8dde02a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/get_file_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetFileResponse::GetFileResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetFileResponse::~GetFileResponse() {}
+
+void GetFileResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Sending GetFile response");
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
index a6c627aad2..0655da27c0 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
@@ -32,6 +32,11 @@
#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+#include <set>
+#include "application_manager/app_service_manager.h"
+#include "application_manager/message_helper.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -80,10 +85,20 @@ void GetSystemCapabilityRequest::Run() {
switch (response_type) {
case mobile_apis::SystemCapabilityType::NAVIGATION: {
+ smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map);
+ bool has_nav_capability = false;
if (hmi_capabilities.navigation_capability()) {
+ has_nav_capability = true;
+ nav_capability = *hmi_capabilities.navigation_capability();
+ }
+
+ has_nav_capability = application_manager_.GetAppServiceManager()
+ .UpdateNavigationCapabilities(nav_capability) ||
+ has_nav_capability;
+
+ if (has_nav_capability) {
response_params[strings::system_capability]
- [strings::navigation_capability] =
- *hmi_capabilities.navigation_capability();
+ [strings::navigation_capability] = nav_capability;
} else {
SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
return;
@@ -128,10 +143,35 @@ void GetSystemCapabilityRequest::Run() {
return;
}
break;
+ case mobile_apis::SystemCapabilityType::APP_SERVICES: {
+ auto all_services =
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
+ response_params[strings::system_capability]
+ [strings::app_services_capabilities] =
+ MessageHelper::CreateAppServiceCapabilities(
+ all_services);
+ break;
+ }
default: // Return unsupported resource
SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
return;
}
+
+ if ((*message_)[app_mngr::strings::msg_params].keyExists(
+ strings::subscribe)) {
+ auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
+ if ((*message_)[app_mngr::strings::msg_params][strings::subscribe]
+ .asBool() == true) {
+ LOG4CXX_DEBUG(logger_,
+ "Subscribe to system capability: " << response_type);
+ ext.SubscribeTo(response_type);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Unsubscribe from system capability: " << response_type);
+ ext.UnsubscribeFrom(response_type);
+ }
+ }
+
SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
}
@@ -140,4 +180,4 @@ void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
index dd5461081c..5df0c72607 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
@@ -30,9 +30,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
-#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -61,4 +61,4 @@ void GetSystemCapabilityResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 7dc9eb9ad9..cd7d7a37b7 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
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager.h"
#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
@@ -113,4 +113,4 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
index 7581990273..e481c926b8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager.h"
#include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h"
+#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
@@ -61,4 +61,4 @@ void GetWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 e671dab463..46a39513d5 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
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "sdl_rpc_plugin/commands/mobile/list_files_request.h"
+#include <string>
#include "application_manager/application_impl.h"
@@ -112,4 +112,4 @@ void ListFilesRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
index d025f05358..ffa8a443d5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/list_files_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -62,4 +62,4 @@ void ListFilesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
index 128ce1e3bf..5714043a51 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
@@ -60,4 +60,4 @@ void OnAppInterfaceUnregisteredNotification::Run() {
SendNotification();
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
index ff88ae96bd..3088c7df33 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
@@ -57,4 +57,4 @@ void OnAudioPassThruNotification::Run() {
SendNotification();
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 79fb1f4272..f0368a742d 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
@@ -79,9 +79,8 @@ void OnButtonEventNotification::Run() {
(*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)) {
+ if (false == (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
LOG4CXX_ERROR(logger_,
"CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
return;
@@ -188,4 +187,4 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 c73f2b4b98..7c77e29298 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
@@ -80,9 +80,8 @@ void OnButtonPressNotification::Run() {
(*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)) {
+ if (false == (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
LOG4CXX_ERROR(logger_,
"CUSTOM_BUTTON OnButtonPress without custom_button_id.");
return;
@@ -196,4 +195,4 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
index dff3aa6808..9c7edf74e6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
@@ -84,4 +84,4 @@ void OnCommandNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
index ca5d4bfed4..42a1928f2e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
@@ -67,4 +67,4 @@ void OnDriverDistractionNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
index e252b031e6..c2ce2550b9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
@@ -34,9 +34,9 @@
#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
+#include <string>
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
-#include <string>
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -81,4 +81,4 @@ void OnHashChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
index 6b5838e40a..df3bce0154 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
-#include "application_manager/message_helper.h"
#include "application_manager/message.h"
+#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
@@ -92,4 +92,4 @@ void OnHMIStatusNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
index c4ee22afed..28325a40f5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/message_helper.h"
#include "application_manager/message.h"
+#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -132,4 +132,4 @@ void OnHMIStatusNotificationFromMobile::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
index 04b52f29e1..8ec8a86554 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
@@ -93,4 +93,4 @@ void OnKeyBoardInputNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
index fdbdd910a0..9605fd6074 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
@@ -60,4 +60,4 @@ void OnLanguageChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
index 32d940aca2..f64ca34bf2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
@@ -62,4 +62,4 @@ void OnPermissionsChangeNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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
new file mode 100644
index 0000000000..515279c5f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
@@ -0,0 +1,181 @@
+#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h"
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/message_helper.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+#include "smart_objects/enum_schema_item.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+namespace mobile {
+
+OnSystemCapabilityUpdatedNotification::OnSystemCapabilityUpdatedNotification(
+ 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) {}
+
+OnSystemCapabilityUpdatedNotification::
+ ~OnSystemCapabilityUpdatedNotification() {}
+
+void OnSystemCapabilityUpdatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ mobile_apis::SystemCapabilityType::eType system_capability_type =
+ static_cast<mobile_apis::SystemCapabilityType::eType>(
+ msg_params[strings::system_capability]
+ [strings::system_capability_type]
+ .asInt());
+
+ switch (system_capability_type) {
+ case mobile_apis::SystemCapabilityType::NAVIGATION: {
+ smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map);
+ bool has_nav_capability = false;
+ if (hmi_capabilities_.navigation_capability()) {
+ has_nav_capability = true;
+ nav_capability = *hmi_capabilities_.navigation_capability();
+ }
+ has_nav_capability = application_manager_.GetAppServiceManager()
+ .UpdateNavigationCapabilities(nav_capability) ||
+ has_nav_capability;
+
+ if (has_nav_capability) {
+ msg_params[strings::system_capability][strings::navigation_capability] =
+ nav_capability;
+ } else {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities_.phone_capability()) {
+ msg_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities_.phone_capability();
+ } else {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
+ if (!hmi_capabilities_.is_rc_cooperating()) {
+ return;
+ }
+ if (hmi_capabilities_.rc_capability()) {
+ msg_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities_.rc_capability();
+ } else {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
+ if (hmi_capabilities_.video_streaming_capability()) {
+ msg_params[strings::system_capability]
+ [strings::video_streaming_capability] =
+ *hmi_capabilities_.video_streaming_capability();
+ } else {
+ return;
+ }
+ break;
+ case mobile_apis::SystemCapabilityType::APP_SERVICES: {
+ auto all_services =
+ application_manager_.GetAppServiceManager().GetAllServiceRecords();
+ auto app_service_caps =
+ MessageHelper::CreateAppServiceCapabilities(all_services);
+
+ smart_objects::SmartArray* app_services =
+ app_service_caps[strings::app_services].asArray();
+ 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++) {
+ std::string service_id =
+ updated_capabilities[i][strings::updated_app_service_record]
+ [strings::service_id]
+ .asString();
+ auto matching_service_predicate =
+ [&service_id](
+ const smart_objects::SmartObject& app_service_capability) {
+ return service_id ==
+ app_service_capability[strings::updated_app_service_record]
+ [strings::service_id]
+ .asString();
+ };
+
+ auto it = std::find_if(app_services->begin(),
+ app_services->end(),
+ matching_service_predicate);
+ if (it != app_services->end()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Replacing updated record with service_id " << service_id);
+ app_services->erase(it);
+ }
+ app_services->push_back(updated_capabilities[i]);
+ }
+ msg_params[strings::system_capability]
+ [strings::app_services_capabilities] = app_service_caps;
+ break;
+ }
+ default:
+ return;
+ }
+
+ const char* capability_type_string;
+ ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::SystemCapabilityType::eType>::
+ EnumToCString(system_capability_type, &capability_type_string);
+
+ auto subscribed_to_capability_predicate =
+ [&system_capability_type](const ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
+ return ext.IsSubscribedTo(system_capability_type);
+ };
+
+ const std::vector<ApplicationSharedPtr>& applications = FindAllApps(
+ application_manager_.applications(), subscribed_to_capability_predicate);
+
+ LOG4CXX_DEBUG(logger_,
+ "Number of Notifications to be sent: " << applications.size());
+
+ std::vector<ApplicationSharedPtr>::const_iterator app_it =
+ applications.begin();
+
+ for (; applications.end() != app_it; ++app_it) {
+ const ApplicationSharedPtr app = *app_it;
+ if (system_capability_type ==
+ mobile_apis::SystemCapabilityType::REMOTE_CONTROL &&
+ !app->is_remote_control_supported()) {
+ LOG4CXX_WARN(
+ logger_,
+ "App with connection key: "
+ << app->app_id()
+ << " was subcribed to REMOTE_CONTROL system capabilities, but "
+ "does not have RC permissions. Unsubscribing");
+ auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
+ ext.UnsubscribeFrom(system_capability_type);
+ continue;
+ }
+ LOG4CXX_INFO(logger_,
+ "Sending OnSystemCapabilityUpdated " << capability_type_string
+ << " application id "
+ << app->app_id());
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+}
+
+} // namespace mobile
+} // namespace commands
+} // namespace sdl_rpc_plugin
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 b78e541f17..a85dec10bb 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
@@ -30,15 +30,16 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <cstring>
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
#include <cstdio>
+#include <cstring>
#include <string>
-#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "policy/policy_table/enums.h"
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "policy/policy_table/enums.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -65,6 +66,7 @@ void OnSystemRequestNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace application_manager;
using namespace mobile_apis;
+ using namespace helpers;
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -106,6 +108,26 @@ void OnSystemRequestNotification::Run() {
}
}
+ LOG4CXX_DEBUG(logger_,
+ "Processing Request type : " << stringified_request_type);
+
+ const bool binary_data_is_required =
+ Compare<mobile_apis::RequestType::eType, EQ, ONE>(
+ request_type,
+ mobile_apis::RequestType::PROPRIETARY,
+ mobile_apis::RequestType::OEM_SPECIFIC);
+
+ BinaryMessage binary_data;
+ if (binary_data_is_required) {
+ const std::string filename =
+ (*message_)[strings::msg_params][strings::file_name].asString();
+ file_system::ReadBinaryFile(filename, binary_data);
+ }
+
+ if (mobile_apis::RequestType::OEM_SPECIFIC == request_type) {
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+ }
+
if (mobile_apis::RequestType::PROPRIETARY == request_type) {
/* According to requirements:
"If the requestType = PROPRIETARY, add to mobile API fileType = JSON
@@ -113,10 +135,6 @@ void OnSystemRequestNotification::Run() {
Also in Genivi SDL we don't save the PT to file - we put it directly in
binary_data */
- const std::string filename =
- (*message_)[strings::msg_params][strings::file_name].asString();
- BinaryMessage binary_data;
- file_system::ReadBinaryFile(filename, binary_data);
#if defined(PROPRIETARY_MODE)
AddHeader(binary_data);
#endif // PROPRIETARY_MODE
@@ -126,7 +144,9 @@ void OnSystemRequestNotification::Run() {
#endif // PROPRIETARY_MODE
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- } else if (mobile_apis::RequestType::HTTP == request_type) {
+ }
+
+ if (mobile_apis::RequestType::HTTP == request_type) {
(*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
if ((*message_)[strings::msg_params].keyExists(strings::url)) {
(*message_)[strings::msg_params][strings::timeout] =
@@ -226,4 +246,4 @@ size_t OnSystemRequestNotification::ParsePTString(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
index 503f1b04d5..ccbdab15c9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
@@ -76,4 +76,4 @@ void OnTBTClientStateNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
index 502f0ae57d..6ceb381d2e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
@@ -93,4 +93,4 @@ void OnTouchEventNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
index 2f666ffc03..e89ede53b9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
@@ -67,4 +67,4 @@ void OnWayPointChangeNotification::Run() {
}
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 c90038a8b7..8f8e4dbf6f 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
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <cstring>
#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
+#include <cstring>
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
@@ -113,9 +113,9 @@ void PerformAudioPassThruRequest::Run() {
initial_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
SendResponse(
false,
mobile_apis::Result::FILE_NOT_FOUND,
@@ -450,4 +450,4 @@ bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
index a5eb98f2ba..5dae6327eb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
@@ -61,4 +61,4 @@ void PerformAudioPassThruResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 42489fd8bd..6b2f3cbcc5 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
@@ -31,20 +31,20 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <numeric>
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
#include <string.h>
+#include <numeric>
#include <string>
-#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/custom_string.h"
+#include "utils/file_system.h"
#include "utils/gen_hash.h"
+#include "utils/helpers.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -560,9 +560,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_WARN(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_WARN(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
invalid_params.push_back("help_prompt");
} else {
msg_params[strings::help_prompt] = help_prompt;
@@ -608,9 +608,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
timeout_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_WARN(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_WARN(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
invalid_params.push_back("timeout_prompt");
} else {
msg_params[strings::timeout_prompt] = timeout_prompt;
@@ -629,9 +629,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
initial_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_WARN(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_WARN(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
invalid_params.push_back("initial_prompt");
} else {
msg_params[strings::initial_prompt] = initial_prompt;
@@ -1065,4 +1065,4 @@ void PerformInteractionRequest::SendBothModeResponse(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
index 85bef9b2ad..fa02641c2b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
@@ -61,4 +61,4 @@ void PerformInteractionResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 b418f52fa3..f68596ce27 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
@@ -31,22 +31,22 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "sdl_rpc_plugin/commands/mobile/put_file_request.h"
+#include <algorithm>
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
#include "application_manager/rpc_service.h"
-#include "utils/file_system.h"
#include <boost/crc.hpp>
+#include "utils/file_system.h"
namespace {
/**
-* Calculates CRC32 checksum
-* @param binary_data - input data for which CRC32 should be calculated
-* @return calculated CRC32 checksum
-*/
+ * Calculates CRC32 checksum
+ * @param binary_data - input data for which CRC32 should be calculated
+ * @return calculated CRC32 checksum
+ */
uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
const std::size_t file_size = binary_data.size();
boost::crc_32_type result;
@@ -284,9 +284,7 @@ void PutFileRequest::Run() {
}
SendResponse(true, save_result, "File was downloaded", &response_params);
- if (is_system_file) {
- SendOnPutFileNotification();
- }
+ SendOnPutFileNotification(is_system_file);
break;
}
default:
@@ -297,7 +295,7 @@ void PutFileRequest::Run() {
}
}
-void PutFileRequest::SendOnPutFileNotification() {
+void PutFileRequest::SendOnPutFileNotification(bool is_system_file) {
LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
smart_objects::SmartObjectSPtr notification =
std::make_shared<smart_objects::SmartObject>(
@@ -316,9 +314,10 @@ void PutFileRequest::SendOnPutFileNotification() {
message[strings::msg_params][strings::length] = length_;
message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
message[strings::msg_params][strings::file_type] = file_type_;
+ message[strings::msg_params][strings::is_system_file] = is_system_file;
rpc_service_.ManageHMICommand(notification);
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
index 8c54970a5c..f9ddbf7717 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/put_file_response.h"
-#include "utils/file_system.h"
#include "application_manager/application_impl.h"
+#include "utils/file_system.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -70,4 +70,4 @@ void PutFileResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 7957d9e055..597df26d0a 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
@@ -33,19 +33,19 @@
#include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h"
+#include <string.h>
#include <unistd.h>
#include <algorithm>
#include <map>
-#include <string.h>
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/application_impl.h"
#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/helpers/application_helper.h"
#include "application_manager/message_helper.h"
-#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/helpers/application_helper.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/rpc_service.h"
#include "config_profile/profile.h"
#include "interfaces/MOBILE_API.h"
@@ -166,7 +166,7 @@ struct IsSameNickname {
private:
const custom_str::CustomString& app_id_;
};
-}
+} // namespace
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -281,17 +281,51 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
- mobile_apis::Result::eType coincidence_result = CheckCoincidence();
+ std::vector<ApplicationSharedPtr> duplicate_apps;
+ mobile_apis::Result::eType coincidence_result =
+ CheckCoincidence(duplicate_apps);
+
+ if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result &&
+ duplicate_apps.size() == 1) {
+ ApplicationSharedPtr duplicate_app = duplicate_apps.front();
+ bool error_response = true;
+ if (duplicate_app->is_cloud_app()) {
+ if (duplicate_app->hybrid_app_preference() ==
+ mobile_apis::HybridAppPreference::MOBILE) {
+ // Unregister cloud application and allow mobile application to register
+ // in it's place
+ application_manager_.UnregisterApplication(
+ duplicate_app->app_id(), mobile_apis::Result::USER_DISALLOWED);
+ error_response = false;
+ }
+ } else {
+ ApplicationSharedPtr cloud_app =
+ application_manager_.pending_application_by_policy_id(policy_app_id);
+ // If the duplicate name was not because of a mobile/cloud app pair, go
+ // through the normal process for handling duplicate names
+ if (cloud_app.use_count() == 0 || !cloud_app->is_cloud_app()) {
+ usage_statistics::AppCounter count_of_rejections_duplicate_name(
+ GetPolicyHandler().GetStatisticManager(),
+ policy_app_id,
+ usage_statistics::REJECTIONS_DUPLICATE_NAME);
+ ++count_of_rejections_duplicate_name;
+ } else if (cloud_app->hybrid_app_preference() ==
+ mobile_apis::HybridAppPreference::CLOUD) {
+ // Unregister mobile application and allow cloud application to
+ // register in it's place
+ application_manager_.UnregisterApplication(
+ duplicate_app->app_id(), mobile_apis::Result::USER_DISALLOWED);
+ error_response = false;
+ }
+ }
- if (mobile_apis::Result::SUCCESS != coincidence_result) {
- LOG4CXX_ERROR(logger_, "Coincidence check failed.");
- if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
- usage_statistics::AppCounter count_of_rejections_duplicate_name(
- GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_DUPLICATE_NAME);
- ++count_of_rejections_duplicate_name;
+ if (error_response) {
+ LOG4CXX_ERROR(logger_, "Coincidence check failed.");
+ SendResponse(false, coincidence_result);
+ return;
}
+ } else if (mobile_apis::Result::SUCCESS != coincidence_result) {
+ LOG4CXX_ERROR(logger_, "Coincidence check failed.");
SendResponse(false, coincidence_result);
return;
}
@@ -346,19 +380,6 @@ void RegisterAppInterfaceRequest::Run() {
application->set_msg_version(module_version);
}
- // For resuming application need to restore hmi_app_id from resumeCtrl
- resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
- const std::string& device_mac = application->mac_address();
-
- // there is side affect with 2 mobile app with the same mobile app_id
- if (resumer.IsApplicationSaved(policy_app_id, device_mac)) {
- application->set_hmi_application_id(
- resumer.GetHMIApplicationID(policy_app_id, device_mac));
- } else {
- application->set_hmi_application_id(
- application_manager_.GenerateNewHMIAppID());
- }
-
application->set_is_media_application(
msg_params[strings::is_media_application].asBool());
@@ -379,9 +400,9 @@ void RegisterAppInterfaceRequest::Run() {
tts_name, application, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_WARN(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_WARN(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
response_info_ = "One or more files needed for tts_name are not present";
result_code_ = mobile_apis::Result::WARNINGS;
}
@@ -433,17 +454,16 @@ void RegisterAppInterfaceRequest::Run() {
// Add device to policy table and set device info, if any
policy::DeviceParams dev_params;
- if (-1 ==
- application_manager_.connection_handler()
- .get_session_observer()
- .GetDataOnDeviceID(application->device(),
- &dev_params.device_name,
- NULL,
- &dev_params.device_mac_address,
- &dev_params.device_connection_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device "
- << application->device());
+ if (-1 == application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(application->device(),
+ &dev_params.device_name,
+ NULL,
+ &dev_params.device_mac_address,
+ &dev_params.device_connection_type)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to extract information for device " << application->device());
}
policy::DeviceInfo device_info;
device_info.AdoptDeviceType(dev_params.device_connection_type);
@@ -451,6 +471,8 @@ void RegisterAppInterfaceRequest::Run() {
FillDeviceInfo(&device_info);
}
+ const std::string& device_mac = application->mac_address();
+
GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
@@ -458,6 +480,9 @@ void RegisterAppInterfaceRequest::Run() {
GetLockScreenIconUrlNotification(connection_key(), application);
rpc_service_.ManageMobileCommand(so, SOURCE_SDL);
application_manager_.SendDriverDistractionState(application);
+ // Create onSystemRequest to mobile to obtain cloud app icons
+ application_manager_.SendGetIconUrlNotifications(connection_key(),
+ application);
}
smart_objects::SmartObjectSPtr
@@ -816,8 +841,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
file_system::FileExists(application->app_icon_path());
SendResponse(true, result_code, add_info.c_str(), &response_params);
- SendOnAppRegisteredNotificationToHMI(
- *(application.get()), resumption, need_restore_vr);
if (msg_params.keyExists(strings::app_hmi_type)) {
GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
&(msg_params[strings::app_hmi_type]));
@@ -826,6 +849,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
// Default HMI level should be set before any permissions validation, since it
// relies on HMI level.
application_manager_.OnApplicationRegistered(application);
+ SendOnAppRegisteredNotificationToHMI(
+ application, resumption, need_restore_vr);
(*notify_upd_manager)();
// Start PTU after successfull registration
@@ -877,9 +902,7 @@ void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
}
void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
- const app_mngr::Application& application_impl,
- bool resumption,
- bool need_restore_vr) {
+ ApplicationConstSharedPtr app, bool resumption, bool need_restore_vr) {
using namespace smart_objects;
SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map);
if (!notification) {
@@ -903,15 +926,15 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
msg_params[strings::resume_vr_grammars] = need_restore_vr;
}
- if (application_impl.vr_synonyms()) {
- msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
+ if (app->vr_synonyms()) {
+ msg_params[strings::vr_synonyms] = *(app->vr_synonyms());
}
- if (application_impl.tts_name()) {
- msg_params[strings::tts_name] = *(application_impl.tts_name());
+ if (app->tts_name()) {
+ msg_params[strings::tts_name] = *(app->tts_name());
}
- const std::string policy_app_id = application_impl.policy_app_id();
+ const std::string policy_app_id = app->policy_app_id();
std::string priority;
GetPolicyHandler().GetPriority(policy_app_id, &priority);
@@ -921,105 +944,19 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
msg_params[strings::msg_params] = SmartObject(SmartType_Map);
smart_objects::SmartObject& application = msg_params[strings::application];
- application[strings::app_name] = application_impl.name();
- application[strings::app_id] = application_impl.app_id();
- application[hmi_response::policy_app_id] = policy_app_id;
- if (file_system::FileExists(application_impl.app_icon_path())) {
- application[strings::icon] = application_impl.app_icon_path();
- }
-
- const smart_objects::SmartObject* ngn_media_screen_name =
- application_impl.ngn_media_screen_name();
- if (ngn_media_screen_name) {
- application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name;
- }
-
- application[strings::hmi_display_language_desired] =
- static_cast<int32_t>(application_impl.ui_language());
-
- application[strings::is_media_application] =
- application_impl.is_media_application();
-
- const smart_objects::SmartObject* app_type = application_impl.app_types();
- if (app_type) {
- application[strings::app_type] = *app_type;
- }
-
- const policy::RequestType::State app_request_types_state =
- GetPolicyHandler().GetAppRequestTypeState(policy_app_id);
- if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
- const auto request_types =
- GetPolicyHandler().GetAppRequestTypes(policy_app_id);
- application[strings::request_type] = SmartObject(SmartType_Array);
- smart_objects::SmartObject& request_types_array =
- application[strings::request_type];
-
- size_t index = 0;
- for (auto it : request_types) {
- request_types_array[index] = it;
- ++index;
- }
- } else if (policy::RequestType::State::EMPTY == app_request_types_state) {
- application[strings::request_type] = SmartObject(SmartType_Array);
- }
-
- const policy::RequestSubType::State app_request_subtypes_state =
- GetPolicyHandler().GetAppRequestSubTypeState(policy_app_id);
- if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) {
- const auto request_subtypes =
- GetPolicyHandler().GetAppRequestSubTypes(policy_app_id);
- application[strings::request_subtype] = SmartObject(SmartType_Array);
- smart_objects::SmartObject& request_subtypes_array =
- application[strings::request_subtype];
-
- size_t index = 0;
- for (auto it : request_subtypes) {
- request_subtypes_array[index] = it;
- ++index;
- }
- } else if (policy::RequestSubType::State::EMPTY ==
- app_request_subtypes_state) {
- application[strings::request_subtype] = SmartObject(SmartType_Array);
- }
-
const protocol_handler::SessionObserver& session_observer =
application_manager_.connection_handler().get_session_observer();
-
- application[strings::device_info] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& device_info = application[strings::device_info];
- MessageHelper::CreateDeviceInfo(application_impl.device(),
- session_observer,
- GetPolicyHandler(),
- application_manager_,
- &device_info);
-
- if (application_impl.secondary_device() != 0) {
- application[strings::secondary_device_info] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& secondary_device_info =
- application[strings::secondary_device_info];
- MessageHelper::CreateDeviceInfo(application_impl.secondary_device(),
- session_observer,
- GetPolicyHandler(),
- application_manager_,
- &secondary_device_info);
- }
-
- const smart_objects::SmartObject* day_color_scheme =
- application_impl.day_color_scheme();
- if (day_color_scheme) {
- application[strings::day_color_scheme] = *day_color_scheme;
- }
-
- const smart_objects::SmartObject* night_color_scheme =
- application_impl.night_color_scheme();
- if (night_color_scheme) {
- application[strings::night_color_scheme] = *night_color_scheme;
- }
+ MessageHelper::CreateHMIApplicationStruct(app,
+ session_observer,
+ GetPolicyHandler(),
+ &application,
+ application_manager_);
DCHECK(rpc_service_.ManageHMICommand(notification));
}
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence(
+ std::vector<ApplicationSharedPtr>& out_duplicate_apps) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -1035,7 +972,8 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
const custom_str::CustomString& cur_name = (*it)->name();
if (app_name.CompareIgnoreCase(cur_name)) {
LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
+ out_duplicate_apps.push_back(*it);
+ continue;
}
const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
@@ -1046,7 +984,8 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
+ out_duplicate_apps.push_back(*it);
+ continue;
}
}
@@ -1058,12 +997,16 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
CoincidencePredicateVR v(cur_name);
if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- return mobile_apis::Result::DUPLICATE_NAME;
+ out_duplicate_apps.push_back(*it);
+ continue;
}
} // end vr check
} // application for end
+ if (!out_duplicate_apps.empty()) {
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
return mobile_apis::Result::SUCCESS;
} // method end
@@ -1268,7 +1211,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params][strings::device_info].keyExists(
strings::hardware)) {
str = (*message_)[strings::msg_params][strings::device_info]
- [strings::hardware].asCharArray();
+ [strings::hardware]
+ .asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid device_info hardware syntax check failed");
@@ -1279,7 +1223,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params][strings::device_info].keyExists(
strings::firmware_rev)) {
str = (*message_)[strings::msg_params][strings::device_info]
- [strings::firmware_rev].asCharArray();
+ [strings::firmware_rev]
+ .asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid device_info firmware_rev syntax check failed");
@@ -1300,7 +1245,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params][strings::device_info].keyExists(
strings::os_version)) {
str = (*message_)[strings::msg_params][strings::device_info]
- [strings::os_version].asCharArray();
+ [strings::os_version]
+ .asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid device_info os_version syntax check failed");
@@ -1311,7 +1257,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params][strings::device_info].keyExists(
strings::carrier)) {
str = (*message_)[strings::msg_params][strings::device_info]
- [strings::carrier].asCharArray();
+ [strings::carrier]
+ .asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid device_info carrier syntax check failed");
@@ -1379,18 +1326,18 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
auto app = application_manager_.application_by_policy_id(policy_app_id);
if (!app) {
- LOG4CXX_DEBUG(logger_,
- "Application with policy id " << policy_app_id
- << " is not found.");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Application with policy id " << policy_app_id << " is not found.");
return false;
}
LOG4CXX_DEBUG(logger_,
"Application with policy id " << policy_app_id << " is found.");
if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
- LOG4CXX_DEBUG(logger_,
- "Policy id " << policy_app_id
- << " is not found in reconnection list.");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Policy id " << policy_app_id << " is not found in reconnection list.");
SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
return false;
}
@@ -1425,4 +1372,4 @@ RegisterAppInterfaceRequest::GetPolicyHandler() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
index 584d7db075..b5683c62cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
@@ -32,11 +32,10 @@
*/
#include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "connection_handler/connection_handler.h"
-#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -128,4 +127,4 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 ab6e1cc143..39363bbad1 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
@@ -36,8 +36,8 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -333,4 +333,4 @@ bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
index f5542ab26b..07aa23d9c9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
@@ -61,4 +61,4 @@ void ResetGlobalPropertiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 0b28e09210..c1d02c96d3 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
@@ -31,14 +31,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string.h>
#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
+#include <string.h>
#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -160,4 +160,4 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
index 4eee819497..6236506c00 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
@@ -69,4 +69,4 @@ void ScrollableMessageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 a09434ebb6..6e745fe0db 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
@@ -105,4 +105,4 @@ void SendHapticDataRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
index f4515472a4..79a0516928 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
@@ -60,4 +60,4 @@ void SendHapticDataResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 2719d0674d..1df4d788d2 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
@@ -30,8 +30,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include <algorithm>
#include "application_manager/message_helper.h"
#include "utils/custom_string.h"
@@ -281,4 +281,4 @@ bool SendLocationRequest::CheckHMICapabilities(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
index 59dab4a9a7..934008b816 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/HMI_API.h"
namespace sdl_rpc_plugin {
@@ -63,4 +63,4 @@ void SendLocationResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 e79fb315ce..b2363e870f 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
@@ -34,10 +34,10 @@
#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
#include <algorithm>
-#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/message_helper.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
@@ -148,10 +148,12 @@ void SetAppIconRequest::CopyToIconStorage(
if (storage_max_size < file_size) {
LOG4CXX_ERROR(logger_,
- "Icon size (" << file_size << ") is bigger, than "
- " icons storage maximum size ("
- << storage_max_size << ")."
- "Copying skipped.");
+ "Icon size (" << file_size
+ << ") is bigger, than "
+ " icons storage maximum size ("
+ << storage_max_size
+ << ")."
+ "Copying skipped.");
return;
}
@@ -203,12 +205,12 @@ void SetAppIconRequest::CopyToIconStorage(
void SetAppIconRequest::RemoveOldestIcons(const std::string& storage,
const uint32_t icons_amount) const {
const std::vector<std::string> icons_list = file_system::ListFiles(storage);
- auto compareTime = [](const time_t t1, const time_t t2)
- -> bool { return difftime(t1, t2) > 0; };
- std::map<time_t,
- std::string,
- std::function<bool(const time_t, const time_t)> >
- icon_modification_time(compareTime);
+ auto compareTime = [](const time_t t1, const time_t t2) -> bool {
+ return difftime(t1, t2) > 0;
+ };
+ std::
+ map<time_t, std::string, std::function<bool(const time_t, const time_t)> >
+ icon_modification_time(compareTime);
std::vector<std::string>::const_iterator it = icons_list.begin();
for (; it != icons_list.end(); ++it) {
const std::string file_name = *it;
@@ -271,7 +273,8 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
const std::string& path =
(*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
+ [strings::value]
+ .asString();
if (is_icons_saving_enabled_) {
CopyToIconStorage(path);
@@ -298,4 +301,4 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
index aa8731f062..55255920d0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
@@ -61,4 +61,4 @@ void SetAppIconResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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
new file mode 100644
index 0000000000..5173be56d6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc
@@ -0,0 +1,43 @@
+#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {}
+
+void SetCloudAppPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ policy_handler_.OnSetCloudAppProperties(*message_);
+
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+void SetCloudAppPropertiesRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event");
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin \ No newline at end of file
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc
new file mode 100644
index 0000000000..39d2ea7f90
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc
@@ -0,0 +1,31 @@
+#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse() {}
+
+void SetCloudAppPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
index 32164b8f0e..2a09a72af2 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
@@ -33,8 +33,8 @@
#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
-#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -145,9 +145,9 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
// in case templates_available is empty copy from hmi capabilities
if (msg_params.keyExists(hmi_response::display_capabilities)) {
- if (0 ==
- msg_params[hmi_response::display_capabilities]
- [hmi_response::templates_available].length()) {
+ if (0 == msg_params[hmi_response::display_capabilities]
+ [hmi_response::templates_available]
+ .length()) {
msg_params[hmi_response::display_capabilities]
[hmi_response::templates_available] =
hmi_capabilities.display_capabilities()->getElement(
@@ -170,4 +170,4 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
index 4bab4a3e5b..0999b596b5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
@@ -62,4 +62,4 @@ void SetDisplayLayoutResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 0c217b6b4f..bbfc61d463 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
@@ -30,14 +30,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
#include <string.h>
-#include <numeric>
#include <algorithm>
-#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include <numeric>
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/helpers.h"
namespace sdl_rpc_plugin {
@@ -74,9 +74,9 @@ void SetGlobalPropertiesRequest::Run() {
ApplicationSharedPtr app = application_manager_.application(connection_key());
if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
+ LOG4CXX_ERROR(
+ logger_,
+ "No application associated with connection key " << connection_key());
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
@@ -197,9 +197,9 @@ void SetGlobalPropertiesRequest::Run() {
MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
invalid_params.push_back("help_prompt");
} else {
app->set_help_prompt(help_prompt);
@@ -215,9 +215,9 @@ void SetGlobalPropertiesRequest::Run() {
timeout_prompt, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
invalid_params.push_back("timeout_prompt");
} else {
app->set_timeout_prompt(timeout_prompt);
@@ -531,7 +531,8 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
strings::limited_character_list)) {
const smart_objects::SmartArray* lcl_array =
msg_params[strings::keyboard_properties]
- [strings::limited_character_list].asArray();
+ [strings::limited_character_list]
+ .asArray();
smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
@@ -565,4 +566,4 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
index 567a1a088b..1de2b97d3a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
@@ -61,4 +61,4 @@ void SetGlobalPropertiesResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 55bd164368..d610090aa4 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
@@ -33,10 +33,10 @@
#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
-#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/message_helper.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -163,4 +163,4 @@ bool SetMediaClockRequest::isDataValid() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
index e777533ce4..948ff84156 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
@@ -61,4 +61,4 @@ void SetMediaClockTimerResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 3b2936e6cd..b439c1cb16 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
@@ -31,15 +31,15 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <cstring>
#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
+#include <cstring>
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -228,7 +228,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
str = (*message_)[strings::msg_params][strings::next_turn_icon]
- [strings::value].asCharArray();
+ [strings::value]
+ .asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid next_turn_icon value syntax check failed");
@@ -289,4 +290,4 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
index 239040a3b3..d027daf77d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
@@ -63,4 +63,4 @@ void ShowConstantTBTResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
index e0c3e1da9a..2bf1a81261 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
@@ -30,12 +30,12 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string.h>
#include "sdl_rpc_plugin/commands/mobile/show_request.h"
+#include <string.h>
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/application.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
@@ -138,7 +138,8 @@ void ShowRequest::Run() {
mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
((*message_)[strings::msg_params][strings::graphic][strings::value]
- .asString()).length()) {
+ .asString())
+ .length()) {
verification_result = MessageHelper::VerifyImage(
(*message_)[strings::msg_params][strings::graphic],
app,
@@ -398,7 +399,8 @@ bool ShowRequest::CheckStringsOfShowRequest() {
if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
str = (*message_)[strings::msg_params][strings::secondary_graphic]
- [strings::value].asCharArray();
+ [strings::value]
+ .asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_,
"Invalid secondary_graphic value syntax check failed");
@@ -410,4 +412,4 @@ bool ShowRequest::CheckStringsOfShowRequest() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
index 4e167e7531..f5667189b7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/show_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/HMI_API.h"
namespace sdl_rpc_plugin {
@@ -63,4 +63,4 @@ void ShowResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 08b4775d3f..d80e73ccbf 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
@@ -35,8 +35,8 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
#include "config_profile/profile.h"
+#include "utils/helpers.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -204,4 +204,4 @@ bool SliderRequest::IsWhiteSpaceExist() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
index 4d6e714e88..4ac96a272e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
@@ -61,4 +61,4 @@ void SliderResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 e14321c488..0730a8730f 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
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string.h>
#include "sdl_rpc_plugin/commands/mobile/speak_request.h"
+#include <string.h>
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
@@ -84,9 +84,9 @@ void SpeakRequest::Run() {
MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyTtsFiles return "
- << verification_result);
+ LOG4CXX_ERROR(
+ logger_,
+ "MessageHelper::VerifyTtsFiles return " << verification_result);
SendResponse(false,
mobile_apis::Result::FILE_NOT_FOUND,
"One or more files needed for tts_chunks are not present");
@@ -181,4 +181,4 @@ bool SpeakRequest::IsWhiteSpaceExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
index f57bd91cd5..69b04977ef 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/speak_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/HMI_API.h"
namespace sdl_rpc_plugin {
@@ -63,4 +63,4 @@ void SpeakResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 f76b6ab210..0d3158d841 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
@@ -144,4 +144,4 @@ void SubscribeButtonRequest::SendSubscribeButtonNotification() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
index 1350cfb66e..e584f84f4c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
@@ -70,4 +70,4 @@ void SubscribeButtonResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 eb4ca42568..2ee7771833 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
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager.h"
#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
@@ -120,4 +120,4 @@ bool SubscribeWayPointsRequest::Init() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
index 7d051df7e9..45486792d7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
@@ -30,9 +30,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
-#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -61,4 +61,4 @@ void SubscribeWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 cea00a9d5e..e70433f29b 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
@@ -33,19 +33,19 @@ Copyright (c) 2018, Ford Motor Company
#include "sdl_rpc_plugin/commands/mobile/system_request.h"
-#include <vector>
-#include <string>
#include <stdio.h>
#include <algorithm>
#include <sstream>
+#include <string>
+#include <vector>
#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "policy/policy_table/enums.h"
#include "formatters/CFormatterJsonBase.h"
+#include "interfaces/MOBILE_API.h"
#include "json/json.h"
-#include "utils/helpers.h"
+#include "policy/policy_table/enums.h"
#include "utils/custom_string.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -170,17 +170,18 @@ class QueryAppsDataValidator {
<< "Package name length ["
<< app_data[json::android][json::packageName]
.asString()
- .length() << "] exceeds max length ["
- << kPackageNameLengthMax << "]in json file.");
+ .length()
+ << "] exceeds max length [" << kPackageNameLengthMax
+ << "]in json file.");
return false;
}
}
// Languages verification
if (!app_data[os_type].keyExists(json::languages)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages' doesn't exist");
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix << "'languages' doesn't exist");
return false;
}
if (!ValidateLanguages(app_data[os_type][json::languages],
@@ -217,9 +218,9 @@ class QueryAppsDataValidator {
ApplicationSharedPtr registered_app =
manager_.application_by_policy_id(app_id);
if (registered_app) {
- LOG4CXX_INFO(logger_,
- "Application with the id: " << app_id
- << " is already registered.");
+ LOG4CXX_INFO(
+ logger_,
+ "Application with the id: " << app_id << " is already registered.");
}
// And app name length
const std::string appName(app_data[json::name].asString());
@@ -250,9 +251,9 @@ class QueryAppsDataValidator {
for (size_t idx = 0; idx < languages_array_size; ++idx) {
const smart_objects::SmartObject& language = languages.getElement(idx);
if (smart_objects::SmartType_Map != language.getType()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language is not a map.");
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix << "language is not a map.");
return false;
}
if (language.length() != 1) {
@@ -263,9 +264,9 @@ class QueryAppsDataValidator {
}
const std::string language_name = (*language.map_begin()).first;
if (!language_name.length()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language name is empty");
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix << "language name is empty");
return false;
}
// Verify default language defined
@@ -329,9 +330,9 @@ class QueryAppsDataValidator {
const smart_objects::SmartArray* synonyms_array =
language[language_name][json::vrSynonyms].asArray();
if (!synonyms_array) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynonyms is not array.");
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix << "vrSynonyms is not array.");
return false;
}
const size_t synonyms_array_size = synonyms_array->size();
@@ -421,7 +422,7 @@ class QueryAppsDataValidator {
DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator);
};
-}
+} // namespace
namespace commands {
@@ -511,7 +512,8 @@ void SystemRequest::Run() {
return;
}
- if (!file_system::IsFileNameValid(file_name)) {
+ if (!file_system::IsFileNameValid(file_name) &&
+ mobile_apis::RequestType::ICON_URL != request_type) {
const std::string err_msg = "Sync file name contains forbidden symbols.";
LOG4CXX_ERROR(logger_, err_msg);
SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
@@ -533,8 +535,22 @@ void SystemRequest::Run() {
std::string binary_data_folder;
if ((*message_)[strings::params].keyExists(strings::binary_data)) {
binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
- binary_data_folder =
- application_manager_.get_settings().system_files_path();
+ if (mobile_apis::RequestType::ICON_URL == request_type) {
+ binary_data_folder =
+ application_manager_.get_settings().app_icons_folder();
+ // Use the URL file name to identify the policy id.
+ // Save the icon file with the policy id as the name.
+ file_name = application_manager_.PolicyIDByIconUrl(file_name);
+ if (file_name.empty()) {
+ const std::string err_msg = "Invalid file name";
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Got ICON_URL Request. File name: " << file_name);
+ } else {
+ binary_data_folder =
+ application_manager_.get_settings().system_files_path();
+ }
} else {
binary_data_folder =
application_manager_.get_settings().app_storage_folder();
@@ -581,6 +597,12 @@ void SystemRequest::Run() {
LOG4CXX_DEBUG(logger_, "Binary data ok.");
+ if (mobile_apis::RequestType::ICON_URL == request_type) {
+ application_manager_.SetIconFileFromSystemRequest(file_name);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ }
+
if (mobile_apis::RequestType::HTTP == request_type &&
(*message_)[strings::msg_params].keyExists(strings::file_name)) {
const std::string& file =
@@ -678,9 +700,9 @@ void SystemRequest::on_event(const event_engine::Event& event) {
bool SystemRequest::ValidateQueryAppData(
smart_objects::SmartObject& data) const {
if (!data.isValid()) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not valid.");
+ LOG4CXX_ERROR(
+ logger_,
+ kQueryAppsValidationFailedPrefix << "QueryApps response is not valid.");
return false;
}
if (!data.keyExists(json::response)) {
@@ -697,4 +719,4 @@ bool SystemRequest::ValidateQueryAppData(
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
index dc2e3ea3f5..428901a1c5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
@@ -61,4 +61,4 @@ void SystemResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
index 9119fb48da..3ba0513aeb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
@@ -32,8 +32,8 @@
*/
#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -62,4 +62,4 @@ void UnregisterAppInterfaceRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
index 4e7c879b58..7c90639968 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
@@ -45,4 +45,4 @@ void UnregisterAppInterfaceResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 0c30f567b4..ebd463d4fa 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
@@ -123,4 +123,4 @@ void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
index 592b91851e..c69d49bca1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
@@ -71,4 +71,4 @@ void UnsubscribeButtonResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // 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 40bb1ddfc9..17326a99a0 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
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager.h"
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
namespace sdl_rpc_plugin {
@@ -71,9 +71,20 @@ void UnsubscribeWayPointsRequest::Run() {
return;
}
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
+ std::set<uint32_t> subscribed_apps =
+ application_manager_.GetAppsSubscribedForWayPoints();
+
+ if (subscribed_apps.size() > 1) {
+ // More than 1 subscribed app, don't send HMI unsubscribe request
+ application_manager_.UnsubscribeAppFromWayPoints(app);
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL);
+ return;
+ } else {
+ // Only subscribed app, send HMI unsubscribe request
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
+ }
}
void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
@@ -114,4 +125,4 @@ bool UnsubscribeWayPointsRequest::Init() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
index 67e3466a44..a7a180fb46 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager.h"
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
namespace sdl_rpc_plugin {
@@ -61,4 +61,4 @@ void UnsubscribeWayPointsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 c04ad34f5f..8c2cce9765 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
@@ -31,14 +31,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
+#include <string>
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/custom_string.h"
namespace sdl_rpc_plugin {
@@ -240,4 +240,4 @@ bool UpdateTurnListRequest::IsWhiteSpaceExist() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
index 5ddf355f88..eca9e3703c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
@@ -62,4 +62,4 @@ void UpdateTurnListResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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
new file mode 100644
index 0000000000..5ffbbd83bb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc
@@ -0,0 +1,98 @@
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+
+namespace sdl_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "GetSystemCapabilitiesAppExtension")
+
+namespace app_mngr_ = application_manager;
+const app_mngr_::AppExtensionUID
+ SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID = 200;
+
+SystemCapabilityAppExtension::SystemCapabilityAppExtension(
+ sdl_rpc_plugin::SDLRPCPlugin& plugin, app_mngr_::Application& app)
+ : app_mngr_::AppExtension(
+ SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID)
+ , plugin_(plugin)
+ , app_(app) {}
+
+SystemCapabilityAppExtension::~SystemCapabilityAppExtension() {}
+
+bool SystemCapabilityAppExtension::SubscribeTo(
+ const SystemCapabilityType system_capability_type) {
+ LOG4CXX_INFO(logger_,
+ "Subscribing to System Capability " << system_capability_type);
+ return subscribed_data_.insert(system_capability_type).second;
+}
+
+bool SystemCapabilityAppExtension::UnsubscribeFrom(
+ const SystemCapabilityType system_capability_type) {
+ LOG4CXX_INFO(
+ logger_,
+ "Unsubscribing from System Capability " << system_capability_type);
+ auto it = subscribed_data_.find(system_capability_type);
+ if (it != subscribed_data_.end()) {
+ subscribed_data_.erase(it);
+ return true;
+ }
+ return false;
+}
+
+void SystemCapabilityAppExtension::UnsubscribeFromAll() {
+ LOG4CXX_INFO(logger_, "Unsubscribing from ALL System Capabilities");
+ subscribed_data_.clear();
+}
+
+bool SystemCapabilityAppExtension::IsSubscribedTo(
+ const SystemCapabilityType system_capability_type) const {
+ LOG4CXX_DEBUG(logger_, system_capability_type);
+ return subscribed_data_.find(system_capability_type) !=
+ subscribed_data_.end();
+}
+
+SystemCapabilitySubscriptions SystemCapabilityAppExtension::Subscriptions() {
+ return subscribed_data_;
+}
+
+void SystemCapabilityAppExtension::SaveResumptionData(
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* application_system_capability = "systemCapability";
+
+ resumption_data[application_system_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int i = 0;
+ for (const auto& subscription : subscribed_data_) {
+ resumption_data[application_system_capability][i] = subscription;
+ i++;
+ }
+}
+
+void SystemCapabilityAppExtension::ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const char* application_system_capability = "systemCapability";
+ if (resumption_data.keyExists(application_system_capability)) {
+ const smart_objects::SmartObject& subscriptions =
+ resumption_data[application_system_capability];
+ for (size_t i = 0; i < subscriptions.length(); ++i) {
+ SystemCapabilityType capability_type =
+ static_cast<SystemCapabilityType>((resumption_data[i]).asInt());
+ SubscribeTo(capability_type);
+ }
+ }
+}
+
+SystemCapabilityAppExtension& SystemCapabilityAppExtension::ExtractExtension(
+ app_mngr_::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto ext_ptr = app.QueryInterface(
+ SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID);
+ DCHECK(ext_ptr);
+ DCHECK(dynamic_cast<SystemCapabilityAppExtension*>(ext_ptr.get()));
+ auto app_extension =
+ std::static_pointer_cast<SystemCapabilityAppExtension>(ext_ptr);
+ DCHECK(app_extension);
+ return *app_extension;
+}
+} // namespace sdl_rpc_plugin \ No newline at end of file
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 342263105e..ab169f9c9b 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
@@ -35,217 +35,224 @@
#include "application_manager/message.h"
#include "interfaces/HMI_API.h"
-#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
-#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
-#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.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/on_find_applications.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h"
#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
#include "sdl_rpc_plugin/commands/hmi/allow_app_response.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_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/sdl_get_status_update_request.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
-#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
-#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
-#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h"
#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
-#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
-#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
-#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
-#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
-#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h"
+#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/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"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_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"
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_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_supported_languages_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
#ifdef EXTERNAL_PROPRIETARY_MODE
#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h"
#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
#endif // EXTERNAL_PROPRIETARY_MODE
+#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h"
#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_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_vr_started_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_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_ui_keyboard_input_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/hmi/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"
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#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_sdl_close_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#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_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
-#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
-#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
-#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
-#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
-#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h"
+#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h"
#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h"
#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+
+#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMICommandFactory")
+
HMICommandFactory::HMICommandFactory(
ApplicationManager& application_manager,
rpc_service::RPCService& rpc_service,
@@ -289,7 +296,8 @@ bool HMICommandFactory::IsAbleToProcess(
return get_creator_factory(
static_cast<hmi_apis::FunctionID::eType>(function_id),
hmi_apis::messageType::INVALID_ENUM,
- message_source).CanBeCreated();
+ message_source)
+ .CanBeCreated();
}
CommandCreator& HMICommandFactory::get_creator_factory(
@@ -313,6 +321,13 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::ActivateAppRequest>()
: factory.GetCreator<commands::ActivateAppResponse>();
}
+ case hmi_apis::FunctionID::BasicCommunication_CloseApplication: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::BasicCommunicationCloseApplicationRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationCloseApplicationResponse>();
+ }
#ifdef EXTERNAL_PROPRIETARY_MODE
case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
return hmi_apis::messageType::request == message_type
@@ -847,8 +862,17 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UISendHapticDataRequest>()
: factory.GetCreator<commands::UISendHapticDataResponse>();
}
+ case hmi_apis::FunctionID::BasicCommunication_GetFilePath: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::BCGetFilePathRequest>()
+ : factory.GetCreator<commands::BCGetFilePathResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated: {
+ return factory
+ .GetCreator<commands::OnBCSystemCapabilityUpdatedNotification>();
+ }
default: { return factory.GetCreator<InvalidCommand>(); }
}
}
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 567707d497..0d24c03382 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
@@ -31,29 +31,38 @@
*/
#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "interfaces/MOBILE_API.h"
#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
#include "sdl_rpc_plugin/commands/mobile/add_command_response.h"
-#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
-#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
-#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
-#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "sdl_rpc_plugin/commands/mobile/close_application_request.h"
+#include "sdl_rpc_plugin/commands/mobile/close_application_response.h"
#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
#include "sdl_rpc_plugin/commands/mobile/delete_file_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h"
#include "sdl_rpc_plugin/commands/mobile/generic_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_file_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_file_response.h"
#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
@@ -64,14 +73,18 @@
#include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h"
-#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
#include "sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h"
#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h"
@@ -85,12 +98,18 @@
#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h"
#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
#include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h"
#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
#include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h"
#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
-#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
-#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
@@ -105,40 +124,28 @@
#include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h"
#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
-#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
-#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/system_request.h"
+#include "sdl_rpc_plugin/commands/mobile/system_response.h"
#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h"
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
#include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h"
-#include "sdl_rpc_plugin/commands/mobile/system_request.h"
-#include "sdl_rpc_plugin/commands/mobile/system_response.h"
-#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
-#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
-#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
-#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
-#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
-#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
-#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
-#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
-#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
#include "sdl_rpc_plugin/commands/mobile/show_app_menu_request.h"
#include "sdl_rpc_plugin/commands/mobile/show_app_menu_response.h"
-#include "interfaces/MOBILE_API.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace sdl_rpc_plugin {
using namespace application_manager;
-CommandCreator& MobileCommandFactory::get_creator_factory(
- mobile_apis::FunctionID::eType id,
- mobile_apis::messageType::eType message_type,
- app_mngr::commands::Command::CommandSource source) const {
+CommandCreator& MobileCommandFactory::get_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const {
CommandCreatorFactory factory(
application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
-
switch (id) {
case mobile_apis::FunctionID::RegisterAppInterfaceID: {
return mobile_api::messageType::request == message_type
@@ -177,7 +184,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
? factory.GetCreator<commands::AddSubMenuRequest>()
: factory.GetCreator<commands::AddSubMenuResponse>();
}
-
case mobile_apis::FunctionID::DeleteSubMenuID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<commands::DeleteSubMenuRequest>()
@@ -215,7 +221,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
? factory.GetCreator<commands::PerformAudioPassThruRequest>()
: factory.GetCreator<commands::PerformAudioPassThruResponse>();
}
-
case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<
@@ -238,6 +243,11 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
? factory.GetCreator<commands::PutFileRequest>()
: factory.GetCreator<commands::PutFileResponse>();
}
+ case mobile_apis::FunctionID::GetFileID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetFileRequest>()
+ : factory.GetCreator<commands::GetFileResponse>();
+ }
case mobile_apis::FunctionID::DeleteFileID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<commands::DeleteFileRequest>()
@@ -293,7 +303,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
? factory.GetCreator<commands::ScrollableMessageRequest>()
: factory.GetCreator<commands::ScrollableMessageResponse>();
}
-
case mobile_apis::FunctionID::AlertManeuverID: {
return mobile_api::messageType::request == message_type
? factory.GetCreator<commands::AlertManeuverRequest>()
@@ -344,6 +353,37 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
? factory.GetCreator<commands::SendHapticDataRequest>()
: factory.GetCreator<commands::SendHapticDataResponse>();
}
+ case mobile_apis::FunctionID::SetCloudAppPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetCloudAppPropertiesRequest>()
+ : factory
+ .GetCreator<commands::SetCloudAppPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::GetCloudAppPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetCloudAppPropertiesRequest>()
+ : factory
+ .GetCreator<commands::GetCloudAppPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::CloseApplicationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::CloseApplicationRequest>()
+ : factory.GetCreator<commands::CloseApplicationResponse>();
+ }
+ case mobile_apis::FunctionID::GenericResponseID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::GenericResponse>();
+ }
+ default: {}
+ }
+ return factory.GetCreator<InvalidCommand>();
+}
+
+CommandCreator& MobileCommandFactory::get_notification_creator(
+ const mobile_apis::FunctionID::eType id) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ switch (id) {
case mobile_apis::FunctionID::OnButtonEventID: {
return factory.GetCreator<commands::mobile::OnButtonEventNotification>();
}
@@ -374,11 +414,7 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
return factory.GetCreator<commands::OnPermissionsChangeNotification>();
}
case mobile_apis::FunctionID::OnHMIStatusID: {
- using app_mngr::commands::Command;
- return Command::CommandSource::SOURCE_MOBILE == source
- ? factory.GetCreator<
- commands::OnHMIStatusNotificationFromMobile>()
- : factory.GetCreator<commands::OnHMIStatusNotification>();
+ return factory.GetCreator<commands::OnHMIStatusNotification>();
}
case mobile_apis::FunctionID::OnKeyboardInputID: {
return factory
@@ -387,24 +423,69 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
case mobile_apis::FunctionID::OnTouchEventID: {
return factory.GetCreator<commands::mobile::OnTouchEventNotification>();
}
+ case mobile_apis::FunctionID::OnSystemCapabilityUpdatedID: {
+ return factory.GetCreator<
+ commands::mobile::OnSystemCapabilityUpdatedNotification>();
+ }
case mobile_apis::FunctionID::OnSystemRequestID: {
return factory
.GetCreator<commands::mobile::OnSystemRequestNotification>();
}
case mobile_apis::FunctionID::OnHashChangeID: {
- using app_mngr::commands::Command;
return factory.GetCreator<commands::mobile::OnHashChangeNotification>();
}
case mobile_apis::FunctionID::OnWayPointChangeID: {
- using app_mngr::commands::Command;
return factory.GetCreator<commands::OnWayPointChangeNotification>();
}
- case mobile_apis::FunctionID::GenericResponseID: {
- using app_mngr::commands::Command;
- return factory.GetCreator<commands::GenericResponse>();
+ default: {}
+ }
+ return factory.GetCreator<InvalidCommand>();
+}
+
+CommandCreator& MobileCommandFactory::get_notification_from_mobile_creator(
+ const mobile_apis::FunctionID::eType id) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ switch (id) {
+ case mobile_apis::FunctionID::OnHMIStatusID: {
+ return factory.GetCreator<commands::OnHMIStatusNotificationFromMobile>();
}
- default: { return factory.GetCreator<InvalidCommand>(); }
+ default: {}
}
+ return factory.GetCreator<InvalidCommand>();
+}
+
+CommandCreator& MobileCommandFactory::get_creator_factory(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const {
+ switch (message_type) {
+ case mobile_api::messageType::request: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) {
+ return get_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_api::messageType::response: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_api::messageType::notification: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_notification_creator(id);
+ } else if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE ==
+ source) {
+ return get_notification_from_mobile_creator(id);
+ }
+ break;
+ }
+ default: {}
+ }
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ return factory.GetCreator<InvalidCommand>();
}
MobileCommandFactory::MobileCommandFactory(
@@ -421,11 +502,10 @@ bool MobileCommandFactory::IsAbleToProcess(
const int32_t function_id,
const application_manager::commands::Command::CommandSource message_source)
const {
- using app_mngr::commands::Command;
- return get_creator_factory(
- static_cast<mobile_apis::FunctionID::eType>(function_id),
- mobile_apis::messageType::INVALID_ENUM,
- message_source).CanBeCreated();
+ auto id = static_cast<mobile_apis::FunctionID::eType>(function_id);
+ return get_command_creator(id, mobile_apis::messageType::INVALID_ENUM)
+ .CanBeCreated() ||
+ get_notification_creator(id).CanBeCreated();
}
CommandSharedPtr MobileCommandFactory::CreateCommand(
@@ -446,4 +526,4 @@ CommandSharedPtr MobileCommandFactory::CreateCommand(
return get_creator_factory(function_id, message_type, source).create(message);
}
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
index efdcde7526..21f15a33fe 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
@@ -55,7 +55,8 @@ SDLCommandFactory::SDLCommandFactory(
app_mngr::CommandSharedPtr SDLCommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::commands::Command::CommandSource source) {
- if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) {
return hmi_command_factory_->CreateCommand(message, source);
} else {
return mobile_command_factory_->CreateCommand(message, source);
@@ -70,9 +71,10 @@ bool SDLCommandFactory::IsAbleToProcess(
bool is_mobile_command_factory_able_to_process =
mobile_command_factory_->IsAbleToProcess(FunctionID, source);
- return app_mngr::commands::Command::SOURCE_HMI == source
+ return (app_mngr::commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source)
? is_hmi_command_factory_able_to_process
: is_mobile_command_factory_able_to_process;
}
-} // namespace application_manager
+} // namespace sdl_rpc_plugin
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 22b818f5e0..b261b20c24 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
@@ -31,16 +31,20 @@
*/
#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
#include "sdl_rpc_plugin/sdl_command_factory.h"
namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
namespace plugins = application_manager::plugin_manager;
-bool SDLRPCPlugin::Init(
- application_manager::ApplicationManager& app_manager,
- application_manager::rpc_service::RPCService& rpc_service,
- application_manager::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler) {
+CREATE_LOGGERPTR_GLOBAL(logger_, "SdlRPCPlugin")
+
+bool SDLRPCPlugin::Init(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory(
app_manager, rpc_service, hmi_capabilities, policy_handler));
return true;
@@ -48,25 +52,35 @@ bool SDLRPCPlugin::Init(
bool SDLRPCPlugin::IsAbleToProcess(
const int32_t function_id,
- const application_manager::commands::Command::CommandSource
- message_source) {
+ const app_mngr::commands::Command::CommandSource message_source) {
return command_factory_->IsAbleToProcess(function_id, message_source);
}
std::string SDLRPCPlugin::PluginName() {
- return "SDL RPC Plugin";
+ return plugins::plugin_names::sdl_rpc_plugin;
}
-application_manager::CommandFactory& SDLRPCPlugin::GetCommandFactory() {
+app_mngr::CommandFactory& SDLRPCPlugin::GetCommandFactory() {
return *command_factory_;
}
-void SDLRPCPlugin::OnPolicyEvent(
- application_manager::plugin_manager::PolicyEvent event) {}
+void SDLRPCPlugin::OnPolicyEvent(plugins::PolicyEvent event) {}
void SDLRPCPlugin::OnApplicationEvent(
- application_manager::plugin_manager::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) {}
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationRegistered == event) {
+ application->AddExtension(
+ std::make_shared<SystemCapabilityAppExtension>(*this, *application));
+ } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
+ ClearSubscriptions(application);
+ }
+}
+
+void SDLRPCPlugin::ClearSubscriptions(app_mngr::ApplicationSharedPtr app) {
+ auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app);
+ ext.UnsubscribeFromAll();
+}
} // namespace sdl_rpc_plugin
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 50b7aae42a..7dadad59fe 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
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/activate_app_request.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -47,9 +47,9 @@ using ::testing::_;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::ActivateAppRequest;
-using am::commands::CommandImpl;
using ::test::components::application_manager_test::MockApplication;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
index a5707488dd..01487284a4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
@@ -30,15 +30,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/add_statistics_info_notification.h"
+#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -49,11 +49,11 @@ namespace add_statistics_info_notification {
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_notification = ::application_manager::hmi_notification;
-using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::AddStatisticsInfoNotification;
using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
using policy::PolicyHandler;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::AddStatisticsInfoNotification;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
index a2fcf8f605..251fe230fc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/allow_all_apps_response.h"
+#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace commands_test {
@@ -53,7 +53,7 @@ typedef std::shared_ptr<AllowAllAppsResponse> ResponsePtr;
namespace {
const bool kResponseIsAllowed = true;
-} //
+} // namespace
class AllowAllAppsResponseTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
index 2ce400542a..a0e23d7b9d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/allow_app_response.h"
+#include "gtest/gtest.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -53,7 +53,7 @@ namespace hmi_response = ::application_manager::hmi_response;
namespace {
const uint32_t kConnectionKey = 1u;
const bool kIsResponseAllowed = true;
-}
+} // namespace
typedef std::shared_ptr<AllowAppResponse> ResponsePtr;
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 a3f0ab6933..0251c4873d 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
@@ -28,7 +28,7 @@
* 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/basic_communication_get_system_time_request.h"
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
index 8f56c6462c..0c8e986fc6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "hmi/basic_communication_get_system_time_response.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "interfaces/HMI_API.h"
namespace test {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
index 6ed15bebeb..7d9ed899a6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/button_get_capabilities_response.h"
+#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace commands_test {
@@ -45,8 +45,8 @@ namespace button_get_capabilities_response {
using application_manager::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::ButtonGetCapabilitiesResponse;
-using ::testing::ReturnRef;
using ::testing::NiceMock;
+using ::testing::ReturnRef;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
@@ -100,7 +100,8 @@ TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
.Times(0);
EXPECT_CALL(mock_hmi_capabilities_,
- set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
+ set_preset_bank_capabilities(preset_bank_capabilities_))
+ .Times(0);
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
index 6914a4ca7e..087109c871 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
@@ -35,13 +35,13 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "hmi/close_popup_response.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/response_from_hmi.h"
#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "hmi/close_popup_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -50,9 +50,9 @@ namespace hmi_commands_test {
namespace close_popup_response {
namespace am = ::application_manager;
+using am::commands::CommandImpl;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::ClosePopupResponse;
-using am::commands::CommandImpl;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
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 a6497ca6e1..f5593bf241 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
@@ -37,192 +37,193 @@
#include <vector>
#include "gtest/gtest.h"
+#include "hmi/activate_app_request.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/add_statistics_info_notification.h"
#include "hmi/allow_all_apps_request.h"
#include "hmi/allow_all_apps_response.h"
#include "hmi/allow_app_request.h"
#include "hmi/allow_app_response.h"
+#include "hmi/basic_communication_system_request.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/bc_get_file_path_request.h"
+#include "hmi/bc_get_file_path_response.h"
+#include "hmi/button_get_capabilities_request.h"
+#include "hmi/button_get_capabilities_response.h"
+#include "hmi/close_popup_request.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/dial_number_request.h"
+#include "hmi/dial_number_response.h"
+#include "hmi/get_system_info_request.h"
+#include "hmi/get_system_info_response.h"
+#include "hmi/get_urls.h"
+#include "hmi/get_urls_response.h"
+#include "hmi/mixing_audio_supported_request.h"
+#include "hmi/mixing_audio_supported_response.h"
+#include "hmi/navi_alert_maneuver_request.h"
+#include "hmi/navi_alert_maneuver_response.h"
#include "hmi/navi_audio_start_stream_request.h"
#include "hmi/navi_audio_start_stream_response.h"
#include "hmi/navi_audio_stop_stream_request.h"
#include "hmi/navi_audio_stop_stream_response.h"
-#include "hmi/update_device_list_request.h"
-#include "hmi/update_device_list_response.h"
-#include "hmi/on_update_device_list.h"
-#include "hmi/on_start_device_discovery.h"
-#include "hmi/update_app_list_request.h"
-#include "hmi/update_app_list_response.h"
-#include "hmi/on_find_applications.h"
-#include "hmi/sdl_get_list_of_permissions_request.h"
-#include "hmi/sdl_get_list_of_permissions_response.h"
-#include "hmi/sdl_get_user_friendly_message_request.h"
-#include "hmi/sdl_get_user_friendly_message_response.h"
-#include "hmi/sdl_get_status_update_request.h"
-#include "hmi/sdl_get_status_update_response.h"
-#include "hmi/on_status_update_notification.h"
-#include "hmi/update_sdl_request.h"
-#include "hmi/update_sdl_response.h"
-#include "hmi/activate_app_request.h"
-#include "hmi/activate_app_response.h"
-#include "hmi/mixing_audio_supported_request.h"
-#include "hmi/mixing_audio_supported_response.h"
+#include "hmi/navi_get_way_points_request.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/navi_is_ready_request.h"
+#include "hmi/navi_is_ready_response.h"
+#include "hmi/navi_send_location_request.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_request.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_request.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_request.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/navi_subscribe_way_points_request.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_request.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_request.h"
+#include "hmi/navi_update_turn_list_response.h"
#include "hmi/on_allow_sdl_functionality_notification.h"
+#include "hmi/on_app_activated_notification.h"
+#include "hmi/on_app_deactivated_notification.h"
#include "hmi/on_app_permission_changed_notification.h"
#include "hmi/on_app_permission_consent_notification.h"
-#include "hmi/on_app_activated_notification.h"
+#include "hmi/on_app_registered_notification.h"
+#include "hmi/on_app_unregistered_notification.h"
#include "hmi/on_audio_data_streaming_notification.h"
-#include "hmi/on_video_data_streaming_notification.h"
-#include "hmi/on_sdl_consent_needed_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"
+#include "hmi/on_event_changed_notification.h"
#include "hmi/on_exit_all_applications_notification.h"
#include "hmi/on_exit_application_notification.h"
+#include "hmi/on_file_removed_notification.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/on_ignition_cycle_over_notification.h"
+#include "hmi/on_navi_tbt_client_state_notification.h"
+#include "hmi/on_navi_way_point_change_notification.h"
+#include "hmi/on_policy_update.h"
#include "hmi/on_put_file_notification.h"
+#include "hmi/on_ready_notification.h"
+#include "hmi/on_received_policy_update.h"
+#include "hmi/on_record_start_notification.h"
#include "hmi/on_resume_audio_source_notification.h"
-#include "hmi/on_ignition_cycle_over_notification.h"
+#include "hmi/on_sdl_close_notification.h"
+#include "hmi/on_sdl_consent_needed_notification.h"
+#include "hmi/on_sdl_persistence_complete_notification.h"
+#include "hmi/on_start_device_discovery.h"
+#include "hmi/on_status_update_notification.h"
+#include "hmi/on_system_context_notification.h"
+#include "hmi/on_system_error_notification.h"
#include "hmi/on_system_info_changed_notification.h"
-#include "hmi/get_system_info_request.h"
-#include "hmi/get_system_info_response.h"
-#include "hmi/close_popup_request.h"
-#include "hmi/close_popup_response.h"
-#include "hmi/button_get_capabilities_request.h"
-#include "hmi/button_get_capabilities_response.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"
+#include "hmi/on_vr_command_notification.h"
+#include "hmi/on_vr_language_change_notification.h"
+#include "hmi/on_vr_started_notification.h"
+#include "hmi/on_vr_stopped_notification.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "hmi/sdl_activate_app_response.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "hmi/sdl_get_list_of_permissions_response.h"
+#include "hmi/sdl_get_status_update_request.h"
+#include "hmi/sdl_get_status_update_response.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "hmi/sdl_get_user_friendly_message_response.h"
+#include "hmi/sdl_policy_update.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/tts_change_registration_request.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/tts_get_capabilities_request.h"
+#include "hmi/tts_get_capabilities_response.h"
+#include "hmi/tts_get_language_request.h"
+#include "hmi/tts_get_language_response.h"
+#include "hmi/tts_get_supported_languages_request.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "hmi/tts_is_ready_request.h"
+#include "hmi/tts_is_ready_response.h"
+#include "hmi/tts_set_global_properties_request.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_speak_request.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_stop_speaking_request.h"
+#include "hmi/tts_stop_speaking_response.h"
#include "hmi/ui_add_command_request.h"
#include "hmi/ui_add_command_response.h"
-#include "hmi/ui_delete_command_request.h"
-#include "hmi/ui_delete_command_response.h"
#include "hmi/ui_add_submenu_request.h"
#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_alert_request.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_change_registration_request.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_delete_command_request.h"
+#include "hmi/ui_delete_command_response.h"
#include "hmi/ui_delete_submenu_request.h"
#include "hmi/ui_delete_submenu_response.h"
-#include "hmi/ui_get_supported_languages_request.h"
-#include "hmi/ui_get_supported_languages_response.h"
-#include "hmi/ui_get_language_request.h"
-#include "hmi/ui_get_language_response.h"
+#include "hmi/ui_end_audio_pass_thru_request.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
#include "hmi/ui_get_capabilities_request.h"
#include "hmi/ui_get_capabilities_response.h"
-#include "hmi/ui_change_registration_request.h"
-#include "hmi/ui_change_registration_response.h"
-#include "hmi/ui_show_request.h"
-#include "hmi/ui_show_response.h"
-#include "hmi/ui_alert_request.h"
-#include "hmi/ui_alert_response.h"
+#include "hmi/ui_get_language_request.h"
+#include "hmi/ui_get_language_response.h"
+#include "hmi/ui_get_supported_languages_request.h"
+#include "hmi/ui_get_supported_languages_response.h"
#include "hmi/ui_is_ready_request.h"
#include "hmi/ui_is_ready_response.h"
-#include "hmi/ui_slider_request.h"
-#include "hmi/ui_slider_response.h"
-#include "hmi/ui_set_media_clock_timer_request.h"
-#include "hmi/ui_set_media_clock_timer_response.h"
-#include "hmi/ui_set_global_properties_request.h"
-#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_perform_audio_pass_thru_request.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_request.h"
+#include "hmi/ui_perform_interaction_response.h"
#include "hmi/ui_scrollable_message_request.h"
#include "hmi/ui_scrollable_message_response.h"
#include "hmi/ui_set_app_icon_request.h"
#include "hmi/ui_set_app_icon_response.h"
-#include "hmi/ui_perform_audio_pass_thru_response.h"
-#include "hmi/ui_perform_audio_pass_thru_request.h"
-#include "hmi/ui_end_audio_pass_thru_request.h"
-#include "hmi/ui_end_audio_pass_thru_response.h"
-#include "hmi/ui_perform_interaction_request.h"
-#include "hmi/ui_perform_interaction_response.h"
-#include "hmi/vr_is_ready_request.h"
-#include "hmi/vr_is_ready_response.h"
+#include "hmi/ui_set_display_layout_request.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/ui_set_global_properties_request.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_set_media_clock_timer_request.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_show_request.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_slider_request.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/update_app_list_request.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/update_device_list_request.h"
+#include "hmi/update_device_list_response.h"
+#include "hmi/update_sdl_request.h"
+#include "hmi/update_sdl_response.h"
#include "hmi/vr_add_command_request.h"
#include "hmi/vr_add_command_response.h"
-#include "hmi/vr_delete_command_request.h"
-#include "hmi/vr_delete_command_response.h"
#include "hmi/vr_change_registration_request.h"
#include "hmi/vr_change_registration_response.h"
-#include "hmi/vr_get_supported_languages_request.h"
-#include "hmi/vr_get_supported_languages_response.h"
-#include "hmi/vr_get_language_request.h"
-#include "hmi/vr_get_language_response.h"
+#include "hmi/vr_delete_command_request.h"
+#include "hmi/vr_delete_command_response.h"
#include "hmi/vr_get_capabilities_request.h"
#include "hmi/vr_get_capabilities_response.h"
-#include "hmi/tts_is_ready_request.h"
-#include "hmi/tts_is_ready_response.h"
-#include "hmi/tts_change_registration_request.h"
-#include "hmi/tts_change_registration_response.h"
-#include "hmi/tts_get_supported_languages_request.h"
-#include "hmi/tts_get_supported_languages_response.h"
-#include "hmi/tts_get_language_request.h"
-#include "hmi/tts_get_language_response.h"
-#include "hmi/tts_stop_speaking_request.h"
-#include "hmi/tts_stop_speaking_response.h"
-#include "hmi/tts_speak_request.h"
-#include "hmi/tts_speak_response.h"
-#include "hmi/tts_set_global_properties_request.h"
-#include "hmi/tts_set_global_properties_response.h"
-#include "hmi/tts_get_capabilities_request.h"
-#include "hmi/tts_get_capabilities_response.h"
+#include "hmi/vr_get_language_request.h"
+#include "hmi/vr_get_language_response.h"
+#include "hmi/vr_get_supported_languages_request.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "hmi/vr_is_ready_request.h"
+#include "hmi/vr_is_ready_response.h"
#include "hmi/vr_perform_interaction_request.h"
#include "hmi/vr_perform_interaction_response.h"
-#include "hmi/sdl_activate_app_request.h"
-#include "hmi/sdl_activate_app_response.h"
-#include "hmi/on_app_permission_changed_notification.h"
-#include "hmi/on_event_changed_notification.h"
-#include "hmi/navi_is_ready_request.h"
-#include "hmi/navi_show_constant_tbt_request.h"
-#include "hmi/navi_show_constant_tbt_response.h"
-#include "hmi/navi_is_ready_response.h"
-#include "hmi/navi_alert_maneuver_request.h"
-#include "hmi/navi_alert_maneuver_response.h"
-#include "hmi/navi_update_turn_list_request.h"
-#include "hmi/navi_update_turn_list_response.h"
-#include "hmi/navi_subscribe_way_points_request.h"
-#include "hmi/navi_subscribe_way_points_response.h"
-#include "hmi/navi_unsubscribe_way_points_request.h"
-#include "hmi/navi_unsubscribe_way_points_response.h"
-#include "hmi/navi_get_way_points_request.h"
-#include "hmi/navi_get_way_points_response.h"
-#include "hmi/on_ready_notification.h"
-#include "hmi/on_device_chosen_notification.h"
-#include "hmi/on_file_removed_notification.h"
-#include "hmi/on_system_context_notification.h"
-#include "hmi/on_app_registered_notification.h"
-#include "hmi/on_app_unregistered_notification.h"
-#include "hmi/on_driver_distraction_notification.h"
-#include "hmi/on_tts_started_notification.h"
-#include "hmi/on_tts_stopped_notification.h"
-#include "hmi/on_vr_started_notification.h"
-#include "hmi/on_vr_stopped_notification.h"
-#include "hmi/on_vr_command_notification.h"
-#include "hmi/on_ui_command_notification.h"
-#include "hmi/on_app_deactivated_notification.h"
-#include "hmi/on_ui_language_change_notification.h"
-#include "hmi/on_vr_language_change_notification.h"
-#include "hmi/on_tts_language_change_notification.h"
-#include "hmi/on_navi_tbt_client_state_notification.h"
-#include "hmi/on_navi_way_point_change_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_ui_keyboard_input_notification.h"
-#include "hmi/on_ui_touch_event_notification.h"
-#include "hmi/on_ui_reset_timeout_notification.h"
-#include "hmi/navi_start_stream_request.h"
-#include "hmi/navi_start_stream_response.h"
-#include "hmi/navi_stop_stream_request.h"
-#include "hmi/navi_stop_stream_response.h"
-#include "hmi/on_system_request_notification.h"
-#include "hmi/ui_set_display_layout_request.h"
-#include "hmi/ui_set_display_layout_response.h"
-#include "hmi/on_sdl_close_notification.h"
-#include "hmi/on_sdl_persistence_complete_notification.h"
-#include "hmi/on_record_start_notification.h"
-#include "hmi/add_statistics_info_notification.h"
-#include "hmi/on_system_error_notification.h"
-#include "hmi/basic_communication_system_request.h"
-#include "hmi/basic_communication_system_response.h"
-#include "hmi/sdl_policy_update.h"
-#include "hmi/sdl_policy_update_response.h"
-#include "hmi/on_received_policy_update.h"
-#include "hmi/on_policy_update.h"
-#include "hmi/get_urls.h"
-#include "hmi/get_urls_response.h"
-#include "hmi/on_device_state_changed_notification.h"
-#include "hmi/navi_send_location_request.h"
-#include "hmi/navi_send_location_response.h"
-#include "hmi/on_tts_reset_timeout_notification.h"
-#include "hmi/dial_number_request.h"
-#include "hmi/dial_number_response.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -240,16 +241,16 @@ namespace dummy_hmi_commands_test {
namespace commands = sdl_rpc_plugin::commands;
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
+using ::application_manager::ApplicationSharedPtr;
using application_manager::commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplication;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
template <class Command>
class HMICommandsTest : public components::commands_test::CommandRequestTest<
@@ -357,7 +358,8 @@ typedef Types<commands::OnStartDeviceDiscovery,
commands::UIGetLanguageRequest,
commands::UIGetCapabilitiesResponse,
commands::UIGetCapabilitiesRequest,
- commands::UIChangeRegistratioResponse> HMICommandsListFirst;
+ commands::UIChangeRegistratioResponse>
+ HMICommandsListFirst;
typedef Types<commands::UIChangeRegistrationRequest,
commands::UIPerformAudioPassThruResponse,
@@ -407,7 +409,8 @@ typedef Types<commands::UIChangeRegistrationRequest,
commands::ClosePopupResponse,
commands::ClosePopupRequest,
commands::UIIsReadyResponse,
- commands::UIIsReadyRequest> HMICommandsListSecond;
+ commands::UIIsReadyRequest>
+ HMICommandsListSecond;
typedef Types<commands::NaviIsReadyResponse,
commands::NaviIsReadyRequest,
@@ -445,7 +448,8 @@ typedef Types<commands::NaviIsReadyResponse,
commands::OnVRStoppedNotification,
commands::OnVRCommandNotification,
commands::OnUICommandNotification,
- commands::OnAppDeactivatedNotification> HMICommandsListThird;
+ commands::OnAppDeactivatedNotification>
+ HMICommandsListThird;
typedef Types<commands::hmi::OnButtonEventNotification,
commands::hmi::OnButtonPressNotification,
@@ -491,12 +495,16 @@ typedef Types<commands::hmi::OnButtonEventNotification,
commands::OnNaviWayPointChangeNotification,
commands::OnUILanguageChangeNotification,
commands::OnVRLanguageChangeNotification,
- commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
+ commands::OnTTSLanguageChangeNotification>
+ HMICommandsListFourth;
typedef Types<commands::AllowAllAppsRequest,
commands::AllowAllAppsResponse,
commands::AllowAppRequest,
- commands::AllowAppResponse> HMICommandsListFifth;
+ commands::AllowAppResponse,
+ commands::BCGetFilePathRequest,
+ commands::BCGetFilePathResponse>
+ HMICommandsListFifth;
TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
@@ -507,30 +515,30 @@ TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_hmi_commands_test
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 4cbe7305ea..5b860499dd 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
@@ -35,13 +35,13 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/smart_object_keys.h"
#include "hmi/get_system_info_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -51,9 +51,9 @@ namespace get_system_info_request {
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
using am::commands::RequestToHMI;
using sdl_rpc_plugin::commands::GetSystemInfoRequest;
-using am::commands::CommandImpl;
typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
index 6908e21053..11589683be 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
@@ -33,32 +33,32 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "hmi/get_system_info_response.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "hmi/get_system_info_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
namespace get_system_info_response {
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
+using am::commands::CommandImpl;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::GetSystemInfoResponse;
using sdl_rpc_plugin::commands::SystemInfo;
-using am::commands::CommandImpl;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
index 339a749909..f030701710 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
@@ -33,15 +33,15 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
#include "application_manager/commands/command.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/commands/response_to_hmi.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/get_urls_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,9 +53,9 @@ using ::testing::_;
using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
-using sdl_rpc_plugin::commands::GetUrlsResponse;
-using am::commands::ResponseToHMI;
using am::commands::CommandImpl;
+using am::commands::ResponseToHMI;
+using sdl_rpc_plugin::commands::GetUrlsResponse;
typedef std::shared_ptr<ResponseToHMI> ResponseToHMIPtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
index 2191900750..b19207cc14 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
@@ -33,21 +33,21 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "application_manager/message.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/command_request_test.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/message.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/policies/policy_handler.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
+#include "gtest/gtest.h"
#include "hmi/get_urls.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/commands/request_from_hmi.h"
#include "policy/mock_policy_manager.h"
-#include "application_manager/event_engine/event_dispatcher.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -57,17 +57,17 @@ namespace get_urls {
using namespace hmi_apis;
using namespace policy;
-using ::testing::NiceMock;
+using ::test::components::application_manager_test::MockApplication;
using ::testing::_;
+using ::testing::NiceMock;
using ::testing::SetArgReferee;
-using ::test::components::application_manager_test::MockApplication;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
-using am::commands::RequestFromHMI;
-using sdl_rpc_plugin::commands::GetUrls;
using am::commands::CommandImpl;
+using am::commands::RequestFromHMI;
using policy::PolicyHandler;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::GetUrls;
typedef std::shared_ptr<RequestFromHMI> RequestFromHMIPtr;
@@ -110,7 +110,7 @@ TEST_F(GetUrlsTest, RUN_SUCCESS) {
TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
request_command_->Run();
@@ -127,7 +127,7 @@ TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
.WillOnce(SetArgReferee<1>(endpoints_));
EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
request_command_->Run();
@@ -160,7 +160,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kAppIdForSending))
.WillOnce(Return(mock_app));
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
request_command_->Run();
@@ -175,10 +175,12 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
EXPECT_EQ(kAppIdForSending,
(*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::app_id].asInt());
+ [strings::app_id]
+ .asInt());
EXPECT_EQ(kDefaultUrl,
(*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::url].asString());
+ [strings::url]
+ .asString());
}
TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
@@ -197,7 +199,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
.WillOnce(Return(kInvalidAppId_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
@@ -226,7 +228,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
EXPECT_CALL(app_mngr_, application(kAppIdForSending))
.WillOnce(Return(invalid_mock_app));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
request_command_->Run();
@@ -261,7 +263,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _))
.WillOnce(Return(true));
request_command_->Run();
@@ -297,10 +299,12 @@ TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
am::hmi_request::service));
EXPECT_EQ(kDefaultUrl,
(*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::strings::url].asString());
+ [am::strings::url]
+ .asString());
EXPECT_EQ(endpoints_[0].app_id,
(*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id].asString());
+ [am::hmi_response::policy_app_id]
+ .asString());
}
TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
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 fe82b16f3f..8f2feed877 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
@@ -33,81 +33,81 @@
#include <stdint.h>
#include <string>
#include <vector>
-#include "gtest/gtest.h"
#include "application_manager/commands/commands_test.h"
-#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_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_touch_event_notification.h"
+#include "gtest/gtest.h"
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
#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"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#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_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"
#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#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_vr_started_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_exit_application_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"
#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
-#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_system_context_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_ui_language_change_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
-#include "utils/lock.h"
#include "utils/data_accessor.h"
+#include "utils/lock.h"
#include "utils/signals.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_rpc_plugin_manager.h"
-#include "application_manager/mock_state_controller.h"
+#include "application_manager/hmi_capabilities_impl.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/hmi_capabilities_impl.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "transport_manager/mock_transport_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/mock_connection_handler_settings.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
#include "protocol_handler/mock_session_observer.h"
-#include "application_manager/mock_resume_ctrl.h"
+#include "smart_objects/smart_object.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "utils/file_system.h"
namespace am = application_manager;
@@ -117,22 +117,22 @@ namespace commands_test {
namespace hmi_commands_test {
namespace hmi_notifications_test {
-using ::testing::_;
-using ::testing::Test;
-using ::testing::Types;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::InSequence;
-using ::smart_objects::SmartObject;
+using ::application_manager::ApplicationSharedPtr;
+using ::application_manager::MockMessageHelper;
using ::application_manager::commands::MessageSharedPtr;
+using ::smart_objects::SmartObject;
+using ::test::components::application_manager_test::MockApplication;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
using ::test::components::event_engine_test::MockEventDispatcher;
-using ::application_manager::MockMessageHelper;
+using ::testing::_;
+using ::testing::InSequence;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Test;
+using ::testing::Types;
using namespace sdl_rpc_plugin::commands;
using namespace am::commands;
@@ -319,7 +319,8 @@ typedef Types<OnAppPermissionChangedNotification,
OnSDLPersistenceCompleteNotification,
OnStatusUpdateNotification,
OnVideoDataStreamingNotification,
- OnRecordStartdNotification> HMIOnNotificationsListToHMITypes;
+ OnRecordStartdNotification>
+ HMIOnNotificationsListToHMITypes;
typedef Types<
CommandPair<OnAppActivatedNotification,
@@ -945,7 +946,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(GetMessage(temp_message));
command->Run();
@@ -973,7 +974,7 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0);
EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
command->Run();
}
@@ -1023,7 +1024,8 @@ TEST_F(HMICommandsNotificationsTest,
EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_, *it_mobile_reason)).WillOnce(Return(notification));
+ kAppId_, *it_mobile_reason))
+ .WillOnce(Return(notification));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(notification, Command::SOURCE_SDL));
EXPECT_CALL(app_mngr_,
@@ -1377,10 +1379,11 @@ TEST_F(HMICommandsNotificationsTest,
[am::strings::id] = "2014";
std::shared_ptr<Command> command =
CreateCommand<OnDeviceChosenNotification>(message);
- EXPECT_CALL(app_mngr_,
- ConnectToDevice(
- (*message)[am::strings::msg_params][am::strings::device_info]
- [am::strings::id].asString()));
+ EXPECT_CALL(
+ app_mngr_,
+ ConnectToDevice((*message)[am::strings::msg_params]
+ [am::strings::device_info][am::strings::id]
+ .asString()));
command->Run();
}
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 8164f957cb..64bf167f83 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
@@ -33,13 +33,13 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/mixing_audio_supported_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -51,9 +51,9 @@ using ::testing::_;
using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
using am::commands::RequestToHMI;
using sdl_rpc_plugin::commands::MixingAudioSupportedRequest;
-using am::commands::CommandImpl;
typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
index aa651c2dca..8c2f07a1d6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
@@ -33,18 +33,18 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/response_from_hmi.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,15 +52,15 @@ namespace commands_test {
namespace hmi_commands_test {
namespace mixing_audio_supported_response {
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
-using sdl_rpc_plugin::commands::MixingAudioSupportedResponse;
-using application_manager::commands::ResponseFromHMI;
-using am::commands::CommandImpl;
using am::HMICapabilities;
+using am::commands::CommandImpl;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::MixingAudioSupportedResponse;
namespace hmi_response = ::application_manager::hmi_response;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
index d8454bb98e..926e51446f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -36,13 +36,13 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -54,9 +54,9 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
namespace commands = am::commands;
+using am::event_engine::Event;
using commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::AudioStartStreamRequest;
-using am::event_engine::Event;
namespace {
const uint32_t kHmiAppId = 13u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
index 1a03ecf523..5e13755a32 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
@@ -34,15 +34,15 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -54,8 +54,8 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::NaviIsReadyRequest;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::NaviIsReadyRequest;
namespace {
const hmi_apis::FunctionID::eType kEventID =
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
index 23f01fac3f..e166928348 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
@@ -33,12 +33,12 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "gtest/gtest.h"
#include "hmi/navi_is_ready_response.h"
namespace test {
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 3110a11fd8..d6ef540bc0 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
@@ -36,14 +36,14 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -55,8 +55,8 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
index 06fa61db29..c4e7976bde 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "hmi/navi_set_video_config_response.h"
+#include "application_manager/commands/commands_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/smart_object_keys.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -47,8 +47,8 @@ namespace navi_set_video_config_response {
using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
-using testing::ReturnRef;
using ::testing::NiceMock;
+using testing::ReturnRef;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
index a7f50504fb..232d5ab628 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
@@ -36,12 +36,12 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,9 +53,9 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
namespace commands = am::commands;
+using am::event_engine::Event;
using commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::NaviStartStreamRequest;
-using am::event_engine::Event;
namespace {
const uint32_t kHmiAppId = 13u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
index e4a79997fd..b32189ce1a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -30,17 +30,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "hmi/navi_stop_stream_request.h"
#include "hmi/navi_audio_stop_stream_request.h"
+#include "hmi/navi_stop_stream_request.h"
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -76,7 +76,8 @@ class NaviStopStreamRequestsTest
};
typedef testing::Types<commands::AudioStopStreamRequest,
- commands::NaviStopStreamRequest> RequestCommandsList;
+ commands::NaviStopStreamRequest>
+ RequestCommandsList;
TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList);
TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
index fc3899e861..802ad01d0b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -33,17 +33,17 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "utils/lock.h"
-#include "utils/data_accessor.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/on_driver_distraction_notification.h"
#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/data_accessor.h"
+#include "utils/lock.h"
namespace test {
namespace components {
@@ -52,8 +52,8 @@ namespace hmi_commands_test {
namespace on_driver_distraction_notification {
using ::testing::_;
-using ::testing::Return;
using ::testing::Eq;
+using ::testing::Return;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification;
@@ -152,7 +152,7 @@ TEST_F(HMIOnDriverDistractionNotificationTest,
command->Run();
}
-} // on_driver_distraction_notification
+} // namespace on_driver_distraction_notification
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
index 2d50ec2b72..f9dbbf259f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "hmi/on_system_time_ready_notification.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "interfaces/HMI_API.h"
namespace test {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
index 8e62c1a409..67c36dce9c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -34,13 +34,13 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
#include "hmi/rc_get_capabilities_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,8 +52,8 @@ using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
-using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse;
using am::commands::CommandImpl;
+using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse;
typedef std::shared_ptr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
typedef NiceMock<
@@ -139,6 +139,7 @@ TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
radio_control_capability["hdChannelAvailable"] = true;
radio_control_capability["rdsDataAvailable"] = true;
radio_control_capability["availableHDsAvailable"] = true;
+ radio_control_capability["availableHdChannelsAvailable"] = true;
radio_control_capability["stateAvailable"] = true;
radio_control_capability["signalStrengthAvailable"] = true;
radio_control_capability["signalChangeThresholdAvailable"] = true;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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 030db2f424..539c0efeb3 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
@@ -34,15 +34,15 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -54,8 +54,8 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::RCIsReadyRequest;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::RCIsReadyRequest;
typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr;
@@ -99,7 +99,7 @@ class RCIsReadyRequestTest
EXPECT_CALL(mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
.WillOnce(Return(capabilities));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities, _));
}
void PrepareEvent(bool is_message_contain_param,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
index a1a8c1c87e..4224e82b5f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
@@ -35,11 +35,11 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "hmi/rc_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
index 0b1f2df491..3e7e6e6f59 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
@@ -32,24 +32,24 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/response_from_hmi.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
-#include "application_manager/commands/response_from_hmi.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
namespace response_from_hmi {
+using ::test::components::event_engine_test::MockEventDispatcher;
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::SaveArg;
-using ::testing::DoAll;
-using ::test::components::event_engine_test::MockEventDispatcher;
namespace am = ::application_manager;
using application_manager::commands::ResponseFromHMI;
@@ -86,7 +86,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
MessageSharedPtr result_msg;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
const hmi_apis::FunctionID::eType posted_function_id =
@@ -115,7 +115,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
MessageSharedPtr result_msg;
ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
const hmi_apis::FunctionID::eType posted_function_id =
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 38cbc7b069..93344f1a0d 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
@@ -32,18 +32,19 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "utils/lock.h"
-#include "utils/helpers.h"
-#include "hmi/sdl_activate_app_request.h"
-#include "application_manager/mock_application.h"
#include "application_manager/application_manager.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "utils/helpers.h"
+#include "utils/lock.h"
namespace test {
namespace components {
@@ -54,16 +55,17 @@ namespace sdl_activate_app_request {
namespace am = ::application_manager;
namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
+using am::ApplicationSet;
using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using connection_handler_test::MockConnectionHandler;
+using policy_test::MockPolicyHandlerInterface;
using sdl_rpc_plugin::commands::SDLActivateAppRequest;
-using am::ApplicationSet;
+using testing::Gt;
using testing::Mock;
+using ::testing::NiceMock;
using testing::Return;
using testing::ReturnRef;
-using testing::Mock;
-using ::testing::NiceMock;
-using policy_test::MockPolicyHandlerInterface;
-using am::event_engine::Event;
namespace {
const uint32_t kCorrelationID = 1u;
@@ -137,6 +139,8 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
@@ -148,7 +152,7 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
command->Run();
}
-TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
+TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DeactivateApp_REJECTED) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
(*msg)[strings::msg_params][strings::function_id] =
@@ -163,9 +167,9 @@ TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
.WillOnce(Return(true));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp), _))
.WillOnce(Return(true));
command->Run();
@@ -189,6 +193,7 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
.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, device()).WillByDefault(Return(kHandle));
MockAppPtr mock_app_first(CreateMockApp());
@@ -250,6 +255,7 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
.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, device()).WillByDefault(Return(kHandle));
DataAccessor<ApplicationSet> accessor(app_list_, lock_);
@@ -336,6 +342,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
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));
EXPECT_CALL(app_mngr_, state_controller())
.WillOnce(ReturnRef(mock_state_controller_));
EXPECT_CALL(mock_state_controller_,
@@ -427,6 +434,55 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
}
#endif
+TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ 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));
+
+#ifndef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(app_mngr_, application(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+#endif
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ const uint16_t kRetries = 3;
+ const uint32_t kRetryTimeout = 2000;
+ const uint32_t kMinimumTimeout = kRetries * kRetryTimeout;
+
+ MockApplicationManagerSettings settings;
+ EXPECT_CALL(settings, cloud_app_max_retry_attempts())
+ .WillOnce(Return(kRetries));
+ EXPECT_CALL(settings, cloud_app_retry_timeout())
+ .WillOnce(Return(kRetryTimeout));
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings));
+
+ EXPECT_CALL(app_mngr_,
+ updateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout)));
+
+ MockConnectionHandler connection_handler;
+ EXPECT_CALL(connection_handler, ConnectToDevice(kHandle));
+
+ EXPECT_CALL(app_mngr_, connection_handler())
+ .WillOnce(ReturnRef(connection_handler));
+
+ command->Run();
+}
+
TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
@@ -434,7 +490,7 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
command->onTimeOut();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
index bca316bcfa..b35ccde314 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
@@ -33,12 +33,12 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/sdl_activate_app_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -48,8 +48,8 @@ namespace sdl_activate_app_response {
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
-using sdl_rpc_plugin::commands::SDLActivateAppResponse;
using am::commands::CommandImpl;
+using sdl_rpc_plugin::commands::SDLActivateAppResponse;
typedef std::shared_ptr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
index 262ac5fc7d..c8cc4bb18c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
@@ -32,11 +32,11 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/command_request_test.h"
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
namespace test {
namespace components {
@@ -46,8 +46,8 @@ namespace sdl_get_list_of_permissions_request {
using application_manager::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::SDLGetListOfPermissionsRequest;
-using test::components::policy_test::MockPolicyHandlerInterface;
using smart_objects::SmartObject;
+using test::components::policy_test::MockPolicyHandlerInterface;
using testing::Return;
using testing::ReturnRef;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
index fca8ed840f..021dfc8b1d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
@@ -32,11 +32,11 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "hmi/sdl_get_status_update_request.h"
+#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/command_request_test.h"
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_status_update_request.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
index b040f8ea40..5cac1c823f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
@@ -34,15 +34,15 @@
#include <string>
#include <vector>
-#include "gtest/gtest.h"
-#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_state_controller.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/commands/command_request_test.h"
namespace test {
namespace components {
@@ -50,11 +50,11 @@ namespace commands_test {
namespace hmi_commands_test {
namespace sdl_get_user_friendly_message_request {
+using application_manager::MockMessageHelper;
using application_manager::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::SDLGetUserFriendlyMessageRequest;
-using application_manager::MockMessageHelper;
-using test::components::policy_test::MockPolicyHandlerInterface;
using test::components::application_manager_test::MockHMICapabilities;
+using test::components::policy_test::MockPolicyHandlerInterface;
using testing::_;
using testing::Return;
using testing::ReturnRef;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
index 581913d3a5..57bb018273 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
@@ -34,8 +34,8 @@
#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/notification_to_hmi.h"
#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/commands/notification_to_hmi.h"
namespace test {
namespace components {
@@ -45,8 +45,8 @@ namespace simple_notifications_test {
using namespace application_manager;
-using ::testing::Types;
using commands::NotificationToHMI;
+using ::testing::Types;
template <typename Command>
class SimpleNotificationsTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
index 5c42d265c7..fc2cd1cca4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -46,12 +46,12 @@ namespace hmi_commands_test {
namespace simple_requests_from_hmi_test {
using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
using ::testing::NiceMock;
+using ::testing::NotNull;
+using ::testing::Types;
namespace commands = ::application_manager::commands;
-using commands::MessageSharedPtr;
using ::application_manager::event_engine::EventObserver;
+using commands::MessageSharedPtr;
using ::test::components::event_engine_test::MockEventDispatcher;
class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
@@ -81,7 +81,7 @@ TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
const bool success = false;
const uint32_t correlation_id = 1u;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull()));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull(), _));
command->SendResponse(success,
correlation_id,
@@ -89,7 +89,7 @@ TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
hmi_apis::Common_Result::SUCCESS);
}
-} // namespace simple_requests_to_hmi_test
+} // namespace simple_requests_from_hmi_test
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
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 599c7e50f2..162e832e9f 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
@@ -30,16 +30,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/commands/command.h"
-#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
@@ -53,21 +55,15 @@
#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/request_to_hmi.h"
-#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
-#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
-#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
@@ -81,6 +77,11 @@
#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
@@ -88,23 +89,11 @@
#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
-#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
-#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
-#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
-#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
-#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
-#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+#include "smart_objects/smart_object.h"
#include "application_manager/mock_event_dispatcher.h"
@@ -115,8 +104,8 @@ namespace hmi_commands_test {
namespace simple_requests_to_hmi_test {
using ::testing::_;
-using ::testing::Types;
using ::testing::NotNull;
+using ::testing::Types;
namespace am_commands = application_manager::commands;
using am_commands::MessageSharedPtr;
using event_engine_test::MockEventDispatcher;
@@ -221,7 +210,8 @@ typedef Types<sdl_rpc_plugin::commands::UIScrollableMessageRequest,
typedef Types<sdl_rpc_plugin::commands::TTSIsReadyRequest,
sdl_rpc_plugin::commands::UIIsReadyRequest,
sdl_rpc_plugin::commands::NaviIsReadyRequest,
- sdl_rpc_plugin::commands::VRIsReadyRequest> RequestCommandsList3;
+ sdl_rpc_plugin::commands::VRIsReadyRequest>
+ RequestCommandsList3;
TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList);
TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
index 4a86fa9458..f232240c28 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -32,13 +32,18 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/activate_app_response.h"
#include "hmi/basic_communication_system_response.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/dial_number_response.h"
#include "hmi/navi_alert_maneuver_response.h"
#include "hmi/navi_audio_start_stream_response.h"
#include "hmi/navi_audio_stop_stream_response.h"
@@ -50,20 +55,13 @@
#include "hmi/navi_subscribe_way_points_response.h"
#include "hmi/navi_unsubscribe_way_points_response.h"
#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/sdl_policy_update_response.h"
#include "hmi/tts_change_registration_response.h"
-#include "hmi/ui_set_app_icon_response.h"
-#include "hmi/ui_set_display_layout_response.h"
-#include "hmi/ui_set_global_properties_response.h"
-#include "hmi/ui_scrollable_message_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/dial_number_response.h"
-#include "hmi/close_popup_response.h"
#include "hmi/tts_set_global_properties_response.h"
#include "hmi/tts_speak_response.h"
#include "hmi/tts_stop_speaking_response.h"
-#include "hmi/tts_change_registration_response.h"
#include "hmi/ui_add_command_response.h"
#include "hmi/ui_add_submenu_response.h"
#include "hmi/ui_alert_response.h"
@@ -73,28 +71,21 @@
#include "hmi/ui_end_audio_pass_thru_response.h"
#include "hmi/ui_perform_audio_pass_thru_response.h"
#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "hmi/ui_send_haptic_data_response.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/ui_set_global_properties_response.h"
#include "hmi/ui_set_media_clock_timer_response.h"
#include "hmi/ui_show_response.h"
#include "hmi/ui_slider_response.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/update_device_list_response.h"
#include "hmi/vr_add_command_response.h"
#include "hmi/vr_change_registration_response.h"
#include "hmi/vr_delete_command_response.h"
#include "hmi/vr_perform_interaction_response.h"
-#include "hmi/activate_app_response.h"
-#include "hmi/basic_communication_system_response.h"
-#include "hmi/navi_unsubscribe_way_points_response.h"
-#include "hmi/navi_update_turn_list_response.h"
-#include "hmi/navi_send_location_response.h"
-#include "hmi/navi_show_constant_tbt_response.h"
-#include "hmi/navi_start_stream_response.h"
-#include "hmi/navi_subscribe_way_points_response.h"
-#include "hmi/on_find_applications.h"
-#include "hmi/on_update_device_list.h"
-#include "hmi/sdl_policy_update_response.h"
-#include "hmi/update_app_list_response.h"
-#include "hmi/update_device_list_response.h"
-#include "application_manager/commands/notification_from_hmi.h"
-#include "hmi/ui_send_haptic_data_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -102,12 +93,12 @@ namespace commands_test {
namespace hmi_commands_test {
namespace simple_response_from_hmi_test {
+using ::test::components::event_engine_test::MockEventDispatcher;
using ::testing::_;
+using ::testing::Eq;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::Types;
-using ::testing::Eq;
-using ::test::components::event_engine_test::MockEventDispatcher;
namespace am = ::application_manager;
namespace commands = sdl_rpc_plugin::commands;
@@ -218,7 +209,8 @@ typedef Types<
CommandData<sdl_rpc_plugin::commands::UIScrollableMessageResponse,
hmi_apis::FunctionID::UI_ScrollableMessage>,
CommandData<sdl_rpc_plugin::commands::UISendHapticDataResponse,
- hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
+ hmi_apis::FunctionID::UI_SendHapticData> >
+ ResponseCommandsList;
typedef Types<sdl_rpc_plugin::commands::AudioStopStreamResponse,
sdl_rpc_plugin::commands::NaviStopStreamResponse,
@@ -310,7 +302,7 @@ TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(correlation_id));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(CheckMsgType(am::MessageType::kRequest)))
+ ManageHMICommand(CheckMsgType(am::MessageType::kRequest), _))
.WillOnce(Return(false));
command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
index 643e21d818..910c3f2873 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
@@ -30,16 +30,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/response_to_hmi.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/response_to_hmi.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -48,8 +48,8 @@ namespace hmi_commands_test {
namespace simple_response_to_hmi_test {
using ::testing::_;
-using ::testing::Types;
using ::testing::NotNull;
+using ::testing::Types;
namespace commands = sdl_rpc_plugin::commands;
using application_manager::commands::MessageSharedPtr;
@@ -63,7 +63,8 @@ class ResponseToHMICommandsTest
typedef Types<commands::SDLActivateAppResponse,
commands::SDLGetListOfPermissionsResponse,
commands::SDLGetStatusUpdateResponse,
- commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
+ commands::SDLGetUserFriendlyMessageResponse>
+ ResponseCommandsList;
TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
index bc9d262e6d..c7b96f1acf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
@@ -32,11 +32,11 @@
#include <string>
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
#include "gtest/gtest.h"
#include "hmi/tts_get_capabilities_response.h"
-#include "application_manager/mock_hmi_capabilities.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
index 0d22500f48..c0d23cb34b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
@@ -30,13 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/tts_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
index 417b8e1898..c0f187a85f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
@@ -33,17 +33,17 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "hmi/tts_get_supported_languages_response.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,14 +52,14 @@ namespace hmi_commands_test {
namespace tts_get_supported_languages_response {
using ::testing::_;
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
+using am::commands::CommandImpl;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse;
-using am::commands::CommandImpl;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
@@ -113,7 +113,8 @@ TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
- set_tts_supported_languages(supported_languages)).Times(0);
+ set_tts_supported_languages(supported_languages))
+ .Times(0);
command->Run();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
index 2fae8a6819..a2f4440c86 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
@@ -33,18 +33,18 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/response_from_hmi.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_application_manager.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "hmi/tts_is_ready_response.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "hmi/tts_is_ready_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,14 +53,14 @@ namespace hmi_commands_test {
namespace tts_is_ready_response {
using ::testing::_;
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
+using am::commands::CommandImpl;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::TTSIsReadyResponse;
-using am::commands::CommandImpl;
using test::components::event_engine_test::MockEventDispatcher;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
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 31e4860d4a..3fd3a39dca 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
@@ -32,14 +32,14 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
+#include "gtest/gtest.h"
#include "hmi/ui_get_capabilities_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -51,9 +51,9 @@ using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
+using am::commands::CommandImpl;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse;
-using am::commands::CommandImpl;
typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
@@ -113,8 +113,9 @@ TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) {
ResponseFromHMIPtr command(
CreateCommand<UIGetCapabilitiesResponse>(command_msg));
- smart_objects::SmartObject soft_button_capabilities_so = (*command_msg)
- [strings::msg_params][hmi_response::soft_button_capabilities];
+ smart_objects::SmartObject soft_button_capabilities_so =
+ (*command_msg)[strings::msg_params]
+ [hmi_response::soft_button_capabilities];
EXPECT_CALL(mock_hmi_capabilities_,
set_soft_button_capabilities(soft_button_capabilities_so));
@@ -149,8 +150,9 @@ TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
ResponseFromHMIPtr command(
CreateCommand<UIGetCapabilitiesResponse>(command_msg));
- smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg)
- [strings::msg_params][strings::audio_pass_thru_capabilities];
+ smart_objects::SmartObject audio_pass_thru_capabilities_so =
+ (*command_msg)[strings::msg_params]
+ [strings::audio_pass_thru_capabilities];
EXPECT_CALL(
mock_hmi_capabilities_,
set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
index de69c5de5c..7e8040543d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/ui_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.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/smart_object_keys.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -47,8 +47,8 @@ namespace ui_get_language_response {
using sdl_rpc_plugin::commands::UIGetLanguageResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
-using testing::ReturnRef;
using ::testing::NiceMock;
+using testing::ReturnRef;
namespace strings = application_manager::strings;
namespace hmi_response = application_manager::hmi_response;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
index 5626e2b0ee..10cf244bcf 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
@@ -33,15 +33,15 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_application_manager.h"
-#include "hmi/ui_get_supported_languages_response.h"
+#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "hmi/ui_get_supported_languages_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -49,8 +49,8 @@ namespace commands_test {
namespace hmi_commands_test {
namespace ui_get_supported_languages_response {
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
@@ -107,7 +107,8 @@ TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
- set_ui_supported_languages(supported_languages)).Times(0);
+ set_ui_supported_languages(supported_languages))
+ .Times(0);
command->Run();
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 fe0d8a8470..837b8438dc 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
@@ -34,16 +34,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,12 +53,12 @@ namespace ui_is_ready_request {
namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::UIIsReadyRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::UIIsReadyRequest;
-using am::event_engine::Event;
typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr;
@@ -125,9 +125,9 @@ class UIIsReadyRequestTest
.WillOnce(Return(get_capabilities));
EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*get_language));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_language));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_all_language));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_language, _));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_all_language, _));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_capabilities, _));
}
void PrepareEvent(bool is_message_contain_param,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
index cccdbdc44d..44b9504055 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
@@ -33,12 +33,12 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "gtest/gtest.h"
#include "hmi/ui_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -46,8 +46,8 @@ namespace commands_test {
namespace hmi_commands_test {
namespace ui_is_ready_response {
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
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 c566702998..31c03a7ed5 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
@@ -32,20 +32,20 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
#include "application_manager/application_manager.h"
#include "application_manager/application_manager_impl.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/request_controller_settings.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/request_controller_settings.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/update_device_list_request.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,18 +53,18 @@ namespace commands_test {
namespace hmi_commands_test {
namespace update_device_list_request {
-using testing::_;
-using testing::ReturnRef;
-using testing::Return;
-using test::components::event_engine_test::MockEventDispatcher;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
namespace am = ::application_manager;
namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
+using am::commands::CommandImpl;
using am::event_engine::Event;
using sdl_rpc_plugin::commands::UpdateDeviceListRequest;
-using am::commands::CommandImpl;
typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
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 af3b9bebf6..96f3b38fbf 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
@@ -33,13 +33,13 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/update_sdl_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -47,8 +47,8 @@ namespace commands_test {
namespace hmi_commands_test {
namespace update_sdl_request {
-using ::testing::ReturnRef;
using ::testing::NiceMock;
+using ::testing::ReturnRef;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::UpdateSDLRequest;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
index 93c49724ce..62ffc6be4d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
@@ -33,12 +33,12 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
#include "hmi/update_sdl_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -48,8 +48,8 @@ namespace update_sdl_response {
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
-using sdl_rpc_plugin::commands::UpdateSDLResponse;
using am::commands::CommandImpl;
+using sdl_rpc_plugin::commands::UpdateSDLResponse;
typedef std::shared_ptr<UpdateSDLResponse> UpdateSDLResponsePtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
index 15d38d4ef3..21acf2bb70 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
@@ -32,14 +32,14 @@
#include <stdint.h>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
+#include "gtest/gtest.h"
#include "hmi/vr_get_capabilities_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -51,8 +51,8 @@ using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
-using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse;
using am::commands::CommandImpl;
+using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse;
typedef std::shared_ptr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
typedef NiceMock<
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
index 05ed186963..8b00b4dded 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "hmi/vr_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.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/smart_object_keys.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -47,8 +47,8 @@ namespace vr_get_language_response {
using sdl_rpc_plugin::commands::VRGetLanguageResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
-using testing::ReturnRef;
using ::testing::NiceMock;
+using testing::ReturnRef;
namespace strings = application_manager::strings;
namespace hmi_response = application_manager::hmi_response;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
index 56b11ad440..b81823624c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
@@ -33,15 +33,15 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_application_manager.h"
-#include "hmi/vr_get_supported_languages_response.h"
+#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -49,8 +49,8 @@ namespace commands_test {
namespace hmi_commands_test {
namespace vr_get_supported_languages_response {
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
@@ -107,7 +107,8 @@ TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
EXPECT_CALL(mock_hmi_capabilities_,
- set_vr_supported_languages(supported_languages)).Times(0);
+ set_vr_supported_languages(supported_languages))
+ .Times(0);
command->Run();
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 5aa00e0264..9bb8e4c2d5 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
@@ -34,15 +34,15 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -54,8 +54,8 @@ using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::VRIsReadyRequest;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::VRIsReadyRequest;
typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr;
@@ -98,7 +98,7 @@ class VRIsReadyRequestTest
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
.WillOnce(Return(language));
EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language, _));
smart_objects::SmartObjectSPtr support_language(
new smart_objects::SmartObject(smart_objects::SmartType_Map));
@@ -106,14 +106,14 @@ class VRIsReadyRequestTest
mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _))
.WillOnce(Return(support_language));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language, _));
smart_objects::SmartObjectSPtr capabilities(
new smart_objects::SmartObject(smart_objects::SmartType_Map));
EXPECT_CALL(mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
.WillOnce(Return(capabilities));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities, _));
}
void PrepareEvent(bool is_message_contain_param,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
index 0e56f5b483..8b7b0a94f4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
@@ -33,12 +33,12 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "gtest/gtest.h"
#include "hmi/vr_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -46,8 +46,8 @@ namespace commands_test {
namespace hmi_commands_test {
namespace vr_is_ready_response {
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
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 7c99b5f2b8..b11312eb33 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
@@ -32,8 +32,8 @@
#include <stdint.h>
#include <memory>
-#include <string>
#include <set>
+#include <string>
#include "mobile/add_command_request.h"
@@ -41,16 +41,16 @@
#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
namespace test {
namespace components {
@@ -60,17 +60,17 @@ namespace add_command_request {
namespace am = application_manager;
namespace am_test = application_manager_test;
-using am::commands::CommandImpl;
using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::InSequence;
-using sdl_rpc_plugin::commands::AddCommandRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::event_engine::EventObserver;
using ns_smart_device_link::ns_smart_objects::SmartObjectSPtr;
+using sdl_rpc_plugin::commands::AddCommandRequest;
using ::test::components::application_manager_test::MockApplication;
-using am::event_engine::EventObserver;
+using ::testing::_;
+using ::testing::InSequence;
+using ::testing::Return;
using namespace smart_objects;
namespace custom_str = utils::custom_string;
@@ -190,11 +190,11 @@ class AddCommandRequestTest
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
@@ -207,7 +207,7 @@ class AddCommandRequestTest
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
+ ManageHMICommand(HMIResultCodeIs(cmd_to_delete), _))
.WillOnce(Return(true));
SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
@@ -276,7 +276,7 @@ TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_WARNINGS) {
commands_map, lock_ptr_)));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
@@ -492,13 +492,13 @@ TEST_F(AddCommandRequestTest,
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
@@ -522,7 +522,7 @@ TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
@@ -547,7 +547,7 @@ TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*mock_app_, help_prompt_manager())
@@ -578,7 +578,7 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*mock_app_, help_prompt_manager())
@@ -659,7 +659,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
@@ -690,13 +690,13 @@ TEST_F(AddCommandRequestTest,
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_,
@@ -734,13 +734,13 @@ TEST_F(
commands_map, lock_ptr_)));
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
@@ -779,13 +779,13 @@ TEST_F(
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
@@ -824,13 +824,13 @@ TEST_F(
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
std::shared_ptr<AddCommandRequest> request_ptr =
@@ -873,13 +873,13 @@ TEST_F(
commands_map, lock_ptr_)));
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
std::shared_ptr<AddCommandRequest> request_ptr =
@@ -921,7 +921,7 @@ TEST_F(
commands_map, lock_ptr_)));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _))
.WillOnce(Return(true));
std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
@@ -958,7 +958,7 @@ TEST_F(
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
@@ -996,13 +996,13 @@ TEST_F(AddCommandRequestTest,
commands_map, lock_ptr_)));
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_,
@@ -1020,9 +1020,9 @@ TEST_F(AddCommandRequestTest,
event_ui.set_smart_object(*msg_ui);
Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
event_vr.set_smart_object(*msg_);
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
request_ptr->on_event(event_ui);
@@ -1044,13 +1044,13 @@ TEST_F(AddCommandRequestTest,
commands_map, lock_ptr_)));
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_,
@@ -1063,9 +1063,9 @@ TEST_F(AddCommandRequestTest,
Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
event_ui.set_smart_object(*msg_);
request_ptr->on_event(event_ui);
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
@@ -1119,13 +1119,13 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
.WillOnce(Return(so_ptr_.get()));
{
InSequence dummy;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ 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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _))
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
index ecaa436529..a88a1ade69 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
@@ -35,14 +35,14 @@
#include "mobile/add_sub_menu_request.h"
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -51,9 +51,9 @@ namespace mobile_commands_test {
namespace add_sub_menu_request {
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::AddSubMenuRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::AddSubMenuRequest;
using ::testing::_;
using ::testing::Return;
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 7d2dd0b2c2..e726616345 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
@@ -35,20 +35,20 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "mobile/alert_maneuver_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "mobile/alert_maneuver_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -60,9 +60,9 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::AlertManeuverRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::AlertManeuverRequest;
typedef std::shared_ptr<AlertManeuverRequest> CommandPtr;
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 e32cc2b335..113c6d32a0 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
@@ -31,19 +31,19 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/alert_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -52,12 +52,12 @@ namespace mobile_commands_test {
namespace alert_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::AlertRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
using am::event_engine::Event;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::AlertRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -169,11 +169,11 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
void ExpectManageHmiCommandTTSAndUI() {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert), _))
.WillOnce(Return(true));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _))
.WillOnce(Return(true));
}
sync_primitives::Lock lock_;
@@ -452,7 +452,7 @@ TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)));
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _));
command->on_event(event);
}
@@ -479,7 +479,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _))
.WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
@@ -511,7 +511,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _))
.WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
@@ -556,9 +556,9 @@ TEST_F(AlertRequestTest,
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_Alert);
@@ -605,9 +605,9 @@ TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) {
(*msg_)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_Alert);
@@ -645,7 +645,7 @@ TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _))
.WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
@@ -654,9 +654,9 @@ TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
(*msg_)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::INVALID_ENUM;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_Alert);
@@ -695,7 +695,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _))
.WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
@@ -704,9 +704,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
(*msg_)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::INVALID_ENUM;
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_Alert);
@@ -743,9 +743,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) {
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_Alert);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
index 58755c8b36..4394c6fe5e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
@@ -31,25 +31,25 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/change_registration_request.h"
-#include "gtest/gtest.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "utils/helpers.h"
namespace test {
namespace components {
@@ -58,18 +58,18 @@ namespace mobile_commands_test {
namespace change_registration_request {
namespace am = application_manager;
-using am::commands::CommandImpl;
using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::ChangeRegistrationRequest;
+using ::test::components::application_manager_test::MockApplication;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SetArgPointee;
-using sdl_rpc_plugin::commands::ChangeRegistrationRequest;
-using policy_test::MockPolicyHandlerInterface;
-using ::test::components::application_manager_test::MockApplication;
namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
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 c42be48e57..73a0008624 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
@@ -31,24 +31,24 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/create_interaction_choice_set_request.h"
#include "mobile/create_interaction_choice_set_response.h"
-#include "gtest/gtest.h"
-#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "utils/helpers.h"
namespace test {
namespace components {
@@ -57,18 +57,18 @@ namespace mobile_commands_test {
namespace create_interaction_choice_set_request {
namespace am = application_manager;
-using am::commands::CommandImpl;
using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::AtLeast;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::CreateInteractionChoiceSetRequest;
using sdl_rpc_plugin::commands::CreateInteractionChoiceSetResponse;
using ::test::components::application_manager_test::MockApplication;
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::Return;
+using ::testing::ReturnRef;
namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
@@ -232,7 +232,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
.WillByDefault(
Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
.WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
req_vr->Run();
@@ -920,4 +920,4 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
index a87d172923..081058f05a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
@@ -37,15 +37,15 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_help_prompt_manager.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -58,11 +58,11 @@ using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
namespace am_test = application_manager_test;
-using sdl_rpc_plugin::commands::DeleteCommandRequest;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockMessageHelper;
-using am::MockHmiInterfaces;
+using sdl_rpc_plugin::commands::DeleteCommandRequest;
typedef std::shared_ptr<DeleteCommandRequest> DeleteCommandPtr;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
index 0ed7a92fa4..4081583099 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
@@ -31,32 +31,32 @@
*/
#include <stdint.h>
-#include <vector>
-#include <string>
#include <map>
+#include <string>
+#include <vector>
#include "mobile/delete_file_request.h"
#include "mobile/delete_file_response.h"
#include "gtest/gtest.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/file_system.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
namespace test {
namespace components {
@@ -65,17 +65,17 @@ namespace mobile_commands_test {
namespace delete_file {
using ::testing::_;
-using ::testing::Test;
+using ::testing::AtLeast;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SetArgReferee;
-using ::testing::AtLeast;
+using ::testing::Test;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::DeleteFileRequest;
-using sdl_rpc_plugin::commands::DeleteFileResponse;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::DeleteFileRequest;
+using sdl_rpc_plugin::commands::DeleteFileResponse;
typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr;
typedef std::shared_ptr<DeleteFileResponse> DeleteFileResponsePtr;
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 43c30809e5..fa96b21ca7 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
@@ -38,13 +38,13 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,15 +53,15 @@ namespace mobile_commands_test {
namespace delete_interaction_choice_set {
using ::testing::_;
-using ::testing::Return;
using ::testing::InSequence;
+using ::testing::Return;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest;
-using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest;
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse;
typedef std::shared_ptr<DeleteInteractionChoiceSetRequest>
DeleteInteractionChoiceSetRequestPtr;
@@ -252,7 +252,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
EXPECT_CALL(*app_, UpdateHash());
}
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
DeleteInteractionChoiceSetRequestPtr command =
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 f1c44f86ac..04f12568b4 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
@@ -36,14 +36,14 @@
#include "mobile/delete_sub_menu_request.h"
#include "mobile/delete_sub_menu_response.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -52,15 +52,15 @@ namespace mobile_commands_test {
namespace delete_sub_menu_request {
using ::testing::_;
+using ::testing::InSequence;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::InSequence;
namespace am = ::application_manager;
namespace am_test = application_manager_test;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
using am::MockHmiInterfaces;
using am::MockMessageHelper;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
using sdl_rpc_plugin::commands::DeleteSubMenuRequest;
using sdl_rpc_plugin::commands::DeleteSubMenuResponse;
@@ -224,9 +224,9 @@ TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu), _))
.WillOnce(Return(true));
command_->Run();
}
@@ -273,9 +273,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
@@ -284,9 +284,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
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)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand), _))
.WillOnce(Return(true));
EXPECT_CALL(*app_, RemoveSubMenu(_));
@@ -330,7 +330,7 @@ TEST_F(DeleteSubMenuRequestTest,
std::make_pair(0, &((*message_)[am::strings::msg_params])));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
@@ -357,7 +357,7 @@ TEST_F(DeleteSubMenuRequestTest,
std::make_pair(0, &((*message_)[am::strings::msg_params])));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
index 5d6c6dc89e..cf2634b37c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
@@ -36,16 +36,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
-#include "mobile/dial_number_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/dial_number_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -57,8 +57,8 @@ using ::testing::_;
using ::testing::Return;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::DialNumberRequest;
using am::event_engine::Event;
+using sdl_rpc_plugin::commands::DialNumberRequest;
namespace mobile_result = mobile_apis::Result;
typedef std::shared_ptr<DialNumberRequest> DialNumberRequestPtr;
@@ -131,9 +131,11 @@ TEST_F(DialNumberRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_DialNumber)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_DialNumber),
+ _));
command->Run();
}
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 8589cbb6be..8f83a2dd10 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
@@ -62,6 +62,8 @@
#include "mobile/end_audio_pass_thru_request.h"
#include "mobile/end_audio_pass_thru_response.h"
#include "mobile/generic_response.h"
+#include "mobile/get_file_request.h"
+#include "mobile/get_file_response.h"
#include "mobile/get_way_points_request.h"
#include "mobile/get_way_points_response.h"
#include "mobile/list_files_request.h"
@@ -78,6 +80,7 @@
#include "mobile/on_keyboard_input_notification.h"
#include "mobile/on_language_change_notification.h"
#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_capability_updated_notification.h"
#include "mobile/on_system_request_notification.h"
#include "mobile/on_tbt_client_state_notification.h"
#include "mobile/on_touch_event_notification.h"
@@ -128,8 +131,8 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "test/application_manager/mock_application_manager_settings.h"
namespace am = application_manager;
@@ -140,16 +143,16 @@ namespace mobile_commands_test {
namespace dummy_mobile_commands_test {
namespace commands = sdl_rpc_plugin::commands;
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
using am::commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
namespace {
const std::string kEmptyString_ = "";
@@ -220,6 +223,8 @@ typedef Types<commands::AddCommandRequest,
commands::EndAudioPassThruRequest,
commands::EndAudioPassThruResponse,
commands::GenericResponse,
+ commands::GetFileRequest,
+ commands::GetFileResponse,
commands::GetWayPointsRequest,
commands::GetWayPointsResponse,
commands::ListFilesRequest,
@@ -236,12 +241,13 @@ typedef Types<commands::AddCommandRequest,
commands::mobile::OnKeyBoardInputNotification,
commands::OnLanguageChangeNotification,
commands::OnPermissionsChangeNotification,
- commands::mobile::OnSystemRequestNotification,
- commands::OnTBTClientStateNotification,
- commands::mobile::OnTouchEventNotification>
+ commands::mobile::OnSystemCapabilityUpdatedNotification>
MobileCommandsListFirst;
-typedef Types<commands::OnWayPointChangeNotification,
+typedef Types<commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification,
+ commands::OnWayPointChangeNotification,
commands::PerformAudioPassThruRequest,
commands::PerformAudioPassThruResponse,
commands::PerformInteractionRequest,
@@ -277,15 +283,17 @@ typedef Types<commands::OnWayPointChangeNotification,
commands::SubscribeWayPointsRequest,
commands::SubscribeWayPointsResponse,
commands::SystemResponse,
- commands::UnregisterAppInterfaceRequest,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeButtonRequest,
- commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
+ commands::UnregisterAppInterfaceRequest>
+ MobileCommandsListSecond;
-typedef Types<commands::UnsubscribeWayPointsRequest,
+typedef Types<commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse,
+ commands::UnsubscribeWayPointsRequest,
commands::UnsubscribeWayPointsResponse,
commands::UpdateTurnListRequest,
- commands::UpdateTurnListResponse> MobileCommandsListThird;
+ commands::UpdateTurnListResponse>
+ MobileCommandsListThird;
TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
@@ -294,18 +302,18 @@ TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
+ EXPECT_NE(command.use_count(), 0);
}
} // namespace dummy_mobile_commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
index 304cf13ffd..ba09e0dabe 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
@@ -36,14 +36,14 @@
#include "mobile/end_audio_pass_thru_request.h"
-#include "gtest/gtest.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -52,13 +52,13 @@ namespace mobile_commands_test {
namespace end_audio_pass_thru_request {
namespace am = ::application_manager;
+using am::MockMessageHelper;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::EndAudioPassThruRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using am::commands::MessageSharedPtr;
-using sdl_rpc_plugin::commands::EndAudioPassThruRequest;
-using am::event_engine::Event;
-using am::MockMessageHelper;
typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
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 09a3336a10..7f7a8b55bd 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
@@ -32,18 +32,17 @@
#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
-#include "mobile/get_way_points_request.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_message_helper.h"
+#include "mobile/get_way_points_request.h"
namespace test {
namespace components {
@@ -52,11 +51,11 @@ namespace mobile_commands_test {
namespace get_way_points_request {
using namespace mobile_apis::Result;
-using ::testing::Return;
-using ::testing::_;
-using sdl_rpc_plugin::commands::GetWayPointsRequest;
-using application_manager::MockMessageHelper;
using application_manager::MockHmiInterfaces;
+using application_manager::MockMessageHelper;
+using sdl_rpc_plugin::commands::GetWayPointsRequest;
+using ::testing::_;
+using ::testing::Return;
typedef std::shared_ptr<GetWayPointsRequest> CommandPtr;
typedef mobile_apis::Result::eType MobileResult;
@@ -67,7 +66,7 @@ const uint32_t kCorrelationId = 2u;
const uint32_t kAppId = 3u;
const uint32_t kConnectionKey = kAppId;
const std::string kMethodName = "Navigation.GetWayPoints";
-}
+} // namespace
class GetWayPointsRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -205,7 +204,7 @@ TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
CallOnEvent caller(*command_sptr_, event);
caller();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
index 3fcc4225f3..8b6f6696b7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
@@ -35,15 +35,15 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
-#include "mobile/list_files_request.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "mobile/list_files_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,13 +52,13 @@ namespace mobile_commands_test {
namespace list_files_request {
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::DoAll;
using ::testing::SaveArg;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::ListFilesRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::ListFilesRequest;
class ListFilesRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
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 a0e41cf728..1f514e09c5 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
@@ -33,16 +33,16 @@
#include <stdint.h>
#include <string>
+#include "application_manager/smart_object_keys.h"
#include "gtest/gtest.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "mobile/on_button_event_notification.h"
#include "mobile/on_button_press_notification.h"
@@ -54,12 +54,12 @@ namespace on_button_notification {
namespace am = ::application_manager;
namespace commands = am::commands;
+using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::mobile::OnButtonEventNotification;
using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification;
using ::testing::_;
-using ::testing::Types;
using ::testing::Return;
-using am::commands::MessageSharedPtr;
+using ::testing::Types;
namespace {
const uint32_t kAppId = 5u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
index 2fd6f6137d..1356b1c5fa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
@@ -35,11 +35,11 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
#include "mobile/on_command_notification.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
index 1d6711e36f..15faa5c13f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
@@ -32,12 +32,12 @@
#include <string>
-#include "gtest/gtest.h"
-#include "mobile/on_hash_change_notification.h"
+#include "application_manager/commands/command_impl.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_impl.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "gtest/gtest.h"
+#include "mobile/on_hash_change_notification.h"
namespace test {
namespace components {
@@ -47,13 +47,13 @@ namespace on_hash_change_notification {
namespace strings = application_manager::strings;
-using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification;
using application_manager::MockMessageHelper;
using application_manager::commands::CommandImpl;
+using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification;
+using testing::_;
using testing::Mock;
using testing::Return;
using testing::ReturnRef;
-using testing::_;
class OnHashChangeNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
index 333c204d57..528f1d8618 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/commands/commands_test.h"
#include <application_manager/smart_object_keys.h>
-#include "application_manager/message.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/message.h"
#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -51,12 +51,12 @@ const connection_handler::DeviceHandle kHandle = 2u;
namespace strings = application_manager::strings;
-using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile;
-using protocol_handler::MajorProtocolVersion;
using application_manager::ApplicationSet;
+using protocol_handler::MajorProtocolVersion;
+using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile;
+using testing::_;
using testing::Mock;
using testing::Return;
-using testing::_;
class OnHMIStatusNotificationFromMobileTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
index ba3b1e8f1d..5bf68414e5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "mobile/on_hmi_status_notification.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -47,13 +47,13 @@ const uint32_t kConnectionKey = 1u;
} // namespace
namespace strings = application_manager::strings;
-using sdl_rpc_plugin::commands::OnHMIStatusNotification;
-using protocol_handler::MajorProtocolVersion;
using application_manager::MockMessageHelper;
using application_manager::commands::CommandImpl;
+using protocol_handler::MajorProtocolVersion;
+using sdl_rpc_plugin::commands::OnHMIStatusNotification;
+using testing::_;
using testing::Mock;
using testing::Return;
-using testing::_;
class OnHMIStatusNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
index 04f88e2b13..501b4d8631 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "mobile/on_keyboard_input_notification.h"
-#include "application_manager/commands/commands_test.h"
#include <application_manager/smart_object_keys.h>
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/message.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/command_impl.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -50,13 +50,13 @@ namespace {
const uint32_t kConnectionKey = 1u;
} // namespace
-using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification;
+using application_manager::ApplicationSet;
using application_manager::MockMessageHelper;
using application_manager::commands::CommandImpl;
-using application_manager::ApplicationSet;
+using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification;
+using testing::_;
using testing::Mock;
using testing::Return;
-using testing::_;
class OnKeyBoardInputNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
index 4981301e07..69ed8fb311 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -32,14 +32,13 @@
#include <string>
-#include "gtest/gtest.h"
-#include "mobile/on_system_request_notification.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
+#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/on_system_request_notification.h"
namespace test {
namespace components {
@@ -49,16 +48,16 @@ namespace on_system_request_notification {
namespace strings = application_manager::strings;
-using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification;
-using application_manager::commands::CommandImpl;
using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification;
using test::components::policy_test::MockPolicyHandlerInterface;
using namespace mobile_apis;
-using testing::SaveArg;
+using testing::_;
using testing::Mock;
using testing::Return;
using testing::ReturnRef;
-using testing::_;
+using testing::SaveArg;
namespace {
const uint32_t kConnectionKey = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
index 3d989db478..f1e1a291d3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -36,10 +36,10 @@
#include "gtest/gtest.h"
#include "mobile/on_tbt_client_state_notification.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
#include "utils/helpers.h"
namespace test {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
index f69dd5da2e..95020328b4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
@@ -36,10 +36,10 @@
#include "gtest/gtest.h"
#include "mobile/on_touch_event_notification.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
#include "utils/helpers.h"
namespace test {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
index ed0a9b07d2..83958954cd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
@@ -36,10 +36,10 @@
#include "gtest/gtest.h"
#include "mobile/on_way_point_change_notification.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
#include "utils/helpers.h"
namespace test {
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 f51f1aa655..b0df0e57d3 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
@@ -31,18 +31,18 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/perform_audio_pass_thru_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -51,14 +51,14 @@ namespace mobile_commands_test {
namespace perform_audio_pass_thru_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::PerformAudioPassThruRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::PerformAudioPassThruRequest;
using ::testing::_;
+using ::testing::InSequence;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::InSequence;
namespace {
const int32_t kCommandId = 1;
@@ -239,7 +239,7 @@ TEST_F(PerformAudioPassThruRequestTest,
MessageSharedPtr response_to_mobile;
uint32_t app_id = kConnectionKey;
EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillRepeatedly(Return(true));
EXPECT_CALL(
mock_rpc_service_,
@@ -250,7 +250,8 @@ TEST_F(PerformAudioPassThruRequestTest,
VerifyTtsFiles((*mobile_request)[am::strings::msg_params]
[am::strings::initial_prompt],
_,
- _)).WillOnce(Return(mobile_apis::Result::SUCCESS));
+ _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
command->Run();
command->on_event(event_tts);
@@ -342,7 +343,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
// Perform audio path thru request sending
@@ -355,7 +356,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
}
CallRun run_caller(*command_sptr_);
@@ -431,7 +432,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
// Perform audio path thru request sending
@@ -444,7 +445,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
}
CallRun caller(*command_sptr_);
@@ -463,10 +464,12 @@ TEST_F(PerformAudioPassThruRequestTest,
.asString();
const std::string result_display_text_1 =
perform_msg_params[am::hmi_request::audio_pass_display_texts][0]
- [am::hmi_request::field_text].asString();
+ [am::hmi_request::field_text]
+ .asString();
const std::string result_display_text_2 =
perform_msg_params[am::hmi_request::audio_pass_display_texts][1]
- [am::hmi_request::field_text].asString();
+ [am::hmi_request::field_text]
+ .asString();
EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
EXPECT_EQ(kCorrectType, result_prompt_type);
@@ -505,7 +508,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
// Perform audio path thru request sending
@@ -518,7 +521,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
}
CallRun caller(*command_sptr_);
@@ -551,7 +554,7 @@ TEST_F(
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Perform audio path thru request sending
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
// Perform audio path thru request sending
@@ -564,7 +567,7 @@ TEST_F(
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Start recording notification sending
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true)));
}
@@ -579,7 +582,8 @@ TEST_F(
const hmi_apis::FunctionID::eType start_record_result_function_id =
static_cast<hmi_apis::FunctionID::eType>(
(*start_record_result_msg)[am::strings::params]
- [am::strings::function_id].asInt());
+ [am::strings::function_id]
+ .asInt());
EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart,
start_record_result_function_id);
}
@@ -613,7 +617,7 @@ TEST_F(PerformAudioPassThruRequestTest,
// Start recording notification sending
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
// Start microphone recording cals
uint32_t app_id = kConnectionKey;
@@ -676,7 +680,7 @@ TEST_F(PerformAudioPassThruRequestTest,
msg_params_[am::strings::function_id] = kFunctionId;
msg_params_[am::strings::correlation_id] = kCorrelationId;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
uint32_t app_id = kConnectionKey;
EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
@@ -703,7 +707,7 @@ TEST_F(PerformAudioPassThruRequestTest,
msg_params_[am::strings::function_id] = kFunctionId;
uint32_t app_id = kConnectionKey;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
EXPECT_CALL(
@@ -751,7 +755,7 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
command_sptr_->onTimeOut();
}
@@ -783,7 +787,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
// Perform audio path thru request sending
@@ -796,7 +800,7 @@ TEST_F(PerformAudioPassThruRequestTest,
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -807,7 +811,7 @@ TEST_F(PerformAudioPassThruRequestTest,
// For setting is_active_tts_speak -> true
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.Times(2)
.WillRepeatedly(Return(false));
CallRun caller(*command_sptr_);
@@ -819,9 +823,9 @@ TEST_F(PerformAudioPassThruRequestTest,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL));
command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _))
.WillOnce(Return(false));
command_sptr_->onTimeOut();
@@ -831,4 +835,4 @@ TEST_F(PerformAudioPassThruRequestTest,
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
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 3b68d3ea72..f1f7c4c907 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
@@ -31,22 +31,22 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/perform_interaction_request.h"
-#include "gtest/gtest.h"
-#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "utils/helpers.h"
namespace test {
namespace components {
@@ -55,16 +55,16 @@ namespace mobile_commands_test {
namespace perform_interaction_request {
namespace am = application_manager;
-using am::commands::CommandImpl;
using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::PerformInteractionRequest;
+using ::test::components::application_manager_test::MockApplication;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using sdl_rpc_plugin::commands::PerformInteractionRequest;
-using ::test::components::application_manager_test::MockApplication;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
@@ -258,4 +258,4 @@ TEST_F(PerformInteractionRequestTest,
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
index df4f69f0d0..e8e03484ed 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -36,18 +36,18 @@
#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
-#include "mobile/put_file_response.h"
#include "mobile/put_file_request.h"
+#include "mobile/put_file_response.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/application.h"
#include "application_manager/mock_application.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/file_system.h"
namespace test {
namespace components {
@@ -56,16 +56,16 @@ namespace mobile_commands_test {
namespace put_file {
using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::AtLeast;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::PutFileRequest;
-using sdl_rpc_plugin::commands::PutFileResponse;
using am::commands::MessageSharedPtr;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::PutFileRequest;
+using sdl_rpc_plugin::commands::PutFileResponse;
typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr;
typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr;
@@ -78,7 +78,7 @@ const int64_t kZeroOffset = 0u;
const std::string kStorageFolder = "./storage";
const std::string kFolder = "folder";
const std::string kAppFolder = "app_folder";
-}
+} // namespace
class PutFileRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -315,9 +315,11 @@ TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
EXPECT_CALL(app_mngr_,
SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnPutFile)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_OnPutFile),
+ _))
.WillOnce(Return(true));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
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 7dab16fe35..0e8374b75a 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
@@ -34,25 +34,25 @@
#include <string>
#include <vector>
-#include "gtest/gtest.h"
-#include "mobile/register_app_interface_request.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_resume_ctrl.h"
#include "application_manager/mock_hmi_interface.h"
-#include "utils/data_accessor.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+#include "mobile/register_app_interface_request.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
+#include "utils/data_accessor.h"
#include "utils/lock.h"
#include "utils/macro.h"
#include "utils/semantic_version.h"
@@ -64,9 +64,9 @@ namespace mobile_commands_test {
namespace register_app_interface_request {
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::DoAll;
namespace am = ::application_manager;
@@ -207,27 +207,38 @@ class RegisterAppInterfaceRequestTest
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(response_result_code), _));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _))
.Times(0);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _))
.Times(0);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_ChangeRegistration))).Times(0);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration), _))
+ .Times(0);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_ChangeRegistration))).Times(0);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration), _))
+ .Times(0);
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration), _))
+ .Times(0);
EXPECT_CALL(app_mngr_,
OnApplicationSwitched(
@@ -297,12 +308,16 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _))
.WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
@@ -399,24 +414,31 @@ TEST_F(RegisterAppInterfaceRequestTest,
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ 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)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_ChangeRegistration)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration), _))
.WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
@@ -447,7 +469,8 @@ TEST_F(RegisterAppInterfaceRequestTest,
mock_resume_crt_,
CheckApplicationHash(
std::static_pointer_cast<application_manager::Application>(mock_app),
- request_hash_id)).WillOnce(Return(true));
+ request_hash_id))
+ .WillOnce(Return(true));
EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
@@ -481,7 +504,8 @@ TEST_F(RegisterAppInterfaceRequestTest,
mock_resume_crt_,
CheckApplicationHash(
std::static_pointer_cast<application_manager::Application>(mock_app),
- request_hash_id)).WillOnce(Return(false));
+ request_hash_id))
+ .WillOnce(Return(false));
EXPECT_CALL(
mock_application_helper_,
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 0e3cd685fa..98c0ad098a 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
@@ -37,17 +37,17 @@
#include "mobile/reset_global_properties_request.h"
#include "mobile/reset_global_properties_response.h"
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/smart_object_keys.h"
+#include "gtest/gtest.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -61,11 +61,11 @@ using ::testing::ReturnRef;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest;
-using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest;
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse;
typedef std::shared_ptr<ResetGlobalPropertiesRequest>
ResetGlobalPropertiesRequestPtr;
@@ -170,7 +170,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
command_->Run();
}
@@ -237,13 +237,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
EXPECT_CALL(*mock_app_, timeout_prompt())
.WillOnce(Return(so_help_prompt.get()));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
@@ -274,9 +276,10 @@ TEST_F(ResetGlobalPropertiesRequestTest,
smart_objects::SmartType_Map);
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
@@ -320,13 +323,15 @@ TEST_F(ResetGlobalPropertiesRequestTest,
(*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
(*ui_msg)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::eType::SUCCESS;
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
ui_event.set_smart_object(*ui_msg);
@@ -362,9 +367,10 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
EXPECT_CALL(*mock_app_, reset_vr_help());
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
smart_objects::SmartObjectSPtr vr_help =
std::make_shared<smart_objects::SmartObject>(
@@ -412,13 +418,15 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
ResetGlobalPropertiesRequestPtr command =
@@ -477,13 +485,15 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
@@ -541,13 +551,15 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
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 cf25a82972..3820112ea5 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
@@ -31,20 +31,20 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/scrollable_message_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -57,10 +57,10 @@ namespace hmi_response = am::hmi_response;
namespace mobile_result = mobile_apis::Result;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::ScrollableMessageRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::ScrollableMessageRequest;
using ::testing::_;
using ::testing::Eq;
using ::testing::Ref;
@@ -282,4 +282,4 @@ TEST_F(ScrollableMessageRequestTest,
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
index 6c7127e48c..3cb9642021 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
@@ -32,15 +32,15 @@
#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "mobile/send_haptic_data_request.h"
#include "mobile/send_haptic_data_response.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/application.h"
#include "application_manager/mock_application.h"
+#include "interfaces/MOBILE_API.h"
namespace test {
namespace components {
@@ -53,9 +53,9 @@ using ::testing::Return;
namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::SendHapticDataRequest;
using sdl_rpc_plugin::commands::SendHapticDataResponse;
-using am::commands::MessageSharedPtr;
typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr;
typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr;
@@ -102,7 +102,7 @@ TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData), _))
.WillOnce(Return(true));
SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
index 4f44293fc9..5d90453278 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
@@ -32,10 +32,10 @@
#include <stdint.h>
#include <string>
-#include "gtest/gtest.h"
-#include "mobile/send_location_request.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
+#include "mobile/send_location_request.h"
#include "application_manager/commands/command_request_test.h"
@@ -45,11 +45,11 @@ namespace commands_test {
namespace mobile_commands_test {
namespace send_location_request {
+using application_manager::MockMessageHelper;
using application_manager::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::SendLocationRequest;
-using application_manager::MockMessageHelper;
-using test::components::application_manager_test::MockHMICapabilities;
using smart_objects::SmartObject;
+using test::components::application_manager_test::MockHMICapabilities;
using testing::_;
using testing::Return;
@@ -137,15 +137,16 @@ class SendLocationRequestTest
void FinishSetup() {
EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Navigation_SendLocation)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Navigation_SendLocation), _));
}
void FinishSetupCancelled(mobile_apis::Result::eType result) {
EXPECT_CALL(*mock_app_, hmi_app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(result), _));
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
index d8d1faca47..116a796312 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
@@ -31,20 +31,20 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/set_app_icon_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
#include "protocol_handler/mock_protocol_handler.h"
#include "protocol_handler/mock_protocol_handler_settings.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
namespace test {
namespace components {
@@ -53,11 +53,11 @@ namespace mobile_commands_test {
namespace set_app_icon_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::SetAppIconRequest;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using am::MockHmiInterfaces;
+using sdl_rpc_plugin::commands::SetAppIconRequest;
using test::components::protocol_handler_test::MockProtocolHandler;
using test::components::protocol_handler_test::MockProtocolHandlerSettings;
using ::testing::_;
@@ -170,4 +170,4 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
index cd6af1512d..cc2f042eac 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
@@ -31,19 +31,19 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/set_display_layout_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -53,10 +53,10 @@ namespace set_display_layout_request {
namespace am = application_manager;
namespace mobile_result = mobile_apis::Result;
-using sdl_rpc_plugin::commands::SetDisplayLayoutRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::SetDisplayLayoutRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -201,7 +201,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(CheckMshCorrId(kCorrelationKey)))
+ ManageHMICommand(CheckMshCorrId(kCorrelationKey), _))
.WillOnce(Return(true));
command->Run();
@@ -246,4 +246,4 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
index 03aa5d85a1..3e791aef01 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
@@ -32,19 +32,19 @@
#include <stdint.h>
#include <memory>
-#include <string>
#include <set>
+#include <string>
#include "mobile/set_global_properties_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
-#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -53,15 +53,15 @@ namespace mobile_commands_test {
namespace set_global_properties_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using am::CommandsMap;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using am::CommandsMap;
-using utils::custom_string::CustomString;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
+using utils::custom_string::CustomString;
namespace {
const int32_t kCommandId = 1;
@@ -314,20 +314,23 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, help_prompt_manager())
.WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
EXPECT_CALL(*mock_help_prompt_manager_,
- OnSetGlobalPropertiesReceived(_, false)).Times(2);
+ OnSetGlobalPropertiesReceived(_, false))
+ .Times(2);
EXPECT_CALL(
mock_message_helper_,
VerifyTtsFiles(
(*msg_vr)[am::strings::msg_params][am::strings::help_prompt], _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _))
.WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
(*msg_vr)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
@@ -413,7 +416,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
command->Run();
EXPECT_CALL(*mock_help_prompt_manager_,
- OnSetGlobalPropertiesReceived(_, true)).Times(2);
+ OnSetGlobalPropertiesReceived(_, true))
+ .Times(2);
command->on_event(event_ui);
command->on_event(event_tts);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
index a69d3d741b..86d15e76f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
@@ -35,13 +35,13 @@
#include "mobile/set_media_clock_timer_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -50,10 +50,10 @@ namespace mobile_commands_test {
namespace set_media_clock_timer_request {
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::SetMediaClockRequest;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::SetMediaClockRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -179,7 +179,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
command->Run();
}
@@ -217,7 +217,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
index 4725af4671..ed0f52a521 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
@@ -32,19 +32,19 @@
#include <stdint.h>
#include <memory>
-#include <string>
#include <set>
+#include <string>
#include "mobile/show_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -53,10 +53,10 @@ namespace mobile_commands_test {
namespace show_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::ShowRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
+using sdl_rpc_plugin::commands::ShowRequest;
using test::components::policy_test::MockPolicyHandlerInterface;
using ::testing::_;
using ::testing::Return;
@@ -125,7 +125,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
static_cast<int32_t>(field_name);
msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] =
text_field_;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
}
@@ -143,7 +143,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
}
@@ -196,7 +196,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
}
}
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
}
@@ -272,7 +272,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
EXPECT_CALL(
mock_message_helper_,
SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -296,7 +296,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
smart_objects::SmartObject(smart_objects::SmartType_Array);
EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -321,7 +321,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
.Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
command->Run();
@@ -348,7 +348,7 @@ TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -375,7 +375,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WARNINGS) {
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -398,7 +398,7 @@ TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
.WillOnce(Return(mobile_apis::Result::INVALID_DATA));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
command->Run();
@@ -421,7 +421,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
command->Run();
@@ -447,7 +447,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
msg_params[am::strings::app_id] = kAppId;
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -473,7 +473,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WARNINGS) {
msg_params[am::strings::app_id] = kAppId;
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -497,7 +497,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
command->Run();
@@ -520,7 +520,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
command->Run();
@@ -836,7 +836,7 @@ TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -859,7 +859,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
msg_params[am::strings::app_id] = kAppId;
msg_params[am::hmi_request::show_strings] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _));
EXPECT_CALL(*mock_app_, set_show_command(msg_params));
command->Run();
@@ -880,7 +880,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
command->Run();
@@ -895,7 +895,7 @@ TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
.WillOnce(Return(MockAppPtr()));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
command->Run();
@@ -910,7 +910,7 @@ TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
command->Run();
@@ -971,4 +971,4 @@ TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
index d96a9d7643..6e85aff281 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
@@ -35,16 +35,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "mobile/on_app_interface_unregistered_notification.h"
#include "mobile/on_audio_pass_thru_notification.h"
#include "mobile/on_driver_distraction_notification.h"
#include "mobile/on_language_change_notification.h"
#include "mobile/on_permissions_change_notification.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -56,8 +56,8 @@ namespace am = ::application_manager;
namespace commands = sdl_rpc_plugin::commands;
using ::testing::_;
-using ::testing::Types;
using ::testing::Return;
+using ::testing::Types;
template <class Command>
class MobileNotificationCommandsTest
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
index bbd39874e0..0034dcf916 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
@@ -38,37 +38,36 @@
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
-#include "mobile/delete_command_response.h"
+#include "mobile/add_command_response.h"
+#include "mobile/add_sub_menu_response.h"
#include "mobile/alert_maneuver_response.h"
#include "mobile/alert_response.h"
-#include "mobile/list_files_response.h"
-#include "mobile/subscribe_button_response.h"
-#include "mobile/add_sub_menu_response.h"
+#include "mobile/change_registration_response.h"
+#include "mobile/delete_command_response.h"
#include "mobile/dial_number_response.h"
#include "mobile/end_audio_pass_thru_response.h"
-#include "mobile/unregister_app_interface_response.h"
-#include "mobile/unsubscribe_button_response.h"
-#include "mobile/unsubscribe_way_points_response.h"
-#include "mobile/update_turn_list_response.h"
-#include "mobile/slider_response.h"
-#include "mobile/speak_response.h"
-#include "mobile/subscribe_way_points_response.h"
-#include "mobile/system_response.h"
+#include "mobile/generic_response.h"
#include "mobile/get_way_points_response.h"
-#include "mobile/perform_interaction_response.h"
+#include "mobile/list_files_response.h"
#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_response.h"
#include "mobile/set_global_properties_response.h"
#include "mobile/set_media_clock_timer_response.h"
#include "mobile/show_constant_tbt_response.h"
#include "mobile/show_response.h"
-#include "mobile/add_command_response.h"
-#include "mobile/send_location_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/set_display_layout_response.h"
-#include "mobile/generic_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/scrollable_message_response.h"
-#include "mobile/change_registration_response.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_response.h"
namespace test {
namespace components {
@@ -120,7 +119,8 @@ typedef Types<commands::ListFilesResponse,
commands::SendLocationResponse,
commands::SetAppIconResponse,
commands::SetDisplayLayoutResponse,
- commands::ChangeRegistrationResponse> ResponseCommandsList;
+ commands::ChangeRegistrationResponse>
+ ResponseCommandsList;
TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
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 be14aebc8f..0450f06ee1 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
@@ -31,19 +31,19 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "mobile/slider_request.h"
-#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -52,11 +52,11 @@ namespace mobile_commands_test {
namespace slider_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::SliderRequest;
+using am::MockMessageHelper;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::SliderRequest;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -268,7 +268,7 @@ TEST_F(SliderRequestTest, Run_SUCCESS) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider)));
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider), _));
CommandPtr command(CreateCommand<SliderRequest>(msg_));
command->Run();
@@ -337,4 +337,4 @@ TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) {
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
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 9eb23eeee3..87320d3a7a 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
@@ -31,26 +31,26 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "mobile/speak_request.h"
#include <string>
#include "gtest/gtest.h"
-#include "mobile/speak_request.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
#include "application_manager/application.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
namespace test {
namespace components {
@@ -62,24 +62,24 @@ namespace am = application_manager;
namespace mobile_result = mobile_apis::Result;
namespace hmi_response = ::application_manager::hmi_response;
namespace strings = ::application_manager::strings;
-using am::commands::CommandImpl;
using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
using sdl_rpc_plugin::commands::SpeakRequest;
using ::test::components::application_manager_test::MockApplication;
+using ::testing::Return;
+using ::testing::ReturnRef;
typedef std::shared_ptr<SpeakRequest> CommandPtr;
namespace {
const uint32_t kAppId = 10u;
const uint32_t kConnectionKey = 5u;
-}
+} // namespace
class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
@@ -295,7 +295,7 @@ TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _));
command->Run();
}
@@ -315,7 +315,7 @@ TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
EXPECT_CALL(
mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _));
command->Run();
}
@@ -402,5 +402,5 @@ TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
} // namespace speak_request
} // namespace mobile_commands_test
} // namespace commands_test
-} // namespace component
+} // namespace components
} // namespace test
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 caca56e297..01f8f313b6 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
@@ -35,16 +35,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "mobile/subscribe_button_request.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "mobile/subscribe_button_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -53,13 +53,13 @@ namespace mobile_commands_test {
namespace subscribe_button_request {
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::DoAll;
using ::testing::SaveArg;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::SubscribeButtonRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SubscribeButtonRequest;
typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr;
@@ -182,7 +182,7 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
MessageSharedPtr hmi_result_msg;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
MessageSharedPtr mobile_result_msg;
@@ -199,7 +199,8 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
EXPECT_EQ(mobile_apis::Result::SUCCESS,
static_cast<mobile_apis::Result::eType>(
(*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
+ [am::strings::result_code]
+ .asInt()));
}
TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
@@ -230,7 +231,7 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
MessageSharedPtr hmi_result_msg;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
MessageSharedPtr mobile_result_msg;
@@ -252,7 +253,8 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
EXPECT_EQ(mobile_apis::Result::SUCCESS,
static_cast<mobile_apis::Result::eType>(
(*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
+ [am::strings::result_code]
+ .asInt()));
}
} // namespace subscribe_button_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
index d08c13b3f3..56e4e05d48 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -32,17 +32,17 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_message_helper.h"
-#include "mobile/subscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,14 +52,14 @@ namespace subscribe_way_points_request {
using ::testing::_;
using ::testing::A;
+using ::testing::DoAll;
+using ::testing::InSequence;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::DoAll;
using ::testing::SaveArg;
-using ::testing::InSequence;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr;
@@ -90,7 +90,8 @@ TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
EXPECT_EQ(mobile_apis::Result::SUCCESS,
static_cast<mobile_apis::Result::eType>(
(*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
+ [am::strings::result_code]
+ .asInt()));
}
TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
index 9e6bc8f505..7351cd67d3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
@@ -31,18 +31,18 @@
*/
#include <stdint.h>
-#include <string>
#include <set>
+#include <string>
#include "gtest/gtest.h"
-#include "mobile/system_request.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "mobile/system_request.h"
namespace test {
namespace components {
@@ -51,13 +51,13 @@ namespace mobile_commands_test {
namespace system_request {
namespace am = application_manager;
-using sdl_rpc_plugin::commands::SystemRequest;
+using am::MessageType;
+using am::MockHmiInterfaces;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
-using am::MockHmiInterfaces;
using am::event_engine::Event;
-using am::MessageType;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::SystemRequest;
using ::testing::_;
using ::testing::DoAll;
@@ -160,7 +160,7 @@ TEST_F(SystemRequestTest,
.WillOnce(Return(mobile_apis::Result::SUCCESS));
smart_objects::SmartObjectSPtr result;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
@@ -201,7 +201,7 @@ TEST_F(
.WillOnce(Return(false));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
ASSERT_TRUE(command->Init());
@@ -222,7 +222,38 @@ TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) {
.WillOnce(Return(false));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SystemRequestTest, Run_RequestType_IconURL_Success) {
+ PreConditions();
+ MessageSharedPtr msg = CreateIVSUMessage();
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::ICON_URL;
+
+ const std::string url = "https://www.appsfakeiconurlendpoint.com/icon.png";
+
+ (*msg)[am::strings::msg_params][am::strings::file_name] = url;
+ const std::vector<uint8_t> binary_data = {1u, 2u};
+ (*msg)[am::strings::params][am::strings::binary_data] = binary_data;
+
+ EXPECT_CALL(
+ mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId, mobile_apis::RequestType::ICON_URL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_settings_, app_icons_folder())
+ .WillOnce(ReturnRef(kAppStorageFolder));
+ EXPECT_CALL(app_mngr_, PolicyIDByIconUrl(url)).WillOnce(Return(kAppPolicyId));
+
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data, kAppStorageFolder, kAppPolicyId, 0u))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(app_mngr_, SetIconFileFromSystemRequest(kAppPolicyId)).Times(1);
std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
ASSERT_TRUE(command->Init());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
index 771374348b..f244acb8d6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -51,8 +51,8 @@ namespace mobile_result = mobile_apis::Result;
using ::testing::_;
-using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest;
typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr;
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 a848fff2b2..98d20dbbc4 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
@@ -5,8 +5,8 @@
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "mobile/unsubscribe_button_request.h"
namespace test {
@@ -20,8 +20,8 @@ namespace mobile_result = mobile_apis::Result;
using ::testing::_;
-using sdl_rpc_plugin::commands::UnsubscribeButtonRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::UnsubscribeButtonRequest;
typedef std::shared_ptr<UnsubscribeButtonRequest> CommandPtr;
@@ -139,9 +139,11 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
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_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _));
EXPECT_CALL(
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
@@ -182,9 +184,11 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Base_RPC_Version) {
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_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _));
EXPECT_CALL(
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
index f345d719c6..3165d57d44 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -34,18 +34,18 @@
#include <string>
#include "gtest/gtest.h"
-#include "mobile/unsubscribe_way_points_request.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/unsubscribe_way_points_request.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -59,8 +59,8 @@ namespace mobile_result = mobile_apis::Result;
using ::testing::_;
using ::testing::Return;
-using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
namespace {
const uint32_t kConnectionKey = 3u;
@@ -122,9 +122,16 @@ TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
.WillOnce(Return(true));
+ const std::set<uint32_t> subscribed_apps{kConnectionKey};
+
+ EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
+ .WillOnce(Return(subscribed_apps));
+
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints),
+ _));
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 78fca8681a..44628a8e89 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
@@ -34,20 +34,20 @@
#include <string>
#include "gtest/gtest.h"
-#include "mobile/update_turn_list_request.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/update_turn_list_request.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -59,14 +59,14 @@ namespace am = ::application_manager;
namespace mobile_result = mobile_apis::Result;
using ::testing::_;
+using ::testing::Eq;
+using ::testing::Ref;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::Ref;
-using ::testing::Eq;
-using sdl_rpc_plugin::commands::UpdateTurnListRequest;
using am::commands::MessageSharedPtr;
using application_manager_test::MockHMICapabilities;
+using sdl_rpc_plugin::commands::UpdateTurnListRequest;
namespace {
const uint32_t kConnectionKey = 3u;
@@ -208,7 +208,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
(*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
[am::strings::turn_icon],
Eq(mock_app),
- Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS));
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
EXPECT_CALL(mock_message_helper_,
SubscribeApplicationToSoftButton(_, _, kFunctionId));
@@ -223,8 +224,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
.keyExists(am::hmi_request::navi_text));
EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_name));
+ [am::hmi_request::navi_text]
+ .keyExists(am::hmi_request::field_name));
EXPECT_EQ(
hmi_apis::Common_TextFieldName::turnText,
(*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
@@ -232,8 +233,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
.asInt());
EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_text));
+ [am::hmi_request::navi_text]
+ .keyExists(am::hmi_request::field_text));
EXPECT_EQ(
kNavigationText,
(*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
@@ -268,7 +269,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
(*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
[am::strings::turn_icon],
Eq(mock_app),
- Ref(app_mngr_))).WillOnce(Return(mobile_result::WARNINGS));
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::WARNINGS));
EXPECT_CALL(mock_message_helper_,
SubscribeApplicationToSoftButton(_, _, kFunctionId));
@@ -283,8 +285,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
.keyExists(am::hmi_request::navi_text));
EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_name));
+ [am::hmi_request::navi_text]
+ .keyExists(am::hmi_request::field_name));
EXPECT_EQ(
hmi_apis::Common_TextFieldName::turnText,
(*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
@@ -292,8 +294,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
.asInt());
EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_text));
+ [am::hmi_request::navi_text]
+ .keyExists(am::hmi_request::field_text));
EXPECT_EQ(
kNavigationText,
(*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
index 1fb9c0a008..103bfb56dc 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
-#include "application_manager/commands/notification_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/notification_from_hmi.h"
namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
@@ -76,6 +76,6 @@ class OnVIVehicleDataNotification
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
index 0b0a9ef99e..162a6b338a 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
@@ -73,6 +73,6 @@ class VIDiagnosticMessageRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
index 31fc73897e..a427bbe362 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
@@ -73,6 +73,6 @@ class VIDiagnosticMessageResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
index 67308a3898..df9e84eab4 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
@@ -72,6 +72,6 @@ class VIGetDTCsRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
index 0ddf225c93..d8351c1a61 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
@@ -72,6 +72,6 @@ class VIGetDTCsResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
index 1b4669cf24..437e7c8933 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
@@ -72,6 +72,6 @@ class VIGetVehicleDataRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
index df5e630aea..651a0af79c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
-#include "application_manager/commands/response_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class VIGetVehicleDataResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
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 79a5270f8d..1166d3f774 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
@@ -72,6 +72,6 @@ class VIGetVehicleTypeRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
index baa4a936ae..00c1944c0f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
@@ -73,6 +73,6 @@ class VIGetVehicleTypeResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
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 3f12a30c8d..7a8ca3a4b6 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
@@ -88,6 +88,6 @@ class VIIsReadyRequest : public app_mngr::commands::RequestToHMI,
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
index 3531aa03c4..e0ff20b8bb 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
-#include "application_manager/commands/response_from_hmi.h"
#include "application_manager/application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
@@ -73,6 +73,6 @@ class VIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
index 2d10bbf11d..1e91a4c3af 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
@@ -72,6 +72,6 @@ class VIReadDIDRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
index 5ac655b499..f659f7ae87 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
@@ -72,6 +72,6 @@ class VIReadDIDResponse : public app_mngr::commands::ResponseFromHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
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 bd22a313e7..dab5989e9e 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
@@ -73,6 +73,6 @@ class VISubscribeVehicleDataRequest : public app_mngr::commands::RequestToHMI {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
index 1148a8b41a..8eea8d0cfa 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -74,6 +74,6 @@ class VISubscribeVehicleDataResponse
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
index 3b39835fbf..a8ebf34ea2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -74,6 +74,6 @@ class VIUnsubscribeVehicleDataRequest
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
index ada6896520..780d1e9eae 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -74,6 +74,6 @@ class VIUnsubscribeVehicleDataResponse
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
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 e2bc7c4dfd..bd9ce31325 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
@@ -80,6 +80,6 @@ class DiagnosticMessageRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
index d69a6a0155..7b6364fe41 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
@@ -74,6 +74,6 @@ class DiagnosticMessageResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
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 01f007697d..9175900610 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
@@ -80,6 +80,6 @@ class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
index 87024b1860..473174fd0d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
@@ -73,6 +73,6 @@ class GetDTCsResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
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 04a131da8f..ff04ca1e2c 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
@@ -77,6 +77,6 @@ class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
index 22ec1a5a78..25fd27b67c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
@@ -73,6 +73,6 @@ class GetVehicleDataResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
index 57c30164e4..ce1b732775 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
-#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
namespace vehicle_info_plugin {
@@ -83,6 +83,6 @@ class OnVehicleDataNotification
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
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 9a8fbbd62e..d006cf02ef 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
@@ -80,6 +80,6 @@ class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
index 2b7ab04768..d3c0e14c93 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
@@ -73,6 +73,6 @@ class ReadDIDResponse : public app_mngr::commands::CommandResponseImpl {
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
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 7c6e1754da..2671173ba3 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
@@ -37,8 +37,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
@@ -153,6 +153,6 @@ class SubscribeVehicleDataRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
index 60670afee1..2212af0846 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
@@ -75,6 +75,6 @@ class SubscribeVehicleDataResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
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 e04d1fb97a..b246dbc9ef 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
@@ -34,8 +34,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
@@ -115,6 +115,6 @@ class UnsubscribeVehicleDataRequest
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
index 397ae3cbce..67f09a68a8 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -75,6 +75,6 @@ class UnsubscribeVehicleDataResponse
};
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
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 ead6af841f..b3ba768b1b 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
@@ -61,11 +61,11 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension {
virtual ~VehicleInfoAppExtension();
/**
- * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of
- * application extension
- * @param vehicle_data data to subscribe
- * @return true in case if subscription is successful
- */
+ * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of
+ * application extension
+ * @param vehicle_data data to subscribe
+ * @return true in case if subscription is successful
+ */
bool subscribeToVehicleInfo(const VehicleDataType vehicle_data);
/**
@@ -130,6 +130,6 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension {
VehicleInfoPlugin& plugin_;
app_mngr::Application& app_;
};
-}
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
index e36611dfa6..58100ba1ae 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
@@ -65,6 +65,6 @@ class VehicleInfoCommandFactory : public app_mngr::CommandFactory {
std::unique_ptr<app_mngr::CommandFactory> hmi_command_factory_;
std::unique_ptr<app_mngr::CommandFactory> mob_command_factory_;
};
-}
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
index 412949eedb..c927f3f2bb 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
@@ -68,6 +68,6 @@ class VehicleInfoHmiCommandFactory : public app_mngr::CommandFactory {
DISALLOW_COPY_AND_ASSIGN(VehicleInfoHmiCommandFactory);
};
-}
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
index 6cfc77a41c..41bd355852 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
@@ -63,11 +63,18 @@ class VehicleInfoMobileCommandFactory : public app_mngr::CommandFactory {
app_mngr::HMICapabilities& hmi_capabilities_;
policy::PolicyHandlerInterface& policy_handler_;
- app_mngr::CommandCreator& buildCommandCreator(
- const int32_t function_id, const int32_t message_type) const;
+ app_mngr::CommandCreator& get_creator_factory(
+ const mobile_apis::FunctionID::eType function_id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const;
+ app_mngr::CommandCreator& get_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const;
+ app_mngr::CommandCreator& get_notification_creator(
+ const mobile_apis::FunctionID::eType id) const;
DISALLOW_COPY_AND_ASSIGN(VehicleInfoMobileCommandFactory);
};
-}
+} // namespace vehicle_info_plugin
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
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 b15b7006e6..d0e4926a65 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
@@ -75,7 +75,7 @@ class VehicleInfoPlugin : public plugins::RPCPlugin {
std::unique_ptr<app_mngr::CommandFactory> command_factory_;
app_mngr::ApplicationManager* application_manager_;
};
-}
+} // namespace vehicle_info_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
index 6125c4ee45..23dd3da879 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
@@ -72,4 +72,4 @@ void OnVIVehicleDataNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
index 8d3b9f13fb..97d035a20b 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
@@ -59,4 +59,4 @@ void VIDiagnosticMessageRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
index e22ba7ddb2..f4079fc6fd 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
@@ -63,4 +63,4 @@ void VIDiagnosticMessageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
index 71ce6331ab..d67d0909a9 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
@@ -59,4 +59,4 @@ void VIGetDTCsRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
index 9d39c60796..494e779c4d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
@@ -62,4 +62,4 @@ void VIGetDTCsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
index 9fc48c8820..e2c1ed4e3a 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
@@ -59,4 +59,4 @@ void VIGetVehicleDataRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
index 73ba1a94fe..a4b778a487 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
@@ -86,4 +86,4 @@ void VIGetVehicleDataResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 a1a221220a..96d27a120b 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
@@ -59,4 +59,4 @@ void VIGetVehicleTypeRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
index 9f14b4e7ea..add55f9a40 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
@@ -61,4 +61,4 @@ void VIGetVehicleTypeResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 04bcc435ba..6479676094 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
@@ -31,8 +31,8 @@
*/
#include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -109,4 +109,4 @@ void VIIsReadyRequest::SendMessageToHMI() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
index 35907e11d2..0db30afb87 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
@@ -59,4 +59,4 @@ void VIIsReadyResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
index b55c9e32a0..fbcc59849d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
@@ -59,4 +59,4 @@ void VIReadDIDRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
index 9d56b2aa78..0b8d0f3055 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
@@ -61,4 +61,4 @@ void VIReadDIDResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 60e9dc88c3..84e41a26dc 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
@@ -59,4 +59,4 @@ void VISubscribeVehicleDataRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
index f004d6f3cd..25d876a125 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
@@ -60,4 +60,4 @@ void VISubscribeVehicleDataResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
index 9056538514..50565e95d2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
@@ -59,4 +59,4 @@ void VIUnsubscribeVehicleDataRequest::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
index 348bc1b269..722073edc7 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
@@ -60,4 +60,4 @@ void VIUnsubscribeVehicleDataResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 4eba894025..a1dfe1e936 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
@@ -31,13 +31,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+#include <algorithm>
#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -127,4 +127,4 @@ void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
index 54d8382f5d..f5ad1c89a2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
@@ -61,4 +61,4 @@ void DiagnosticMessageResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 6c04e874e8..af941e3ea7 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
@@ -34,8 +34,8 @@
#include "vehicle_info_plugin/commands/mobile/get_dtcs_request.h"
#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -116,4 +116,4 @@ void GetDTCsRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
index 3686094b73..894c564a0b 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
@@ -61,4 +61,4 @@ void GetDTCsResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 87a9ace377..8d762e30e5 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
@@ -31,13 +31,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h"
+#include <string>
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -144,4 +144,4 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
index 3a7d663756..f634915354 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
@@ -62,4 +62,4 @@ void GetVehicleDataResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 f8553c84f8..7d34bbbe37 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
@@ -34,11 +34,11 @@
#include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h"
#include "application_manager/application_impl.h"
+#include "application_manager/helpers/application_helper.h"
#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
-#include "vehicle_info_plugin/vehicle_info_app_extension.h"
-#include "application_manager/helpers/application_helper.h"
#include "utils/macro.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -72,7 +72,7 @@ void OnVehicleDataNotification::Run() {
for (; vehicle_data.end() != it; ++it) {
if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
- LOG4CXX_ERROR(logger_, "vehicle_data nanme" << it->first);
+ LOG4CXX_DEBUG(logger_, "vehicle_data name" << it->first);
auto vehicle_data_value =
(*message_)[strings::msg_params][it->first].asInt();
@@ -133,4 +133,4 @@ void OnVehicleDataNotification::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 010cce4c63..ed83f53516 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
@@ -30,13 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+#include <string>
#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
namespace vehicle_info_plugin {
using namespace application_manager;
@@ -131,4 +131,4 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
index 82d49574f0..f0b9e3097a 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
@@ -61,4 +61,4 @@ void ReadDIDResponse::Run() {
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 65f4fde0b2..815ffeb3d2 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
@@ -325,9 +325,8 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions(
}
const bool is_everything_already_subscribed =
- items_to_subscribe ==
- vi_already_subscribed_by_another_apps_.size() +
- vi_already_subscribed_by_this_app_.size();
+ items_to_subscribe == vi_already_subscribed_by_another_apps_.size() +
+ vi_already_subscribed_by_this_app_.size();
if (0 == items_to_subscribe) {
if (HasDisallowedParams()) {
@@ -357,4 +356,4 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions(
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
index 2bea839320..b0d09e1a5b 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
@@ -32,8 +32,8 @@
*/
#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
#include "interfaces/MOBILE_API.h"
namespace vehicle_info_plugin {
@@ -60,4 +60,4 @@ void SubscribeVehicleDataResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 d0152ea0c3..40bd9182e7 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
@@ -36,9 +36,9 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
#include "utils/helpers.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
@@ -284,4 +284,4 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
index 5f79785784..a4a486a5e7 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
@@ -67,4 +67,4 @@ void UnsubscribeVehicleDataResponse::Run() {
}
} // namespace commands
-} // namespace application_manager
+} // namespace vehicle_info_plugin
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 3b1d411841..730812e9c8 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
@@ -122,4 +122,4 @@ VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension(
DCHECK(vi_app_extension);
return *vi_app_extension;
}
-}
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
index 32959174da..617925589f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
@@ -53,7 +53,8 @@ VehicleInfoCommandFactory::~VehicleInfoCommandFactory() {}
app_mngr::CommandSharedPtr VehicleInfoCommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::commands::Command::CommandSource source) {
- if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) {
return hmi_command_factory_->CreateCommand(message, source);
} else {
return mob_command_factory_->CreateCommand(message, source);
@@ -63,8 +64,9 @@ app_mngr::CommandSharedPtr VehicleInfoCommandFactory::CreateCommand(
bool VehicleInfoCommandFactory::IsAbleToProcess(
const int32_t function_id,
const commands::Command::CommandSource source) const {
- return commands::Command::SOURCE_HMI == source
+ return (commands::Command::SOURCE_HMI == source ||
+ app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source)
? hmi_command_factory_->IsAbleToProcess(function_id, source)
: mob_command_factory_->IsAbleToProcess(function_id, source);
}
-}
+} // namespace vehicle_info_plugin
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
index 9311cea6d7..dd3b43920a 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
@@ -41,6 +41,8 @@
#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h"
#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h"
#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
#include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
#include "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h"
#include "vehicle_info_plugin/commands/hmi/vi_read_did_request.h"
@@ -49,8 +51,6 @@
#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
-#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
@@ -153,4 +153,4 @@ app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator(
return factory.GetCreator<app_mngr::InvalidCommand>();
}
}
-}
+} // namespace vehicle_info_plugin
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 7600afa091..dffc836a89 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
@@ -69,8 +69,6 @@ VehicleInfoMobileCommandFactory::VehicleInfoMobileCommandFactory(
app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::commands::Command::CommandSource source) {
- UNUSED(source);
-
const mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asInt());
@@ -91,54 +89,102 @@ app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand(
"HMICommandFactory::CreateCommand function_id: "
<< function_id << ", message type: " << message_type_str);
- return buildCommandCreator(function_id, message_type).create(message);
+ return get_creator_factory(function_id, message_type, source).create(message);
}
bool VehicleInfoMobileCommandFactory::IsAbleToProcess(
const int32_t function_id,
const app_mngr::commands::Command::CommandSource source) const {
UNUSED(source);
- return buildCommandCreator(function_id,
- mobile_apis::messageType::INVALID_ENUM)
- .CanBeCreated();
+ auto id = static_cast<mobile_apis::FunctionID::eType>(function_id);
+ return get_command_creator(id, mobile_apis::messageType::INVALID_ENUM)
+ .CanBeCreated() ||
+ get_notification_creator(id).CanBeCreated();
}
-app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::buildCommandCreator(
- const int32_t function_id, const int32_t message_type) const {
+app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_command_creator(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type) const {
auto factory = app_mngr::CommandCreatorFactory(
application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
-
- switch (function_id) {
- case mobile_apis::FunctionID::GetVehicleDataID:
+ switch (id) {
+ case mobile_apis::FunctionID::GetVehicleDataID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::GetVehicleDataRequest>()
: factory.GetCreator<commands::GetVehicleDataResponse>();
- case mobile_apis::FunctionID::SubscribeVehicleDataID:
+ }
+ case mobile_apis::FunctionID::SubscribeVehicleDataID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::SubscribeVehicleDataRequest>()
: factory.GetCreator<commands::SubscribeVehicleDataResponse>();
- case mobile_apis::FunctionID::UnsubscribeVehicleDataID:
+ }
+ case mobile_apis::FunctionID::UnsubscribeVehicleDataID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::UnsubscribeVehicleDataRequest>()
: factory
.GetCreator<commands::UnsubscribeVehicleDataResponse>();
- case mobile_apis::FunctionID::OnVehicleDataID:
- return factory.GetCreator<commands::OnVehicleDataNotification>();
- case mobile_apis::FunctionID::ReadDIDID:
+ }
+ case mobile_apis::FunctionID::ReadDIDID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::ReadDIDRequest>()
: factory.GetCreator<commands::ReadDIDResponse>();
- case mobile_apis::FunctionID::GetDTCsID:
+ }
+ case mobile_apis::FunctionID::GetDTCsID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::GetDTCsRequest>()
: factory.GetCreator<commands::GetDTCsResponse>();
- case mobile_apis::FunctionID::DiagnosticMessageID:
+ }
+ case mobile_apis::FunctionID::DiagnosticMessageID: {
return mobile_apis::messageType::request == message_type
? factory.GetCreator<commands::DiagnosticMessageRequest>()
: factory.GetCreator<commands::DiagnosticMessageResponse>();
- default:
- LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
- return factory.GetCreator<app_mngr::InvalidCommand>();
+ }
+ default: {}
}
+ return factory.GetCreator<app_mngr::InvalidCommand>();
}
+
+app_mngr::CommandCreator&
+VehicleInfoMobileCommandFactory::get_notification_creator(
+ const mobile_apis::FunctionID::eType id) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ switch (id) {
+ case mobile_apis::FunctionID::OnVehicleDataID: {
+ return factory.GetCreator<commands::OnVehicleDataNotification>();
+ }
+ default: {}
+ }
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+}
+
+app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_creator_factory(
+ const mobile_apis::FunctionID::eType id,
+ const mobile_apis::messageType::eType message_type,
+ const app_mngr::commands::Command::CommandSource source) const {
+ switch (message_type) {
+ case mobile_apis::messageType::request: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) {
+ return get_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_apis::messageType::response: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_command_creator(id, message_type);
+ }
+ break;
+ }
+ case mobile_apis::messageType::notification: {
+ if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) {
+ return get_notification_creator(id);
+ }
+ break;
+ }
+ default: {}
+ }
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ return factory.GetCreator<app_mngr::InvalidCommand>();
}
+} // namespace vehicle_info_plugin
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 d0bcc36ab4..70210f704e 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
@@ -31,16 +31,17 @@
*/
#include "vehicle_info_plugin/vehicle_info_plugin.h"
-#include "vehicle_info_plugin/vehicle_info_command_factory.h"
-#include "vehicle_info_plugin/vehicle_info_app_extension.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/message_helper.h"
#include "application_manager/message_helper.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
+#include "application_manager/smart_object_keys.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_command_factory.h"
namespace vehicle_info_plugin {
CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
namespace strings = application_manager::strings;
+namespace plugins = application_manager::plugin_manager;
VehicleInfoPlugin::VehicleInfoPlugin() : application_manager_(nullptr) {}
@@ -61,7 +62,7 @@ bool VehicleInfoPlugin::IsAbleToProcess(
}
std::string VehicleInfoPlugin::PluginName() {
- return "Vehicle Info Plugin";
+ return plugins::plugin_names::vehicle_info_rpc_plugin;
}
app_mngr::CommandFactory& VehicleInfoPlugin::GetCommandFactory() {
@@ -160,7 +161,7 @@ void VehicleInfoPlugin::DeleteSubscriptions(
}
}
}
-}
+} // namespace vehicle_info_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
return new vehicle_info_plugin::VehicleInfoPlugin();
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
index 0508f0cdd6..575df4ce50 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
@@ -36,17 +36,17 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
#include "hmi/vi_get_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -61,9 +61,9 @@ namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
using am::commands::MessageSharedPtr;
-using vehicle_info_plugin::commands::VIGetVehicleDataResponse;
using am::event_engine::Event;
using test::components::event_engine_test::MockEventDispatcher;
+using vehicle_info_plugin::commands::VIGetVehicleDataResponse;
typedef std::shared_ptr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
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 d4477d5d5f..8c77b492ee 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
@@ -34,16 +34,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -52,12 +52,12 @@ namespace hmi_commands_test {
namespace vi_is_ready_request {
using ::testing::_;
-using ::testing::ReturnRef;
using ::testing::Return;
+using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using vehicle_info_plugin::commands::VIIsReadyRequest;
using am::event_engine::Event;
+using vehicle_info_plugin::commands::VIIsReadyRequest;
typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr;
@@ -101,7 +101,7 @@ class VIIsReadyRequestTest
mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
.WillOnce(Return(ivi_type));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type, _));
}
void PrepareEvent(bool is_message_contain_param,
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
index 9cdf60b1ea..3763e033fc 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
@@ -36,16 +36,16 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
namespace test {
@@ -59,8 +59,8 @@ using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using vehicle_info_plugin::commands::DiagnosticMessageRequest;
using am::event_engine::Event;
+using vehicle_info_plugin::commands::DiagnosticMessageRequest;
namespace mobile_result = mobile_apis::Result;
typedef std::shared_ptr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
@@ -141,9 +141,11 @@ TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) {
EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
.WillOnce(ReturnRef(supported_diag_modes));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage),
+ _));
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
index 4473a36c63..1575fe2bd8 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
@@ -36,17 +36,17 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/event_engine/event.h"
-#include "mobile/get_dtcs_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/get_dtcs_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -57,11 +57,11 @@ namespace get_dtcs_request {
using ::testing::_;
using ::testing::Return;
namespace am = ::application_manager;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
-using vehicle_info_plugin::commands::GetDTCsRequest;
using am::event_engine::Event;
-using am::MockMessageHelper;
using testing::Mock;
+using vehicle_info_plugin::commands::GetDTCsRequest;
namespace mobile_result = mobile_apis::Result;
typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr;
@@ -98,9 +98,10 @@ TEST_F(GetDTCsRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs), _));
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
index a88d362968..ed9fe9d1c0 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -36,17 +36,17 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "mobile/get_vehicle_data_request.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "mobile/get_vehicle_data_request.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -59,8 +59,8 @@ using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
-using vehicle_info_plugin::commands::GetVehicleDataRequest;
using am::event_engine::Event;
+using vehicle_info_plugin::commands::GetVehicleDataRequest;
namespace mobile_result = mobile_apis::Result;
typedef std::shared_ptr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
@@ -200,9 +200,11 @@ TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetVehicleData),
+ _));
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc
new file mode 100644
index 0000000000..fb14373bcf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "mobile/get_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_vehicle_data_response {
+
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetVehicleDataResponse;
+
+typedef std::shared_ptr<GetVehicleDataResponse> GetVehicleDataResponsePtr;
+
+class GetVehicleDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetVehicleDataResponseTest, GetVehicleDataResponse_SUCCESS) {
+ MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map));
+ GetVehicleDataResponsePtr command(
+ CreateCommand<GetVehicleDataResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+ command->Run();
+}
+
+} // namespace get_vehicle_data_response
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
index 1e8a289637..8df00521de 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Ford Motor Company
+ * Copyright (c) 2019, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,21 +30,21 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdint.h>
-#include <vector>
-#include <map>
+#include <strings.h>
#include "gtest/gtest.h"
#include "mobile/on_vehicle_data_notification.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/message_helper.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
namespace test {
namespace components {
@@ -62,49 +62,75 @@ using am::commands::MessageSharedPtr;
using vehicle_info_plugin::commands::OnVehicleDataNotification;
typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr;
+typedef std::shared_ptr<vehicle_info_plugin::VehicleInfoAppExtension>
+ VehicleInfoAppExtensionPtr;
+typedef DataAccessor<application_manager::ApplicationSet> ApplicationSetDA;
namespace {
const uint32_t kAppId = 1u;
+const utils::custom_string::CustomString kAppName("test_app");
} // namespace
class OnVehicleDataNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
- OnVehicleDataNotificationTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
+ OnVehicleDataNotificationTest() : mock_app_(CreateMockApp()) {}
+
+ protected:
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName));
- MessageSharedPtr command_msg_;
- NotificationPtr command_;
+ ON_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillByDefault(Return(false));
+ }
+ MockAppPtr mock_app_;
};
-MATCHER_P2(CheckMessageData, key, value, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- const bool kAreMsgParamsCorrect =
- (*arg)[am::strings::msg_params][key].asInt() == value;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect,
- kAreMsgParamsCorrect);
+TEST_F(OnVehicleDataNotificationTest, OnVehicleDataNotification_SUCCESS) {
+ MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map));
+ smart_objects::SmartObject gps_data;
+ gps_data[am::strings::longitude_degrees] = 1.0;
+ gps_data[am::strings::latitude_degrees] = 1.0;
+ gps_data[am::strings::shifted] = true;
+
+ (*message)[am::strings::msg_params][am::strings::gps] = gps_data;
+ (*message)[am::strings::msg_params][am::strings::speed] = 0;
+
+ NotificationPtr command(CreateCommand<OnVehicleDataNotification>(message));
+
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin;
+ VehicleInfoAppExtensionPtr vi_app_extention_ptr =
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin, *mock_app_);
+ vi_app_extention_ptr->subscribeToVehicleInfo(
+ mobile_apis::VehicleDataType::VEHICLEDATA_GPS);
+ vi_app_extention_ptr->subscribeToVehicleInfo(
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED);
+
+ EXPECT_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillOnce(Return(vi_app_extention_ptr));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ ApplicationSetDA apps_da(apps, apps_lock);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(apps_da));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS));
+ vehicle_data.insert(am::VehicleData::value_type(
+ am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+
+ command->Run();
}
} // namespace on_vehicle_data_notification
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
index c0a07fb57c..baf75bd93b 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
@@ -35,17 +35,17 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/event_engine/event.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
namespace test {
@@ -59,9 +59,9 @@ using ::testing::DoAll;
using ::testing::Return;
using ::testing::SaveArg;
namespace am = ::application_manager;
-using vehicle_info_plugin::commands::ReadDIDRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
+using vehicle_info_plugin::commands::ReadDIDRequest;
class ReadDIDRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
index 323334de2d..0126e7c762 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -39,8 +39,8 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
#include "mobile/unsubscribe_vehicle_data_request.h"
-#include "vehicle_info_plugin/vehicle_info_plugin.h"
#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
namespace test {
namespace components {
@@ -53,8 +53,8 @@ namespace mobile_result = mobile_apis::Result;
using ::testing::_;
-using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest;
using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest;
typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr;
@@ -149,8 +149,10 @@ TEST_F(UnsubscribeVehicleRequestTest,
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData)))
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData),
+ _))
.WillOnce(Return(true));
vehicle_info_plugin::VehicleInfoAppExtension* vi_app_extension =
dynamic_cast<vehicle_info_plugin::VehicleInfoAppExtension*>(
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
index a0d4699de8..89dbfe1cdb 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "mobile/unsubscribe_vehicle_data_response.h"
#include <stdint.h>
#include <string>
#include "gtest/gtest.h"
+#include "mobile/unsubscribe_vehicle_data_response.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
@@ -50,8 +50,8 @@ using ::testing::_;
using ::testing::NotNull;
using ::testing::Types;
-using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse;
using commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse;
namespace am = ::application_manager;
class UnsubscribeVehicleResponseTest
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
index 8df3d436bd..691f8d3259 100644
--- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
@@ -29,14 +29,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <iterator>
+#include "application_manager/app_launch/app_launch_ctrl_impl.h"
#include <algorithm>
+#include <iterator>
#include <utility>
#include <vector>
-#include "application_manager/app_launch/app_launch_ctrl_impl.h"
+#include "application_manager/application.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "connection_handler/connection_handler.h"
-#include "application_manager/application.h"
#include "utils/timer_task_impl.h"
namespace app_launch {
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
index 393b01c952..a931b96fa1 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
@@ -29,14 +29,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <unistd.h>
+#include <string>
#include "application_manager/app_launch/app_launch_data_db.h"
-#include "application_manager/application_manager_impl.h"
#include "application_manager/app_launch/app_launch_sql_queries.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -332,9 +332,9 @@ uint32_t AppLaunchDataDB::GetCurentNumberOfAppData() const {
"Values of ignition off counts were updated successfully");
number_of_app_data = query.GetInteger(result_query);
- LOG4CXX_DEBUG(logger_,
- "Total cout saved mobile applications is "
- << number_of_app_data);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Total cout saved mobile applications is " << number_of_app_data);
} else {
LOG4CXX_WARN(logger_,
"Failed execute query 'kGetNumberOfApplicationData'. Reson: "
@@ -392,4 +392,4 @@ utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
#endif // __QNX__
}
-} // namespace resumption
+} // namespace app_launch
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 d3e3b7d445..984997e424 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
@@ -29,13 +29,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "application_manager/app_launch/app_launch_data_json.h"
+#include <algorithm>
#include "application_manager/smart_object_keys.h"
#include "smart_objects/smart_object.h"
-#include "utils/date_time.h"
#include "json/json.h"
+#include "utils/date_time.h"
namespace app_launch {
@@ -277,4 +277,4 @@ bool AppLaunchDataJson::Persist() {
return true;
}
-} // app_launch
+} // namespace app_launch
diff --git a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
index cc4765e6c9..7a9402d35e 100644
--- a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
@@ -75,4 +75,4 @@ const std::string kRefreshApplicationDataSessionTime =
"SET `last_session` = STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')"
"WHERE `deviceMac` = ? AND appID = ? AND bundleID = ?;";
-} // namespace resumption
+} // namespace app_launch
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
index f3851482c1..993a57364e 100644
--- a/src/components/application_manager/src/app_launch/apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -1,8 +1,8 @@
-#include <algorithm>
#include "application_manager/app_launch/apps_launcher.h"
+#include <algorithm>
-#include "utils/timer_task_impl.h"
#include <iostream>
+#include "utils/timer_task_impl.h"
namespace app_launch {
struct LauncherGenerator {
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
index a4468d87bc..9a7a6658fe 100644
--- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -1,15 +1,15 @@
+#include <algorithm>
#include <string>
#include <vector>
-#include <algorithm>
-#include "application_manager/app_launch/device_apps_launcher.h"
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch/apps_launcher.h"
+#include "application_manager/app_launch/device_apps_launcher.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include <iostream>
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
-#include <iostream>
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -58,9 +58,9 @@ class Launcher {
device_launcher_.settings().wait_time_between_apps(),
timer::kSingleShot);
} else {
- LOG4CXX_DEBUG(logger_,
- "All Apps on " << apps_on_device_->first
- << " postponed launched");
+ LOG4CXX_DEBUG(
+ logger_,
+ "All Apps on " << apps_on_device_->first << " postponed launched");
device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
}
}
diff --git a/src/components/application_manager/src/app_service_manager.cc b/src/components/application_manager/src/app_service_manager.cc
new file mode 100644
index 0000000000..bab8147d9f
--- /dev/null
+++ b/src/components/application_manager/src/app_service_manager.cc
@@ -0,0 +1,593 @@
+/*
+ * 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 "application_manager/app_service_manager.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "encryption/hashing.h"
+#include "resumption/last_state.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceManager")
+
+namespace application_manager {
+
+const char* kAppServiceSection = "AppServices";
+const char* kDefaults = "defaults";
+
+AppServiceManager::AppServiceManager(ApplicationManager& app_manager,
+ resumption::LastState& last_state)
+ : app_manager_(app_manager)
+ , last_state_(last_state)
+ , rpc_passing_handler_(*this, app_manager_) {}
+
+AppServiceManager::~AppServiceManager() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+smart_objects::SmartObject AppServiceManager::PublishAppService(
+ const smart_objects::SmartObject& manifest,
+ const bool mobile_service,
+ const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string str_to_hash = "";
+ std::string service_id = "";
+
+ std::string service_type = manifest[strings::service_type].asString();
+
+ if (FindServiceByProvider(connection_key, service_type)) {
+ LOG4CXX_WARN(logger_,
+ "Service already exists for this provider, rejecting");
+ return smart_objects::SmartObject();
+ }
+
+ if (manifest.keyExists(strings::service_name) &&
+ FindServiceByName(manifest[strings::service_name].asString())) {
+ LOG4CXX_WARN(logger_, "A service already exists with this name, rejecting");
+ return smart_objects::SmartObject();
+ }
+
+ published_services_lock_.Acquire();
+ do {
+ str_to_hash = manifest[strings::service_type].asString() +
+ std::to_string(std::rand());
+ service_id = encryption::MakeHash(str_to_hash);
+ } while (published_services_.find(service_id) != published_services_.end());
+
+ AppService app_service;
+ app_service.connection_key = connection_key;
+ app_service.mobile_service = mobile_service;
+
+ smart_objects::SmartObject service_record;
+ service_record[strings::service_manifest] = manifest;
+ service_record[strings::service_id] = service_id;
+ service_record[strings::service_published] = true;
+ service_record[strings::service_active] = false;
+ app_service.record = service_record;
+
+ std::string default_app_id = DefaultServiceByType(service_type);
+ if (default_app_id.empty() && !mobile_service) {
+ auto embedded_services = app_manager_.get_settings().embedded_services();
+ for (auto it = embedded_services.begin(); it != embedded_services.end();
+ ++it) {
+ if (*it == service_type) {
+ Json::Value& dictionary = last_state_.get_dictionary();
+ dictionary[kAppServiceSection][kDefaults][service_type] =
+ kEmbeddedService;
+ default_app_id = kEmbeddedService;
+ }
+ }
+ }
+ app_service.default_service =
+ !default_app_id.empty() && GetPolicyAppID(app_service) == default_app_id;
+
+ auto ret = published_services_.insert(
+ std::pair<std::string, AppService>(service_id, app_service));
+ smart_objects::SmartObject& published_record = ret.first->second.record;
+ published_services_lock_.Release();
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+ AppServiceUpdated(
+ service_record, mobile_apis::ServiceUpdateReason::PUBLISHED, msg_params);
+
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+
+ // Activate the new service if it is the default for its service type, or if
+ // no service is active of its service type
+ AppService* active_service = ActiveServiceForType(service_type);
+ if (!active_service || app_service.default_service) {
+ ActivateAppService(service_id);
+ }
+
+ return published_record;
+}
+
+bool AppServiceManager::UnpublishAppService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Service id does not exist in published services");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "Unpublishing app service: " << service_id);
+
+ SetServicePublished(service_id, false);
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+
+ auto& record = it->second.record;
+ if (record[strings::service_active].asBool()) {
+ record[strings::service_active] = false;
+
+ // Activate embedded service, if available
+ auto embedded_service = EmbeddedServiceForType(
+ record[strings::service_manifest][strings::service_type].asString());
+ if (embedded_service) {
+ embedded_service->record[strings::service_active] = true;
+ AppServiceUpdated(embedded_service->record,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ msg_params);
+ }
+ }
+ AppServiceUpdated(
+ record, mobile_apis::ServiceUpdateReason::REMOVED, msg_params);
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+ published_services_.erase(it);
+
+ return true;
+}
+
+void AppServiceManager::UnpublishServices(const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Unpublishing all app services: " << connection_key);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ if (it->second.connection_key == connection_key) {
+ UnpublishAppService(it->first);
+ }
+ }
+}
+
+void AppServiceManager::OnAppActivated(ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.begin();
+ // Activate all services published by the app
+ for (; it != published_services_.end(); ++it) {
+ if (it->second.connection_key == app->app_id()) {
+ ActivateAppService(it->first);
+ }
+ }
+}
+
+std::vector<smart_objects::SmartObject>
+AppServiceManager::GetAllServiceRecords() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<smart_objects::SmartObject> services;
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ services.push_back(it->second.record);
+ }
+ return services;
+}
+
+void AppServiceManager::GetProviderByType(const std::string& service_type,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto active_service = ActiveServiceForType(service_type);
+ if (!active_service) {
+ LOG4CXX_ERROR(logger_,
+ "There is no active service for the given service type: "
+ << service_type);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Found provider for service type: " << service_type);
+ GetProviderFromService(*active_service, mobile_consumer, app, hmi_service);
+}
+
+void AppServiceManager::GetProviderByID(const std::string& service_id,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Service id does not exist in published services");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Found provider with service ID: " << service_id);
+ GetProviderFromService(it->second, mobile_consumer, app, hmi_service);
+}
+
+void AppServiceManager::GetProviderFromService(const AppService& service,
+ const bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (mobile_consumer &&
+ !service.record[strings::service_manifest][strings::allow_app_consumers]
+ .asBool()) {
+ LOG4CXX_ERROR(logger_, "Service does not support app consumers");
+ return;
+ }
+ bool mobile_service = service.mobile_service;
+ if (mobile_service) {
+ app = app_manager_.application(service.connection_key);
+ hmi_service = false;
+ return;
+ }
+ hmi_service = true;
+}
+
+bool AppServiceManager::SetDefaultService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id);
+ return false;
+ }
+ AppService& service = it->second;
+
+ std::string service_type =
+ service.record[strings::service_manifest][strings::service_type]
+ .asString();
+ std::string default_app_id = DefaultServiceByType(service_type);
+ if (!default_app_id.empty()) {
+ auto default_service =
+ FindServiceByPolicyAppID(default_app_id, service_type);
+ if (default_service) {
+ default_service->default_service = false;
+ }
+ }
+ service.default_service = true;
+
+ Json::Value& dictionary = last_state_.get_dictionary();
+ dictionary[kAppServiceSection][kDefaults][service_type] =
+ GetPolicyAppID(service);
+ return true;
+}
+
+bool AppServiceManager::RemoveDefaultService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id);
+ return false;
+ }
+
+ AppService& service = it->second;
+ if (!service.default_service) {
+ LOG4CXX_ERROR(logger_, "Service was not default " << service_id);
+ return false;
+ }
+ service.default_service = false;
+
+ std::string service_type =
+ service.record[strings::service_manifest][strings::service_type]
+ .asString();
+ Json::Value& dictionary = last_state_.get_dictionary();
+ dictionary[kAppServiceSection][kDefaults].removeMember(service_type);
+ return true;
+}
+
+bool AppServiceManager::ActivateAppService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id);
+ return false;
+ }
+
+ smart_objects::SmartObject& service = it->second.record;
+ if (service[strings::service_active].asBool()) {
+ LOG4CXX_DEBUG(logger_, "Service was already active " << service_id);
+ return true;
+ }
+
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+
+ const std::string service_type =
+ service[strings::service_manifest][strings::service_type].asString();
+ auto active_service = ActiveServiceForType(service_type);
+ if (active_service) {
+ active_service->record[strings::service_active] = false;
+ AppServiceUpdated(active_service->record,
+ mobile_apis::ServiceUpdateReason::DEACTIVATED,
+ msg_params);
+ }
+ service[strings::service_active] = true;
+ AppServiceUpdated(
+ service, mobile_apis::ServiceUpdateReason::ACTIVATED, msg_params);
+
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+
+ std::string navi_service_type;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::AppServiceType::eType>::EnumToString(
+ mobile_apis::AppServiceType::NAVIGATION, &navi_service_type);
+ if (service_type == navi_service_type) {
+ smart_objects::SmartObject msg_params;
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::NAVIGATION;
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+ }
+ return true;
+}
+
+bool AppServiceManager::DeactivateAppService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id);
+ return false;
+ }
+ smart_objects::SmartObject& service = it->second.record;
+ smart_objects::SmartObject msg_params;
+ bool send_update = false;
+
+ if (service[strings::service_active].asBool()) {
+ service[strings::service_active] = false;
+ AppServiceUpdated(
+ service, mobile_apis::ServiceUpdateReason::DEACTIVATED, msg_params);
+
+ // Activate embedded service, if available
+ const std::string service_type =
+ service[strings::service_manifest][strings::service_type].asString();
+ auto embedded_service = EmbeddedServiceForType(service_type);
+ if (embedded_service &&
+ embedded_service->record[strings::service_id].asString() !=
+ service_id) {
+ embedded_service->record[strings::service_active] = true;
+ AppServiceUpdated(embedded_service->record,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ msg_params);
+ }
+ send_update = true;
+ }
+
+ if (send_update) {
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+ MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_);
+ }
+ return true;
+}
+
+AppService* AppServiceManager::ActiveServiceForType(
+ const std::string service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ if (it->second.record[strings::service_manifest][strings::service_type]
+ .asString() == service_type &&
+ it->second.record[strings::service_published].asBool() &&
+ it->second.record[strings::service_active].asBool()) {
+ return &(it->second);
+ }
+ }
+ return NULL;
+}
+
+AppService* AppServiceManager::EmbeddedServiceForType(
+ const std::string service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ if (it->second.record[strings::service_manifest][strings::service_type]
+ .asString() == service_type &&
+ !it->second.mobile_service) {
+ return &(it->second);
+ }
+ }
+ return NULL;
+}
+
+AppService* AppServiceManager::FindServiceByPolicyAppID(
+ const std::string policy_app_id, const std::string type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ if (it->second.record[strings::service_manifest][strings::service_type]
+ .asString() != type) {
+ continue;
+ }
+
+ if (policy_app_id == GetPolicyAppID(it->second)) {
+ return &(it->second);
+ }
+ }
+ return NULL;
+}
+
+AppService* AppServiceManager::FindServiceByID(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Service id does not exist in published services");
+ return NULL;
+ }
+ return &(it->second);
+}
+
+AppService* AppServiceManager::FindServiceByProvider(
+ const uint32_t connection_key, const std::string service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto& service : published_services_) {
+ if (service.second.connection_key == connection_key &&
+ service.second.record[strings::service_manifest][strings::service_type]
+ .asString() == service_type) {
+ return &(service.second);
+ }
+ }
+ return NULL;
+}
+
+AppService* AppServiceManager::FindServiceByName(std::string name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ for (auto& service : published_services_) {
+ if (service.second.record[strings::service_manifest][strings::service_name]
+ .asString() == name) {
+ return &(service.second);
+ }
+ }
+ return NULL;
+}
+
+std::string AppServiceManager::DefaultServiceByType(
+ const std::string service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value& dictionary = last_state_.get_dictionary();
+ if (dictionary[kAppServiceSection][kDefaults].isMember(service_type)) {
+ return dictionary[kAppServiceSection][kDefaults][service_type].asString();
+ }
+ return std::string();
+}
+
+void AppServiceManager::SetServicePublished(const std::string service_id,
+ const bool service_published) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(published_services_lock_);
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Service id does not exist in published services");
+ return;
+ }
+ it->second.record[strings::service_published] = service_published;
+}
+
+std::string AppServiceManager::GetPolicyAppID(AppService service) {
+ if (service.mobile_service) {
+ auto app = app_manager_.application(service.connection_key);
+ return app ? app->policy_app_id() : std::string();
+ }
+ return kEmbeddedService;
+}
+
+bool AppServiceManager::UpdateNavigationCapabilities(
+ smart_objects::SmartObject& out_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string navi_service_type;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::AppServiceType::eType>::EnumToString(
+ mobile_apis::AppServiceType::NAVIGATION, &navi_service_type);
+ auto service = ActiveServiceForType(navi_service_type);
+ if (!service) {
+ return false;
+ }
+
+ if (!out_params.keyExists(strings::send_location_enabled)) {
+ out_params[strings::send_location_enabled] = false;
+ }
+ if (!out_params.keyExists(strings::get_way_points_enabled)) {
+ out_params[strings::get_way_points_enabled] = false;
+ }
+
+ if (!service->record[strings::service_manifest].keyExists(
+ strings::handled_rpcs)) {
+ return true;
+ }
+
+ smart_objects::SmartObject& handled_rpcs =
+ service->record[strings::service_manifest][strings::handled_rpcs];
+ for (size_t i = 0; i < handled_rpcs.length(); ++i) {
+ if (handled_rpcs[i].asInt() == mobile_apis::FunctionID::SendLocationID) {
+ out_params[strings::send_location_enabled] = true;
+ } else if (handled_rpcs[i].asInt() ==
+ mobile_apis::FunctionID::GetWayPointsID) {
+ out_params[strings::get_way_points_enabled] = true;
+ }
+ }
+ return true;
+}
+
+void AppServiceManager::AppServiceUpdated(
+ const smart_objects::SmartObject& service_record,
+ const mobile_apis::ServiceUpdateReason::eType update_reason,
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject& services =
+ msg_params[strings::system_capability][strings::app_services_capabilities]
+ [strings::app_services];
+ smart_objects::SmartObject service(smart_objects::SmartType_Map);
+ service[strings::update_reason] = update_reason;
+ service[strings::updated_app_service_record] = service_record;
+ services[-1] = service;
+}
+
+std::vector<AppService> AppServiceManager::GetActiveServices() {
+ std::vector<AppService> active_services;
+ for (auto it = published_services_.begin(); it != published_services_.end();
+ ++it) {
+ if (it->second.record[strings::service_active].asBool()) {
+ active_services.push_back(it->second);
+ }
+ }
+ return active_services;
+}
+
+RPCPassingHandler& AppServiceManager::GetRPCPassingHandler() {
+ return rpc_passing_handler_;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 8a611195c7..3b2f51f26c 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -31,21 +31,21 @@
*/
#include "application_manager/application_impl.h"
-#include <string>
#include <strings.h>
-#include "application_manager/message_helper.h"
-#include "protocol_handler/protocol_handler.h"
+#include <string>
#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
#include "config_profile/profile.h"
#include "interfaces/MOBILE_API.h"
+#include "protocol_handler/protocol_handler.h"
#include "utils/file_system.h"
-#include "utils/logger.h"
#include "utils/gen_hash.h"
+#include "utils/logger.h"
-#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "transport_manager/common.h"
+#include "utils/timer_task_impl.h"
namespace {
@@ -849,8 +849,9 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
"Time Info: "
<< "\n Current: " << date_time::getSecs(current)
<< "\n Limit: (" << date_time::getSecs(limit.first)
- << "," << limit.second << ")"
- "\n frequency_restrictions: ("
+ << "," << limit.second
+ << ")"
+ "\n frequency_restrictions: ("
<< frequency_restrictions.first << ","
<< frequency_restrictions.second << ")");
if (date_time::getSecs(current) <
@@ -964,7 +965,7 @@ void ApplicationImpl::CleanupFiles() {
application_manager_.get_settings().app_storage_folder();
directory_name += "/" + folder_name();
- if (file_system::DirectoryExists(directory_name)) {
+ if (file_system::DirectoryExists(directory_name) && !folder_name().empty()) {
std::vector<std::string> files = file_system::ListFiles(directory_name);
AppFilesMap::const_iterator app_files_it;
@@ -1152,9 +1153,9 @@ bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) {
auto it = std::find_if(
- extensions_.begin(),
- extensions_.end(),
- [uid](AppExtensionPtr extension) { return extension->uid() == uid; });
+ extensions_.begin(), extensions_.end(), [uid](AppExtensionPtr extension) {
+ return extension->uid() == uid;
+ });
return it != extensions_.end();
}
@@ -1163,6 +1164,58 @@ const std::list<AppExtensionPtr>& ApplicationImpl::Extensions() const {
return extensions_;
}
+const std::string& ApplicationImpl::cloud_app_endpoint() const {
+ return endpoint_;
+}
+
+const std::string& ApplicationImpl::auth_token() const {
+ return auth_token_;
+}
+
+const std::string& ApplicationImpl::cloud_app_transport_type() const {
+ return cloud_transport_type_;
+}
+
+const mobile_apis::HybridAppPreference::eType&
+ApplicationImpl::hybrid_app_preference() const {
+ return hybrid_app_preference_;
+}
+
+const std::string& ApplicationImpl::cloud_app_certificate() const {
+ return certificate_;
+}
+
+bool ApplicationImpl::is_cloud_app() const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ return false;
+#else
+ return !endpoint_.empty();
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+void ApplicationImpl::set_cloud_app_endpoint(const std::string& endpoint) {
+ endpoint_ = endpoint;
+}
+
+void ApplicationImpl::set_auth_token(const std::string& auth_token) {
+ auth_token_ = auth_token;
+}
+
+void ApplicationImpl::set_cloud_app_transport_type(
+ const std::string& transport_type) {
+ cloud_transport_type_ = transport_type;
+}
+
+void ApplicationImpl::set_hybrid_app_preference(
+ const mobile_apis::HybridAppPreference::eType& hybrid_app_preference) {
+ hybrid_app_preference_ = hybrid_app_preference;
+}
+
+void ApplicationImpl::set_cloud_app_certificate(
+ const std::string& certificate) {
+ certificate_ = certificate;
+}
+
void ApplicationImpl::PushMobileMessage(
smart_objects::SmartObjectSPtr mobile_message) {
sync_primitives::AutoLock lock(mobile_message_lock_);
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 24f27af2e2..3a92009d4f 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -32,47 +32,48 @@
#include <stdlib.h> // for rand()
+#include <bson_object.h>
#include <climits>
-#include <string>
#include <fstream>
+#include <string>
#include <utility>
-#include <bson_object.h>
+#include "application_manager/app_launch/app_launch_ctrl_impl.h"
+#include "application_manager/app_launch/app_launch_data_db.h"
+#include "application_manager/app_launch/app_launch_data_json.h"
#include "application_manager/application_manager_impl.h"
+#include "application_manager/command_holder_impl.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/hmi_capabilities_impl.h"
#include "application_manager/message_helper.h"
-#include "application_manager/rpc_service_impl.h"
-#include "application_manager/rpc_handler_impl.h"
#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/hmi_capabilities_impl.h"
#include "application_manager/resumption/resume_ctrl_impl.h"
-#include "application_manager/app_launch/app_launch_ctrl_impl.h"
-#include "application_manager/app_launch/app_launch_data_db.h"
-#include "application_manager/app_launch/app_launch_data_json.h"
-#include "application_manager/helpers/application_helper.h"
-#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
-#include "protocol_handler/protocol_handler.h"
-#include "hmi_message_handler/hmi_message_handler.h"
-#include "application_manager/command_holder_impl.h"
+#include "application_manager/rpc_handler_impl.h"
+#include "application_manager/rpc_service_impl.h"
#include "connection_handler/connection_handler_impl.h"
-#include "formatters/formatter_json_rpc.h"
-#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/formatter_json_rpc.h"
+#include "hmi_message_handler/hmi_message_handler.h"
#include "protocol/bson_object_keys.h"
+#include "protocol_handler/protocol_handler.h"
-#include "utils/threads/thread.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "utils/timer_task_impl.h"
-#include "smart_objects/enum_schema_item.h"
-#include "interfaces/HMI_API_schema.h"
+#include <time.h>
+#include <boost/filesystem.hpp>
#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API_schema.h"
#include "media_manager/media_manager.h"
#include "policy/usage_statistics/counter.h"
+#include "smart_objects/enum_schema_item.h"
#include "utils/custom_string.h"
-#include <time.h>
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "utils/threads/thread.h"
+#include "utils/timer_task_impl.h"
namespace {
int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) {
@@ -98,7 +99,9 @@ DeviceTypes devicesType = {
std::make_pair(std::string("USB_IOS_DEVICE_MODE"),
hmi_apis::Common_TransportType::USB_IOS),
std::make_pair(std::string("CARPLAY_WIRELESS_IOS"),
- hmi_apis::Common_TransportType::WIFI)};
+ hmi_apis::Common_TransportType::WIFI),
+ std::make_pair(std::string("CLOUD_WEBSOCKET"),
+ hmi_apis::Common_TransportType::CLOUD_WEBSOCKET)};
}
/**
@@ -130,6 +133,7 @@ bool policy_app_id_comparator(const std::string& policy_app_id,
return app->policy_app_id() == policy_app_id;
}
+uint32_t ApplicationManagerImpl::mobile_corelation_id_ = 0;
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
@@ -166,6 +170,8 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, navi_close_app_timeout_(am_settings.stop_streaming_timeout())
, navi_end_stream_timeout_(am_settings.stop_streaming_timeout())
, state_ctrl_(*this)
+ , pending_device_map_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, application_list_update_timer_(
"AM ListUpdater",
new TimerTaskImpl<ApplicationManagerImpl>(
@@ -236,6 +242,13 @@ DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const {
return accessor;
}
+DataAccessor<AppsWaitRegistrationSet>
+ApplicationManagerImpl::pending_applications() const {
+ DataAccessor<AppsWaitRegistrationSet> accessor(
+ apps_to_register_, apps_to_register_list_lock_ptr_);
+ return accessor;
+}
+
ApplicationSharedPtr ApplicationManagerImpl::application(
uint32_t app_id) const {
AppIdPredicate finder(app_id);
@@ -257,6 +270,20 @@ ApplicationSharedPtr ApplicationManagerImpl::application_by_policy_id(
return FindApp(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::pending_application_by_policy_id(
+ const std::string& policy_app_id) const {
+ PolicyAppIdPredicate finder(policy_app_id);
+ DataAccessor<AppsWaitRegistrationSet> accessor = pending_applications();
+ return FindPendingApp(accessor, finder);
+}
+
bool ActiveAppPredicate(const ApplicationSharedPtr app) {
return app ? app->IsFullscreen() : false;
}
@@ -379,21 +406,6 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
plugin.OnApplicationEvent(plugin_manager::kApplicationRegistered, app);
};
plugin_manager_->ForEachPlugin(on_app_registered);
-
- // TODO(AOleynik): Is neccessary to be able to know that registration process
- // has been completed and default HMI level is set, otherwise policy will
- // block all the requests/notifications to mobile
- // APPLINK-20764 - introduce usage of internal events or re-implement
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
-
- smart_objects::SmartObject msg;
- msg[strings::params][strings::message_type] =
- hmi_apis::messageType::notification;
- msg[strings::params][strings::app_id] = app->app_id();
-
- event.set_smart_object(msg);
- event.raise(event_dispatcher());
}
void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
@@ -539,6 +551,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
app_name,
GetPolicyHandler().GetStatisticManager(),
*this));
+
if (!application) {
std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
@@ -582,11 +595,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
Version version;
int32_t min_version = message[strings::msg_params][strings::sync_msg_version]
- [strings::minor_version].asInt();
+ [strings::minor_version]
+ .asInt();
version.min_supported_api_version = static_cast<APIVersion>(min_version);
int32_t max_version = message[strings::msg_params][strings::sync_msg_version]
- [strings::major_version].asInt();
+ [strings::major_version]
+ .asInt();
version.max_supported_api_version = static_cast<APIVersion>(max_version);
application->set_version(version);
@@ -608,13 +623,48 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
// Keep HMI add id in case app is present in "waiting for registration" list
apps_to_register_list_lock_ptr_->Acquire();
- AppsWaitRegistrationSet::iterator it = apps_to_register_.find(application);
- if (apps_to_register_.end() != it) {
+ PolicyAppIdPredicate finder(application->policy_app_id());
+ ApplicationSet::iterator it =
+ std::find_if(apps_to_register_.begin(), apps_to_register_.end(), finder);
+ bool is_mismatched_cloud_app = false;
+
+ if (apps_to_register_.end() == it) {
+ DevicePredicate finder(application->device());
+ it = std::find_if(
+ apps_to_register_.begin(), apps_to_register_.end(), finder);
+
+ bool found = apps_to_register_.end() != it;
+ is_mismatched_cloud_app = found && (*it)->is_cloud_app() &&
+ policy_app_id != (*it)->policy_app_id();
+ } else {
application->set_hmi_application_id((*it)->hmi_app_id());
- apps_to_register_.erase(application);
+
+ // Set cloud app parameters
+ application->set_cloud_app_endpoint((*it)->cloud_app_endpoint());
+ application->set_cloud_app_certificate((*it)->cloud_app_certificate());
+ application->set_auth_token((*it)->auth_token());
+ application->set_cloud_app_transport_type(
+ (*it)->cloud_app_transport_type());
+ application->set_hybrid_app_preference((*it)->hybrid_app_preference());
+ apps_to_register_.erase(it);
}
apps_to_register_list_lock_ptr_->Release();
+ // Reject registration request if a cloud app registers with the incorrect
+ // appID
+ if (is_mismatched_cloud_app) {
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id].asUInt(),
+ mobile_apis::Result::DISALLOWED));
+ (*response)[strings::msg_params][strings::info] =
+ "Cloud app registered with incorrect app id";
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
+ return ApplicationSharedPtr();
+ }
+
if (!application->hmi_app_id()) {
const bool is_saved =
resume_controller().IsApplicationSaved(policy_app_id, device_mac);
@@ -650,6 +700,10 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
apps_size_ = applications_.size();
applications_list_lock_ptr_->Release();
+ // Update cloud app information, in case any pending apps are unable to be
+ // registered due to a mobile app taking precedence
+ RefreshCloudAppInformation();
+
// It is possible that secondary transport of this app has been already
// established. Make sure that the information is reflected to application
// instance.
@@ -674,6 +728,8 @@ bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
// remove from resumption if app was activated by user
resume_controller().OnAppActivated(app);
+ // Activate any app services published by the app
+ GetAppServiceManager().OnAppActivated(app);
const HMILevel::eType hmi_level = HMILevel::HMI_FULL;
const AudioStreamingState::eType audio_state =
app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
@@ -779,6 +835,426 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
*this));
rpc_service_->ManageHMICommand(mixing_audio_supported_request);
resume_controller().ResetLaunchTime();
+
+ RefreshCloudAppInformation();
+}
+
+std::string ApplicationManagerImpl::PolicyIDByIconUrl(const std::string url) {
+ sync_primitives::AutoLock lock(app_icon_map_lock_ptr_);
+ for (auto& x : app_icon_map_) {
+ auto policy_id = x.first;
+ std::string icon_url = GetPolicyHandler().GetIconUrl(policy_id);
+ if (icon_url == url) {
+ LOG4CXX_DEBUG(logger_, "Matched icon url: " << url);
+ x.second.pending_request = false;
+ return policy_id;
+ }
+ }
+ return std::string("");
+}
+
+void ApplicationManagerImpl::SetIconFileFromSystemRequest(
+ const std::string policy_id) {
+ app_icon_map_lock_ptr_.Acquire();
+ auto app_icon_it = app_icon_map_.find(policy_id);
+ if (app_icon_it != app_icon_map_.end()) {
+ app_icon_map_.erase(app_icon_it);
+ }
+ app_icon_map_lock_ptr_.Release();
+
+ // Find pending application and set icon path
+ auto app = pending_application_by_policy_id(policy_id);
+ if (!app) {
+ return;
+ }
+ const std::string app_icon_dir(settings_.app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + policy_id);
+ if (file_system::FileExists(full_icon_path)) {
+ LOG4CXX_DEBUG(logger_, "Set Icon Path: " << full_icon_path);
+ AppFile file;
+ file.is_persistent = true;
+ file.is_download_complete = true;
+ file.file_name = full_icon_path;
+
+ std::string icon_url = GetPolicyHandler().GetIconUrl(policy_id);
+ std::string extension = boost::filesystem::extension(icon_url);
+ if (extension == "bmp" || extension == "BMP") {
+ file.file_type = mobile_apis::FileType::GRAPHIC_BMP;
+ } else if (extension == "JPEG" || extension == "jpeg" ||
+ extension == "JPG" || extension == "jpg") {
+ file.file_type = mobile_apis::FileType::GRAPHIC_JPEG;
+ } else {
+ file.file_type = mobile_apis::FileType::GRAPHIC_PNG;
+ }
+
+ app->AddFile(file);
+ app->set_app_icon_path(full_icon_path);
+ }
+ SendUpdateAppList();
+}
+
+void ApplicationManagerImpl::DisconnectCloudApp(ApplicationSharedPtr app) {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function");
+ return;
+#else
+ std::string endpoint;
+ std::string certificate;
+ std::string auth_token;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference;
+ bool enabled = true;
+ std::string policy_app_id = app->policy_app_id();
+ GetPolicyHandler().GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+ if (app->IsRegistered() && app->is_cloud_app()) {
+ LOG4CXX_DEBUG(logger_, "Disabled app is registered, unregistering now");
+ GetRPCService().ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
+ commands::Command::SOURCE_SDL);
+
+ OnAppUnauthorized(app->app_id());
+ }
+ // Delete the cloud device
+ connection_handler().RemoveCloudAppDevice(app->device());
+
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ endpoint,
+ certificate,
+ enabled,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference};
+ // Create device in pending state
+ LOG4CXX_DEBUG(logger_, "Re-adding the cloud app device");
+ connection_handler().AddCloudAppDevice(policy_app_id, properties);
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+void ApplicationManagerImpl::RefreshCloudAppInformation() {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function");
+ return;
+#else
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_stopping()) {
+ return;
+ }
+ std::vector<std::string> enabled_apps;
+ GetPolicyHandler().GetEnabledCloudApps(enabled_apps);
+ std::vector<std::string>::iterator enabled_it = enabled_apps.begin();
+ std::vector<std::string>::iterator enabled_end = enabled_apps.end();
+ std::string endpoint;
+ std::string certificate;
+ std::string auth_token;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference_str;
+ bool enabled = true;
+
+ // Store old device map and clear the current map
+ pending_device_map_lock_ptr_->Acquire();
+ app_icon_map_lock_ptr_.Acquire();
+ std::map<std::string, std::string> old_device_map = pending_device_map_;
+ pending_device_map_ = std::map<std::string, std::string>();
+ // Create a device for each newly enabled cloud app
+ for (; enabled_it != enabled_end; ++enabled_it) {
+ GetPolicyHandler().GetCloudAppParameters(*enabled_it,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference_str);
+
+ mobile_apis::HybridAppPreference::eType hybrid_app_preference =
+ mobile_apis::HybridAppPreference::INVALID_ENUM;
+ smart_objects::EnumConversionHelper<
+ mobile_apis::HybridAppPreference::eType>::
+ StringToEnum(hybrid_app_preference_str, &hybrid_app_preference);
+
+ auto policy_id = *enabled_it;
+ policy::StringArray nicknames;
+ policy::StringArray app_hmi_types;
+ GetPolicyHandler().GetInitialAppData(policy_id, &nicknames, &app_hmi_types);
+
+ if (nicknames.empty()) {
+ LOG4CXX_ERROR(logger_, "Cloud App missing nickname");
+ continue;
+ } else if (mobile_apis::HybridAppPreference::MOBILE ==
+ hybrid_app_preference) {
+ auto nickname_it = nicknames.begin();
+ for (; nickname_it != nicknames.end(); ++nickname_it) {
+ auto app = application_by_name(*nickname_it);
+ if (app.use_count() != 0) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Mobile app already registered for cloud app: " << *nickname_it);
+ continue;
+ }
+ }
+ }
+
+ pending_device_map_.insert(
+ std::pair<std::string, std::string>(endpoint, policy_id));
+ // Determine which endpoints were disabled by erasing all enabled apps from
+ // the old device list
+ auto old_device_it = old_device_map.find(endpoint);
+ if (old_device_it != old_device_map.end()) {
+ old_device_map.erase(old_device_it);
+ }
+
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ endpoint,
+ certificate,
+ enabled,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference_str};
+
+ // If the device was disconnected, this will reinitialize the device
+ connection_handler().AddCloudAppDevice(policy_id, properties);
+
+ // Look for app icon url data and add to app_icon_url_map
+ std::string url = GetPolicyHandler().GetIconUrl(policy_id);
+
+ if (url.empty()) {
+ LOG4CXX_DEBUG(logger_, "No Icon Url for cloud app");
+ continue;
+ }
+
+ auto app_icon_it = app_icon_map_.find(policy_id);
+ if (app_icon_it != app_icon_map_.end()) {
+ LOG4CXX_DEBUG(logger_, "Cloud App Already Exists in Icon Map");
+ continue;
+ }
+
+ const std::string app_icon_dir(settings_.app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + policy_id);
+ if (!file_system::FileExists(full_icon_path)) {
+ AppIconInfo icon_info(endpoint, false);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Inserting cloud app into icon map: " << app_icon_map_.size());
+ app_icon_map_.insert(
+ std::pair<std::string, AppIconInfo>(policy_id, icon_info));
+ }
+ }
+ app_icon_map_lock_ptr_.Release();
+ pending_device_map_lock_ptr_->Release();
+
+ int removed_app_count = 0;
+ // Clear out devices for existing cloud apps that were disabled
+ for (auto& device : old_device_map) {
+ std::string policy_app_id = device.second;
+ // First search for the disabled app within the registered apps
+ ApplicationSharedPtr app = application_by_policy_id(policy_app_id);
+ if (app.use_count() == 0) {
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
+ // If the disabled app is not present in the registered app list, check
+ // the apps awaiting registration
+ PolicyAppIdPredicate finder(policy_app_id);
+ ApplicationSet::iterator it = std::find_if(
+ apps_to_register_.begin(), apps_to_register_.end(), finder);
+ if (it == apps_to_register_.end()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Unable to find app to remove (" << policy_app_id << "), skipping");
+ continue;
+ }
+ app = *it;
+ apps_to_register_.erase(it);
+ }
+ // If the disabled app is registered, unregistered it before destroying the
+ // device
+ if (app->IsRegistered() && app->is_cloud_app()) {
+ LOG4CXX_DEBUG(logger_, "Disabled app is registered, unregistering now");
+ GetRPCService().ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
+ commands::Command::SOURCE_SDL);
+
+ OnAppUnauthorized(app->app_id());
+ }
+ // Delete the cloud device
+ connection_handler().RemoveCloudAppDevice(app->device());
+ removed_app_count++;
+ }
+
+ // Update app list if disabled apps were removed
+ if (removed_app_count > 0) {
+ LOG4CXX_DEBUG(logger_, "Removed " << removed_app_count << " disabled apps");
+ SendUpdateAppList();
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+void ApplicationManagerImpl::CreatePendingApplication(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info,
+ connection_handler::DeviceHandle device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string endpoint;
+ std::string certificate;
+ std::string auth_token;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference_str;
+ bool enabled = true;
+ std::string name = device_info.name();
+ pending_device_map_lock_ptr_->Acquire();
+ auto it = pending_device_map_.find(name);
+ if (it == pending_device_map_.end()) {
+ pending_device_map_lock_ptr_->Release();
+ return;
+ }
+ pending_device_map_lock_ptr_->Release();
+
+ const std::string policy_app_id = it->second;
+
+ policy::StringArray nicknames;
+ policy::StringArray app_hmi_types;
+
+ GetPolicyHandler().GetInitialAppData(
+ policy_app_id, &nicknames, &app_hmi_types);
+
+ if (nicknames.empty()) {
+ LOG4CXX_ERROR(logger_, "Cloud App missing nickname");
+ return;
+ }
+
+ const std::string display_name = nicknames[0];
+
+ ApplicationSharedPtr application(
+ new ApplicationImpl(0,
+ policy_app_id,
+ device_info.mac_address(),
+ device_id,
+ custom_str::CustomString(display_name),
+ GetPolicyHandler().GetStatisticManager(),
+ *this));
+
+ if (!application) {
+ LOG4CXX_INFO(logger_, "Could not create application");
+ return;
+ }
+
+ const std::string app_icon_dir(settings_.app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
+ if (file_system::FileExists(full_icon_path)) {
+ application->set_app_icon_path(full_icon_path);
+ }
+
+ GetPolicyHandler().GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference_str);
+
+ mobile_apis::HybridAppPreference::eType hybrid_app_preference_enum;
+
+ bool convert_result = smart_objects::EnumConversionHelper<
+ mobile_apis::HybridAppPreference::eType>::
+ StringToEnum(hybrid_app_preference_str, &hybrid_app_preference_enum);
+
+ if (!hybrid_app_preference_str.empty() && !convert_result) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Could not convert string to enum: " << hybrid_app_preference_str);
+ return;
+ }
+
+ application->set_hmi_application_id(GenerateNewHMIAppID());
+ application->set_cloud_app_endpoint(endpoint);
+ application->set_auth_token(auth_token);
+ application->set_cloud_app_transport_type(cloud_transport_type);
+ application->set_hybrid_app_preference(hybrid_app_preference_enum);
+ application->set_cloud_app_certificate(certificate);
+
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
+ LOG4CXX_DEBUG(logger_,
+ "apps_to_register_ size before: " << apps_to_register_.size());
+ apps_to_register_.insert(application);
+ LOG4CXX_DEBUG(logger_,
+ "apps_to_register_ size after: " << apps_to_register_.size());
+
+ SendUpdateAppList();
+}
+
+void ApplicationManagerImpl::SetPendingApplicationState(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info) {
+ std::string name = device_info.name();
+ pending_device_map_lock_ptr_->Acquire();
+ auto it = pending_device_map_.find(name);
+ if (it == pending_device_map_.end()) {
+ pending_device_map_lock_ptr_->Release();
+ return;
+ }
+ pending_device_map_lock_ptr_->Release();
+
+ const std::string policy_app_id = it->second;
+ auto app = application_by_policy_id(policy_app_id);
+
+ if (!app) {
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Unregister application and move into apps_to_register");
+
+ UnregisterApplication(
+ app->app_id(), mobile_apis::Result::INVALID_ENUM, true, true);
+ app->MarkUnregistered();
+
+ {
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
+ apps_to_register_.insert(app);
+ }
+}
+
+void ApplicationManagerImpl::OnConnectionStatusUpdated() {
+ SendUpdateAppList();
+}
+
+hmi_apis::Common_CloudConnectionStatus::eType
+ApplicationManagerImpl::GetCloudAppConnectionStatus(
+ ApplicationConstSharedPtr app) const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ return hmi_apis::Common_CloudConnectionStatus::INVALID_ENUM;
+#else
+ transport_manager::ConnectionStatus status =
+ connection_handler().GetConnectionStatus(app->device());
+ switch (status) {
+ case transport_manager::ConnectionStatus::CONNECTED:
+ return hmi_apis::Common_CloudConnectionStatus::CONNECTED;
+ case transport_manager::ConnectionStatus::RETRY:
+ return hmi_apis::Common_CloudConnectionStatus::RETRY;
+ case transport_manager::ConnectionStatus::PENDING:
+ case transport_manager::ConnectionStatus::CLOSING:
+ return hmi_apis::Common_CloudConnectionStatus::NOT_CONNECTED;
+ default:
+ return hmi_apis::Common_CloudConnectionStatus::INVALID_ENUM;
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+uint32_t ApplicationManagerImpl::GetNextMobileCorrelationID() {
+ if (mobile_corelation_id_ < max_corelation_id_) {
+ mobile_corelation_id_++;
+ } else {
+ mobile_corelation_id_ = 0;
+ }
+
+ return mobile_corelation_id_;
}
uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
@@ -1003,6 +1479,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
rpc_service_->ManageHMICommand(update_list);
+ RefreshCloudAppInformation();
}
void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
@@ -1412,9 +1889,9 @@ void ApplicationManagerImpl::OnServiceStartedCallback(
using namespace helpers;
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "ServiceType = " << type << ". Session = " << std::hex
- << session_key);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ServiceType = " << type << ". Session = " << std::hex << session_key);
std::vector<std::string> empty;
if (type == kRpc) {
@@ -1424,9 +1901,9 @@ void ApplicationManagerImpl::OnServiceStartedCallback(
}
ApplicationSharedPtr app = application(session_key);
if (!app) {
- LOG4CXX_WARN(logger_,
- "The application with id:" << session_key
- << " doesn't exists.");
+ LOG4CXX_WARN(
+ logger_,
+ "The application with id:" << session_key << " doesn't exists.");
connection_handler().NotifyServiceStartedResult(session_key, false, empty);
return;
}
@@ -1586,9 +2063,9 @@ void ApplicationManagerImpl::OnSecondaryTransportEndedCallback(
connection_handler::DeviceHandle device_handle = app->secondary_device();
if (device_handle == 0) {
- LOG4CXX_WARN(logger_,
- "Secondary transport of app " << session_key
- << " is not found");
+ LOG4CXX_WARN(
+ logger_,
+ "Secondary transport of app " << session_key << " is not found");
return;
}
@@ -1779,6 +2256,9 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
}
app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
*app_launch_dto_.get(), *this, settings_));
+
+ app_service_manager_.reset(
+ new application_manager::AppServiceManager(*this, last_state));
return true;
}
@@ -1806,7 +2286,9 @@ bool ApplicationManagerImpl::Stop() {
}
bool ApplicationManagerImpl::ConvertSOtoMessage(
- const smart_objects::SmartObject& message, Message& output) {
+ const smart_objects::SmartObject& message,
+ Message& output,
+ const bool allow_unknown_parameters) {
LOG4CXX_AUTO_TRACE(logger_);
if (smart_objects::SmartType_Null == message.getType() ||
@@ -1831,16 +2313,16 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
switch (protocol_type) {
case 0: {
if (protocol_version == 1) {
- if (!formatters::CFormatterJsonSDLRPCv1::toString(message,
- output_string)) {
+ if (!formatters::CFormatterJsonSDLRPCv1::toString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
output.set_protocol_version(
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
} else {
- if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
- output_string)) {
+ if (!formatters::CFormatterJsonSDLRPCv2::toString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -1852,7 +2334,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
break;
}
case 1: {
- if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ if (!formatters::FormatterJsonRpc::ToString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -2049,9 +2532,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
connection_handler::DeviceHandle device_id = 0;
- if (-1 ==
- connection_handler().get_session_observer().GetDataOnSessionKey(
- connection_key, NULL, NULL, &device_id)) {
+ if (-1 == connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, NULL, NULL, &device_id)) {
LOG4CXX_ERROR(logger_,
"Failed to create application: no connection info.");
continue;
@@ -2151,6 +2633,17 @@ void ApplicationManagerImpl::updateRequestTimeout(
connection_key, mobile_correlation_id, new_timeout_value);
}
+void ApplicationManagerImpl::IncreaseForwardedRequestTimeout(
+ uint32_t connection_key, uint32_t mobile_correlation_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Increasing Request Timeout by "
+ << get_settings().rpc_pass_through_timeout());
+ uint32_t new_timeout_value = get_settings().default_timeout() +
+ get_settings().rpc_pass_through_timeout();
+ request_ctrl_.updateRequestTimeout(
+ connection_key, mobile_correlation_id, new_timeout_value);
+}
+
uint32_t ApplicationManagerImpl::application_id(const int32_t correlation_id) {
// ykazakov: there is no erase for const iterator for QNX
std::map<const int32_t, const uint32_t>::iterator it =
@@ -2350,6 +2843,21 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
it = accessor.GetData().begin();
}
}
+
+ bool send_pending_update_app_list = false;
+ {
+ sync_primitives::AutoLock auto_lock(apps_to_register_list_lock_ptr_);
+ if (!apps_to_register_.empty()) {
+ send_pending_update_app_list = true;
+ apps_to_register_.clear();
+ }
+ }
+
+ // Only send update app list if pending apps were removed.
+ if (send_pending_update_app_list) {
+ SendUpdateAppList();
+ }
+
if (is_ignition_off) {
resume_controller().OnIgnitionOff();
}
@@ -2364,9 +2872,9 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
while (apps_to_register_.end() != it_app) {
- LOG4CXX_DEBUG(logger_,
- "Waiting app: " << (*it_app)->name().c_str()
- << " is removed.");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Waiting app: " << (*it_app)->name().c_str() << " is removed.");
apps_to_register_.erase(it_app);
it_app = std::find_if(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
@@ -2387,6 +2895,8 @@ void ApplicationManagerImpl::UnregisterApplication(
<< is_unexpected_disconnect);
size_t subscribed_for_way_points_app_count = 0;
+ GetAppServiceManager().UnpublishServices(app_id);
+
// SDL sends UnsubscribeWayPoints only for last application
{
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
@@ -2449,6 +2959,7 @@ void ApplicationManagerImpl::UnregisterApplication(
if (app_id == (*it_app)->app_id()) {
app_to_remove = *it_app;
applications_.erase(it_app++);
+ break;
} else {
++it_app;
}
@@ -2472,14 +2983,23 @@ void ApplicationManagerImpl::UnregisterApplication(
(hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
- AppV4DevicePredicate finder(handle);
- ApplicationSharedPtr app = FindApp(applications(), finder);
- if (!app) {
- LOG4CXX_DEBUG(
- logger_, "There is no more SDL4 apps with device handle: " << handle);
- RemoveAppsWaitingForRegistration(handle);
- SendUpdateAppList();
+ if (connection_handler().GetDeviceID(app_to_remove->mac_address(),
+ &handle)) {
+ AppV4DevicePredicate finder(handle);
+ ApplicationSharedPtr app = FindApp(applications(), finder);
+ if (!app) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no more SDL4 apps with device handle: " << handle);
+
+ RemoveAppsWaitingForRegistration(handle);
+ RefreshCloudAppInformation();
+ SendUpdateAppList();
+ } else if (app_to_remove->is_cloud_app()) {
+ RefreshCloudAppInformation();
+ SendUpdateAppList();
+ }
}
}
@@ -2778,8 +3298,8 @@ void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) {
}
MobileMessageQueue messages;
app->SwapMobileMessageQueue(messages);
- auto push_allowed_messages = [this, &app](
- smart_objects::SmartObjectSPtr message) {
+ auto push_allowed_messages = [this,
+ &app](smart_objects::SmartObjectSPtr message) {
const std::string function_id = MessageHelper::StringifiedFunctionID(
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asUInt()));
@@ -3363,6 +3883,15 @@ void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
if (!ptu_result) {
return;
}
+
+ RefreshCloudAppInformation();
+
+ auto app_id = policy_handler_->GetAppIdForSending();
+ auto app = application(app_id);
+ if (app) {
+ SendGetIconUrlNotifications(app->app_id(), app);
+ }
+
auto on_app_policy_updated = [](plugin_manager::RPCPlugin& plugin) {
plugin.OnPolicyEvent(plugin_manager::kApplicationPolicyUpdated);
};
@@ -3405,6 +3934,58 @@ void ApplicationManagerImpl::SendDriverDistractionState(
}
}
+void ApplicationManagerImpl::SendGetIconUrlNotifications(
+ const uint32_t connection_key, ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> enabled_apps;
+ GetPolicyHandler().GetEnabledCloudApps(enabled_apps);
+ std::vector<std::string>::iterator enabled_it = enabled_apps.begin();
+ std::vector<std::string>::iterator enabled_end = enabled_apps.end();
+ sync_primitives::AutoLock lock(app_icon_map_lock_ptr_);
+ for (; enabled_it != enabled_end; ++enabled_it) {
+ auto app_icon_it = app_icon_map_.find(*enabled_it);
+ if (app_icon_it == app_icon_map_.end()) {
+ LOG4CXX_WARN(logger_, "Could not find cloud app in icon map");
+ continue;
+ }
+
+ std::string endpoint = app_icon_it->second.endpoint;
+ bool pending_request = app_icon_it->second.pending_request;
+
+ if (pending_request) {
+ LOG4CXX_DEBUG(logger_, "Cloud app has already sent request");
+ continue;
+ }
+
+ std::string url = GetPolicyHandler().GetIconUrl(*enabled_it);
+
+ if (url.empty()) {
+ LOG4CXX_DEBUG(logger_, "No Icon Url for cloud app");
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Creating Get Icon Request");
+
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemRequestID;
+ (*message)[strings::params][strings::connection_key] = connection_key;
+ (*message)[strings::params][strings::message_type] =
+ mobile_apis::messageType::notification;
+ (*message)[strings::params][strings::protocol_version] =
+ application->protocol_version();
+ (*message)[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::ICON_URL;
+ (*message)[strings::msg_params][strings::url] = url;
+
+ app_icon_it->second.pending_request = true;
+
+ rpc_service_->ManageMobileCommand(message, commands::Command::SOURCE_SDL);
+ }
+}
+
protocol_handler::MajorProtocolVersion
ApplicationManagerImpl::SupportedSDLVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -3436,9 +4017,9 @@ bool ApplicationManagerImpl::InitDirectory(
LOG4CXX_WARN(logger_, directory_type << " directory doesn't exist.");
// if storage directory doesn't exist try to create it
if (!file_system::CreateDirectoryRecursively(path)) {
- LOG4CXX_ERROR(logger_,
- "Unable to create " << directory_type << " directory "
- << path);
+ LOG4CXX_ERROR(
+ logger_,
+ "Unable to create " << directory_type << " directory " << path);
return false;
}
LOG4CXX_DEBUG(logger_,
@@ -3453,9 +4034,9 @@ bool ApplicationManagerImpl::IsReadWriteAllowed(const std::string& path,
const std::string directory_type = DirectoryTypeToString(type);
if (!(file_system::IsWritingAllowed(path) &&
file_system::IsReadingAllowed(path))) {
- LOG4CXX_ERROR(logger_,
- directory_type
- << " directory doesn't have read/write permissions.");
+ LOG4CXX_ERROR(
+ logger_,
+ directory_type << " directory doesn't have read/write permissions.");
return false;
}
@@ -3642,6 +4223,13 @@ void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) {
applications_list_lock_ptr_->Release();
}
+void ApplicationManagerImpl::AddMockPendingApplication(
+ ApplicationSharedPtr mock_app) {
+ apps_to_register_list_lock_ptr_->Acquire();
+ apps_to_register_.insert(mock_app);
+ apps_to_register_list_lock_ptr_->Release();
+}
+
void ApplicationManagerImpl::SetMockMediaManager(
media_manager::MediaManager* mock_media_manager) {
media_manager_ = mock_media_manager;
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc
index 3f775ee4e2..2b02e9b658 100644
--- a/src/components/application_manager/src/application_state.cc
+++ b/src/components/application_manager/src/application_state.cc
@@ -45,7 +45,7 @@ struct StateIDComparator {
return cur->state_id() == state_id_;
}
};
-}
+} // namespace
namespace application_manager {
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
index ea74e78f4e..87ac50ebd7 100644
--- a/src/components/application_manager/src/command_holder_impl.cc
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -139,4 +139,4 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
app_mobile_commands_.erase(app_commands);
}
-} // application_manager
+} // 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 04fabfb2ec..521a44890f 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -43,7 +43,7 @@ struct AppExtensionPredicate {
return app ? (app->QueryInterface(uid).use_count() != 0) : false;
}
};
-}
+} // namespace
namespace commands {
diff --git a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
index 4e9a2556de..bd4fa58c8f 100644
--- a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
@@ -32,8 +32,8 @@
#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
namespace application_manager {
@@ -75,6 +75,30 @@ void CommandNotificationFromMobileImpl::SendNotification() {
rpc_service_.SendMessageToMobile(message_);
}
+void CommandNotificationFromMobileImpl::SendNotificationToMobile() {
+ auto app = application_manager_.application(connection_key());
+ (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] =
+ app->protocol_version();
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ rpc_service_.ManageMobileCommand(message_, SOURCE_SDL);
+}
+
+void CommandNotificationFromMobileImpl::SendNotificationToHMI(
+ const hmi_apis::FunctionID::eType& hmi_function_id) {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::function_id] = hmi_function_id;
+ rpc_service_.ManageHMICommand(message_, SOURCE_SDL_TO_HMI);
+}
+
+void CommandNotificationFromMobileImpl::SendNotificationToConsumers(
+ const hmi_apis::FunctionID::eType& hmi_function_id) {
+ SendNotificationToMobile();
+ SendNotificationToHMI(hmi_function_id);
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc
index 70df95986b..cc2606ab6f 100644
--- a/src/components/application_manager/src/commands/command_notification_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_impl.cc
@@ -32,8 +32,8 @@
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
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 68e8cfe6b4..f67fde22a0 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -36,11 +36,15 @@
#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/rpc_service.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"
+
namespace application_manager {
namespace commands {
@@ -233,7 +237,8 @@ void CommandRequestImpl::Run() {}
void CommandRequestImpl::onTimeOut() {
LOG4CXX_AUTO_TRACE(logger_);
- unsubscribe_from_all_events();
+ 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_);
@@ -257,11 +262,14 @@ void CommandRequestImpl::onTimeOut() {
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 smart_objects::SmartObject* response_params,
+ const std::vector<uint8_t> binary_data) {
LOG4CXX_AUTO_TRACE(logger_);
{
sync_primitives::AutoLock auto_lock(state_lock_);
@@ -286,7 +294,9 @@ void CommandRequestImpl::SendResponse(
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;
}
@@ -414,6 +424,94 @@ void CommandRequestImpl::UpdateHash() {
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) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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) {
+ LOG4CXX_DEBUG(logger_, "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) {
+ LOG4CXX_DEBUG(logger_, "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);
+}
+
+void CommandRequestImpl::SendMobileRequest(
+ const mobile_apis::FunctionID::eType& function_id,
+ smart_objects::SmartObjectSPtr msg,
+ bool use_events) {
+ smart_objects::SmartObject& request = *msg;
+
+ const uint32_t mobile_correlation_id =
+ application_manager_.GetNextMobileCorrelationID();
+
+ request[strings::params][strings::correlation_id] = mobile_correlation_id;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ if (use_events) {
+ LOG4CXX_DEBUG(logger_,
+ "SendMobileRequest subscribe_on_event "
+ << function_id << " " << mobile_correlation_id);
+ subscribe_on_event(function_id, mobile_correlation_id);
+ }
+
+ if (!rpc_service_.ManageMobileCommand(msg, SOURCE_SDL)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request to mobile");
+ }
+}
+
uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
@@ -439,12 +537,12 @@ uint32_t CommandRequestImpl::SendHMIRequest(
if (use_events) {
LOG4CXX_DEBUG(logger_,
- "subscribe_on_event " << function_id << " "
- << hmi_correlation_id);
+ "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)) {
+ if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
}
@@ -474,7 +572,7 @@ void CommandRequestImpl::CreateHMINotification(
notify[strings::params][strings::function_id] = function_id;
notify[strings::msg_params] = msg_params;
- if (!rpc_service_.ManageHMICommand(result)) {
+ if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) {
LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
}
}
@@ -811,6 +909,19 @@ bool CommandRequestImpl::HasDisallowedParams() const {
(!removed_parameters_permissions_.undefined_params.empty()));
}
+bool CommandRequestImpl::IsMobileResultSuccess(
+ mobile_apis::Result::eType result_code) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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 CommandRequestImpl::PrepareResultForMobileResponse(
hmi_apis::Common_Result::eType result_code,
HmiInterfaces::InterfaceID interface) const {
diff --git a/src/components/application_manager/src/commands/command_request_to_mobile.cc b/src/components/application_manager/src/commands/command_request_to_mobile.cc
new file mode 100644
index 0000000000..e1ed06e887
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_request_to_mobile.cc
@@ -0,0 +1,72 @@
+/*
+ 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 "application_manager/commands/command_request_to_mobile.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CommandRequestToMobile::CommandRequestToMobile(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CommandRequestToMobile::~CommandRequestToMobile() {}
+
+bool CommandRequestToMobile::Init() {
+ return true;
+}
+
+bool CommandRequestToMobile::CleanUp() {
+ return true;
+}
+
+void CommandRequestToMobile::Run() {
+ SendRequest();
+}
+
+void CommandRequestToMobile::SendRequest() {
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_response_from_mobile.cc b/src/components/application_manager/src/commands/command_response_from_mobile.cc
new file mode 100644
index 0000000000..dfed65b134
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_response_from_mobile.cc
@@ -0,0 +1,71 @@
+/*
+ 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/commands/command_response_from_mobile.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CommandResponseFromMobile::CommandResponseFromMobile(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+CommandResponseFromMobile::~CommandResponseFromMobile() {}
+
+bool CommandResponseFromMobile::Init() {
+ return true;
+}
+
+bool CommandResponseFromMobile::CleanUp() {
+ return true;
+}
+
+void CommandResponseFromMobile::Run() {}
+
+void CommandResponseFromMobile::SendResponse() {
+ rpc_service_.ManageMobileCommand(message_, SOURCE_SDL);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc
index 75e49b180e..5e1314bad3 100644
--- a/src/components/application_manager/src/commands/notification_from_hmi.cc
+++ b/src/components/application_manager/src/commands/notification_from_hmi.cc
@@ -73,6 +73,20 @@ void NotificationFromHMI::SendNotificationToMobile(
rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
}
+void NotificationFromHMI::SendNotificationToMobile(
+ const MessageSharedPtr& message,
+ const mobile_apis::FunctionID::eType& mobile_function_id) {
+ (*message)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ (*message)[strings::params][strings::function_id] = mobile_function_id;
+ rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
+}
+
+void NotificationFromHMI::SendNotificationToHMI(MessageSharedPtr& message) {
+ (*message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ rpc_service_.ManageHMICommand(message, SOURCE_SDL_TO_HMI);
+}
+
void NotificationFromHMI::CreateHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject& msg_params) const {
@@ -106,6 +120,12 @@ void NotificationFromHMI::CreateHMIRequest(
}
}
+void NotificationFromHMI::SendNotificationToConsumers(
+ const mobile_apis::FunctionID::eType& mobile_function_id) {
+ SendNotificationToHMI(message_);
+ SendNotificationToMobile(message_, mobile_function_id);
+}
+
} // 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 ff760c2d2a..873d9a844f 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -31,8 +31,16 @@
*/
#include "application_manager/commands/request_from_hmi.h"
+
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_manager.h"
+#include "application_manager/request_info.h"
#include "application_manager/rpc_service.h"
+#include "utils/helpers.h"
+
+#include "smart_objects/enum_schema_item.h"
+
+#include "smart_objects/enum_schema_item.h"
namespace application_manager {
@@ -67,28 +75,37 @@ void RequestFromHMI::Run() {}
void RequestFromHMI::on_event(const event_engine::Event& event) {}
+void RequestFromHMI::on_event(const event_engine::MobileEvent& event) {}
+
void RequestFromHMI::SendResponse(
const bool success,
const uint32_t correlation_id,
const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code) {
+ const hmi_apis::Common_Result::eType result_code,
+ const smart_objects::SmartObject* response_params,
+ commands::Command::CommandSource source) {
smart_objects::SmartObjectSPtr message =
std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
FillCommonParametersOfSO(*message, correlation_id, function_id);
(*message)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message)[strings::params][hmi_response::code] = 0;
+ (*message)[strings::params][hmi_response::code] = result_code;
(*message)[strings::msg_params][strings::success] = success;
(*message)[strings::msg_params][strings::result_code] = result_code;
- rpc_service_.ManageHMICommand(message);
+ if (response_params) {
+ (*message)[strings::msg_params] = *response_params;
+ }
+
+ rpc_service_.ManageHMICommand(message, source);
}
void RequestFromHMI::SendErrorResponse(
const uint32_t correlation_id,
const hmi_apis::FunctionID::eType function_id,
const hmi_apis::Common_Result::eType result_code,
- const std::string error_message) {
+ const std::string error_message,
+ commands::Command::CommandSource source) {
smart_objects::SmartObjectSPtr message =
std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
@@ -98,7 +115,7 @@ void RequestFromHMI::SendErrorResponse(
(*message)[strings::params][hmi_response::code] = result_code;
(*message)[strings::params][strings::error_msg] = error_message;
- rpc_service_.ManageHMICommand(message);
+ rpc_service_.ManageHMICommand(message, source);
}
void RequestFromHMI::FillCommonParametersOfSO(
@@ -111,5 +128,191 @@ void RequestFromHMI::FillCommonParametersOfSO(
(message)[strings::params][strings::correlation_id] = correlation_id;
}
+bool RequestFromHMI::IsMobileResultSuccess(
+ mobile_apis::Result::eType result_code) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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 {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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,
+ const smart_objects::SmartObject* msg,
+ bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool hmi_destination = false;
+ ApplicationSharedPtr app;
+ // Default error code and error message
+ std::string error_msg = "No app service provider available";
+ hmi_apis::Common_Result::eType error_code =
+ hmi_apis::Common_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, false, app, hmi_destination);
+ error_msg = "No app service provider with serviceType: " + service_type +
+ " is available";
+ error_code = hmi_apis::Common_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, false, app, hmi_destination);
+ error_msg = "No app service provider with serviceId: " + service_id +
+ " is available";
+ error_code = hmi_apis::Common_Result::INVALID_ID;
+ }
+
+ if (hmi_destination) {
+ LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider");
+ application_manager_.IncreaseForwardedRequestTimeout(
+ application_manager::request_controller::RequestInfo::HmiConnectoinKey,
+ correlation_id());
+ SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events);
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_DEBUG(logger_, "Invalid App Provider pointer");
+ SendErrorResponse(correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()),
+ error_code,
+ error_msg,
+ commands::Command::CommandSource::SOURCE_SDL_TO_HMI);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Sending Request to Mobile Provider");
+ application_manager_.IncreaseForwardedRequestTimeout(
+ application_manager::request_controller::RequestInfo::HmiConnectoinKey,
+ correlation_id());
+ SendMobileRequest(
+ mobile_function_id, app, &(*msg)[strings::msg_params], use_events);
+}
+
+void RequestFromHMI::SendMobileRequest(
+ const mobile_apis::FunctionID::eType& function_id,
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject* msg_params,
+ bool use_events) {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
+ const uint32_t mobile_correlation_id =
+ application_manager_.GetNextMobileCorrelationID();
+
+ 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] = mobile_correlation_id;
+ request[strings::params][strings::protocol_version] = app->protocol_version();
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::mobile_protocol_type_;
+
+ request[strings::params][strings::connection_key] = app->app_id();
+
+ if (msg_params) {
+ request[strings::msg_params] = *msg_params;
+ }
+
+ if (use_events) {
+ LOG4CXX_DEBUG(logger_,
+ "RequestFromHMI subscribe_on_event "
+ << function_id << " " << mobile_correlation_id);
+ subscribe_on_event(function_id, mobile_correlation_id);
+ }
+ if (!rpc_service_.ManageMobileCommand(
+ result, commands::Command::CommandSource::SOURCE_SDL)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request to mobile");
+ }
+}
+
+void RequestFromHMI::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_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ if (msg_params) {
+ request[strings::msg_params] = *msg_params;
+ }
+
+ if (use_events) {
+ LOG4CXX_DEBUG(logger_,
+ "RequestFromHMI 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, commands::Command::CommandSource::SOURCE_SDL_TO_HMI)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ }
+ } else {
+ LOG4CXX_DEBUG(logger_, "Interface is not available");
+ }
+}
+
+bool RequestFromHMI::ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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) {
+ return false;
+ }
+ return true;
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/event_engine/event.cc b/src/components/application_manager/src/event_engine/event.cc
index cc180ca950..ecdeb41a2e 100644
--- a/src/components/application_manager/src/event_engine/event.cc
+++ b/src/components/application_manager/src/event_engine/event.cc
@@ -48,5 +48,17 @@ void Event::set_smart_object(const smart_objects::SmartObject& so) {
response_so_ = so;
}
+MobileEvent::MobileEvent(const MobileEventID& id) : id_(id), response_so_() {}
+
+MobileEvent::~MobileEvent() {}
+
+void MobileEvent::raise(EventDispatcher& event_dispatcher) {
+ event_dispatcher.raise_mobile_event(*this);
+}
+
+void MobileEvent::set_smart_object(const smart_objects::SmartObject& so) {
+ response_so_ = so;
+}
+
} // namespace event_engine
} // namespace application_manager
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 f1e5bf9735..30b1b83e79 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
@@ -31,9 +31,9 @@
*/
#include "application_manager/event_engine/event_dispatcher_impl.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/event_engine/event_observer.h"
#include <algorithm>
+#include "application_manager/event_engine/event_observer.h"
+#include "interfaces/HMI_API.h"
namespace application_manager {
namespace event_engine {
@@ -122,5 +122,78 @@ void EventDispatcherImpl::remove_observer_from_vector(EventObserver& observer) {
observers_.end());
}
+// Mobile Events
+
+void EventDispatcherImpl::raise_mobile_event(const MobileEvent& event) {
+ AutoLock observer_lock(mobile_observer_lock_);
+ {
+ AutoLock state_lock(mobile_state_lock_);
+
+ // check if event is notification
+ if (mobile_apis::messageType::notification == event.smart_object_type()) {
+ const uint32_t notification_correlation_id = 0;
+ mobile_observers_ =
+ mobile_observers_event_[event.id()][notification_correlation_id];
+ }
+
+ if (mobile_apis::messageType::response == event.smart_object_type()) {
+ mobile_observers_ =
+ mobile_observers_event_[event.id()]
+ [event.smart_object_correlation_id()];
+ }
+ }
+
+ // Call observers
+ while (!mobile_observers_.empty()) {
+ EventObserver* temp = *mobile_observers_.begin();
+ mobile_observers_.erase(mobile_observers_.begin());
+ AutoUnlock unlock_observer(observer_lock);
+ temp->on_event(event);
+ }
+}
+
+void EventDispatcherImpl::add_mobile_observer(
+ const MobileEvent::MobileEventID& event_id,
+ int32_t mobile_correlation_id,
+ EventObserver& observer) {
+ AutoLock auto_lock(mobile_state_lock_);
+ mobile_observers_event_[event_id][mobile_correlation_id].push_back(&observer);
+}
+
+void EventDispatcherImpl::remove_mobile_observer(
+ const MobileEvent::MobileEventID& event_id, EventObserver& observer) {
+ remove_mobile_observer_from_vector(observer);
+ AutoLock auto_lock(mobile_state_lock_);
+ ObserversMap::iterator it = mobile_observers_event_[event_id].begin();
+
+ for (; mobile_observers_event_[event_id].end() != it; ++it) {
+ ObserverVector& obs_vec = it->second;
+ const ObserverVector::iterator obs_vec_it = obs_vec.end();
+ obs_vec.erase(
+ std::remove_if(
+ obs_vec.begin(), obs_vec_it, IdCheckFunctor(observer.id())),
+ obs_vec_it);
+ }
+}
+
+void EventDispatcherImpl::remove_mobile_observer(EventObserver& observer) {
+ remove_mobile_observer_from_vector(observer);
+ MobileEventObserverMap::iterator event_map = mobile_observers_event_.begin();
+
+ for (; mobile_observers_event_.end() != event_map; ++event_map) {
+ remove_mobile_observer(event_map->first, observer);
+ }
+}
+
+void EventDispatcherImpl::remove_mobile_observer_from_vector(
+ EventObserver& observer) {
+ AutoLock auto_lock(mobile_observer_lock_);
+
+ mobile_observers_.erase(
+ std::remove_if(
+ observers_.begin(), observers_.end(), IdCheckFunctor(observer.id())),
+ observers_.end());
+}
+
} // namespace event_engine
} // namespace application_manager
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 f89f6649b1..fc252d3125 100644
--- a/src/components/application_manager/src/event_engine/event_observer.cc
+++ b/src/components/application_manager/src/event_engine/event_observer.cc
@@ -44,7 +44,8 @@ EventObserver::EventObserver(EventDispatcher& event_dispatcher)
}
EventObserver::~EventObserver() {
- unsubscribe_from_all_events();
+ unsubscribe_from_all_hmi_events();
+ unsubscribe_from_all_mobile_events();
}
void EventObserver::subscribe_on_event(const Event::EventID& event_id,
@@ -60,5 +61,25 @@ void EventObserver::unsubscribe_from_all_events() {
event_dispatcher_.remove_observer(*this);
}
+void EventObserver::unsubscribe_from_all_hmi_events() {
+ event_dispatcher_.remove_observer(*this);
+}
+
+void EventObserver::subscribe_on_event(
+ const MobileEvent::MobileEventID& event_id, int32_t mobile_correlation_id) {
+ event_dispatcher_.add_mobile_observer(event_id, mobile_correlation_id, *this);
+}
+
+void EventObserver::unsubscribe_from_event(
+ const MobileEvent::MobileEventID& event_id) {
+ event_dispatcher_.remove_mobile_observer(event_id, *this);
+}
+
+void EventObserver::unsubscribe_from_all_mobile_events() {
+ event_dispatcher_.remove_mobile_observer(*this);
+}
+
+void EventObserver::on_event(const event_engine::MobileEvent& event) {}
+
} // 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 016e09635b..ec883e5fc2 100644
--- a/src/components/application_manager/src/help_prompt_manager_impl.cc
+++ b/src/components/application_manager/src/help_prompt_manager_impl.cc
@@ -28,7 +28,7 @@
* 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/help_prompt_manager_impl.h"
@@ -90,9 +90,9 @@ bool HelpPromptManagerImpl::AddCommand(
const bool limit_exceeded =
kLimitCommand <= GetCommandsCount(vr_commands_.end());
- LOG4CXX_DEBUG(logger_,
- "Will be added first command from array "
- << strings::vr_commands);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Will be added first command from array " << strings::vr_commands);
smart_objects::SmartObjectSPtr vr_item =
std::make_shared<smart_objects::SmartObject>(commands.asArray()->front());
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
index 59f1c6caf2..fc86eb5e62 100644
--- a/src/components/application_manager/src/helpers/application_helper.cc
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -1,9 +1,9 @@
-#include <vector>
-#include <string>
#include "application_manager/helpers/application_helper.h"
+#include <string>
+#include <vector>
#include "application_manager/message_helper.h"
-#include "utils/logger.h"
#include "utils/file_system.h"
+#include "utils/logger.h"
namespace {
using namespace application_manager;
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index f67590543d..0f5bc80d56 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -32,20 +32,22 @@
#include <map>
-#include "utils/logger.h"
+#include "application_manager/application_manager.h"
#include "application_manager/hmi_capabilities_impl.h"
-#include "application_manager/application_manager_impl.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/message_helper.h"
#include "application_manager/smart_object_keys.h"
#include "config_profile/profile.h"
#include "formatters/CFormatterJsonBase.h"
#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
#include "utils/file_system.h"
+#include "utils/logger.h"
namespace application_manager {
namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMICapabilities")
+
namespace {
std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
vr_enum_capabilities;
@@ -912,7 +914,8 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
hmi_apis::Common_TextFieldName::eType>::const_iterator
it_text_field_name = text_fields_enum_name.find(
display_capabilities_so[hmi_response::text_fields][i]
- [strings::name].asString());
+ [strings::name]
+ .asString());
display_capabilities_so[hmi_response::text_fields][i].erase(
strings::name);
if (text_fields_enum_name.end() != it_text_field_name) {
@@ -1029,19 +1032,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
smart_objects::SmartObject(smart_objects::SmartType_Map);
if (check_existing_json_member(audio_capabilities, "samplingRate")) {
audio_capabilities_so["samplingRate"] =
- sampling_rate_enum.find(audio_capabilities.get("samplingRate", "")
- .asString())->second;
+ sampling_rate_enum
+ .find(audio_capabilities.get("samplingRate", "").asString())
+ ->second;
}
if (check_existing_json_member(audio_capabilities, "bitsPerSample")) {
audio_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum.find(audio_capabilities.get("bitsPerSample",
- "").asString())
+ bit_per_sample_enum
+ .find(audio_capabilities.get("bitsPerSample", "").asString())
->second;
}
if (check_existing_json_member(audio_capabilities, "audioType")) {
audio_capabilities_so["audioType"] =
- audio_type_enum.find(audio_capabilities.get("audioType", "")
- .asString())->second;
+ audio_type_enum
+ .find(audio_capabilities.get("audioType", "").asString())
+ ->second;
}
set_audio_pass_thru_capabilities(audio_capabilities_so);
}
@@ -1053,18 +1058,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(pcm_capabilities, "samplingRate")) {
pcm_capabilities_so["samplingRate"] =
- sampling_rate_enum.find(pcm_capabilities.get("samplingRate", "")
- .asString())->second;
+ sampling_rate_enum
+ .find(pcm_capabilities.get("samplingRate", "").asString())
+ ->second;
}
if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) {
pcm_capabilities_so["bitsPerSample"] =
- bit_per_sample_enum.find(pcm_capabilities.get("bitsPerSample", "")
- .asString())->second;
+ bit_per_sample_enum
+ .find(pcm_capabilities.get("bitsPerSample", "").asString())
+ ->second;
}
if (check_existing_json_member(pcm_capabilities, "audioType")) {
pcm_capabilities_so["audioType"] =
- audio_type_enum.find(pcm_capabilities.get("audioType", "")
- .asString())->second;
+ audio_type_enum
+ .find(pcm_capabilities.get("audioType", "").asString())
+ ->second;
}
set_pcm_stream_capabilities(pcm_capabilities_so);
@@ -1170,6 +1178,20 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
smart_objects::SmartObject rc_capability_so;
formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
rc_capability_so);
+ if (rc_capability_so.keyExists("lightControlCapabilities")) {
+ if (rc_capability_so["lightControlCapabilities"].keyExists(
+ "supportedLights")) {
+ auto& lights = rc_capability_so["lightControlCapabilities"]
+ ["supportedLights"];
+ auto it = lights.asArray()->begin();
+ for (; it != lights.asArray()->end(); ++it) {
+ smart_objects::SmartObject& light_name_so = (*it)["name"];
+ auto light_name = MessageHelper::CommonLightNameFromString(
+ light_name_so.asString());
+ light_name_so = light_name;
+ }
+ }
+ }
set_rc_capability(rc_capability_so);
if (!rc_capability_so.empty()) {
set_rc_supported(true);
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 3e7341ccf4..6fd17953d6 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -103,6 +103,10 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnEventChanged] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_GetFilePath] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
+ convert_map[BasicCommunication_CloseApplication] =
+ HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Started] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Stopped] = HmiInterfaces::HMI_INTERFACE_VR;
@@ -228,6 +232,14 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_RC;
convert_map[RC_OnInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
convert_map[RC_OnRemoteControlSettings] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[AppService_PublishAppService] =
+ HmiInterfaces::HMI_INTERFACE_AppService;
+ convert_map[AppService_GetAppServiceData] =
+ HmiInterfaces::HMI_INTERFACE_AppService;
+ convert_map[AppService_PerformAppServiceInteraction] =
+ HmiInterfaces::HMI_INTERFACE_AppService;
+ convert_map[AppService_GetActiveServiceConsent] =
+ HmiInterfaces::HMI_INTERFACE_AppService;
return convert_map;
}
@@ -251,6 +263,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() {
HmiInterfaces::STATE_NOT_RESPONSE;
interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] =
HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_AppService] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
}
HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState(
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index 6e89b2419c..e206633ae2 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -28,16 +28,16 @@
* 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/hmi_language_handler.h"
#include "application_manager/application_manager.h"
+#include "application_manager/hmi_capabilities.h"
#include "application_manager/message_helper.h"
#include "application_manager/rpc_service.h"
-#include "application_manager/hmi_capabilities.h"
-#include "utils/helpers.h"
#include "resumption/last_state.h"
#include "smart_objects/smart_object.h"
+#include "utils/helpers.h"
static const std::string LanguagesKey = "Languages";
static const std::string UIKey = "UI";
@@ -78,9 +78,9 @@ void HMILanguageHandler::set_language_for(
LOG4CXX_WARN(logger_, "Unknown interface has been passed " << interface);
return;
}
- LOG4CXX_DEBUG(logger_,
- "Setting language " << language << " for interface "
- << interface);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Setting language " << language << " for interface " << interface);
Json::Value& dictionary = last_state_->get_dictionary();
dictionary[LanguagesKey][key] = language;
return;
@@ -273,8 +273,9 @@ void HMILanguageHandler::VerifyWithPersistedLanguages() {
LOG4CXX_INFO(logger_,
"Application with app_id "
- << app->app_id() << " will be unregistered because of "
- "HMI language(s) mismatch.");
+ << app->app_id()
+ << " will be unregistered because of "
+ "HMI language(s) mismatch.");
CheckApplication(std::make_pair(app->app_id(), false));
}
@@ -284,7 +285,7 @@ void HMILanguageHandler::VerifyWithPersistedLanguages() {
LOG4CXX_DEBUG(logger_,
"No registered apps found. HMILanguageHandler unsubscribed "
"from all events.");
- unsubscribe_from_all_events();
+ unsubscribe_from_all_hmi_events();
}
}
@@ -304,7 +305,7 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) {
if (0 == apps_.size()) {
LOG4CXX_DEBUG(logger_,
"HMILanguageHandler unsubscribed from all events.");
- unsubscribe_from_all_events();
+ unsubscribe_from_all_hmi_events();
}
}
SendOnLanguageChangeToMobile(app.first);
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 7be9668543..77880eddc0 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -32,9 +32,9 @@
*/
#include "application_manager/hmi_state.h"
-#include <ostream>
#include <boost/assign.hpp>
#include <boost/bimap.hpp>
+#include <ostream>
#include "application_manager/application_manager.h"
#include "utils/helpers.h"
@@ -45,7 +45,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState")
HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
- : app_(app)
+ : hmi_app_id_(app->hmi_app_id())
, state_id_(state_id)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
@@ -57,7 +57,7 @@ HmiState::HmiState(std::shared_ptr<Application> app,
HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : app_(app)
+ : hmi_app_id_(app->hmi_app_id())
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
@@ -73,19 +73,27 @@ void HmiState::set_parent(HmiStatePtr parent) {
}
bool HmiState::is_navi_app() const {
- return app_->is_navi();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_navi() : false;
}
bool HmiState::is_media_app() const {
- return app_->is_media_application();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_media_application() : false;
}
bool HmiState::is_voice_communication_app() const {
- return app_->is_voice_communication_supported();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->is_voice_communication_supported() : false;
}
bool HmiState::is_mobile_projection_app() const {
- return app_->mobile_projection_enabled();
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ return app ? app->mobile_projection_enabled() : false;
}
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
@@ -123,7 +131,9 @@ VideoStreamingHmiState::VideoStreamingHmiState(
mobile_apis::VideoStreamingState::eType
VideoStreamingHmiState::video_streaming_state() const {
- if (app_->IsVideoApplication()) {
+ const ApplicationSharedPtr app =
+ app_mngr_.application_by_hmi_app(hmi_app_id_);
+ if (app && app->IsVideoApplication()) {
return parent()->video_streaming_state();
}
@@ -201,7 +211,7 @@ AudioSource::AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE)
, keep_context_(app->keep_context()) {
- app_->set_keep_context(false);
+ app->set_keep_context(false);
}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
@@ -260,7 +270,15 @@ std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) {
}
std::ostream& operator<<(std::ostream& os, const HmiState& src) {
- os << "HMIState(app id:" << src.app_->app_id() << ", state:" << src.state_id()
+ const ApplicationSharedPtr app =
+ src.app_mngr_.application_by_hmi_app(src.hmi_app_id_);
+ os << "HMIState(app id:";
+ if (app) {
+ os << app->app_id();
+ } else {
+ os << "(none)";
+ }
+ os << ", hmi app id:" << src.hmi_app_id_ << ", state:" << src.state_id()
<< ", hmi_level:" << src.hmi_level()
<< ", audio:" << src.audio_streaming_state()
<< ", video:" << src.video_streaming_state()
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index 332d68adbf..2ec5891ae3 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -36,7 +36,7 @@ namespace {
bool BinaryDataPredicate(uint8_t i, uint8_t j) {
return (i == j);
}
-}
+} // namespace
namespace application_manager {
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 e99db3bece..8dc57b96b0 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -39,13 +39,13 @@
#include <inttypes.h>
#undef __STDC_FORMAT_MACROS
-#include <set>
-#include <string>
#include <strings.h>
#include <algorithm>
-#include <utility>
-#include <map>
#include <functional>
+#include <map>
+#include <set>
+#include <string>
+#include <utility>
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
@@ -55,18 +55,18 @@
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/rpc_service.h"
#include "connection_handler/connection_handler_impl.h"
-#include "transport_manager/common.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/enum_schema_item.h"
+#include "transport_manager/common.h"
#include "utils/file_system.h"
-#include "utils/macro.h"
#include "utils/logger.h"
+#include "utils/macro.h"
-#include "formatters/formatter_json_rpc.h"
-#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonBase.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/formatter_json_rpc.h"
#include "json/json.h"
-#include "formatters/CFormatterJsonBase.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -162,69 +162,81 @@ struct ExternalConsentStatusAppender
} // namespace
-std::pair<std::string,
- mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = {
- std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
- std::make_pair(strings::speed,
- mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
- std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
- std::make_pair(strings::fuel_level,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
- std::make_pair(strings::fuel_level_state,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
- std::make_pair(strings::instant_fuel_consumption,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
- std::make_pair(strings::fuel_range,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
- std::make_pair(strings::external_temp,
- mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
- std::make_pair(strings::turn_signal,
- mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL),
- std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
- std::make_pair(strings::prndl,
- mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
- std::make_pair(strings::tire_pressure,
- mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
- std::make_pair(strings::odometer,
- mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
- std::make_pair(strings::belt_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
- std::make_pair(
- strings::electronic_park_brake_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_ELECTRONICPARKBRAKESTATUS),
- std::make_pair(strings::body_information,
- mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
- std::make_pair(strings::device_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
- std::make_pair(strings::driver_braking,
- mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
- std::make_pair(strings::wiper_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
- std::make_pair(strings::head_lamp_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
- std::make_pair(strings::e_call_info,
- mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
- std::make_pair(strings::airbag_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
- std::make_pair(strings::emergency_event,
- mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
- std::make_pair(strings::cluster_mode_status,
- mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
- std::make_pair(strings::my_key,
- mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
- /*
- NOT DEFINED in mobile API
- std::make_pair(strings::gps,
- BATTVOLTAGE),
- */
- std::make_pair(strings::engine_torque,
- mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
- std::make_pair(strings::acc_pedal_pos,
- mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
- std::make_pair(strings::steering_wheel_angle,
- mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
- std::make_pair(strings::engine_oil_life,
- mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
+std::pair<std::string, mobile_apis::VehicleDataType::eType>
+ kVehicleDataInitializer[] = {
+ std::make_pair(strings::gps,
+ mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
+ std::make_pair(strings::speed,
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
+ std::make_pair(strings::rpm,
+ mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
+ std::make_pair(strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
+ std::make_pair(
+ strings::fuel_level_state,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
+ std::make_pair(
+ strings::instant_fuel_consumption,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
+ std::make_pair(strings::fuel_range,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
+ std::make_pair(
+ strings::cloud_app_vehicle_id,
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLOUDAPPVEHICLEID),
+ std::make_pair(strings::external_temp,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
+ std::make_pair(strings::turn_signal,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL),
+ std::make_pair(strings::vin,
+ mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
+ std::make_pair(strings::prndl,
+ mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
+ std::make_pair(strings::tire_pressure,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
+ std::make_pair(strings::odometer,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
+ std::make_pair(strings::belt_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(strings::electronic_park_brake_status,
+ mobile_apis::VehicleDataType::
+ VEHICLEDATA_ELECTRONICPARKBRAKESTATUS),
+ std::make_pair(strings::body_information,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
+ std::make_pair(strings::device_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
+ std::make_pair(strings::driver_braking,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
+ std::make_pair(strings::wiper_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
+ std::make_pair(
+ strings::head_lamp_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
+ std::make_pair(strings::airbag_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
+ std::make_pair(
+ strings::emergency_event,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
+ std::make_pair(
+ strings::cluster_mode_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
+ std::make_pair(strings::my_key,
+ mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
+ /*
+ NOT DEFINED in mobile API
+ std::make_pair(strings::gps,
+ BATTVOLTAGE),
+ */
+ std::make_pair(strings::engine_torque,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
+ std::make_pair(strings::steering_wheel_angle,
+ mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
+ std::make_pair(
+ strings::engine_oil_life,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
@@ -288,6 +300,17 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
return hmi_apis::Common_Language::INVALID_ENUM;
}
+hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString(
+ const std::string& lightName) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+ hmi_apis::Common_LightName::eType value;
+ if (EnumConversionHelper<hmi_apis::Common_LightName::eType>::StringToEnum(
+ lightName, &value)) {
+ return value;
+ }
+ return hmi_apis::Common_LightName::INVALID_ENUM;
+}
+
std::string MessageHelper::GetDeviceMacAddressForHandle(
const transport_manager::DeviceHandle device_handle,
const ApplicationManager& app_mngr) {
@@ -325,6 +348,51 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
return message;
}
+void MessageHelper::BroadcastCapabilityUpdate(
+ smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject message(smart_objects::SmartType_Map);
+
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ message[strings::msg_params] = msg_params;
+
+ // Construct and send mobile notification
+ message[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemCapabilityUpdatedID;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>(message);
+ app_mngr.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::CommandSource::SOURCE_SDL);
+
+ // Construct and send HMI notification
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated;
+ smart_objects::SmartObjectSPtr hmi_notification =
+ std::make_shared<smart_objects::SmartObject>(message);
+ app_mngr.GetRPCService().ManageHMICommand(hmi_notification);
+}
+
+smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
+ std::vector<smart_objects::SmartObject>& all_services) {
+ smart_objects::SmartObject app_service_capabilities(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject app_services(smart_objects::SmartType_Array);
+
+ std::vector<smart_objects::SmartObject> service_records = all_services;
+
+ int i = 0;
+ for (auto& record : service_records) {
+ smart_objects::SmartObject app_service_capability(
+ smart_objects::SmartType_Map);
+ app_service_capability[strings::updated_app_service_record] = record;
+ app_services[i] = app_service_capability;
+ i++;
+ }
+
+ app_service_capabilities[strings::app_services] = app_services;
+ return app_service_capabilities;
+}
+
smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1072,12 +1140,11 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
auto& help_prompt_manager =
const_cast<Application*>(app.get())->help_prompt_manager();
- const bool can_send_ui = helpers::Compare<HelpPromptManager::SendingType,
- helpers::EQ,
- helpers::ONE>(
- help_prompt_manager.GetSendingType(),
- HelpPromptManager::SendingType::kSendVRHelp,
- HelpPromptManager::SendingType::kSendBoth);
+ const bool can_send_ui = helpers::
+ Compare<HelpPromptManager::SendingType, helpers::EQ, helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendVRHelp,
+ HelpPromptManager::SendingType::kSendBoth);
// UI global properties
@@ -1115,12 +1182,11 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
requests.push_back(ui_global_properties);
}
- const bool can_send_vr = helpers::Compare<HelpPromptManager::SendingType,
- helpers::EQ,
- helpers::ONE>(
- help_prompt_manager.GetSendingType(),
- HelpPromptManager::SendingType::kSendHelpPrompt,
- HelpPromptManager::SendingType::kSendBoth);
+ const bool can_send_vr = helpers::
+ Compare<HelpPromptManager::SendingType, helpers::EQ, helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendHelpPrompt,
+ HelpPromptManager::SendingType::kSendBoth);
// TTS global properties
if (can_send_vr && (app->help_prompt() || app->timeout_prompt())) {
@@ -1540,15 +1606,20 @@ bool MessageHelper::CreateHMIApplicationStruct(
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
message[strings::app_name] = app->name();
message[strings::app_id] = app->hmi_app_id();
+
+ const std::string policy_app_id = app->policy_app_id();
+ message[hmi_response::policy_app_id] = policy_app_id;
+
const std::string icon_path = app->app_icon_path();
- if (!icon_path.empty()) {
+
+ if (file_system::FileExists(app->app_icon_path())) {
message[strings::icon] = icon_path;
}
if (app->IsRegistered()) {
message[strings::hmi_display_language_desired] = app->ui_language();
message[strings::is_media_application] = app->is_media_application();
} else {
- message[strings::greyOut] = app->is_greyed_out();
+ message[strings::grey_out] = app->is_greyed_out();
}
if (app->tts_name() && !app->tts_name()->empty()) {
message[json::ttsName] = *(app->tts_name());
@@ -1564,6 +1635,46 @@ bool MessageHelper::CreateHMIApplicationStruct(
message[strings::app_type] = *app_types;
}
+ const policy::RequestType::State app_request_types_state =
+ policy_handler.GetAppRequestTypeState(policy_app_id);
+ if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
+ const auto request_types = policy_handler.GetAppRequestTypes(policy_app_id);
+ message[strings::request_type] =
+ SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject& request_types_array =
+ message[strings::request_type];
+
+ size_t index = 0;
+ for (auto it : request_types) {
+ request_types_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestType::State::EMPTY == app_request_types_state) {
+ message[strings::request_type] =
+ SmartObject(smart_objects::SmartType_Array);
+ }
+
+ const policy::RequestSubType::State app_request_subtypes_state =
+ policy_handler.GetAppRequestSubTypeState(policy_app_id);
+ if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) {
+ const auto request_subtypes =
+ policy_handler.GetAppRequestSubTypes(policy_app_id);
+ message[strings::request_subtype] =
+ SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject& request_subtypes_array =
+ message[strings::request_subtype];
+
+ size_t index = 0;
+ for (auto it : request_subtypes) {
+ request_subtypes_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestSubType::State::EMPTY ==
+ app_request_subtypes_state) {
+ message[strings::request_subtype] =
+ SmartObject(smart_objects::SmartType_Array);
+ }
+
if (day_color_scheme) {
message[strings::day_color_scheme] = *day_color_scheme;
}
@@ -1590,6 +1701,12 @@ bool MessageHelper::CreateHMIApplicationStruct(
&secondary_device_info);
}
+ message[strings::is_cloud_application] = app->is_cloud_app();
+ if (app->is_cloud_app()) {
+ message[strings::cloud_connection_status] =
+ app_mngr.GetCloudAppConnectionStatus(app);
+ }
+
return true;
}
@@ -1672,12 +1789,16 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+ if (hmi_apis::Common_HMILevel::NONE == level) {
+ LOG4CXX_WARN(logger_,
+ "BC.ActivateApp cannot be used to deactivate an application");
+ return NULL;
+ }
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
@@ -1714,6 +1835,23 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
return message;
}
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+
+ const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_CloseApplication;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::msg_params][strings::app_id] = app->app_id();
+
+ return message;
+}
+
void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id);
@@ -2821,7 +2959,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
}
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
(!VerifyString(
- request_soft_buttons[i][strings::text].asString()))) {
+ request_soft_buttons[i][strings::text].asString()))) {
return Result::INVALID_DATA;
}
break;
@@ -2830,7 +2968,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
((request_soft_buttons[i][strings::text].length()) &&
(!VerifyString(
- request_soft_buttons[i][strings::text].asString())))) {
+ request_soft_buttons[i][strings::text].asString())))) {
return Result::INVALID_DATA;
}
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 1ee368a212..4c4cb251fc 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -32,12 +32,12 @@
#include <string.h>
-#include "utils/macro.h"
#include "application_manager/mobile_message_handler.h"
-#include "protocol_handler/protocol_payload.h"
#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/protocol_payload.h"
#include "utils/bitstream.h"
#include "utils/logger.h"
+#include "utils/macro.h"
#include <stdint.h>
#include <memory>
@@ -48,7 +48,7 @@ const uint8_t kRequest = 0x0;
const uint8_t kResponse = 0x1;
const uint8_t kNotification = 0x2;
const uint8_t kUnknown = 0xF;
-}
+} // namespace
namespace application_manager {
using protocol_handler::Extract;
@@ -58,7 +58,7 @@ typedef std::map<MessageType, std::string> MessageTypeMap;
MessageTypeMap message_types = {std::make_pair(kRequest, "Request"),
std::make_pair(kResponse, "Response"),
std::make_pair(kNotification, "Notification")};
-}
+} // namespace
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
application_manager::Message*
diff --git a/src/components/application_manager/src/plugin_manager/plugin_keys.cc b/src/components/application_manager/src/plugin_manager/plugin_keys.cc
new file mode 100644
index 0000000000..80be2d1389
--- /dev/null
+++ b/src/components/application_manager/src/plugin_manager/plugin_keys.cc
@@ -0,0 +1,14 @@
+#include "application_manager/plugin_manager/plugin_keys.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+namespace plugin_names {
+const char* vehicle_info_rpc_plugin = "Vehicle Info RPC Plugin";
+const char* app_service_rpc_plugin = "App Service RPC Plugin";
+const char* rc_rpc_plugin = "RC RPC Plugin";
+const char* sdl_rpc_plugin = "SDL RPC Plugin";
+} // namespace plugin_names
+
+} // namespace plugin_manager
+} // namespace application_manager \ No newline at end of file
diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
index 712b91afe7..ad313c638f 100644
--- a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
+++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
@@ -37,9 +37,9 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
void* plugin_dll = dlopen(full_plugin_path.c_str(), RTLD_LAZY);
if (nullptr == plugin_dll) {
- LOG4CXX_ERROR(logger_,
- "Failed to open dll " << full_plugin_path << " : "
- << dlerror());
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to open dll " << full_plugin_path << " : " << dlerror());
return RPCPluginPtr();
}
@@ -54,7 +54,6 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
return RPCPluginPtr();
}
RPCPlugin* plugin = create_plugin();
- dlclose(plugin_dll);
return RPCPluginPtr(plugin);
}
@@ -67,9 +66,9 @@ uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) {
if (!plugin) {
continue;
}
- LOG4CXX_DEBUG(logger_,
- "Loaded " << plugin->PluginName() << " plugin from "
- << full_name);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Loaded " << plugin->PluginName() << " plugin from " << full_name);
if (plugin->Init(
app_manager_, rpc_service_, hmi_capabilities_, policy_handler_)) {
loaded_plugins_.push_back(std::move(plugin));
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 f397814005..afe909fee4 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -31,10 +31,10 @@
*/
#include "application_manager/policies/policy_event_observer.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/policies/policy_handler.h"
-#include "utils/date_time.h"
+#include "application_manager/smart_object_keys.h"
#include "smart_objects/smart_object.h"
+#include "utils/date_time.h"
namespace policy {
using namespace application_manager;
@@ -55,6 +55,8 @@ void PolicyEventObserver::set_policy_handler(
policy_handler_ = policy_handler;
}
+void PolicyEventObserver::on_event(const event_engine::MobileEvent& event) {}
+
void PolicyEventObserver::on_event(const event_engine::Event& event) {
sync_primitives::AutoLock auto_lock(policy_handler_lock_);
if (!policy_handler_) {
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 1b64c5d7b4..bee88633c1 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -30,33 +30,34 @@
POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/policies/policy_handler.h"
-#include <unistd.h>
#include <dlfcn.h>
+#include <unistd.h>
#include <algorithm>
-#include <vector>
#include <functional>
#include <utility>
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/policies/delegates/app_permission_delegate.h"
-#include "policy/status.h"
+#include <vector>
#include "application_manager/application_manager.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/delegates/app_permission_delegate.h"
#include "application_manager/rpc_service.h"
-#include "policy/policy_manager_impl.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/usage_statistics.h"
#include "connection_handler/connection_handler.h"
-#include "utils/macro.h"
-#include "utils/date_time.h"
+#include "interfaces/MOBILE_API.h"
#include "json/value.h"
#include "json/writer.h"
-#include "application_manager/usage_statistics.h"
+#include "policy/policy_manager_impl.h"
#include "policy/policy_types.h"
-#include "interfaces/MOBILE_API.h"
+#include "policy/status.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/date_time.h"
#include "utils/file_system.h"
+#include "utils/macro.h"
#include "utils/scope_guard.h"
-#include "utils/helpers.h"
#include "policy/policy_manager.h"
+#include "utils/helpers.h"
namespace policy {
@@ -90,7 +91,8 @@ RequestTypeMap TypeToString = {
{mobile_apis::RequestType::EMERGENCY, "EMERGENCY"},
{mobile_apis::RequestType::MEDIA, "MEDIA"},
{mobile_apis::RequestType::FOTA, "FOTA"},
- {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"}};
+ {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"},
+ {mobile_apis::RequestType::ICON_URL, "ICON_URL"}};
const std::string RequestTypeToString(mobile_apis::RequestType::eType type) {
RequestTypeMap::const_iterator it = TypeToString.find(type);
@@ -105,13 +107,12 @@ const policy::DeviceParams GetDeviceParams(
const protocol_handler::SessionObserver& session_observer) {
CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler");
policy::DeviceParams device_params;
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- device_handle,
- &device_params.device_name,
- NULL,
- &device_params.device_mac_address,
- &device_params.device_connection_type)) {
+ if (-1 == session_observer.GetDataOnDeviceID(
+ device_handle,
+ &device_params.device_name,
+ NULL,
+ &device_params.device_mac_address,
+ &device_params.device_connection_type)) {
LOG4CXX_ERROR(logger_,
"Failed to extract information for device " << device_handle);
}
@@ -176,41 +177,6 @@ struct DeactivateApplication {
StateController& state_ctrl_;
};
-struct SDLAllowedNotification {
- SDLAllowedNotification(const connection_handler::DeviceHandle& device_id,
- PolicyManager* policy_manager,
- StateController& state_controller)
- : device_id_(device_id)
- , policy_manager_(policy_manager)
- , state_controller_(state_controller) {}
-
- void operator()(const ApplicationSharedPtr& app) {
- DCHECK_OR_RETURN_VOID(policy_manager_);
- if (device_id_ == app->device()) {
- std::string hmi_level = "NONE";
- mobile_apis::HMILevel::eType default_mobile_hmi;
- policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
- if ("BACKGROUND" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
- } else if ("FULL" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
- } else if ("LIMITED" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
- } else if ("NONE" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
- } else {
- return;
- }
- state_controller_.SetRegularState(app, default_mobile_hmi, true);
- }
- }
-
- private:
- connection_handler::DeviceHandle device_id_;
- PolicyManager* policy_manager_;
- StateController& state_controller_;
-};
-
/**
* @brief Gets from system list of currently registered applications and
* create collection of links device-to-application
@@ -514,9 +480,9 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
void PolicyHandler::SendOnAppPermissionsChanged(
const AppPermissions& permissions, const std::string& policy_app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "PolicyHandler::SendOnAppPermissionsChanged for "
- << policy_app_id);
+ LOG4CXX_DEBUG(
+ logger_,
+ "PolicyHandler::SendOnAppPermissionsChanged for " << policy_app_id);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
if (app.use_count() == 0) {
@@ -810,9 +776,9 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate(
LOG4CXX_AUTO_TRACE(logger_);
if (!value->IsRegistered()) {
- LOG4CXX_DEBUG(logger_,
- "Application " << value->app_id()
- << " is not marked as registered.");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Application " << value->app_id() << " is not marked as registered.");
return false;
}
@@ -825,9 +791,9 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate(
value->device(),
application_manager_.connection_handler().get_session_observer());
- const bool is_device_allowed = (kDeviceAllowed ==
- policy_manager_->GetUserConsentForDevice(
- device_params.device_mac_address));
+ const bool is_device_allowed =
+ (kDeviceAllowed == policy_manager_->GetUserConsentForDevice(
+ device_params.device_mac_address));
LOG4CXX_DEBUG(logger_,
"Is device " << device_params.device_mac_address << " allowed "
@@ -934,9 +900,9 @@ void PolicyHandler::OnVehicleDataUpdated(
POLICY_LIB_CHECK_VOID();
#ifdef EXTERNAL_PROPRIETARY_MODE
if (!message.keyExists(strings::msg_params)) {
- LOG4CXX_ERROR(logger_,
- "Message does not contains mandatory section "
- << strings::msg_params);
+ LOG4CXX_ERROR(
+ logger_,
+ "Message does not contains mandatory section " << strings::msg_params);
return;
}
if (message[strings::msg_params].keyExists(strings::vin)) {
@@ -952,9 +918,9 @@ void PolicyHandler::OnVehicleDataUpdated(
void PolicyHandler::OnPendingPermissionChange(
const std::string& policy_app_id) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "PolicyHandler::OnPendingPermissionChange for "
- << policy_app_id);
+ LOG4CXX_DEBUG(
+ logger_,
+ "PolicyHandler::OnPendingPermissionChange for " << policy_app_id);
POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
@@ -1049,14 +1015,17 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
if (mobile_app_id.empty()) {
LOG4CXX_WARN(logger_,
"Application with connection key '"
- << app_id << "'"
- " has no application id.");
+ << app_id
+ << "'"
+ " has no application id.");
return false;
}
LOG4CXX_DEBUG(logger_,
- "Update url is " << url << " for application "
- "with connection key " << app_id);
+ "Update url is " << url
+ << " for application "
+ "with connection key "
+ << app_id);
MessageHelper::SendPolicySnapshotNotification(
app_id, pt_string, url, application_manager_);
@@ -1171,9 +1140,9 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
policy_manager_->SetUserConsentForDevice(device_id, is_allowed);
connection_handler::DeviceHandle device_handle = 0;
if (!connection_handler.GetDeviceID(device_id, &device_handle)) {
- LOG4CXX_WARN(logger_,
- "Device handle with mac " << device_id
- << " wasn't found.");
+ LOG4CXX_WARN(
+ logger_,
+ "Device handle with mac " << device_id << " wasn't found.");
}
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -1371,9 +1340,9 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
MessageHelper::StringToHMILevel(default_hmi);
if (mobile_apis::HMILevel::INVALID_ENUM == hmi_level) {
- LOG4CXX_WARN(logger_,
- "Couldn't convert default hmi level " << default_hmi
- << " to enum.");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't convert default hmi level " << default_hmi << " to enum.");
return;
}
if (current_hmi_level == hmi_level) {
@@ -1575,6 +1544,11 @@ std::string PolicyHandler::GetLockScreenIconUrl() const {
return policy_manager_->GetLockScreenIconUrl();
}
+std::string PolicyHandler::GetIconUrl(const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(std::string(""));
+ return policy_manager_->GetIconUrl(policy_app_id);
+}
+
uint32_t PolicyHandler::NextRetryTimeout() {
POLICY_LIB_CHECK(0);
LOG4CXX_AUTO_TRACE(logger_);
@@ -1696,9 +1670,9 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
const bool is_written = file_system::Write(
file_name,
std::vector<uint8_t>(certificate_data.begin(), certificate_data.end()));
- LOG4CXX_DEBUG(logger_,
- "Saving encrypted certificate data: \"" << certificate_data
- << '"');
+ LOG4CXX_DEBUG(
+ logger_,
+ "Saving encrypted certificate data: \"" << certificate_data << '"');
if (!is_written) {
LOG4CXX_ERROR(logger_,
"Unable to save encrypted certificate to file " << file_name);
@@ -1745,9 +1719,9 @@ void PolicyHandler::OnCertificateDecrypted(bool is_succeeded) {
"Unable to read certificate from file " << file_name);
return;
}
- LOG4CXX_DEBUG(logger_,
- "Loaded decrypted certificate data: \"" << certificate_data
- << '"');
+ LOG4CXX_DEBUG(
+ logger_,
+ "Loaded decrypted certificate data: \"" << certificate_data << '"');
policy_manager_->SetDecryptedCertificate(certificate_data);
@@ -1770,6 +1744,17 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
}
#endif // EXTERNAL_PROPRIETARY_MODE
+void PolicyHandler::OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(listeners_lock_);
+ HandlersCollection::const_iterator it = listeners_.begin();
+ for (; it != listeners_.end(); ++it) {
+ PolicyHandlerObserver* observer = *it;
+ observer->OnAuthTokenUpdated(policy_app_id, auth_token);
+ }
+}
+
void PolicyHandler::OnPTUFinished(const bool ptu_result) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(listeners_lock_);
@@ -1845,6 +1830,205 @@ bool PolicyHandler::CheckSystemAction(
return false;
}
+void PolicyHandler::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->GetEnabledCloudApps(enabled_apps);
+}
+
+bool PolicyHandler::GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+}
+
+const bool PolicyHandler::CheckCloudAppEnabled(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(false);
+ bool enabled = false;
+ std::string endpoint;
+ std::string auth_token;
+ std::string certificate;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference;
+ policy_manager_->GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+ return enabled;
+}
+
+void PolicyHandler::OnSetCloudAppProperties(
+ const smart_objects::SmartObject& message) {
+ POLICY_LIB_CHECK_VOID();
+ if (!message.keyExists(strings::msg_params)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Message does not contain mandatory section " << strings::msg_params);
+ return;
+ }
+ if (!message[strings::msg_params].keyExists(strings::properties)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Message does not contain app properties " << strings::msg_params);
+ return;
+ }
+
+ const smart_objects::SmartObject& properties =
+ message[strings::msg_params][strings::properties];
+ if (!properties.keyExists(strings::app_id)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Message does not contain mandatory parameter " << strings::app_id);
+ return;
+ }
+ std::string policy_app_id(properties[strings::app_id].asString());
+
+ policy_manager_->InitCloudApp(policy_app_id);
+
+ bool auth_token_update = false;
+ if (properties.keyExists(strings::enabled)) {
+ bool enabled = properties[strings::enabled].asBool();
+ policy_manager_->SetCloudAppEnabled(policy_app_id, enabled);
+ auth_token_update = enabled;
+ application_manager_.RefreshCloudAppInformation();
+ }
+ if (properties.keyExists(strings::auth_token)) {
+ std::string auth_token = properties[strings::auth_token].asString();
+ policy_manager_->SetAppAuthToken(policy_app_id, auth_token);
+ auth_token_update = true;
+ }
+ if (properties.keyExists(strings::cloud_transport_type)) {
+ policy_manager_->SetAppCloudTransportType(
+ policy_app_id, properties[strings::cloud_transport_type].asString());
+ }
+ if (properties.keyExists(strings::endpoint)) {
+ policy_manager_->SetAppEndpoint(policy_app_id,
+ properties[strings::endpoint].asString());
+ }
+ if (properties.keyExists(strings::nicknames)) {
+ StringArray nicknames;
+ const smart_objects::SmartObject& nicknames_array =
+ properties[strings::nicknames];
+ for (size_t i = 0; i < nicknames_array.length(); ++i) {
+ nicknames.push_back(nicknames_array[i].asString());
+ }
+ policy_manager_->SetAppNicknames(policy_app_id, nicknames);
+ }
+ if (properties.keyExists(strings::hybrid_app_preference)) {
+ std::string hybrid_app_preference;
+
+ mobile_apis::HybridAppPreference::eType value =
+ static_cast<mobile_apis::HybridAppPreference::eType>(
+ properties[strings::hybrid_app_preference].asUInt());
+ smart_objects::EnumConversionHelper<
+ mobile_apis::HybridAppPreference::eType>::
+ EnumToString(value, &hybrid_app_preference);
+ policy_manager_->SetHybridAppPreference(policy_app_id,
+ hybrid_app_preference);
+ }
+
+ if (auth_token_update) {
+ bool enabled;
+ std::string end, cert, ctt, hap;
+ std::string auth_token;
+
+ policy_manager_->GetCloudAppParameters(
+ policy_app_id, enabled, end, cert, auth_token, ctt, hap);
+ OnAuthTokenUpdated(policy_app_id, auth_token);
+ }
+}
+
+void PolicyHandler::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->GetAppServiceParameters(policy_app_id,
+ app_service_parameters);
+}
+
+bool PolicyHandler::CheckAppServiceParameters(
+ const std::string& policy_app_id,
+ const std::string& requested_service_name,
+ const std::string& requested_service_type,
+ smart_objects::SmartArray* requested_handled_rpcs) const {
+ std::string service_name = std::string();
+ std::string service_type = std::string();
+ std::vector<int32_t> handled_rpcs = {};
+
+ policy_table::AppServiceParameters app_service_parameters =
+ policy_table::AppServiceParameters();
+ this->GetAppServiceParameters(policy_app_id, &app_service_parameters);
+
+ if (app_service_parameters.find(requested_service_type) ==
+ app_service_parameters.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Disallowed service type: " << requested_service_type);
+ return false;
+ }
+
+ auto service_names =
+ *(app_service_parameters[requested_service_type].service_names);
+ if (!service_names.is_initialized()) {
+ LOG4CXX_DEBUG(logger_,
+ "Pt Service Name is Null, All service names accepted");
+ } else if (!requested_service_name.empty()) {
+ auto find_name_result =
+ std::find(service_names.begin(),
+ service_names.end(),
+ rpc::String<0, 255>(requested_service_name));
+ if (find_name_result == service_names.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Disallowed service name: " << requested_service_name);
+ return false;
+ }
+ }
+
+ if (requested_handled_rpcs) {
+ auto temp_rpcs =
+ app_service_parameters[requested_service_type].handled_rpcs;
+ for (auto handled_it = temp_rpcs.begin(); handled_it != temp_rpcs.end();
+ ++handled_it) {
+ handled_rpcs.push_back(handled_it->function_id);
+ }
+
+ for (auto requested_it = requested_handled_rpcs->begin();
+ requested_it != requested_handled_rpcs->end();
+ ++requested_it) {
+ auto find_result = std::find(
+ handled_rpcs.begin(), handled_rpcs.end(), requested_it->asInt());
+ if (find_result == handled_rpcs.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Disallowed by handled rpc: " << requested_it->asInt());
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool PolicyHandler::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->UnknownRPCPassthroughAllowed(policy_app_id);
+}
+
uint32_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const {
POLICY_LIB_CHECK(0);
return policy_manager_->HeartBeatTimeout(app_id);
@@ -2071,17 +2255,17 @@ void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id,
ApplicationSharedPtr app =
application_manager_.application(device_id, policy_app_id);
if (!app) {
- LOG4CXX_WARN(logger_,
- "Could not find application: " << device_id << " - "
- << policy_app_id);
+ LOG4CXX_WARN(
+ logger_,
+ "Could not find application: " << device_id << " - " << policy_app_id);
return;
}
mobile_apis::HMILevel::eType level =
MessageHelper::StringToHMILevel(hmi_level);
if (mobile_apis::HMILevel::INVALID_ENUM == level) {
- LOG4CXX_WARN(logger_,
- "Couldn't convert default hmi level " << hmi_level
- << " to enum.");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't convert default hmi level " << hmi_level << " to enum.");
return;
}
@@ -2144,17 +2328,17 @@ void PolicyHandler::OnUpdateHMILevel(const std::string& device_id,
ApplicationSharedPtr app =
application_manager_.application(device_id, policy_app_id);
if (!app) {
- LOG4CXX_WARN(logger_,
- "Could not find application: " << device_id << " - "
- << policy_app_id);
+ LOG4CXX_WARN(
+ logger_,
+ "Could not find application: " << device_id << " - " << policy_app_id);
return;
}
mobile_apis::HMILevel::eType level =
MessageHelper::StringToHMILevel(hmi_level);
if (mobile_apis::HMILevel::INVALID_ENUM == level) {
- LOG4CXX_WARN(logger_,
- "Couldn't convert default hmi level " << hmi_level
- << " to enum.");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't convert default hmi level " << hmi_level << " to enum.");
return;
}
UpdateHMILevel(app, level);
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 315cf6fdf8..93c45ed5dc 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -32,9 +32,9 @@
#include "utils/logger.h"
-#include "application_manager/request_controller.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/request_controller.h"
#include "utils/timer_task_impl.h"
diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc
index c047c82579..052667dc3f 100644
--- a/src/components/application_manager/src/request_tracker.cc
+++ b/src/components/application_manager/src/request_tracker.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/logger.h"
-#include "utils/macro.h"
#include "application_manager/request_tracker.h"
#include "application_manager/message_helper.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
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 3e77078ee5..fff1aefed3 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -31,23 +31,23 @@
*/
#include "application_manager/resumption/resume_ctrl_impl.h"
-#include <fstream>
#include <algorithm>
+#include <fstream>
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
-#include "utils/file_system.h"
-#include "connection_handler/connection_handler_impl.h"
-#include "application_manager/message_helper.h"
-#include "connection_handler/connection.h"
#include "application_manager/commands/command_impl.h"
-#include "policy/policy_manager_impl.h"
+#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/state_controller.h"
-#include "utils/helpers.h"
#include "application_manager/resumption/resumption_data_db.h"
#include "application_manager/resumption/resumption_data_json.h"
+#include "application_manager/state_controller.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "policy/policy_manager_impl.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "utils/timer_task_impl.h"
@@ -152,9 +152,9 @@ void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
return;
}
- LOG4CXX_DEBUG(logger_,
- "application with appID " << application->app_id()
- << " will be saved");
+ LOG4CXX_DEBUG(
+ logger_,
+ "application with appID " << application->app_id() << " will be saved");
resumption_storage_->SaveApplication(application);
}
@@ -399,7 +399,13 @@ bool ResumeCtrlImpl::StartResumption(ApplicationSharedPtr application,
<< " hmi_app_id = " << application->hmi_app_id()
<< " policy_id = " << application->policy_app_id()
<< " received hash = " << hash);
- SetupDefaultHMILevel(application);
+ if (!application->is_cloud_app()) {
+ // Default HMI Level is already set before resumption in
+ // ApplicationManager::OnApplicationRegistered, and handling low bandwidth
+ // transports doesn't apply to cloud apps, so this step can be skipped for
+ // such apps
+ SetupDefaultHMILevel(application);
+ }
smart_objects::SmartObject saved_app;
const std::string& device_mac = application->mac_address();
bool result = resumption_storage_->GetSavedApplication(
@@ -426,7 +432,13 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
<< application->app_id() << "with hmi_app_id "
<< application->hmi_app_id() << ", policy_app_id "
<< application->policy_app_id());
- SetupDefaultHMILevel(application);
+ if (!application->is_cloud_app()) {
+ // Default HMI Level is already set before resumption in
+ // ApplicationManager::OnApplicationRegistered, and handling low bandwidth
+ // transports doesn't apply to cloud apps, so this step can be skipped for
+ // such apps
+ SetupDefaultHMILevel(application);
+ }
const std::string& device_mac = application->mac_address();
smart_objects::SmartObject saved_app;
bool result = resumption_storage_->GetSavedApplication(
@@ -503,9 +515,9 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
}
RemoveApplicationFromSaved(application);
} else {
- LOG4CXX_INFO(logger_,
- "Do not need to resume application "
- << application->policy_app_id());
+ LOG4CXX_INFO(
+ logger_,
+ "Do not need to resume application " << application->policy_app_id());
}
}
@@ -1023,8 +1035,9 @@ void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
}
queue_lock_.Release();
LOG4CXX_DEBUG(logger_,
- "Application ID " << app_id << " have been added"
- " to resumption queue.");
+ "Application ID " << app_id
+ << " have been added"
+ " to resumption queue.");
if (run_resumption) {
LOG4CXX_DEBUG(logger_,
"Application ID " << app_id << " will be restored by timer");
@@ -1185,4 +1198,4 @@ static mobile_api::HMILevel::eType ConvertHmiLevelString(
}
}
-} // namespce resumption
+} // namespace resumption
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 856fb03750..b4d39eccc1 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -31,9 +31,9 @@
*/
#include "application_manager/resumption/resumption_data.h"
-#include "utils/logger.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/application_manager_settings.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/logger.h"
namespace resumption {
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 1591ce566a..02b7098414 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -29,18 +29,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <unistd.h>
+#include <string>
#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/message_helper.h"
#include "application_manager/resumption/resumption_data_db.h"
#include "application_manager/resumption/resumption_sql_queries.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
#include "utils/gen_hash.h"
+#include "utils/helpers.h"
#include "utils/scope_guard.h"
-#include "application_manager/application_manager_settings.h"
namespace {
const std::string kDatabaseName = "resumption";
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 c8e9032dfa..591166c687 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/application_manager_impl.h"
#include "application_manager/resumption/resumption_data_json.h"
-#include "smart_objects/smart_object.h"
-#include "json/json.h"
-#include "formatters/CFormatterJsonBase.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_settings.h"
#include "application_manager/message_helper.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/application_manager_settings.h"
+#include "formatters/CFormatterJsonBase.h"
+#include "json/json.h"
+#include "smart_objects/smart_object.h"
namespace resumption {
@@ -531,4 +531,4 @@ void ResumptionDataJson::Persist() {
last_state().SaveStateToFileSystem();
}
-} // resumption
+} // namespace resumption
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index 939b3d1ce6..3fceaf573c 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -32,12 +32,16 @@
#include "application_manager/rpc_handler_impl.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
+
namespace application_manager {
namespace rpc_handler {
CREATE_LOGGERPTR_LOCAL(logger_, "RPCHandlerImpl")
namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+namespace plugin_names = application_manager::plugin_manager::plugin_names;
RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager)
: app_manager_(app_manager)
@@ -63,17 +67,76 @@ void RPCHandlerImpl::ProcessMessageFromMobile(
#endif // TELEMETRY_MONITOR
smart_objects::SmartObjectSPtr so_from_mobile =
std::make_shared<smart_objects::SmartObject>();
-
+ bool allow_unknown_parameters = false;
DCHECK_OR_RETURN_VOID(so_from_mobile);
if (!so_from_mobile) {
LOG4CXX_ERROR(logger_, "Null pointer");
return;
}
- if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ if (message->type() == application_manager::MessageType::kRequest &&
+ message->correlation_id() < 0) {
+ LOG4CXX_ERROR(logger_, "Request correlation id < 0. Returning INVALID_ID");
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(message->connection_key(),
+ message->function_id(),
+ 0,
+ mobile_apis::Result::INVALID_ID));
+ // CreateNegativeResponse() takes a uint32_t for correlation_id, therefore a
+ // negative number cannot be passed to that function or else it will be
+ // improperly cast. correlation_id is reassigned below to its original
+ // value.
+ (*response)[strings::params][strings::correlation_id] =
+ message->correlation_id();
+ (*response)[strings::msg_params][strings::info] =
+ "Invalid Correlation ID for RPC Request";
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return;
+ }
+
+ bool rpc_passing = app_manager_.GetAppServiceManager()
+ .GetRPCPassingHandler()
+ .CanHandleFunctionID(message->function_id());
+ if (app_manager_.GetRPCService().IsAppServiceRPC(
+ message->function_id(), commands::Command::SOURCE_MOBILE) ||
+ rpc_passing) {
+ LOG4CXX_DEBUG(logger_,
+ "Allowing unknown parameters for request function "
+ << message->function_id());
+ allow_unknown_parameters = true;
+ }
+
+ if (!ConvertMessageToSO(
+ *message, *so_from_mobile, allow_unknown_parameters, !rpc_passing)) {
LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
return;
}
+
+ if (rpc_passing) {
+ uint32_t correlation_id =
+ (*so_from_mobile)[strings::params][strings::correlation_id].asUInt();
+ int32_t message_type =
+ (*so_from_mobile)[strings::params][strings::message_type].asInt();
+ RPCPassingHandler& handler =
+ app_manager_.GetAppServiceManager().GetRPCPassingHandler();
+ // Check permissions for requests, otherwise attempt passthrough
+ if ((application_manager::MessageType::kRequest != message_type ||
+ handler.IsPassthroughAllowed(*so_from_mobile)) &&
+ handler.RPCPassThrough(*so_from_mobile)) {
+ // RPC was forwarded. Skip handling by Core
+ return;
+ } else if (!handler.IsPassThroughMessage(correlation_id,
+ commands::Command::SOURCE_MOBILE,
+ message_type)) {
+ // Since PassThrough failed, refiltering the message
+ if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+ }
+ }
+
#ifdef TELEMETRY_MONITOR
metric->message = so_from_mobile;
#endif // TELEMETRY_MONITOR
@@ -95,13 +158,28 @@ void RPCHandlerImpl::ProcessMessageFromHMI(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr smart_object =
std::make_shared<smart_objects::SmartObject>();
-
+ bool allow_unknown_parameters = false;
if (!smart_object) {
LOG4CXX_ERROR(logger_, "Null pointer");
return;
}
- if (!ConvertMessageToSO(*message, *smart_object)) {
+ smart_objects::SmartObject converted_result;
+ formatters::FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(
+ message->json_message(), converted_result);
+
+ if (app_manager_.GetRPCService().IsAppServiceRPC(
+ converted_result[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt(),
+ commands::Command::SOURCE_HMI)) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Allowing unknown parameters for request function "
+ << converted_result[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ allow_unknown_parameters = true;
+ }
+
+ if (!ConvertMessageToSO(*message, *smart_object, allow_unknown_parameters)) {
if (application_manager::MessageType::kResponse ==
(*smart_object)[strings::params][strings::message_type].asInt()) {
(*smart_object).erase(strings::msg_params);
@@ -228,7 +306,9 @@ void RPCHandlerImpl::GetMessageVersion(
bool RPCHandlerImpl::ConvertMessageToSO(
const Message& message,
- ns_smart_device_link::ns_smart_objects::SmartObject& output) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ const bool allow_unknown_parameters,
+ const bool validate_params) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"\t\t\tMessage to convert: protocol "
@@ -262,13 +342,14 @@ bool RPCHandlerImpl::ConvertMessageToSO(
}
if (!conversion_result ||
- !mobile_so_factory().attachSchema(output, true, msg_version) ||
- ((output.validate(&report, msg_version) !=
- smart_objects::errors::OK))) {
+ (validate_params &&
+ !ValidateRpcSO(
+ output, msg_version, report, allow_unknown_parameters))) {
LOG4CXX_WARN(logger_,
"Failed to parse string to smart object with API version "
<< msg_version.toString() << " : "
<< message.json_message());
+
std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
message.connection_key(),
@@ -280,8 +361,10 @@ bool RPCHandlerImpl::ConvertMessageToSO(
rpc::PrettyFormat(report);
app_manager_.GetRPCService().ManageMobileCommand(
response, commands::Command::SOURCE_SDL);
+
return false;
}
+
LOG4CXX_DEBUG(logger_,
"Convertion result for sdl object is true function_id "
<< output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
@@ -330,10 +413,13 @@ bool RPCHandlerImpl::ConvertMessageToSO(
rpc::ValidationReport report("RPC");
- if (output.validate(&report) != smart_objects::errors::OK) {
- LOG4CXX_ERROR(logger_,
- "Incorrect parameter from HMI"
- << rpc::PrettyFormat(report));
+ utils::SemanticVersion empty_version;
+ if (validate_params &&
+ output.validate(&report, empty_version, allow_unknown_parameters) !=
+ smart_objects::errors::OK) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Incorrect parameter from HMI - " << rpc::PrettyFormat(report));
output.erase(strings::msg_params);
output[strings::params][hmi_response::code] =
@@ -391,6 +477,20 @@ bool RPCHandlerImpl::ConvertMessageToSO(
return true;
}
+bool RPCHandlerImpl::ValidateRpcSO(smart_objects::SmartObject& message,
+ utils::SemanticVersion& msg_version,
+ rpc::ValidationReport& report_out,
+ bool allow_unknown_parameters) {
+ if (!mobile_so_factory().attachSchema(
+ message, !allow_unknown_parameters, msg_version) ||
+ message.validate(&report_out, msg_version, allow_unknown_parameters) !=
+ smart_objects::errors::OK) {
+ LOG4CXX_WARN(logger_, "Failed to parse string to smart object");
+ return false;
+ }
+ return true;
+}
+
std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
const protocol_handler::RawMessagePtr message) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -423,5 +523,5 @@ hmi_apis::HMI_API& RPCHandlerImpl::hmi_so_factory() {
mobile_apis::MOBILE_API& RPCHandlerImpl::mobile_so_factory() {
return mobile_so_factory_;
}
-}
-}
+} // namespace rpc_handler
+} // namespace application_manager
diff --git a/src/components/application_manager/src/rpc_passing_handler.cc b/src/components/application_manager/src/rpc_passing_handler.cc
new file mode 100644
index 0000000000..feb3bccc1f
--- /dev/null
+++ b/src/components/application_manager/src/rpc_passing_handler.cc
@@ -0,0 +1,441 @@
+/*
+ * 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 "application_manager/help_prompt_manager_impl.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "application_manager/app_service_manager.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_passing_handler.h"
+#include "application_manager/smart_object_keys.h"
+#include "encryption/hashing.h"
+#include "resumption/last_state.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/logger.h"
+
+#include "smart_objects/enum_schema_item.h"
+#include "utils/timer_task_impl.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RPCPassingHandler")
+
+namespace application_manager {
+
+RPCPassingHandler::RPCPassingHandler(AppServiceManager& asm_ref,
+ ApplicationManager& am_ref)
+ : app_service_manager_(asm_ref), app_manager_(am_ref) {}
+
+RPCPassingHandler::~RPCPassingHandler() {}
+
+bool RPCPassingHandler::IsPassThroughMessage(
+ uint32_t correlation_id,
+ commands::Command::CommandSource source,
+ int32_t message_type) {
+ sync_primitives::AutoLock lock(rpc_request_queue_lock_);
+
+ if (rpc_request_queue.find(correlation_id) != rpc_request_queue.end()) {
+ if (message_type == MessageType::kResponse &&
+ source == commands::Command::CommandSource::SOURCE_SDL) {
+ // Checks if response is being sent to mobile then removes the correlation
+ // id from the map
+ rpc_request_queue.erase(correlation_id);
+ }
+ return true;
+ }
+ return false;
+}
+
+bool RPCPassingHandler::CanHandleFunctionID(int32_t function_id) {
+ auto services = app_service_manager_.GetActiveServices();
+ 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++) {
+ if (handled_rpcs[i].asInt() == function_id) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool RPCPassingHandler::ExtractRPCParams(
+ const smart_objects::SmartObject& s_map,
+ const ApplicationSharedPtr app,
+ const std::string& function_id_str) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RPCParams params;
+
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ for (auto iter = s_map.map_begin(); iter != s_map.map_end(); ++iter) {
+ LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
+ }
+ }
+
+ CommandParametersPermissions parameters_permissions;
+
+ mobile_apis::Result::eType check_result = app_manager_.CheckPolicyPermissions(
+ app, function_id_str, params, &parameters_permissions);
+
+ // Check if RPC is allowed by policy (since we are allowing unknown params,
+ // check should pass if only undefined parameters exist)
+ if (mobile_apis::Result::DISALLOWED == check_result &&
+ !parameters_permissions.undefined_params.empty() &&
+ parameters_permissions.disallowed_params.empty() &&
+ parameters_permissions.allowed_params.empty()) {
+ return true;
+ } else if (mobile_apis::Result::SUCCESS != check_result) {
+ return false;
+ }
+
+ return true;
+}
+
+bool RPCPassingHandler::IsPassthroughAllowed(
+ smart_objects::SmartObject rpc_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t connection_key =
+ rpc_message[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = app_manager_.application(connection_key);
+ if (!app) {
+ return false;
+ }
+
+ mobile_api::FunctionID::eType function_id =
+ static_cast<mobile_api::FunctionID::eType>(
+ rpc_message[strings::params][strings::function_id].asInt());
+ std::string function_id_str =
+ MessageHelper::StringifiedFunctionID(function_id);
+ PolicyHandlerInterface& policy_handler = app_manager_.GetPolicyHandler();
+
+ if (function_id_str.empty()) {
+ // Unknown RPC, just do basic revoked and user consent checks
+ std::string device_mac;
+ app_manager_.connection_handler().get_session_observer().GetDataOnDeviceID(
+ app->device(), NULL, NULL, &device_mac, NULL);
+ return policy_handler.UnknownRPCPassthroughAllowed(app->policy_app_id()) &&
+ !policy_handler.IsApplicationRevoked(app->policy_app_id()) &&
+ policy::kDeviceAllowed ==
+ app_manager_.GetUserConsentForDevice(device_mac);
+ }
+
+ return ExtractRPCParams(
+ rpc_message[strings::msg_params], app, function_id_str);
+}
+
+bool RPCPassingHandler::RPCPassThrough(smart_objects::SmartObject rpc_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t correlation_id =
+ rpc_message[strings::params][strings::correlation_id].asUInt();
+ int32_t message_type =
+ rpc_message[strings::params][strings::message_type].asInt();
+
+ LOG4CXX_DEBUG(logger_, "RPC_PASSING: ");
+ MessageHelper::PrintSmartObject(rpc_message);
+
+ // Clear timers for timed out requests
+ ClearCompletedTimers();
+ switch (message_type) {
+ case MessageType::kRequest: {
+ LOG4CXX_DEBUG(logger_, "Handle request");
+ rpc_request_queue_lock_.Acquire();
+ if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) {
+ rpc_request_queue_lock_.Release();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Correlation id DOES NOT exist in map. Constructing request queue");
+ PopulateRPCRequestQueue(rpc_message);
+ } else {
+ rpc_request_queue_lock_.Release();
+ LOG4CXX_DEBUG(logger_, "Correlation id DOES exist in map. Returning");
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ rpc_message[strings::params][strings::connection_key].asUInt(),
+ rpc_message[strings::params][strings::function_id].asInt(),
+ correlation_id,
+ mobile_apis::Result::INVALID_ID));
+
+ (*response)[strings::msg_params][strings::info] =
+ "Duplicate correlation_id";
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+
+ return true;
+ }
+
+ rpc_request_queue_lock_.Acquire();
+ if (rpc_request_queue[correlation_id].second.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "No services left in map. Using core to handle request");
+ rpc_request_queue.erase(correlation_id);
+ rpc_request_queue_lock_.Release();
+ return false;
+ } else {
+ rpc_request_queue_lock_.Release();
+ ForwardRequestToMobile(correlation_id);
+ return true;
+ }
+
+ break;
+ }
+
+ case MessageType::kResponse: {
+ LOG4CXX_DEBUG(logger_, "Handle response");
+ rpc_request_queue_lock_.Acquire();
+ if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) {
+ rpc_request_queue_lock_.Release();
+ return false;
+ }
+ rpc_request_queue_lock_.Release();
+ RemoveRequestTimer(correlation_id);
+
+ mobile_apis::Result::eType result_code;
+ smart_objects::EnumConversionHelper<mobile_apis::Result::eType>::
+ StringToEnum(
+ rpc_message[strings::msg_params][strings::result_code].asString(),
+ &result_code);
+
+ if (result_code == mobile_apis::Result::UNSUPPORTED_REQUEST) {
+ LOG4CXX_DEBUG(logger_, "Service sent UNSUPPORTED_REQUEST");
+ PerformNextRequest(correlation_id);
+ return true;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Valid RPC passing response");
+ ForwardResponseToMobile(correlation_id, rpc_message);
+ return true;
+ }
+
+ break;
+ }
+ }
+
+ return false;
+}
+
+void RPCPassingHandler::PopulateRPCRequestQueue(
+ smart_objects::SmartObject request_message) {
+ uint32_t origin_connection_key =
+ request_message[strings::params][strings::connection_key].asUInt();
+ uint32_t correlation_id =
+ request_message[strings::params][strings::correlation_id].asUInt();
+ int32_t function_id =
+ request_message[strings::params][strings::function_id].asInt();
+
+ // Construct list of pass through services
+ auto entry = std::make_pair(request_message, std::deque<ServiceInfo>());
+ auto services = app_service_manager_.GetActiveServices();
+
+ for (auto services_it = services.begin(); services_it != services.end();
+ ++services_it) {
+ auto handled_rpcs =
+ services_it->record[strings::service_manifest][strings::handled_rpcs];
+ for (size_t i = 0; i < handled_rpcs.length(); i++) {
+ if (handled_rpcs[i].asInt() == function_id) {
+ // Add requests to queue
+ ServiceInfo service_info{
+ services_it->record[strings::service_id].asString(),
+ services_it->connection_key};
+ entry.second.push_back(service_info);
+ app_manager_.IncreaseForwardedRequestTimeout(origin_connection_key,
+ correlation_id);
+ break;
+ }
+ }
+ }
+
+ sync_primitives::AutoLock lock(rpc_request_queue_lock_);
+ rpc_request_queue[correlation_id] = entry;
+
+ LOG4CXX_DEBUG(logger_,
+ "Added " << rpc_request_queue[correlation_id].second.size()
+ << " requests to the queue");
+}
+void RPCPassingHandler::ForwardRequestToMobile(uint32_t correlation_id) {
+ rpc_request_queue_lock_.Acquire();
+ uint32_t connection_key =
+ rpc_request_queue[correlation_id].second.front().connection_key;
+ LOG4CXX_DEBUG(logger_,
+ "Forwarding request to service with app id " << connection_key);
+
+ smart_objects::SmartObject message(rpc_request_queue[correlation_id].first);
+ message[strings::params][strings::connection_key] = connection_key;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>(message);
+ rpc_request_queue_lock_.Release();
+ AddRequestTimer(correlation_id);
+ app_manager_.GetRPCService().SendMessageToMobile(result);
+}
+
+void RPCPassingHandler::ForwardRequestToCore(uint32_t correlation_id) {
+ LOG4CXX_DEBUG(logger_,
+ "No services left in map. using core to handle request");
+ rpc_request_queue_lock_.Acquire();
+ smart_objects::SmartObject message(rpc_request_queue[correlation_id].first);
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>(message);
+ rpc_request_queue.erase(correlation_id);
+ rpc_request_queue_lock_.Release();
+
+ // Validate rpc message before forwarding to core
+ rpc::ValidationReport report("RPC");
+ uint32_t connection_key =
+ message[strings::params][strings::connection_key].asUInt();
+ int32_t function_id = message[strings::params][strings::function_id].asInt();
+ auto app_ptr = app_manager_.application(connection_key);
+ utils::SemanticVersion msg_version(0, 0, 0);
+ if (app_ptr) {
+ msg_version = app_ptr->msg_version();
+ }
+
+ if (!app_manager_.GetRPCHandler().ValidateRpcSO(
+ message, msg_version, report, false)) {
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ function_id,
+ correlation_id,
+ mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return;
+ }
+
+ app_manager_.GetRPCService().ManageMobileCommand(
+ result, commands::Command::SOURCE_MOBILE);
+}
+
+void RPCPassingHandler::ForwardResponseToMobile(
+ uint32_t correlation_id, smart_objects::SmartObject response_message) {
+ rpc_request_queue_lock_.Acquire();
+ uint32_t origin_connection_key =
+ rpc_request_queue[correlation_id]
+ .first[strings::params][strings::connection_key]
+ .asUInt();
+ rpc_request_queue_lock_.Release();
+
+ LOG4CXX_DEBUG(logger_,
+ "Forwarding response to mobile app " << origin_connection_key);
+ smart_objects::SmartObject message(response_message);
+ message[strings::params][strings::connection_key] = origin_connection_key;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>(message);
+ app_manager_.GetRPCService().SendMessageToMobile(result);
+}
+
+bool RPCPassingHandler::PerformNextRequest(uint32_t correlation_id) {
+ LOG4CXX_DEBUG(logger_, "Performing next request in queue");
+ rpc_request_queue_lock_.Acquire();
+ if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) {
+ LOG4CXX_ERROR(logger_, "Correlation id does NOT exist in map");
+ rpc_request_queue_lock_.Release();
+ return false;
+ }
+ rpc_request_queue[correlation_id].second.pop_front();
+ bool empty = rpc_request_queue[correlation_id].second.empty();
+ rpc_request_queue_lock_.Release();
+
+ if (empty) {
+ ForwardRequestToCore(correlation_id);
+ } else {
+ ForwardRequestToMobile(correlation_id);
+ }
+
+ return true;
+}
+
+void RPCPassingHandler::OnPassThroughRequestTimeout() {
+ timeout_queue_lock_.Acquire();
+ LOG4CXX_DEBUG(logger_, "Request Timed out");
+ auto timeout_entry = timeout_queue_.front();
+ uint32_t correlation_id = timeout_entry.second;
+ timeout_queue_lock_.Release();
+ PerformNextRequest(correlation_id);
+}
+
+void RPCPassingHandler::ClearCompletedTimers() {
+ sync_primitives::AutoLock lock(timeout_queue_lock_);
+
+ LOG4CXX_DEBUG(logger_, "Clearing Completed Timers");
+ for (auto it = timeout_queue_.begin(); it != timeout_queue_.end();) {
+ TimerSPtr timer = it->first;
+ if (timer->is_completed()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Removing completed timer for correlation id " << it->second);
+ it = timeout_queue_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
+void RPCPassingHandler::AddRequestTimer(uint32_t correlation_id) {
+ TimerSPtr rpc_passing_timer(std::make_shared<timer::Timer>(
+ "RPCPassingTimeoutTimer_" + std::to_string(correlation_id),
+ new timer::TimerTaskImpl<RPCPassingHandler>(
+ this, &RPCPassingHandler::OnPassThroughRequestTimeout)));
+ const uint32_t timeout_ms =
+ app_manager_.get_settings().rpc_pass_through_timeout();
+ rpc_passing_timer->Start(timeout_ms, timer::kSingleShot);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Adding and starting timer for correlation id " << correlation_id);
+ sync_primitives::AutoLock lock(timeout_queue_lock_);
+ timeout_queue_.push_back(std::make_pair(rpc_passing_timer, correlation_id));
+}
+
+void RPCPassingHandler::RemoveRequestTimer(uint32_t correlation_id) {
+ sync_primitives::AutoLock lock(timeout_queue_lock_);
+
+ for (auto it = timeout_queue_.begin(); it != timeout_queue_.end();) {
+ TimerSPtr timer = it->first;
+ uint32_t cid = it->second;
+ if (cid == correlation_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Removing timer for correlation id " << correlation_id);
+ it = timeout_queue_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index 7a68ae5779..b5cae1c126 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -32,12 +32,16 @@
#include "application_manager/rpc_service_impl.h"
+#include "application_manager/app_service_manager.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
+
namespace application_manager {
namespace rpc_service {
CREATE_LOGGERPTR_LOCAL(logger_, "RPCServiceImpl")
namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+namespace plugin_names = application_manager::plugin_manager::plugin_names;
RPCServiceImpl::RPCServiceImpl(
ApplicationManager& app_manager,
@@ -122,7 +126,8 @@ bool RPCServiceImpl::ManageMobileCommand(
auto plugin =
app_manager_.GetPluginManager().FindPluginToProcess(function_id, source);
if (!plugin) {
- LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error());
+ LOG4CXX_WARN(logger_, "Failed to find plugin : " << plugin.error());
+ CheckSourceForUnsupportedRequest(message, source);
return false;
}
application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();
@@ -154,7 +159,19 @@ bool RPCServiceImpl::ManageMobileCommand(
return true;
}
- if (message_type == mobile_apis::messageType::request) {
+ if (message_type == mobile_apis::messageType::request &&
+ source == commands::Command::CommandSource::SOURCE_SDL) {
+ if (command->Init()) {
+ command->Run();
+ command->CleanUp();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ if (message_type == mobile_apis::messageType::request &&
+ source == commands::Command::CommandSource::SOURCE_MOBILE) {
// commands will be launched from requesr_ctrl
mobile_apis::HMILevel::eType app_hmi_level =
mobile_apis::HMILevel::INVALID_ENUM;
@@ -241,8 +258,8 @@ bool RPCServiceImpl::ManageMobileCommand(
return false;
}
-bool RPCServiceImpl::ManageHMICommand(
- const commands::MessageSharedPtr message) {
+bool RPCServiceImpl::ManageHMICommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) {
LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
@@ -258,15 +275,15 @@ bool RPCServiceImpl::ManageHMICommand(
MessageHelper::PrintSmartObject(*message);
const int32_t function_id =
(*(message.get()))[strings::params][strings::function_id].asInt();
- auto plugin = app_manager_.GetPluginManager().FindPluginToProcess(
- function_id, commands::Command::SOURCE_HMI);
+ auto plugin =
+ app_manager_.GetPluginManager().FindPluginToProcess(function_id, source);
if (!plugin) {
LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error());
return false;
}
application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();
- auto command = factory.CreateCommand(message, commands::Command::SOURCE_HMI);
+ auto command = factory.CreateCommand(message, source);
if (!command) {
LOG4CXX_WARN(logger_, "Failed to create command from smart object");
@@ -374,6 +391,7 @@ void RPCServiceImpl::SendMessageToMobile(
const bool is_result_code_exists =
(*message)[strings::msg_params].keyExists(strings::result_code);
+ bool allow_unknown_parameters = false;
if (!app) {
LOG4CXX_ERROR(logger_, "No application associated with connection key");
@@ -405,7 +423,31 @@ void RPCServiceImpl::SendMessageToMobile(
// Messages to mobile are not yet prioritized so use default priority value
std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
- if (!ConvertSOtoMessage((*message), (*message_to_send))) {
+
+ int32_t function_id = (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt();
+ bool rpc_passing = app_manager_.GetAppServiceManager()
+ .GetRPCPassingHandler()
+ .CanHandleFunctionID(function_id);
+ if (IsAppServiceRPC(function_id,
+ commands::Command::CommandSource::SOURCE_SDL) ||
+ rpc_passing) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Allowing unknown parameters for response function " << function_id);
+ allow_unknown_parameters = true;
+ }
+
+ if (rpc_passing &&
+ !app_manager_.GetAppServiceManager()
+ .GetRPCPassingHandler()
+ .IsPassThroughMessage(
+ (*message)[jhs::S_PARAMS][jhs::S_CORRELATION_ID].asUInt(),
+ commands::Command::CommandSource::SOURCE_SDL,
+ (*message)[jhs::S_PARAMS][jhs::S_MESSAGE_TYPE].asInt())) {
+ allow_unknown_parameters = false;
+ }
+ if (!ConvertSOtoMessage(
+ (*message), (*message_to_send), allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
return;
}
@@ -484,6 +526,7 @@ void RPCServiceImpl::SendMessageToHMI(
return;
}
+ bool allow_unknown_parameters = false;
// SmartObject |message| has no way to declare priority for now
std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
@@ -497,7 +540,17 @@ void RPCServiceImpl::SendMessageToHMI(
logger_,
"Attached schema to message, result if valid: " << message->isValid());
- if (!ConvertSOtoMessage(*message, *message_to_send)) {
+ if (IsAppServiceRPC((*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt(),
+ commands::Command::CommandSource::SOURCE_SDL_TO_HMI)) {
+ LOG4CXX_DEBUG(logger_,
+ "Allowing unknown parameters for response function "
+ << (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+
+ allow_unknown_parameters = true;
+ }
+
+ if (!ConvertSOtoMessage(
+ *message, *message_to_send, allow_unknown_parameters)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
@@ -506,6 +559,42 @@ void RPCServiceImpl::SendMessageToHMI(
messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
}
+bool RPCServiceImpl::IsAppServiceRPC(int32_t function_id,
+ commands::Command::CommandSource source) {
+ // General RPCs related to App Services
+ if ((source == commands::Command::CommandSource::SOURCE_MOBILE) ||
+ (source ==
+ commands::Command::CommandSource::SOURCE_SDL)) { // MOBILE COMMANDS
+ switch (function_id) {
+ case mobile_apis::FunctionID::GetSystemCapabilityID:
+ case mobile_apis::FunctionID::OnSystemCapabilityUpdatedID:
+ return true;
+ break;
+ }
+ } else if ((source == commands::Command::CommandSource::SOURCE_HMI) ||
+ (source == commands::Command::CommandSource::
+ SOURCE_SDL_TO_HMI)) { // HMI COMMANDS
+ switch (function_id) {
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated:
+ return true;
+ break;
+ }
+ }
+
+ // RPCs handled by app services plugin
+ auto plugin =
+ app_manager_.GetPluginManager().FindPluginToProcess(function_id, source);
+ if (!plugin) {
+ return false;
+ }
+ if ((*plugin).PluginName() != plugin_names::app_service_rpc_plugin) {
+ return false;
+ }
+ application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();
+
+ return factory.IsAbleToProcess(function_id, source);
+}
+
void RPCServiceImpl::set_protocol_handler(
protocol_handler::ProtocolHandler* handler) {
protocol_handler_ = handler;
@@ -518,7 +607,8 @@ void RPCServiceImpl::set_hmi_message_handler(
bool RPCServiceImpl::ConvertSOtoMessage(
const ns_smart_device_link::ns_smart_objects::SmartObject& message,
- Message& output) {
+ Message& output,
+ const bool allow_unknown_parameters) {
LOG4CXX_AUTO_TRACE(logger_);
if (smart_objects::SmartType_Null == message.getType() ||
@@ -543,16 +633,16 @@ bool RPCServiceImpl::ConvertSOtoMessage(
switch (protocol_type) {
case 0: {
if (protocol_version == 1) {
- if (!formatters::CFormatterJsonSDLRPCv1::toString(message,
- output_string)) {
+ if (!formatters::CFormatterJsonSDLRPCv1::toString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
output.set_protocol_version(
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
} else {
- if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
- output_string)) {
+ if (!formatters::CFormatterJsonSDLRPCv2::toString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -564,7 +654,8 @@ bool RPCServiceImpl::ConvertSOtoMessage(
break;
}
case 1: {
- if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ if (!formatters::FormatterJsonRpc::ToString(
+ message, output_string, !allow_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -577,7 +668,7 @@ bool RPCServiceImpl::ConvertSOtoMessage(
return false;
}
- LOG4CXX_DEBUG(logger_, "Convertion result: " << output_string);
+ LOG4CXX_DEBUG(logger_, "Conversion result: " << output_string);
output.set_connection_key(message.getElement(jhs::S_PARAMS)
.getElement(strings::connection_key)
@@ -624,6 +715,43 @@ mobile_apis::MOBILE_API& RPCServiceImpl::mobile_so_factory() {
return mobile_so_factory_;
}
+void RPCServiceImpl::CheckSourceForUnsupportedRequest(
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) {
+ int32_t message_type =
+ (*(message.get()))[strings::params][strings::message_type].asInt();
+ uint32_t correlation_id =
+ (*message)[strings::params].keyExists(strings::correlation_id)
+ ? (*message)[strings::params][strings::correlation_id].asUInt()
+ : 0;
+ const uint32_t connection_key = static_cast<uint32_t>(
+ (*message)[strings::params][strings::connection_key].asUInt());
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+ if ((source == commands::Command::CommandSource::SOURCE_MOBILE &&
+ kRequest == message_type) ||
+ (source == commands::Command::CommandSource::SOURCE_SDL &&
+ kResponse == message_type)) {
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ 0);
+
+ // Since we are dealing with an unknown RPC, there is no schema attached
+ // to the message, so we have to convert the result to string directly
+ std::string result_code;
+ smart_objects::EnumConversionHelper<mobile_apis::Result::eType>::
+ EnumToString(mobile_apis::Result::UNSUPPORTED_REQUEST, &result_code);
+ (*response)[strings::msg_params][strings::result_code] = result_code;
+ (*response)[strings::msg_params][strings::info] =
+ "Module does not recognize this function id";
+
+ SendMessageToMobile(response);
+ }
+}
+
} // namespace rpc_service
} // namespace application_manager
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index ff9ebb6208..54033b12ab 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -27,6 +27,7 @@ const char* app_launch_last_session = "app_launch_last_session";
const char* policy_app_id = "policyAppID";
const char* hmi_app_id = "hmiAppID";
const char* device_id = "deviceID";
+const char* subscribe = "subscribe";
const char* subscribed_for_way_points = "subscribed_for_way_points";
const char* url = "url";
const char* urlScheme = "urlScheme";
@@ -43,7 +44,7 @@ const char* ngn_media_screen_app_name = "ngnMediaScreenAppName";
const char* vr_synonyms = "vrSynonyms";
const char* uses_vehicle_data = "usesVehicleData";
const char* is_media_application = "isMediaApplication";
-const char* greyOut = "greyOut";
+const char* grey_out = "greyOut";
const char* language_desired = "languageDesired";
const char* auto_activated_id = "autoActivateID";
const char* app_type = "appType";
@@ -145,6 +146,7 @@ const char* navigation_capability = "navigationCapability";
const char* phone_capability = "phoneCapability";
const char* video_streaming_capability = "videoStreamingCapability";
const char* rc_capability = "remoteControlCapability";
+const char* app_services_capabilities = "appServicesCapabilities";
const char* day_color_scheme = "dayColorScheme";
const char* night_color_scheme = "nightColorScheme";
const char* primary_color = "primaryColor";
@@ -155,10 +157,19 @@ const char* green = "green";
const char* blue = "blue";
const char* display_layout = "displayLayout";
const char* icon_resumed = "iconResumed";
+const char* nicknames = "nicknames";
+const char* enabled = "enabled";
+const char* auth_token = "authToken";
+const char* cloud_transport_type = "cloudTransportType";
+const char* hybrid_app_preference = "hybridAppPreference";
+const char* is_cloud_application = "isCloudApplication";
+const char* cloud_connection_status = "cloudConnectionStatus";
+const char* endpoint = "endpoint";
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
+const char* file_path = "filePath";
const char* file_type = "fileType";
const char* file_size = "fileSize";
const char* crc32_check_sum = "crc";
@@ -172,6 +183,7 @@ const char* is_template = "isTemplate";
const char* image = "image";
const char* type = "type";
const char* system_file = "systemFile";
+const char* is_system_file = "isSystemFile";
const char* offset = "offset";
const char* length = "length";
const char* secondary_image = "secondaryImage";
@@ -220,6 +232,7 @@ const char* fuel_level = "fuelLevel";
const char* fuel_level_state = "fuelLevel_State";
const char* instant_fuel_consumption = "instantFuelConsumption";
const char* fuel_range = "fuelRange";
+const char* cloud_app_vehicle_id = "cloudAppVehicleID";
const char* external_temp = "externalTemperature";
const char* turn_signal = "turnSignal";
const char* vin = "vin";
@@ -260,6 +273,49 @@ const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
const char* engine_oil_life = "engineOilLife";
+// app services
+const char* app_service_manifest = "appServiceManifest";
+const char* service_name = "serviceName";
+const char* service_type = "serviceType";
+const char* service_icon = "serviceIcon";
+const char* allow_app_consumers = "allowAppConsumers";
+const char* rpc_spec_version = "rpcSpecVersion";
+const char* handled_rpcs = "handledRPCs";
+const char* media_service_manifest = "mediaServiceManifest";
+const char* app_service_record = "appServiceRecord";
+const char* service_id = "serviceID";
+const char* service_manifest = "serviceManifest";
+const char* service_published = "servicePublished";
+const char* service_active = "serviceActive";
+const char* app_service_id = "appServiceId";
+const char* service_data = "serviceData";
+const char* media_service_data = "mediaServiceData";
+const char* media_image = "mediaImage";
+const char* weather_service_data = "weatherServiceData";
+const char* location = "location";
+const char* current_forecast = "currentForecast";
+const char* minute_forecast = "minuteForecast";
+const char* hourly_forecast = "hourlyForecast";
+const char* multiday_forecast = "multidayForecast";
+const char* weather_icon = "weatherIcon";
+const char* navigation_service_data = "navigationServiceData";
+const char* origin = "origin";
+const char* destination = "destination";
+const char* instructions = "instructions";
+const char* location_details = "locationDetails";
+const char* request_service_active = "requestServiceActive";
+const char* app_services = "appServices";
+const char* update_reason = "updateReason";
+const char* updated_app_service_record = "updatedAppServiceRecord";
+const char* service_records = "serviceRecords";
+const char* activate = "activate";
+const char* set_as_default = "setAsDefault";
+const char* origin_app = "originApp";
+
+// sis data
+const char* station_short_name = "stationShortName";
+const char* station_location = "stationLocation";
+
// resuming
const char* application_commands = "applicationCommands";
const char* application_submenus = "applicationSubMenus";
@@ -288,8 +344,12 @@ const char* time_stamp = "timeStamp";
const char* manual_text_entry = "manualTextEntry";
const char* image_type_supported = "imageTypeSupported";
const char* unexpected_disconnect = "unexpectedDisconnect";
+
+const char* shifted = "shifted";
+const char* altitude = "altitude";
const char* longitude_degrees = "longitudeDegrees";
const char* latitude_degrees = "latitudeDegrees";
+
const char* address = "address";
const char* country_name = "countryName";
const char* country_code = "countryCode";
@@ -319,6 +379,8 @@ const char* const keypress_mode_supported = "keypressModeSupported";
const char* const limited_characters_list_supported =
"limitedCharactersListSupported";
const char* const auto_complete_text_supported = "autoCompleteTextSupported";
+const char* const send_location_enabled = "sendLocationEnabled";
+const char* const get_way_points_enabled = "getWayPointsEnabled";
const char* const entity_type = "entityType";
const char* const entity_id = "entityID";
const char* const status = "status";
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 3d44709657..994c7b8b7f 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -32,8 +32,8 @@
#include "application_manager/state_controller_impl.h"
#include <tuple>
-#include "application_manager/usage_statistics.h"
#include "application_manager/rpc_service.h"
+#include "application_manager/usage_statistics.h"
#include "utils/helpers.h"
#include "connection_handler/connection_handler.h"
@@ -68,7 +68,7 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
@@ -101,12 +101,17 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- if (send_activate_app) {
- const int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
- if (-1 != corr_id) {
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- corr_id);
- waiting_for_activate_[app->app_id()] = resolved_state;
+ if (request_hmi_state_change) {
+ const int64_t result = RequestHMIStateChange(app, hmi_level, true);
+ if (-1 != result) {
+ const uint32_t corr_id = static_cast<uint32_t>(result);
+ subscribe_on_event(
+ hmi_apis::Common_HMILevel::NONE == hmi_level
+ ? hmi_apis::FunctionID::BasicCommunication_CloseApplication
+ : hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ corr_id);
+ waiting_for_response_[app->app_id()] = resolved_state;
+ app_mngr_.set_application_id(corr_id, app->hmi_app_id());
return;
}
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp");
@@ -120,7 +125,7 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
@@ -132,13 +137,13 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_regular->system_context());
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
@@ -150,7 +155,7 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
@@ -159,7 +164,7 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool send_activate_app) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr hmi_state =
@@ -169,7 +174,7 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(system_context);
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
@@ -475,7 +480,9 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
return result;
}
- const bool is_active_app_exist = (bool)app_mngr_.active_application();
+ ApplicationConstSharedPtr active_app = app_mngr_.active_application();
+ const bool is_active_app_exist =
+ (active_app.use_count() != 0) && active_app->app_id() != app->app_id();
if (is_audio_app) {
if (does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
@@ -622,10 +629,11 @@ void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app,
"Resolving HMI level conflicts for app " << app->app_id());
ForEachApplication(HmiLevelConflictResolver(app, state, this));
}
+void StateControllerImpl::on_event(const event_engine::MobileEvent& event) {}
void StateControllerImpl::on_event(const event_engine::Event& event) {
- using smart_objects::SmartObject;
using event_engine::Event;
+ using smart_objects::SmartObject;
using namespace hmi_apis;
namespace FunctionID = hmi_apis::FunctionID;
@@ -633,8 +641,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
const SmartObject& message = event.smart_object();
const FunctionID::eType id = static_cast<FunctionID::eType>(event.id());
switch (id) {
- case FunctionID::BasicCommunication_ActivateApp: {
- OnActivateAppResponse(message);
+ case FunctionID::BasicCommunication_ActivateApp:
+ case FunctionID::BasicCommunication_CloseApplication: {
+ OnHMIResponse(message);
break;
}
case FunctionID::BasicCommunication_OnAppActivated: {
@@ -788,31 +797,33 @@ void StateControllerImpl::OnApplicationRegistered(
OnStateChanged(app, initial_state, new_state);
}
-int64_t StateControllerImpl::SendBCActivateApp(
+int64_t StateControllerImpl::RequestHMIStateChange(
ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr bc_activate_app_request =
- MessageHelper::GetBCActivateAppRequestToHMI(
- app,
- app_mngr_.connection_handler().get_session_observer(),
- app_mngr_.GetPolicyHandler(),
- level,
- send_policy_priority,
- app_mngr_);
- if (!bc_activate_app_request) {
- LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest");
+ smart_objects::SmartObjectSPtr request = NULL;
+ if (hmi_apis::Common_HMILevel::NONE == level) {
+ request = MessageHelper::GetBCCloseApplicationRequestToHMI(app, app_mngr_);
+ } else {
+ request = MessageHelper::GetBCActivateAppRequestToHMI(
+ app,
+ app_mngr_.GetPolicyHandler(),
+ level,
+ send_policy_priority,
+ app_mngr_);
+ }
+ if (!request) {
+ LOG4CXX_ERROR(logger_, "Unable to create request");
return -1;
}
- if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) {
- LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest");
+ if (!app_mngr_.GetRPCService().ManageHMICommand(request)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
return -1;
}
- const int64_t corr_id =
- (*bc_activate_app_request)[strings::params][strings::correlation_id]
- .asInt();
- return corr_id;
+ const uint32_t corr_id =
+ (*request)[strings::params][strings::correlation_id].asUInt();
+ return static_cast<int64_t>(corr_id);
}
void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) {
@@ -887,18 +898,18 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
SetRegularState(app, new_regular, false);
}
-void StateControllerImpl::OnActivateAppResponse(
+void StateControllerImpl::OnHMIResponse(
const smart_objects::SmartObject& message) {
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- const int32_t correlation_id =
- message[strings::params][strings::correlation_id].asInt();
+ const uint32_t correlation_id =
+ message[strings::params][strings::correlation_id].asUInt();
const uint32_t hmi_app_id = app_mngr_.application_id(correlation_id);
ApplicationSharedPtr application =
app_mngr_.application_by_hmi_app(hmi_app_id);
if (application && hmi_apis::Common_Result::SUCCESS == code) {
- HmiStatePtr pending_state = waiting_for_activate_[application->app_id()];
+ HmiStatePtr pending_state = waiting_for_response_[application->app_id()];
DCHECK_OR_RETURN_VOID(pending_state);
ApplyRegularState(application, pending_state);
}
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 27f0972c01..f5d08a8ebf 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
@@ -41,6 +41,8 @@
namespace application_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "SystemTimeHandler")
+
SystemTimeHandlerImpl::SystemTimeHandlerImpl(
ApplicationManager& application_manager)
: event_engine::EventObserver(application_manager.event_dispatcher())
@@ -56,7 +58,7 @@ SystemTimeHandlerImpl::SystemTimeHandlerImpl(
SystemTimeHandlerImpl::~SystemTimeHandlerImpl() {
LOG4CXX_AUTO_TRACE(logger_);
- unsubscribe_from_all_events();
+ unsubscribe_from_all_hmi_events();
}
void SystemTimeHandlerImpl::DoSystemTimeQuery() {
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 1cfccd816e..3f1831f449 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -31,9 +31,9 @@
*/
#include "application_manager/usage_statistics.h"
-#include "smart_objects/smart_object.h"
-#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/statistics_manager.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "utils/macro.h"
using namespace mobile_apis;
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 02cf58485a..ccec05a795 100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -56,6 +56,7 @@ set(testSources
${AM_TEST_DIR}/request_info_test.cc
${AM_TEST_DIR}/resumption_sql_queries_test.cc
${AM_TEST_DIR}/event_engine_test.cc
+ ${AM_TEST_DIR}/mobile_event_engine_test.cc
${AM_TEST_DIR}/policy_event_observer_test.cc
${AM_TEST_DIR}/application_impl_test.cc
${AM_TEST_DIR}/hmi_capabilities_test.cc
@@ -63,6 +64,8 @@ set(testSources
${AM_TEST_DIR}/application_state_test.cc
${AM_TEST_DIR}/usage_statistics_test.cc
${AM_TEST_DIR}/policy_handler_test.cc
+ ${AM_TEST_DIR}/app_service_manager_test.cc
+ ${AM_TEST_DIR}/rpc_passing_handler_test.cc
${AM_TEST_DIR}/application_manager_impl_test.cc
${AM_TEST_DIR}/application_helper_test.cc
${AM_TEST_DIR}/command_holder_test.cc
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 3293a8908d..b3bb8dd705 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -30,16 +30,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include <sstream>
-#include "utils/macro.h"
#include "application_manager/app_launch/app_launch_ctrl_impl.h"
#include "application_manager/mock_app_launch_data.h"
#include "application_manager/mock_app_launch_settings.h"
-#include "application_manager/mock_resume_ctrl.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_resume_ctrl.h"
#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "utils/macro.h"
#include "utils/test_async_waiter.h"
@@ -47,14 +47,14 @@ namespace test {
namespace components {
namespace app_launch_test {
+using ::testing::AtLeast;
+using ::testing::DoAll;
+using ::testing::InSequence;
+using ::testing::Invoke;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::Truly;
-using ::testing::NiceMock;
-using ::testing::Invoke;
-using ::testing::AtLeast;
-using ::testing::InSequence;
-using ::testing::DoAll;
namespace ch_test = test::components::connection_handler_test;
namespace am_test = test::components::application_manager_test;
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
index dc96fcf176..d0f2e21f4c 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -31,18 +31,18 @@
*/
#include <algorithm>
+#include <memory>
#include <sstream>
#include <string>
-#include <memory>
#include "gtest/gtest.h"
-#include "utils/macro.h"
#include "sql_database.h"
#include "sql_query.h"
+#include "utils/macro.h"
-#include "utils/file_system.h"
-#include "application_manager/mock_app_launch_settings.h"
#include "application_manager/app_launch/app_launch_data_db.h"
#include "application_manager/app_launch/app_launch_sql_queries.h"
+#include "application_manager/mock_app_launch_settings.h"
+#include "utils/file_system.h"
namespace test {
namespace components {
@@ -51,9 +51,9 @@ namespace app_launch_test {
using namespace file_system;
using namespace app_launch;
-using ::testing::ReturnRef;
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
namespace {
const std::string kEmptyString = "";
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 4541970c70..12a375685e 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
@@ -30,27 +30,27 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/app_launch/app_launch_data_json.h"
#include <algorithm>
-#include <sstream>
#include <memory>
-#include "json/json.h"
+#include <sstream>
+#include "application_manager/mock_app_launch_settings.h"
+#include "application_manager/smart_object_keys.h"
#include "gtest/gtest.h"
-#include "utils/macro.h"
-#include "utils/file_system.h"
-#include "utils/date_time.h"
+#include "json/json.h"
#include "resumption/last_state_impl.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_app_launch_settings.h"
-#include "application_manager/app_launch/app_launch_data_json.h"
+#include "utils/date_time.h"
+#include "utils/file_system.h"
+#include "utils/macro.h"
namespace test {
namespace components {
namespace test_app_launch {
using ::testing::_;
-using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Return;
namespace am = application_manager;
using namespace Json;
@@ -339,6 +339,6 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
}
}
-} // namespace app_launch
+} // namespace test_app_launch
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/app_service_manager_test.cc b/src/components/application_manager/test/app_service_manager_test.cc
new file mode 100644
index 0000000000..0f2b4469a2
--- /dev/null
+++ b/src/components/application_manager/test/app_service_manager_test.cc
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2017, 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 <gmock/gmock.h>
+
+#include "application_manager/commands/command.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "resumption/mock_last_state.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using testing::_;
+using ::testing::DoAll;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+
+namespace am = application_manager;
+
+const char* kAppServiceSection = "AppServices";
+const char* kDefaults = "defaults";
+const std::string kServiceType = "MEDIA";
+const std::string kServiceName = "service_name";
+const std::string kServiceId = "service_id";
+const std::string kPolicyAppId = "p_app_id";
+const uint32_t kConnectionKey = 43629;
+const uint32_t kHMIConnectionKey = 0;
+
+MATCHER_P(CapabilityUpdateMatcher, reason, "") {
+ smart_objects::SmartObject& services_updated =
+ arg[am::strings::system_capability]
+ [am::strings::app_services_capabilities][am::strings::app_services];
+ if (smart_objects::SmartType_Array != services_updated.getType()) {
+ return false;
+ }
+ for (size_t i = 0; i < services_updated.length(); i++) {
+ smart_objects::SmartObject& service_cap = services_updated[i];
+ if (reason == service_cap[am::strings::update_reason].asInt()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+class AppServiceManagerTest : public testing::Test {
+ public:
+ AppServiceManagerTest()
+ : mock_app_ptr_(new MockApplication)
+ , app_service_manager_(mock_app_manager_, mock_last_state_)
+ , mock_message_helper_(
+ application_manager::MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
+ }
+ ~AppServiceManagerTest() {
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_message_helper_, BroadcastCapabilityUpdate(_, _))
+ .WillByDefault(Return());
+ ON_CALL(mock_settings_, embedded_services())
+ .WillByDefault(ReturnRef(embedded_services_));
+ ON_CALL(mock_app_manager_, get_settings())
+ .WillByDefault(ReturnRef(mock_settings_));
+ ON_CALL(*mock_app_ptr_, policy_app_id())
+ .WillByDefault(Return(kPolicyAppId));
+ ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(dict_));
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ ON_CALL(mock_app_manager_, application(kConnectionKey))
+ .WillByDefault(Return(app_ptr));
+ }
+
+ protected:
+ smart_objects::SmartObject GenerateMediaManifest(
+ bool allow_app_consumers, std::string app_service_name = kServiceName) {
+ smart_objects::SmartObject manifest(smart_objects::SmartType_Map);
+ manifest[am::strings::service_type] = "MEDIA";
+ manifest[am::strings::service_name] = app_service_name;
+ manifest[am::strings::allow_app_consumers] = allow_app_consumers;
+ manifest[am::strings::media_service_manifest] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ return manifest;
+ }
+
+ smart_objects::SmartObject PublishService(
+ uint32_t connection_key = kConnectionKey,
+ std::string service_name = kServiceName,
+ bool first_run = true) {
+ smart_objects::SmartObject manifest =
+ GenerateMediaManifest(true, service_name);
+
+ Json::Value empty_json;
+ EXPECT_CALL(mock_last_state_, get_dictionary())
+ .WillOnce(ReturnRef(empty_json));
+
+ EXPECT_CALL(*mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(
+ mobile_apis::ServiceUpdateReason::PUBLISHED),
+ _))
+ .WillOnce(Return());
+ if (first_run) {
+ EXPECT_CALL(*mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(
+ mobile_apis::ServiceUpdateReason::ACTIVATED),
+ _))
+ .WillOnce(Return());
+ }
+ bool mobile_service = connection_key != kHMIConnectionKey;
+ return app_service_manager_.PublishAppService(
+ manifest, mobile_service, connection_key);
+ }
+
+ void CheckCapabilityUpdate(smart_objects::SmartObject& msg_params,
+ size_t length,
+ std::string service_id,
+ mobile_apis::ServiceUpdateReason::eType reason,
+ bool published,
+ bool active) {
+ smart_objects::SmartObject& services_updated =
+ msg_params[am::strings::system_capability]
+ [am::strings::app_services_capabilities]
+ [am::strings::app_services];
+ ASSERT_EQ(smart_objects::SmartType_Array, services_updated.getType());
+ EXPECT_EQ(length, services_updated.length());
+ for (size_t i = 0; i < services_updated.length(); i++) {
+ smart_objects::SmartObject& service_cap = services_updated[i];
+ if (service_id == service_cap[am::strings::updated_app_service_record]
+ [am::strings::service_id]
+ .asString()) {
+ CheckCapability(service_cap, service_id, reason, published, active);
+ return;
+ }
+ }
+ FAIL() << "Unable to find service in capability update with service_id: "
+ << service_id;
+ }
+
+ void CheckCapability(smart_objects::SmartObject& app_service_capability,
+ std::string service_id,
+ mobile_apis::ServiceUpdateReason::eType reason,
+ bool published,
+ bool active) {
+ EXPECT_EQ(reason,
+ app_service_capability[am::strings::update_reason].asInt());
+ smart_objects::SmartObject& updated_record =
+ app_service_capability[am::strings::updated_app_service_record];
+ EXPECT_EQ(service_id, updated_record[am::strings::service_id].asString());
+ EXPECT_EQ(published,
+ updated_record[am::strings::service_published].asBool());
+ EXPECT_EQ(active, updated_record[am::strings::service_active].asBool());
+ }
+
+ Json::Value dict_;
+ std::vector<std::string> embedded_services_;
+ std::shared_ptr<MockApplication> mock_app_ptr_;
+ MockApplicationManager mock_app_manager_;
+ resumption_test::MockLastState mock_last_state_;
+ MockApplicationManagerSettings mock_settings_;
+ application_manager::AppServiceManager app_service_manager_;
+ application_manager::MockMessageHelper* mock_message_helper_;
+};
+
+TEST_F(AppServiceManagerTest, PublishAppService_Mobile_SUCCESS) {
+ smart_objects::SmartObject manifest = GenerateMediaManifest(true);
+
+ Json::Value empty_json;
+ EXPECT_CALL(mock_last_state_, get_dictionary())
+ .WillOnce(ReturnRef(empty_json));
+
+ smart_objects::SmartObject syscap_update_published;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::PUBLISHED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_published), Return()));
+
+ smart_objects::SmartObject syscap_update_activated;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return()));
+
+ auto record =
+ app_service_manager_.PublishAppService(manifest, true, kConnectionKey);
+
+ // Check final record
+ std::string service_id = record[am::strings::service_id].asString();
+ EXPECT_EQ(manifest, record[am::strings::service_manifest]);
+ EXPECT_TRUE(record[am::strings::service_published].asBool());
+ EXPECT_TRUE(record[am::strings::service_active].asBool());
+
+ // Check first capability update
+ CheckCapabilityUpdate(syscap_update_published,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::PUBLISHED,
+ true,
+ false);
+
+ // Check second capability update
+ CheckCapabilityUpdate(syscap_update_activated,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ true,
+ true);
+}
+
+TEST_F(AppServiceManagerTest, PublishAppService_HMI_SUCCESS) {
+ smart_objects::SmartObject manifest = GenerateMediaManifest(true);
+
+ Json::Value empty_json;
+ EXPECT_CALL(mock_last_state_, get_dictionary())
+ .WillOnce(ReturnRef(empty_json));
+
+ smart_objects::SmartObject syscap_update_published;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::PUBLISHED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_published), Return()));
+
+ smart_objects::SmartObject syscap_update_activated;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return()));
+
+ auto record = app_service_manager_.PublishAppService(manifest, false);
+
+ // Check final record
+ std::string service_id = record[am::strings::service_id].asString();
+ EXPECT_EQ(manifest, record[am::strings::service_manifest]);
+ EXPECT_TRUE(record[am::strings::service_published].asBool());
+ EXPECT_TRUE(record[am::strings::service_active].asBool());
+
+ // Check first capability update
+ CheckCapabilityUpdate(syscap_update_published,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::PUBLISHED,
+ true,
+ false);
+
+ // Check second capability update
+ CheckCapabilityUpdate(syscap_update_activated,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ true,
+ true);
+}
+
+TEST_F(AppServiceManagerTest, UnpublishAppService_SUCCESS) {
+ auto record = PublishService();
+
+ smart_objects::SmartObject syscap_update_unpublished;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::REMOVED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_unpublished), Return()));
+ std::string service_id = record[am::strings::service_id].asString();
+
+ EXPECT_TRUE(app_service_manager_.UnpublishAppService(service_id));
+
+ // Check removed capability update
+ CheckCapabilityUpdate(syscap_update_unpublished,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::REMOVED,
+ false,
+ false);
+}
+
+TEST_F(AppServiceManagerTest, ActivateAppService_AlreadyActivated) {
+ auto record = PublishService();
+
+ // No capability update
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED),
+ _))
+ .Times(0);
+ std::string service_id = record[am::strings::service_id].asString();
+
+ EXPECT_TRUE(app_service_manager_.ActivateAppService(service_id));
+}
+
+TEST_F(AppServiceManagerTest, ActivateAppService_TwoApps_SUCCESS) {
+ // Register two services with the same service type, the first is activated
+ // automatically
+ auto record = PublishService();
+ auto record2 = PublishService(kConnectionKey + 1, kServiceName + "2", false);
+
+ // No capability update
+ smart_objects::SmartObject syscap_update_activated;
+ EXPECT_CALL(
+ *mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return()));
+ std::string service_id = record[am::strings::service_id].asString();
+ std::string service_id2 = record2[am::strings::service_id].asString();
+
+ // Activate the second service
+ EXPECT_TRUE(app_service_manager_.ActivateAppService(service_id2));
+
+ // Check that the first service is deactivated
+ CheckCapabilityUpdate(syscap_update_activated,
+ 2,
+ service_id,
+ mobile_apis::ServiceUpdateReason::DEACTIVATED,
+ true,
+ false);
+
+ // Check that the second service is activated
+ CheckCapabilityUpdate(syscap_update_activated,
+ 2,
+ service_id2,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ true,
+ true);
+}
+
+TEST_F(AppServiceManagerTest, DeactivateAppService_SUCCESS) {
+ auto record = PublishService();
+
+ smart_objects::SmartObject syscap_update_deactivated;
+ EXPECT_CALL(*mock_message_helper_,
+ BroadcastCapabilityUpdate(
+ CapabilityUpdateMatcher(
+ mobile_apis::ServiceUpdateReason::DEACTIVATED),
+ _))
+ .WillOnce(DoAll(SaveArg<0>(&syscap_update_deactivated), Return()));
+ std::string service_id = record[am::strings::service_id].asString();
+
+ EXPECT_TRUE(app_service_manager_.DeactivateAppService(service_id));
+
+ // Check deactivated capability update
+ CheckCapabilityUpdate(syscap_update_deactivated,
+ 1,
+ service_id,
+ mobile_apis::ServiceUpdateReason::DEACTIVATED,
+ true,
+ false);
+}
+
+TEST_F(AppServiceManagerTest, ActiveServiceForType_SUCCESS) {
+ auto record = PublishService();
+
+ auto service = app_service_manager_.ActiveServiceForType(kServiceType);
+
+ ASSERT_FALSE(service == NULL);
+ EXPECT_EQ(record, service->record);
+ EXPECT_EQ(kConnectionKey, service->connection_key);
+ EXPECT_TRUE(service->mobile_service);
+}
+
+TEST_F(AppServiceManagerTest, EmbeddedServiceForType_SUCCESS) {
+ auto record = PublishService(kHMIConnectionKey);
+
+ auto service = app_service_manager_.EmbeddedServiceForType(kServiceType);
+
+ ASSERT_FALSE(service == NULL);
+ EXPECT_EQ(record, service->record);
+ EXPECT_FALSE(service->mobile_service);
+}
+
+TEST_F(AppServiceManagerTest, FindServiceByID_SUCCESS) {
+ auto record = PublishService();
+
+ std::string service_id = record[am::strings::service_id].asString();
+ auto service = app_service_manager_.FindServiceByID(service_id);
+
+ ASSERT_FALSE(service == NULL);
+ EXPECT_EQ(record, service->record);
+ EXPECT_EQ(kConnectionKey, service->connection_key);
+ EXPECT_TRUE(service->mobile_service);
+}
+
+TEST_F(AppServiceManagerTest, GetAllServiceRecords_OneService_SUCCESS) {
+ auto record = PublishService();
+
+ auto records = app_service_manager_.GetAllServiceRecords();
+
+ ASSERT_EQ(1u, records.size());
+ EXPECT_EQ(record, records[0]);
+}
+
+TEST_F(AppServiceManagerTest, GetActiveServices_OneService_SUCCESS) {
+ auto record = PublishService();
+
+ auto services = app_service_manager_.GetActiveServices();
+
+ ASSERT_EQ(1u, services.size());
+ EXPECT_EQ(record, services[0].record);
+ EXPECT_EQ(kConnectionKey, services[0].connection_key);
+ EXPECT_TRUE(services[0].mobile_service);
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test \ No newline at end of file
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
index 3203839fc2..d9d590a171 100644
--- a/src/components/application_manager/test/application_helper_test.cc
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -36,42 +36,42 @@
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_message_helper.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
#include "application_manager/application.h"
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
-#include "application_manager/usage_statistics.h"
#include "application_manager/helpers/application_helper.h"
#include "application_manager/smart_object_keys.h"
-#include "interfaces/MOBILE_API.h"
+#include "application_manager/usage_statistics.h"
#include "connection_handler/device.h"
+#include "interfaces/MOBILE_API.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "utils/macro.h"
-#include "test/resumption/mock_last_state.h"
#include "media_manager/mock_media_manager.h"
+#include "test/resumption/mock_last_state.h"
namespace {
const uint8_t expected_tread_pool_size = 2u;
const uint8_t stop_streaming_timeout = 1u;
const std::string kDirectoryName = "./test_storage";
const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
-}
+} // namespace
namespace test {
namespace components {
namespace application_manager_test {
+using resumption_test::MockLastState;
+using test::components::media_manager_test::MockMediaManager;
using testing::_;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using resumption_test::MockLastState;
-using test::components::media_manager_test::MockMediaManager;
using namespace application_manager;
using namespace policy_handler_test;
@@ -255,6 +255,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
}
-} // application_manager_test
-} // components
-} // test
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 301ed227b8..46d35bdbef 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -35,23 +35,23 @@
#include <stdint.h>
#include <iostream>
-#include "gtest/gtest.h"
#include "application_manager/hmi_state.h"
+#include "gtest/gtest.h"
#include "utils/file_system.h"
-#include "application_manager/mock_message_helper.h"
-#include "utils/custom_string.h"
+#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_request_controller_settings.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
-#include "resumption/last_state.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/state_controller.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "resumption/last_state.h"
#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
namespace test {
namespace components {
@@ -63,10 +63,10 @@ using namespace mobile_apis;
namespace custom_str = utils::custom_string;
using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::AtLeast;
using usage_statistics_test::MockStatisticsManager;
typedef void (ApplicationImpl::*AddSet)(HmiStatePtr args);
@@ -91,9 +91,11 @@ class ApplicationImplTest : public ::testing::Test {
EXPECT_CALL(mock_application_manager_settings_, app_storage_folder())
.WillRepeatedly(ReturnRef(directory_name));
EXPECT_CALL(mock_application_manager_settings_,
- audio_data_stopped_timeout()).WillOnce(Return(0));
+ audio_data_stopped_timeout())
+ .WillOnce(Return(0));
EXPECT_CALL(mock_application_manager_settings_,
- video_data_stopped_timeout()).WillOnce(Return(0));
+ video_data_stopped_timeout())
+ .WillOnce(Return(0));
app_impl.reset(
new ApplicationImpl(app_id,
policy_app_id,
@@ -118,6 +120,13 @@ class ApplicationImplTest : public ::testing::Test {
AddSet hmi_action);
void CheckCurrentHMIState();
+ // 'directory_name' has to be declared prior to 'app_impl' so that when
+ // deleting ApplicationImplTest class, 'directory_name' will be removed
+ // after 'app_impl' runs its destructor.
+ // (ApplicationImpl's destructor calls CleanupFiles(), which will call
+ // application_manager_.get_settings().app_storage_folder() and will
+ // access 'directory_name'.)
+ const std::string directory_name = "./test_storage";
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
std::shared_ptr<ApplicationImpl> app_impl;
@@ -126,7 +135,6 @@ class ApplicationImplTest : public ::testing::Test {
std::string mac_address;
connection_handler::DeviceHandle device_handle;
custom_str::CustomString app_name;
- const std::string directory_name = "./test_storage";
HmiState::StateID state_id;
HmiStatePtr testHmiState;
HMILevel::eType test_lvl;
@@ -660,7 +668,8 @@ TEST_F(ApplicationImplTest,
TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendHashUpdateNotification(app_id, _)).Times(1);
+ SendHashUpdateNotification(app_id, _))
+ .Times(1);
resumprion_test::MockResumeCtrl mock_resume_ctrl;
EXPECT_CALL(mock_application_manager_, resume_controller())
.WillOnce(ReturnRef(mock_resume_ctrl));
@@ -672,7 +681,8 @@ TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
TEST_F(ApplicationImplTest, UpdateHash_AppMngrSuspended) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendHashUpdateNotification(app_id, _)).Times(0);
+ SendHashUpdateNotification(app_id, _))
+ .Times(0);
resumprion_test::MockResumeCtrl mock_resume_ctrl;
EXPECT_CALL(mock_application_manager_, resume_controller())
.WillOnce(ReturnRef(mock_resume_ctrl));
@@ -693,7 +703,8 @@ TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingNotApproved) {
TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) {
app_impl->set_video_streaming_approved(true);
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+ SendNaviSetVideoConfig(app_id, _, _))
+ .Times(0);
smart_objects::SmartObject params;
app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params);
@@ -701,7 +712,8 @@ TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) {
TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+ SendNaviSetVideoConfig(app_id, _, _))
+ .Times(0);
smart_objects::SmartObject params;
app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params);
@@ -726,13 +738,15 @@ TEST_F(ApplicationImplTest, StartStreaming_Audio_StreamingNotApproved) {
TEST_F(ApplicationImplTest, StartStreaming_StreamingApproved) {
app_impl->set_video_streaming_approved(true);
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendNaviStartStream(app_id, _)).Times(0);
+ SendNaviStartStream(app_id, _))
+ .Times(0);
app_impl->StartStreaming(protocol_handler::ServiceType::kMobileNav);
app_impl->set_audio_streaming_approved(true);
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendAudioStartStream(app_id, _)).Times(0);
+ SendAudioStartStream(app_id, _))
+ .Times(0);
app_impl->StartStreaming(protocol_handler::ServiceType::kAudio);
}
diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
index 8ab852779a..939ef98620 100644
--- a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
@@ -33,25 +33,25 @@
#include <memory>
#include <string>
-#include "gtest/gtest.h"
#include "application_manager/application.h"
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
+#include "gtest/gtest.h"
#include "utils/custom_string.h"
#include "encryption/hashing.h"
#include "application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_resumption_data.h"
#include "application_manager/mock_command_factory.h"
#include "application_manager/mock_request.h"
+#include "application_manager/mock_resumption_data.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
#include "connection_handler/mock_connection_handler.h"
#include "policy/mock_policy_settings.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "protocol_handler/mock_session_observer.h"
#include "protocol_handler/mock_protocol_handler.h"
-#include "application_manager/mock_rpc_plugin_manager.h"
-#include "application_manager/mock_rpc_plugin.h"
+#include "protocol_handler/mock_session_observer.h"
#include "utils/optional.h"
namespace test {
@@ -63,9 +63,9 @@ namespace am = application_manager;
using testing::_;
using ::testing::DoAll;
using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
using ::testing::SetArgPointee;
using namespace application_manager;
@@ -269,6 +269,6 @@ TEST_F(ApplicationManagerImplMockHmiTest,
Mock::VerifyAndClearExpectations(&mock_command_factory);
}
-} // application_manager_test
+} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index 7e57b51329..804959e1db 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -29,38 +29,43 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <bson_object.h>
#include <stdint.h>
#include <memory>
#include <set>
#include <string>
#include <vector>
-#include <bson_object.h>
-#include "gtest/gtest.h"
#include "application_manager/application.h"
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_app_service_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_resumption_data.h"
-#include "application_manager/mock_rpc_service.h"
#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/test/include/application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
#include "hmi_message_handler/mock_hmi_message_handler.h"
#include "media_manager/mock_media_manager.h"
#include "policy/mock_policy_settings.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol/bson_object_keys.h"
-#include "protocol_handler/mock_session_observer.h"
#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "resumption/mock_last_state.h"
#include "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/lock.h"
-#include "utils/push_log.h"
#include "encryption/hashing.h"
+#ifdef ENABLE_LOG
+#include "utils/push_log.h"
+#endif
namespace test {
namespace components {
@@ -72,15 +77,16 @@ namespace con_test = connection_handler_test;
using testing::_;
using ::testing::An;
-using ::testing::Matcher;
using ::testing::ByRef;
using ::testing::DoAll;
+using ::testing::Matcher;
using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
using ::testing::SaveArg;
using ::testing::SetArgPointee;
+using ::testing::SetArgReferee;
using namespace application_manager;
@@ -96,6 +102,19 @@ connection_handler::DeviceHandle kDeviceId = 12345u;
const std::string kAppId = "someID";
const uint32_t kConnectionKey = 1232u;
const std::string kAppName = "appName";
+
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+// Cloud application params
+const std::string kEndpoint = "endpoint";
+const std::string kEndpoint2 = "https://fakesdlcloudapptesting.com:8080";
+const std::string kAuthToken = "auth_token";
+const std::string kCertificate = "cert";
+const std::string kTransportType = "WS";
+const mobile_api::HybridAppPreference::eType kHybridAppPreference =
+ mobile_api::HybridAppPreference::CLOUD;
+const std::string kHybridAppPreferenceStr = "CLOUD";
+const bool kEnabled = true;
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
} // namespace
class ApplicationManagerImplTest : public ::testing::Test {
@@ -106,6 +125,10 @@ class ApplicationManagerImplTest : public ::testing::Test {
std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_))
, mock_rpc_service_(new MockRPCService)
+ , mock_policy_handler_(
+ new test::components::policy_test::MockPolicyHandlerInterface)
+ , mock_app_service_manager_(
+ new MockAppServiceManager(mock_app_mngr_, mock_last_state_))
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock())
@@ -122,14 +145,21 @@ class ApplicationManagerImplTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
CreateAppManager();
- ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, &kDeviceId))
- .WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0)));
+ ON_CALL(mock_session_observer_, GetDataOnSessionKey(_, _, _, _))
+ .WillByDefault(DoAll(SetArgPointee<3u>(kDeviceId), Return(0)));
ON_CALL(mock_connection_handler_, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer_));
- app_manager_impl_->SetRPCService(mock_rpc_service_);
+ app_manager_impl_->SetMockRPCService(mock_rpc_service_);
app_manager_impl_->resume_controller().set_resumption_storage(
mock_storage_);
app_manager_impl_->set_connection_handler(&mock_connection_handler_);
+ ON_CALL(*mock_app_service_manager_, UnpublishServices(_))
+ .WillByDefault(Return());
+ ON_CALL(*mock_app_service_manager_, OnAppActivated(_))
+ .WillByDefault(Return());
+ app_manager_impl_->SetAppServiceManager(mock_app_service_manager_);
+ Json::Value empty;
+ ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(empty));
}
void CreateAppManager() {
@@ -149,7 +179,8 @@ class ApplicationManagerImplTest : public ::testing::Test {
ON_CALL(mock_application_manager_settings_, default_timeout())
.WillByDefault(ReturnRef(kTimeout));
ON_CALL(mock_application_manager_settings_,
- application_list_update_timeout()).WillByDefault(Return(kTimeout));
+ application_list_update_timeout())
+ .WillByDefault(Return(kTimeout));
app_manager_impl_.reset(new am::ApplicationManagerImpl(
mock_application_manager_settings_, mock_policy_settings_));
@@ -196,16 +227,24 @@ class ApplicationManagerImplTest : public ::testing::Test {
connection_handler::DeviceHandle secondary_device_handle,
std::string secondary_transport_device_string);
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ void AddCloudAppToPendingDeviceMap();
+ void CreatePendingApplication();
+#endif
uint32_t app_id_;
NiceMock<policy_test::MockPolicySettings> mock_policy_settings_;
std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
- std::unique_ptr<rpc_service::RPCService> mock_rpc_service_;
+ MockRPCService* mock_rpc_service_;
+ resumption_test::MockLastState mock_last_state_;
NiceMock<con_test::MockConnectionHandler> mock_connection_handler_;
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ test::components::policy_test::MockPolicyHandlerInterface*
+ mock_policy_handler_;
application_manager_test::MockApplicationManager mock_app_mngr_;
std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ MockAppServiceManager* mock_app_service_manager_;
application_manager::MockMessageHelper* mock_message_helper_;
std::shared_ptr<MockApplication> mock_app_ptr_;
@@ -1120,9 +1159,10 @@ bool ApplicationManagerImplTest::CheckResumptionRequiredTransportAvailableTest(
TransportTypeProfileStringFromDeviceHandle(secondary_device_handle))
.WillOnce(Return(secondary_transport_device_string));
} else {
- EXPECT_CALL(mock_session_observer_,
- TransportTypeProfileStringFromDeviceHandle(
- secondary_device_handle)).WillOnce(Return(std::string("")));
+ EXPECT_CALL(
+ mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(secondary_device_handle))
+ .WillOnce(Return(std::string("")));
}
return app_manager_impl_->CheckResumptionRequiredTransportAvailable(
@@ -1413,6 +1453,280 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true));
}
-} // application_manager_test
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+void ApplicationManagerImplTest::AddCloudAppToPendingDeviceMap() {
+ app_manager_impl_->SetMockPolicyHandler(mock_policy_handler_);
+ std::vector<std::string> enabled_apps{"1234"};
+ EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_))
+ .WillOnce(SetArgReferee<0>(enabled_apps));
+ EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<1>(kEnabled),
+ SetArgReferee<2>(kEndpoint2),
+ SetArgReferee<3>(kCertificate),
+ SetArgReferee<4>(kAuthToken),
+ SetArgReferee<5>(kTransportType),
+ SetArgReferee<6>(kHybridAppPreferenceStr),
+ Return(true)));
+
+ std::vector<std::string> nicknames{"CloudApp"};
+ EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _))
+ .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true)));
+
+ EXPECT_CALL(*mock_policy_handler_, GetIconUrl(_)).WillOnce(Return(""));
+
+ app_manager_impl_->RefreshCloudAppInformation();
+}
+
+void ApplicationManagerImplTest::CreatePendingApplication() {
+ AddCloudAppToPendingDeviceMap();
+
+ // CreatePendingApplication
+ transport_manager::DeviceInfo device_info(
+ 1, "mac", kEndpoint2, "CLOUD_WEBSOCKET");
+ std::vector<std::string> nicknames{"CloudApp"};
+ EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _))
+ .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true)));
+ std::vector<std::string> enabled_apps{"1234"};
+
+ EXPECT_CALL(*mock_policy_handler_, GetStatisticManager())
+ .WillOnce(Return(std::shared_ptr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager())));
+ EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<1>(kEnabled),
+ SetArgReferee<2>(kEndpoint2),
+ SetArgReferee<3>(kCertificate),
+ SetArgReferee<4>(kAuthToken),
+ SetArgReferee<5>(kTransportType),
+ SetArgReferee<6>(kHybridAppPreferenceStr),
+ Return(true)));
+ // Expect Update app list
+ EXPECT_CALL(*mock_rpc_service_, ManageHMICommand(_, _)).Times(1);
+ app_manager_impl_->CreatePendingApplication(1, device_info, 1);
+ AppsWaitRegistrationSet app_list =
+ app_manager_impl_->AppsWaitingForRegistration().GetData();
+ EXPECT_EQ(1u, app_list.size());
+}
+
+TEST_F(ApplicationManagerImplTest, CreatePendingApplication) {
+ CreatePendingApplication();
+}
+
+TEST_F(ApplicationManagerImplTest, SetPendingState) {
+ AddCloudAppToPendingDeviceMap();
+ AddMockApplication();
+ AppsWaitRegistrationSet app_list =
+ app_manager_impl_->AppsWaitingForRegistration().GetData();
+ EXPECT_EQ(0u, app_list.size());
+ EXPECT_CALL(*mock_app_ptr_, policy_app_id()).WillRepeatedly(Return("1234"));
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(123));
+ std::string mac = "MAC_ADDRESS";
+ EXPECT_CALL(*mock_app_ptr_, mac_address()).WillRepeatedly(ReturnRef(mac));
+ transport_manager::DeviceInfo device_info(
+ 1, "mac", kEndpoint2, "CLOUD_WEBSOCKET");
+
+ std::vector<std::string> enabled_apps{"1234"};
+
+ EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_))
+ .WillOnce(SetArgReferee<0>(enabled_apps));
+ EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<1>(kEnabled),
+ SetArgReferee<2>(kEndpoint2),
+ SetArgReferee<3>(kCertificate),
+ SetArgReferee<4>(kAuthToken),
+ SetArgReferee<5>(kTransportType),
+ SetArgReferee<6>(kHybridAppPreferenceStr),
+ Return(true)));
+
+ std::vector<std::string> nicknames{"CloudApp"};
+ EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _))
+ .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true)));
+
+ EXPECT_CALL(*mock_policy_handler_, GetIconUrl(_)).WillOnce(Return(""));
+
+ plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
+ new plugin_manager::MockRPCPluginManager;
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ mock_rpc_plugin_manager);
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
+
+ EXPECT_CALL(mock_connection_handler_, GetDeviceID(_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(0), Return(true)));
+ app_manager_impl_->SetPendingApplicationState(1, device_info);
+ app_list = app_manager_impl_->AppsWaitingForRegistration().GetData();
+ EXPECT_EQ(1u, app_list.size());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ RegisterApplication_CloudAppRegisterSuccess) {
+ std::shared_ptr<MockApplication> waiting_app =
+ std::make_shared<MockApplication>();
+ ON_CALL(*waiting_app, device()).WillByDefault(Return(kDeviceId));
+ EXPECT_CALL(*waiting_app, cloud_app_endpoint())
+ .WillOnce(ReturnRef(kEndpoint));
+ EXPECT_CALL(*waiting_app, auth_token()).WillOnce(ReturnRef(kAuthToken));
+ EXPECT_CALL(*waiting_app, cloud_app_certificate())
+ .WillOnce(ReturnRef(kCertificate));
+ EXPECT_CALL(*waiting_app, cloud_app_transport_type())
+ .WillOnce(ReturnRef(kTransportType));
+ EXPECT_CALL(*waiting_app, hybrid_app_preference())
+ .WillOnce(ReturnRef(kHybridAppPreference));
+ ON_CALL(*waiting_app, is_cloud_app()).WillByDefault(Return(true));
+ EXPECT_CALL(*waiting_app, policy_app_id()).WillRepeatedly(Return(kAppId));
+ app_manager_impl_->AddMockPendingApplication(waiting_app);
+
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(kConnectionKey,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(kDeviceId), Return(0)));
+ EXPECT_CALL(*mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL))
+ .Times(0);
+ smart_objects::SmartObject request_for_registration(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& params =
+ request_for_registration[strings::msg_params];
+ params[strings::app_id] = kAppId;
+ params[strings::language_desired] = mobile_api::Language::EN_US;
+ params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US;
+
+ request_for_registration[strings::params][strings::connection_key] =
+ kConnectionKey;
+ request_for_registration[strings::msg_params][strings::app_name] = kAppName;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::minor_version] = APIVersion::kAPIV2;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::major_version] = APIVersion::kAPIV3;
+
+ request_for_registration[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2;
+
+ smart_objects::SmartObjectSPtr request_for_registration_ptr =
+ std::make_shared<smart_objects::SmartObject>(request_for_registration);
+
+ ApplicationSharedPtr application =
+ app_manager_impl_->RegisterApplication(request_for_registration_ptr);
+
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ application->protocol_version());
+ EXPECT_EQ(APIVersion::kAPIV2,
+ application->version().min_supported_api_version);
+ EXPECT_EQ(APIVersion::kAPIV3,
+ application->version().max_supported_api_version);
+ EXPECT_EQ(kEndpoint, application->cloud_app_endpoint());
+ EXPECT_EQ(kAuthToken, application->auth_token());
+ EXPECT_EQ(kCertificate, application->cloud_app_certificate());
+ EXPECT_EQ(kTransportType, application->cloud_app_transport_type());
+ EXPECT_EQ(kHybridAppPreference, application->hybrid_app_preference());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ RegisterApplication_CloudAppRegisterFailed_DISALLOWED) {
+ std::shared_ptr<MockApplication> waiting_app =
+ std::make_shared<MockApplication>();
+ EXPECT_CALL(*waiting_app, device()).WillRepeatedly(Return(kDeviceId));
+ EXPECT_CALL(*waiting_app, is_cloud_app()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*waiting_app, policy_app_id())
+ .WillRepeatedly(Return("Fake" + kAppId));
+ app_manager_impl_->AddMockPendingApplication(waiting_app);
+
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(kConnectionKey,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(kDeviceId), Return(0)));
+ EXPECT_CALL(*mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+ smart_objects::SmartObject request_for_registration(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& params =
+ request_for_registration[strings::msg_params];
+ params[strings::app_id] = kAppId;
+ params[strings::language_desired] = mobile_api::Language::EN_US;
+ params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US;
+
+ request_for_registration[strings::params][strings::connection_key] =
+ kConnectionKey;
+ request_for_registration[strings::msg_params][strings::app_name] = kAppName;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::minor_version] = APIVersion::kAPIV2;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::major_version] = APIVersion::kAPIV3;
+
+ request_for_registration[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2;
+
+ smart_objects::SmartObjectSPtr request_for_registration_ptr =
+ std::make_shared<smart_objects::SmartObject>(request_for_registration);
+
+ ApplicationSharedPtr application =
+ app_manager_impl_->RegisterApplication(request_for_registration_ptr);
+ EXPECT_EQ(0, application.use_count());
+}
+
+TEST_F(ApplicationManagerImplTest, PolicyIDByIconUrl_Success) {
+ app_manager_impl_->SetMockPolicyHandler(mock_policy_handler_);
+ std::vector<std::string> enabled_apps{"1234"};
+ EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_))
+ .WillOnce(SetArgReferee<0>(enabled_apps));
+ EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<1>(kEnabled),
+ SetArgReferee<2>(kEndpoint2),
+ SetArgReferee<3>(kCertificate),
+ SetArgReferee<4>(kAuthToken),
+ SetArgReferee<5>(kTransportType),
+ SetArgReferee<6>(kHybridAppPreferenceStr),
+ Return(true)));
+
+ std::vector<std::string> nicknames{"CloudApp"};
+ EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _))
+ .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true)));
+
+ const std::string url = "https://www.fakeiconurl.com/icon.png";
+ EXPECT_CALL(*mock_policy_handler_, GetIconUrl("1234"))
+ .WillRepeatedly(Return(url));
+
+ app_manager_impl_->RefreshCloudAppInformation();
+
+ std::string result = app_manager_impl_->PolicyIDByIconUrl(url);
+ EXPECT_EQ(result, "1234");
+}
+
+TEST_F(ApplicationManagerImplTest, SetIconFileFromSystemRequest_Success) {
+ CreatePendingApplication();
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
+
+ file_system::CreateDirectory(kDirectoryName);
+ const std::string full_icon_path = kDirectoryName + "/1234";
+ ASSERT_TRUE(file_system::CreateFile(full_icon_path));
+
+ const std::string url = "https://www.fakeiconurl.com/icon.png";
+ EXPECT_CALL(*mock_policy_handler_, GetIconUrl("1234"))
+ .WillRepeatedly(Return(url));
+
+ smart_objects::SmartObject dummy_object(smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr sptr =
+ std::make_shared<smart_objects::SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+ EXPECT_CALL(*mock_rpc_service_, ManageHMICommand(sptr, _)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillOnce(ReturnRef(kDirectoryName));
+ app_manager_impl_->SetIconFileFromSystemRequest("1234");
+ EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true));
+}
+
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index a0bfa2890f..5ebcdd29c7 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -31,15 +31,15 @@
*/
#include "application_manager/application_state.h"
-#include "gtest/gtest.h"
+#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/hmi_state.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "resumption/last_state.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/state_controller.h"
+#include "gtest/gtest.h"
+#include "resumption/last_state.h"
namespace test {
namespace components {
@@ -60,7 +60,7 @@ std::vector<StateID> GenerateCurrentStates() {
states.push_back(StateID::STATE_ID_DEACTIVATE_HMI);
return states;
}
-}
+} // namespace
class ApplicationStateTest : public ::testing::Test {
public:
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
index 56e24b8d29..8a5c639775 100644
--- a/src/components/application_manager/test/command_holder_test.cc
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -36,8 +36,8 @@
#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_rpc_service.h"
namespace test {
@@ -84,7 +84,7 @@ TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) {
mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
// Act
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _));
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -99,7 +99,8 @@ TEST_F(CommandHolderImplTest, HoldMany_ExpectReleaseSame) {
} while (iterations < 5);
// Act
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _))
+ .Times(iterations);
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -112,7 +113,7 @@ TEST_F(CommandHolderImplTest, Hold_Drop_ExpectNoReleased) {
// Act
cmd_holder.Clear(mock_app_ptr_);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)).Times(0);
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -127,7 +128,7 @@ TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) {
std::shared_ptr<MockApplication> another_app =
std::make_shared<MockApplication>();
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)).Times(0);
cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -146,7 +147,8 @@ TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) {
std::make_shared<MockApplication>();
cmd_holder.Clear(another_app);
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _))
+ .Times(iterations);
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -160,7 +162,7 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) {
mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand, cmd_ptr_);
// Act
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _));
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
EXPECT_CALL(
@@ -171,6 +173,6 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) {
am::CommandHolder::CommandType::kMobileCommand);
}
-} // application_manager_test
-} // components
-} // test
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index 33258e60db..556f3a5032 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -59,6 +59,7 @@ set(LIBRARIES
ApplicationManager
jsoncpp
Policy
+ Resumption
)
create_test("commands_test" "${SOURCES}" "${LIBRARIES}")
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 222f16ef46..734a7d91b8 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -31,35 +31,35 @@
*/
#include <stdint.h>
-#include <string>
#include <algorithm>
#include <functional>
#include <set>
+#include <string>
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/application_manager.h"
#include "application_manager/commands/command.h"
#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace commands_test {
namespace command_impl {
-using ::testing::Return;
-using ::testing::AtLeast;
using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::Return;
namespace strings = ::application_manager::strings;
-using ::application_manager::commands::CommandImpl;
using ::application_manager::ApplicationManager;
-using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::ApplicationSharedPtr;
+using ::application_manager::commands::CommandImpl;
+using ::application_manager::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplication;
typedef std::shared_ptr<MockApplication> MockAppPtr;
@@ -82,14 +82,15 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
public:
class UnwrappedCommandImpl : CommandImpl {
public:
- using CommandImpl::ReplaceMobileWithHMIAppId;
using CommandImpl::ReplaceHMIWithMobileAppId;
+ using CommandImpl::ReplaceMobileWithHMIAppId;
- UnwrappedCommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler)
+ UnwrappedCommandImpl(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
: CommandImpl(message,
application_manager,
rpc_service,
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index c70dd14852..cf26c19249 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -31,25 +31,28 @@
*/
#include <stdint.h>
-#include <string>
#include <algorithm>
+#include <string>
-#include "gtest/gtest.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "gtest/gtest.h"
#include "utils/lock.h"
-#include "utils/data_accessor.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
#include "application_manager/application_manager.h"
-#include "application_manager/mock_application.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/data_accessor.h"
+
+#include "application_manager/mock_app_service_manager.h"
+#include "resumption/last_state_impl.h"
namespace test {
namespace components {
@@ -61,19 +64,21 @@ namespace strings = am::strings;
namespace hmi_response = am::hmi_response;
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::SaveArg;
-using ::testing::DoAll;
+using ::testing::SetArgReferee;
-using am::commands::MessageSharedPtr;
-using am::CommandParametersPermissions;
-using am::event_engine::EventObserver;
-using am::commands::CommandImpl;
-using am::commands::CommandRequestImpl;
using am::ApplicationManager;
using am::ApplicationSet;
-using am::RPCParams;
+using am::CommandParametersPermissions;
using am::MockHmiInterfaces;
+using am::RPCParams;
+using am::commands::CommandImpl;
+using am::commands::CommandRequestImpl;
+using am::commands::MessageSharedPtr;
+using am::event_engine::EventObserver;
+using test::components::application_manager_test::MockAppServiceManager;
typedef am::commands::CommandRequestImpl::RequestState RequestState;
@@ -100,10 +105,10 @@ class CommandRequestImplTest
class UnwrappedCommandRequestImpl : public CommandRequestImpl {
public:
- using CommandRequestImpl::CheckAllowedParameters;
- using CommandRequestImpl::RemoveDisallowedParameters;
using CommandRequestImpl::AddDisallowedParameters;
+ using CommandRequestImpl::CheckAllowedParameters;
using CommandRequestImpl::HasDisallowedParams;
+ using CommandRequestImpl::RemoveDisallowedParameters;
UnwrappedCommandRequestImpl(const MessageSharedPtr& message,
ApplicationManager& am,
@@ -258,7 +263,7 @@ TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
MessageSharedPtr result;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
command->CreateHMINotification(kInvalidFunctionId, *msg_params);
@@ -280,7 +285,7 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
EXPECT_EQ(kCorrelationId,
command->SendHMIRequest(kInvalidFunctionId, NULL, false));
@@ -298,7 +303,7 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
EXPECT_CALL(event_dispatcher_, add_observer(_, _, _));
EXPECT_EQ(kCorrelationId,
@@ -585,6 +590,87 @@ TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
command.reset();
}
+TEST_F(CommandRequestImplTest, SendProviderRequest_ByServiceType) {
+ resumption::LastStateImpl last_state("app_storage_folder",
+ "app_info_storage");
+ MockAppServiceManager app_service_manager(app_mngr_, last_state);
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager));
+ EXPECT_CALL(app_service_manager, GetProviderByType("MEDIA", _, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(false)));
+
+ MessageSharedPtr result;
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::GetAppServiceDataID;
+ (*msg)[strings::msg_params][strings::service_type] = "MEDIA";
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SendProviderRequest(
+ mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*msg),
+ true);
+}
+
+TEST_F(CommandRequestImplTest, SendProviderRequest_ByProviderID) {
+ resumption::LastStateImpl last_state("app_storage_folder",
+ "app_info_storage");
+ MockAppServiceManager app_service_manager(app_mngr_, last_state);
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager));
+ EXPECT_CALL(app_service_manager, GetProviderByID("serviceid12345", _, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(false)));
+
+ MessageSharedPtr result;
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::GetAppServiceDataID;
+ (*msg)[strings::msg_params][strings::service_id] = "serviceid12345";
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SendProviderRequest(
+ mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*msg),
+ true);
+}
+
+TEST_F(CommandRequestImplTest, SendProviderRequestToHMI_ByProviderID) {
+ resumption::LastStateImpl last_state("app_storage_folder",
+ "app_info_storage");
+ MockAppServiceManager app_service_manager(app_mngr_, last_state);
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, GetAppServiceManager())
+ .WillRepeatedly(ReturnRef(app_service_manager));
+ EXPECT_CALL(app_service_manager, GetProviderByID("serviceid12345", _, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(true)));
+
+ MessageSharedPtr result;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::GetAppServiceDataID;
+ (*msg)[strings::msg_params][strings::service_id] = "serviceid12345";
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SendProviderRequest(
+ mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*msg),
+ true);
+}
+
} // namespace command_request_impl
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc
index 41cc654a24..6362ea702e 100644
--- a/src/components/application_manager/test/commands/command_response_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -35,12 +35,12 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command.h"
#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -50,8 +50,8 @@ namespace command_response_impl {
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::commands::CommandResponseImpl;
+using ::application_manager::commands::MessageSharedPtr;
class CommandResponseImplTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index de0b5afb3c..6746e0d5ec 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -32,11 +32,11 @@
#include "gtest/gtest.h"
-#include "application_manager/event_engine/event_observer.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
-#include "application_manager/mock_event_observer.h"
+#include "application_manager/event_engine/event_observer.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_event_observer.h"
#include "smart_objects/smart_object.h"
#include "interfaces/HMI_API.h"
@@ -45,10 +45,12 @@ namespace test {
namespace components {
namespace event_engine_test {
-using application_manager::event_engine::EventDispatcherImpl;
using application_manager::event_engine::Event;
+using application_manager::event_engine::EventDispatcherImpl;
using application_manager::event_engine::EventObserver;
using testing::_;
+using ::testing::An;
+using ::testing::Matcher;
class EventEngineTest : public testing::Test {
public:
@@ -122,7 +124,9 @@ class EventEngineTest : public testing::Test {
event_dispatcher_instance_->add_observer(
event_id, correlation_id, event_observer_mock_);
event_->set_smart_object(so);
- EXPECT_CALL(event_observer_mock_, on_event(_)).Times(calls_number);
+
+ EXPECT_CALL(event_observer_mock_, on_event(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 f921eb1dde..dc6635b049 100644
--- a/src/components/application_manager/test/help_prompt_manager_test.cc
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -136,10 +136,12 @@ class HelpPromptManagerTest : public ::testing::Test {
typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager
MockAppManager;
MockAppManager app_mngr_;
+ // put this before ApplicationImplTest instance, so that app_mngr_settings_
+ // will still exist during app_impl_'s destructor.
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
std::shared_ptr<ApplicationImplTest> app_impl_;
MockHmiInterfaces mock_hmi_interfaces_;
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
std::shared_ptr<application_manager_test::MockApplication> mock_app_;
sync_primitives::Lock app_lock_;
MockRPCService mock_rpc_service_;
@@ -175,11 +177,6 @@ void HelpPromptManagerTest::SetUp() {
mock_help_prompt_manager_ =
std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
- HmiStatePtr state = std::make_shared<HmiState>(
- static_cast<std::shared_ptr<Application> >(mock_app_),
- app_mngr_,
- HmiState::STATE_ID_REGULAR);
-
std::string path = file_system::CreateDirectory("storage");
file_system::CreateFile(path + "/" + "certificate");
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index ae95fca35f..e883e7bddb 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -36,32 +36,32 @@
#include <string>
#include "application_manager/hmi_capabilities.h"
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/mock_message_helper.h"
-#include "smart_objects/enum_schema_item.h"
+#include "gtest/gtest.h"
#include "interfaces/HMI_API.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "application_manager/hmi_capabilities_for_testing.h"
-#include "utils/file_system.h"
#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_rpc_service.h"
+#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/state_controller.h"
#include "resumption/last_state_impl.h"
-#include "application_manager/resumption/resume_ctrl.h"
+#include "utils/file_system.h"
namespace test {
namespace components {
namespace application_manager_test {
using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
using ::testing::AtLeast;
-using ::testing::Invoke;
using ::testing::InSequence;
+using ::testing::Invoke;
+using ::testing::Return;
+using ::testing::ReturnRef;
using namespace application_manager;
@@ -76,7 +76,8 @@ class HMICapabilitiesTest : public ::testing::Test {
EXPECT_CALL(app_mngr_, get_settings())
.WillRepeatedly(ReturnRef(mock_application_manager_settings_));
EXPECT_CALL(mock_application_manager_settings_,
- hmi_capabilities_file_name()).WillOnce(ReturnRef(file_name_));
+ hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(file_name_));
EXPECT_CALL(mock_event_dispatcher, add_observer(_, _, _)).Times(1);
EXPECT_CALL(mock_event_dispatcher, remove_observer(_)).Times(1);
EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
@@ -140,9 +141,9 @@ struct CStringComparator {
}
};
-typedef std::map<const char*,
- hmi_apis::Common_Language::eType,
- CStringComparator> CStringToEnumMap;
+typedef std::
+ map<const char*, hmi_apis::Common_Language::eType, CStringComparator>
+ CStringToEnumMap;
CStringToEnumMap InitCStringToEnumMap() {
size_t value = sizeof(cstring_values_) / sizeof(cstring_values_[0]);
@@ -407,7 +408,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
.asInt());
EXPECT_EQ(350,
vs_capability_so[strings::preferred_resolution]
- [strings::resolution_height].asInt());
+ [strings::resolution_height]
+ .asInt());
EXPECT_TRUE(vs_capability_so.keyExists(strings::max_bitrate));
EXPECT_EQ(10000, vs_capability_so[strings::max_bitrate].asInt());
EXPECT_TRUE(vs_capability_so.keyExists(strings::supported_formats));
@@ -454,7 +456,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"]
.asBool());
EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0]
- ["desiredTemperatureAvailable"].asBool());
+ ["desiredTemperatureAvailable"]
+ .asBool());
EXPECT_TRUE(
rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"]
.asBool());
@@ -582,8 +585,9 @@ TEST_F(HMICapabilitiesTest, VerifyImageType) {
void HMICapabilitiesTest::SetCooperating() {
smart_objects::SmartObjectSPtr test_so;
EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
- CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ CreateModuleInfoSO(_, _))
+ .WillRepeatedly(Return(test_so));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillRepeatedly(Return(true));
}
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 ec88075212..5f07c1b9d1 100644
--- a/src/components/application_manager/test/hmi_language_handler_test.cc
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -32,18 +32,18 @@
#include <stdint.h>
-#include "gtest/gtest.h"
#include "application_manager/application_manager.h"
#include "application_manager/hmi_language_handler.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_rpc_service.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/smart_object_keys.h"
+#include "application_manager/state_controller.h"
+#include "gtest/gtest.h"
#include "test/resumption/mock_last_state.h"
#include "utils/lock.h"
@@ -54,13 +54,13 @@ namespace hmi_language_handler {
namespace am = ::application_manager;
-using am::event_engine::Event;
using am::ApplicationSet;
+using am::event_engine::Event;
+using ::testing::_;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::_;
typedef NiceMock<
::test::components::application_manager_test::MockApplicationManager>
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 1980ffa100..3a44d7b3ff 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
@@ -37,11 +37,11 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_impl.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+#include "smart_objects/smart_object.h"
#include "application_manager/event_engine/event.h"
@@ -49,12 +49,12 @@ namespace test {
namespace components {
namespace commands_test {
+using ::test::components::event_engine_test::MockEventDispatcher;
using ::testing::_;
-using ::testing::Return;
-using ::testing::SaveArg;
using ::testing::DoAll;
using ::testing::NiceMock;
-using ::test::components::event_engine_test::MockEventDispatcher;
+using ::testing::Return;
+using ::testing::SaveArg;
namespace am = ::application_manager;
using am::commands::Command;
using am::commands::CommandRequestImpl;
@@ -105,7 +105,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
MessageSharedPtr CatchHMICommandResult(CallableT delegate,
bool call_return = true) {
MessageSharedPtr result_msg;
- EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
delegate();
return result_msg;
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 9a961ea1a9..cd0514a0da 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
@@ -36,38 +36,38 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/test/include/application_manager/mock_hmi_interface.h"
-#include "application_manager/test/include/application_manager/mock_application.h"
-#include "application_manager/test/include/application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_rpc_service.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/test/include/application_manager/mock_application.h"
+#include "application_manager/test/include/application_manager/mock_hmi_interface.h"
+#include "application_manager/test/include/application_manager/mock_message_helper.h"
+#include "test/application_manager/mock_application_manager_settings.h"
namespace test {
namespace components {
namespace commands_test {
namespace am = ::application_manager;
-using ::testing::ReturnRef;
-using ::testing::Return;
-using ::testing::NiceMock;
-using ::testing::Mock;
using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
-using ::smart_objects::SmartObject;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
using am::commands::MessageSharedPtr;
+using ::smart_objects::SmartObject;
+using ::test::components::application_manager_test::MockApplication;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using ::test::components::application_manager_test::MockApplication;
// Depending on the value type will be selected
template <const bool kIf, class ThenT, class ElseT>
@@ -100,9 +100,8 @@ class CommandsTest : public ::testing::Test {
typedef typename TypeIf<kIsNice,
NiceMock<MockApplicationManager>,
MockApplicationManager>::Result MockAppManager;
- typedef typename TypeIf<kIsNice,
- NiceMock<MockApplication>,
- MockApplication>::Result MockApp;
+ typedef typename TypeIf<kIsNice, NiceMock<MockApplication>, MockApplication>::
+ Result MockApp;
typedef std::shared_ptr<MockApp> MockAppPtr;
virtual ~CommandsTest() {
@@ -183,11 +182,11 @@ class CommandsTest : public ::testing::Test {
void InitHMIToMobileResultConverter() {
namespace MobileResult = mobile_apis::Result;
namespace HMIResult = hmi_apis::Common_Result;
- auto link_hmi_to_mob_result =
- [this](HMIResult::eType hmi_result, MobileResult::eType mobile_result) {
- ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result))
- .WillByDefault(Return(mobile_result));
- };
+ auto link_hmi_to_mob_result = [this](HMIResult::eType hmi_result,
+ MobileResult::eType mobile_result) {
+ ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result))
+ .WillByDefault(Return(mobile_result));
+ };
link_hmi_to_mob_result(HMIResult::INVALID_ENUM, MobileResult::INVALID_ENUM);
link_hmi_to_mob_result(HMIResult::SUCCESS, MobileResult::SUCCESS);
link_hmi_to_mob_result(HMIResult::UNSUPPORTED_REQUEST,
@@ -233,17 +232,17 @@ class CommandsTest : public ::testing::Test {
};
MATCHER_P(MobileResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<mobile_apis::Result::eType>(
- (*arg)[application_manager::strings::msg_params]
- [application_manager::strings::result_code].asInt());
+ return result_code == static_cast<mobile_apis::Result::eType>(
+ (*arg)[application_manager::strings::msg_params]
+ [application_manager::strings::result_code]
+ .asInt());
}
MATCHER_P(HMIResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<hmi_apis::FunctionID::eType>(
- (*arg)[application_manager::strings::params]
- [application_manager::strings::function_id].asInt());
+ return result_code == static_cast<hmi_apis::FunctionID::eType>(
+ (*arg)[application_manager::strings::params]
+ [application_manager::strings::function_id]
+ .asInt());
}
MATCHER_P3(MobileResponseIs, result_code, result_info, result_success, "") {
diff --git a/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h
index 881ebb2575..9f50a73075 100644
--- a/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_H_
-#include "gmock/gmock.h"
#include "application_manager/app_launch/app_launch_data.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h b/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h
new file mode 100644
index 0000000000..f77b5685da
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h
@@ -0,0 +1,95 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/app_service_manager.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockAppServiceManager : public application_manager::AppServiceManager {
+ public:
+ MockAppServiceManager(application_manager::ApplicationManager& app_manager,
+ resumption::LastState& last_state)
+ : application_manager::AppServiceManager(app_manager, last_state) {}
+ MOCK_METHOD3(
+ PublishAppService,
+ smart_objects::SmartObject(const smart_objects::SmartObject& manifest,
+ const bool mobile_service,
+ const uint32_t connection_key));
+ MOCK_METHOD1(UnpublishAppService, bool(const std::string service_id));
+ MOCK_METHOD1(UnpublishServices, void(const uint32_t connection_key));
+ MOCK_METHOD1(OnAppActivated,
+ void(application_manager::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(SetDefaultService, bool(const std::string service_id));
+ MOCK_METHOD1(RemoveDefaultService, bool(const std::string service_id));
+ MOCK_METHOD1(ActivateAppService, bool(const std::string service_id));
+ MOCK_METHOD1(DeactivateAppService, bool(const std::string service_id));
+ MOCK_METHOD0(GetAllServiceRecords, std::vector<smart_objects::SmartObject>());
+ MOCK_METHOD0(GetActiveServices,
+ std::vector<application_manager::AppService>());
+ MOCK_METHOD4(GetProviderByType,
+ void(const std::string& service_type,
+ const bool mobile_consumer,
+ application_manager::ApplicationSharedPtr& app,
+ bool& hmi_service));
+ MOCK_METHOD4(GetProviderByID,
+ void(const std::string& service_id,
+ const bool mobile_consumer,
+ application_manager::ApplicationSharedPtr& app,
+ bool& hmi_service));
+ MOCK_METHOD1(
+ ActiveServiceForType,
+ application_manager::AppService*(const std::string service_type));
+ MOCK_METHOD1(
+ EmbeddedServiceForType,
+ application_manager::AppService*(const std::string service_type));
+ MOCK_METHOD1(FindServiceByID,
+ application_manager::AppService*(const std::string service_id));
+ MOCK_METHOD2(SetServicePublished,
+ void(const std::string service_id,
+ const bool service_published));
+ MOCK_METHOD1(UpdateNavigationCapabilities,
+ bool(smart_objects::SmartObject& out_params));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_
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 fe16e8ce6e..74d09661c7 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
@@ -1,43 +1,43 @@
/*
* Copyright (c) 2016, 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.
-*/
+ * 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_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_
#include <string>
-#include "gmock/gmock.h"
-#include "application_manager/application.h"
#include "application_manager/app_extension.h"
+#include "application_manager/application.h"
+#include "application_manager/usage_statistics.h"
+#include "gmock/gmock.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
-#include "application_manager/usage_statistics.h"
#include "utils/semantic_version.h"
namespace test {
@@ -342,6 +342,21 @@ class MockApplication : public ::application_manager::Application {
const std::list<application_manager::AppExtensionPtr>&());
MOCK_CONST_METHOD0(is_remote_control_supported, bool());
MOCK_METHOD1(set_remote_control_supported, void(const bool allow));
+ MOCK_CONST_METHOD0(cloud_app_endpoint, const std::string&());
+ MOCK_CONST_METHOD0(auth_token, const std::string&());
+ MOCK_CONST_METHOD0(cloud_app_transport_type, const std::string&());
+ MOCK_CONST_METHOD0(hybrid_app_preference,
+ const mobile_apis::HybridAppPreference::eType&());
+ MOCK_CONST_METHOD0(cloud_app_certificate, const std::string&());
+ MOCK_CONST_METHOD0(is_cloud_app, bool());
+ MOCK_METHOD1(set_cloud_app_endpoint, void(const std::string& endpoint));
+ MOCK_METHOD1(set_auth_token, void(const std::string& auth_token));
+ MOCK_METHOD1(set_cloud_app_transport_type,
+ void(const std::string& transport_type));
+ MOCK_METHOD1(set_hybrid_app_preference,
+ void(const mobile_apis::HybridAppPreference::eType&
+ hybrid_app_preference));
+ MOCK_METHOD1(set_cloud_app_certificate, void(const std::string& certificate));
};
} // namespace application_manager_test
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 916f4a69f0..b345f53c1c 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
@@ -37,6 +37,7 @@
#include "application_manager/event_engine/event.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/event_engine/event_observer.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
@@ -59,6 +60,26 @@ class MockEventDispatcher
MOCK_METHOD1(
remove_observer,
void(::application_manager::event_engine::EventObserver& observer));
+
+ MOCK_METHOD1(
+ raise_mobile_event,
+ void(const ::application_manager::event_engine::MobileEvent& event));
+ MOCK_METHOD3(
+ add_mobile_observer,
+ void(
+ const ::application_manager::event_engine::MobileEvent::MobileEventID&
+ event_id,
+ int32_t mobile_correlation_id,
+ ::application_manager::event_engine::EventObserver& observer));
+ MOCK_METHOD2(
+ remove_mobile_observer,
+ void(
+ const ::application_manager::event_engine::MobileEvent::MobileEventID&
+ event_id,
+ ::application_manager::event_engine::EventObserver& observer));
+ MOCK_METHOD1(
+ remove_mobile_observer,
+ void(::application_manager::event_engine::EventObserver& observer));
};
} // namespace event_engine_test
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 8af31c1998..1357d67a65 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_
-#include "application_manager/event_engine/event_observer.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_observer.h"
#include "gmock/gmock.h"
namespace test {
@@ -49,6 +49,9 @@ class MockEventObserver
: application_manager::event_engine::EventObserver(event_dispatcher) {}
MOCK_METHOD1(on_event,
void(const application_manager::event_engine::Event& event));
+ MOCK_METHOD1(
+ on_event,
+ void(const application_manager::event_engine::MobileEvent& event));
};
} // namespace event_engine_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
index a415f94d56..b44345deff 100644
--- a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
+++ b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
@@ -1,34 +1,34 @@
/*
* 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.
-*/
+ * 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_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
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 84a3b6bc87..819ead8d8b 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
@@ -32,13 +32,13 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
-#include "gmock/gmock.h"
#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "gmock/gmock.h"
#include "interfaces/HMI_API.h"
#include "policy/policy_types.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/application_manager.h"
#include "smart_objects/smart_object.h"
#include "transport_manager/common.h"
@@ -164,6 +164,8 @@ class MockMessageHelper {
ApplicationManager& app_mngr));
MOCK_METHOD1(CommonLanguageFromString,
hmi_apis::Common_Language::eType(const std::string& language));
+ MOCK_METHOD1(CommonLightNameFromString,
+ hmi_apis::Common_LightName::eType(const std::string& lightName));
MOCK_METHOD1(CommonLanguageToString,
std::string(hmi_apis::Common_Language::eType));
MOCK_METHOD2(CreateModuleInfoSO,
@@ -199,14 +201,16 @@ class MockMessageHelper {
MessageHelper::ChoiceSetVRCommandsStatus(
const smart_objects::SmartObject&));
- MOCK_METHOD6(GetBCActivateAppRequestToHMI,
+ MOCK_METHOD5(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr));
+ MOCK_METHOD2(GetBCCloseApplicationRequestToHMI,
+ smart_objects::SmartObjectSPtr(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
@@ -308,6 +312,12 @@ class MockMessageHelper {
void(mobile_apis::ButtonName::eType button,
ApplicationSharedPtr application,
ApplicationManager& app_mngr));
+ MOCK_METHOD1(CreateAppServiceCapabilities,
+ smart_objects::SmartObject(
+ std::vector<smart_objects::SmartObject>& all_services));
+ MOCK_METHOD2(BroadcastCapabilityUpdate,
+ void(smart_objects::SmartObject& msg_params,
+ ApplicationManager& app_mngr));
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 e4cfa84841..dfc6691ef4 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_
-#include "gmock/gmock.h"
#include "application_manager/commands/command.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
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 0fa7a898be..4fd3b7fc5a 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
@@ -31,9 +31,9 @@
*/
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_
-#include "gmock/gmock.h"
-#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/application.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "gmock/gmock.h"
#include "resumption/last_state.h"
namespace test {
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index 38d1944dba..7cabc12086 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -1,42 +1,42 @@
/*
-* Copyright (c) 2016, 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.
-*/
+ * Copyright (c) 2016, 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_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_
#include <string>
-#include "gmock/gmock.h"
-#include "application_manager/resumption/resumption_data.h"
#include "application_manager/application.h"
-#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/resumption/resumption_data.h"
+#include "gmock/gmock.h"
#include "smart_objects/smart_object.h"
namespace test {
diff --git a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
index cd4632965c..c79a31817e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
+++ b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
-#include "gmock/gmock.h"
#include "application_manager/telemetry_observer.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index 4e614c4d9f..cab3c23253 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -33,20 +33,20 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_
-#include <string>
#include <algorithm>
-#include "gtest/gtest.h"
-#include "application_manager/usage_statistics.h"
+#include <string>
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/mock_app_extension.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_app_extension.h"
-#include "utils/data_accessor.h"
-#include "config_profile/profile.h"
+#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/usage_statistics.h"
+#include "config_profile/profile.h"
+#include "gtest/gtest.h"
+#include "utils/data_accessor.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h
index e10f60afac..3f5802cb5a 100644
--- a/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h
+++ b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_
-#include "utils/sqlite_wrapper/sql_database.h"
-#include "application_manager/resumption/resumption_data_db.h"
-#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/resumption/resumption_data_db.h"
+#include "utils/sqlite_wrapper/sql_database.h"
using ::resumption::ResumptionDataDB;
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index d115ad8b40..99031849f6 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -40,6 +40,7 @@ set(LIBRARIES
ApplicationManager
MessageHelper
jsoncpp
+ Policy
connectionHandler
MediaManager
Resumption
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index 15a09c33cc..d0fbe696cd 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
@@ -36,18 +36,21 @@
#include "gmock/gmock.h"
#include "utils/macro.h"
-#include "application_manager/policies/policy_handler.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_help_prompt_manager.h"
-#include "utils/custom_string.h"
-#include "utils/lock.h"
-#include "policy/mock_policy_settings.h"
-#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_rpc_service.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/policies/policy_handler.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/state_controller.h"
+#include "policy/mock_policy_settings.h"
+#include "utils/custom_string.h"
+#include "utils/lock.h"
+
+#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base_json_inl.h"
#ifdef EXTERNAL_PROPRIETARY_MODE
#include "policy/policy_external/include/policy/policy_types.h"
@@ -67,12 +70,12 @@ typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr;
typedef std::vector<std::string> StringArray;
typedef std::shared_ptr<application_manager::Application> ApplicationSharedPtr;
+using testing::_;
using testing::AtLeast;
-using testing::ReturnRefOfCopy;
-using testing::ReturnRef;
using testing::Return;
+using testing::ReturnRef;
+using testing::ReturnRefOfCopy;
using testing::SaveArg;
-using testing::_;
TEST(MessageHelperTestCreate,
CreateBlockedByPoliciesResponse_SmartObject_Equal) {
@@ -948,7 +951,8 @@ TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
size_t function_id = 1;
//
EXPECT_CALL(*appSharedPtr,
- SubscribeToSoftButtons(function_id, SoftButtonID())).Times(1);
+ SubscribeToSoftButtons(function_id, SoftButtonID()))
+ .Times(1);
MessageHelper::SubscribeApplicationToSoftButton(
message_params, appSharedPtr, function_id);
}
@@ -964,7 +968,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
ON_CALL(mock_application_manager, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const uint32_t correlation_id = 0u;
@@ -1004,7 +1008,7 @@ TEST_F(MessageHelperTest,
ON_CALL(mock_application_manager, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const uint32_t correlation_id = 0u;
@@ -1050,7 +1054,7 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
smart_objects::SmartObjectSPtr result;
ON_CALL(mock_application_manager, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
int32_t app_id = 123;
diff --git a/src/components/application_manager/test/mobile_event_engine_test.cc b/src/components/application_manager/test/mobile_event_engine_test.cc
new file mode 100644
index 0000000000..cad1ff14ff
--- /dev/null
+++ b/src/components/application_manager/test/mobile_event_engine_test.cc
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_event_observer.h"
+#include "smart_objects/smart_object.h"
+
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace event_engine_test {
+
+using application_manager::event_engine::Event;
+using application_manager::event_engine::EventDispatcherImpl;
+using application_manager::event_engine::EventObserver;
+using application_manager::event_engine::MobileEvent;
+using testing::_;
+using ::testing::An;
+using ::testing::Matcher;
+
+class MobileEventEngineTest : public testing::Test {
+ public:
+ MobileEventEngineTest()
+ : event_id(MobileEvent::MobileEventID::GetAppServiceDataID)
+ , event_observer_mock_(mock_event_dispatcher_) {}
+
+ protected:
+ EventDispatcherImpl* event_dispatcher_instance_;
+ MobileEvent* event_;
+ const MobileEvent::MobileEventID event_id;
+ MockEventDispatcher mock_event_dispatcher_;
+ MockEventObserver event_observer_mock_;
+ const int32_t correlation_id = 1121;
+ smart_objects::SmartObject smart_object_with_type_notification;
+ smart_objects::SmartObject smart_object_with_type_response;
+ smart_objects::SmartObject smart_object_with_type_error_response;
+ smart_objects::SmartObject smart_object_with_type_request;
+ smart_objects::SmartObject smart_object_with_invalid_type;
+
+ virtual void SetUp() OVERRIDE {
+ event_dispatcher_instance_ = new EventDispatcherImpl();
+ event_ =
+ new MobileEvent(mobile_apis::FunctionID::eType::GetAppServiceDataID);
+ smart_object_with_type_notification["params"]["message_type"] =
+ application_manager::MessageType::kNotification;
+ smart_object_with_type_notification["params"]["correlation_id"] =
+ correlation_id;
+ smart_object_with_type_notification["params"]["function_id"] =
+ mobile_apis::FunctionID::eType::GetAppServiceDataID;
+
+ smart_object_with_type_response["params"]["message_type"] =
+ application_manager::MessageType::kResponse;
+ smart_object_with_type_response["params"]["correlation_id"] =
+ correlation_id;
+ smart_object_with_type_response["params"]["function_id"] =
+ mobile_apis::FunctionID::eType::GetAppServiceDataID;
+
+ smart_object_with_type_request["params"]["message_type"] =
+ application_manager::MessageType::kRequest;
+ smart_object_with_type_request["params"]["correlation_id"] = correlation_id;
+ smart_object_with_type_request["params"]["function_id"] =
+ mobile_apis::FunctionID::eType::GetAppServiceDataID;
+
+ smart_object_with_invalid_type["params"]["message_type"] =
+ application_manager::MessageType::kUnknownType;
+ smart_object_with_invalid_type["params"]["correlation_id"] = correlation_id;
+ smart_object_with_invalid_type["params"]["function_id"] =
+ mobile_apis::FunctionID::eType::GetAppServiceDataID;
+ }
+
+ void TearDown() OVERRIDE {
+ delete event_dispatcher_instance_;
+ delete event_;
+ }
+
+ void CheckRaiseMobileEvent(const MobileEvent::MobileEventID& event_id,
+ const uint32_t calls_number,
+ const smart_objects::SmartObject& so) {
+ // Arrange
+ 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&>()))
+ .Times(calls_number);
+ event_dispatcher_instance_->raise_mobile_event(*event_);
+ }
+};
+
+TEST_F(MobileEventEngineTest, EventObserverTest_ExpectObserversEmpty) {
+ // Arrange
+ EventObserver* event_observer_ptr =
+ static_cast<EventObserver*>(&event_observer_mock_);
+ // Check
+ EXPECT_EQ(reinterpret_cast<unsigned long>(event_observer_ptr),
+ event_observer_mock_.id());
+}
+
+TEST_F(MobileEventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeResponse_ExpectEventRaised) {
+ CheckRaiseMobileEvent(event_id, 1u, smart_object_with_type_response);
+}
+
+TEST_F(MobileEventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeInvalid_ExpectEventNotRaised) {
+ CheckRaiseMobileEvent(event_id, 0u, smart_object_with_invalid_type);
+}
+
+TEST_F(MobileEventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeRequest_ExpectEventNotRaised) {
+ CheckRaiseMobileEvent(event_id, 0u, smart_object_with_type_request);
+}
+
+TEST_F(
+ MobileEventEngineTest,
+ EventDispatcherImpl_RaiseEvent_EventSOTypeNotification_ExpectEventNotRaised) {
+ CheckRaiseMobileEvent(event_id, 0u, smart_object_with_type_notification);
+}
+
+TEST_F(MobileEventEngineTest, Event_set_smart_object_ExpectObjectSet) {
+ // Act
+ event_->set_smart_object(smart_object_with_type_response);
+ const int32_t obj_type =
+ static_cast<int32_t>(application_manager::MessageType::kResponse);
+ const int32_t function_id =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::GetAppServiceDataID);
+ // Checks
+ EXPECT_EQ(obj_type, event_->smart_object_type());
+ EXPECT_EQ(function_id, event_->smart_object_function_id());
+ EXPECT_EQ(correlation_id, event_->smart_object_correlation_id());
+ EXPECT_EQ(smart_object_with_type_response, event_->smart_object());
+}
+
+} // namespace event_engine_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
index 23957b61fb..cac04d4508 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -32,30 +32,30 @@
#include "application_manager/mobile_message_handler.h"
-#include <string>
-#include <ctime>
#include <algorithm>
+#include <ctime>
#include <iterator>
+#include <string>
#include <vector>
-#include "gmock/gmock.h"
#include "application_manager/message.h"
+#include "gmock/gmock.h"
#include "protocol/raw_message.h"
namespace test {
namespace components {
namespace application_manager_test {
+using ::application_manager::Message;
+using ::application_manager::MobileMessage;
+using application_manager::MobileMessageHandler;
+using protocol_handler::MajorProtocolVersion;
+using protocol_handler::MessagePriority;
+using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
using protocol_handler::ServiceType;
-using protocol_handler::MessagePriority;
-using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
-using application_manager::MobileMessageHandler;
-using protocol_handler::MajorProtocolVersion;
using ::testing::_;
-using ::application_manager::Message;
-using ::application_manager::MobileMessage;
using testing::Return;
diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
index 5cbc28b20c..7801798705 100644
--- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -32,19 +32,19 @@
#include "application_manager/mobile_message_handler.h"
-#include <string>
-#include <vector>
#include <algorithm>
#include <iterator>
+#include <string>
+#include <vector>
-#include "gmock/gmock.h"
#include "application_manager/message.h"
+#include "gmock/gmock.h"
#include "protocol/raw_message.h"
+using application_manager::MobileMessageHandler;
+using protocol_handler::PROTOCOL_HEADER_V1_SIZE;
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
-using protocol_handler::PROTOCOL_HEADER_V1_SIZE;
-using application_manager::MobileMessageHandler;
namespace test {
namespace components {
diff --git a/src/components/application_manager/test/mock_application_helper.cc b/src/components/application_manager/test/mock_application_helper.cc
index c64a56e53e..ea57709a73 100644
--- a/src/components/application_manager/test/mock_application_helper.cc
+++ b/src/components/application_manager/test/mock_application_helper.cc
@@ -41,15 +41,16 @@ MockApplicationHelper& MockApplicationHelper::application_helper_mock() {
return application_helper_mock;
}
-} // application_manager_test
-} // components
-} // test
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
namespace application_manager {
void DeleteApplicationData(ApplicationSharedPtr app,
ApplicationManager& app_manager) {
test::components::application_manager_test::MockApplicationHelper::
- application_helper_mock().RecallApplicationData(app, app_manager);
+ application_helper_mock()
+ .RecallApplicationData(app, app_manager);
}
-} // application_managers
+} // namespace application_manager
diff --git a/src/components/application_manager/test/mock_hmi_command_factory.cc b/src/components/application_manager/test/mock_hmi_command_factory.cc
index 375da26067..5f76a9300b 100644
--- a/src/components/application_manager/test/mock_hmi_command_factory.cc
+++ b/src/components/application_manager/test/mock_hmi_command_factory.cc
@@ -30,9 +30,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/mock_hmi_command_factory.h"
#include <gmock/gmock.h>
#include "application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h"
-#include "application_manager/mock_hmi_command_factory.h"
namespace test {
namespace components {
@@ -43,9 +43,9 @@ MockHMICommandFactory* MockHMICommandFactory::mock_hmi_command_factory() {
return &mock_hmi_command_factory;
}
-} // application_manager_test
-} // components
-} // test
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
namespace sdl_rpc_plugin {
namespace app_mngr = application_manager;
@@ -53,6 +53,7 @@ app_mngr::CommandSharedPtr HMICommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager) {
return test::components::application_manager_test::MockHMICommandFactory::
- mock_hmi_command_factory()->CreateCommand(message, application_manager);
+ mock_hmi_command_factory()
+ ->CreateCommand(message, application_manager);
}
-} // application_manager
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index f091e183dc..522ef3dbd5 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "application_manager/message_helper.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
-#include "transport_manager/common.h"
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "transport_manager/common.h"
namespace application_manager {
@@ -277,6 +277,12 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
language);
}
+hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString(
+ const std::string& lightName) {
+ return MockMessageHelper::message_helper_mock()->CommonLightNameFromString(
+ lightName);
+}
+
smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
uint32_t function_id, ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->CreateModuleInfoSO(
@@ -362,18 +368,18 @@ std::string MessageHelper::CommonLanguageToString(
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->GetBCActivateAppRequestToHMI(
- app,
- session_observer,
- policy_handler,
- level,
- send_policy_priority,
- app_mngr);
+ app, policy_handler, level, send_policy_priority, app_mngr);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->GetBCCloseApplicationRequestToHMI(app, app_mngr);
}
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
@@ -572,4 +578,15 @@ void MessageHelper::SendUnsubscribeButtonNotification(
->SendUnsubscribeButtonNotification(button, application, app_mngr);
}
+smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
+ std::vector<smart_objects::SmartObject>& all_services) {
+ return MockMessageHelper::message_helper_mock()->CreateAppServiceCapabilities(
+ all_services);
+}
+
+void MessageHelper::BroadcastCapabilityUpdate(
+ smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->BroadcastCapabilityUpdate(
+ msg_params, app_mngr);
+}
} // 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 9b97f054b3..a74b12071c 100644
--- a/src/components/application_manager/test/policy_event_observer_test.cc
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -33,10 +33,10 @@
#include "application_manager/policies/policy_event_observer.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "gmock/gmock.h"
#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/mock_event_dispatcher.h"
namespace test {
namespace components {
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index a1471eff36..458b065cdd 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -30,48 +30,47 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <fstream>
#include <string>
#include <vector>
-#include <fstream>
#include "gmock/gmock.h"
-#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
#include "application_manager/policies/delegates/app_permission_delegate.h"
+#include "application_manager/policies/policy_handler.h"
#include "connection_handler/connection_handler_impl.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/application_impl.h"
#ifdef ENABLE_SECURITY
-#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_crypto_manager.h"
+#include "security_manager/mock_security_manager.h"
#endif // ENABLE_SECURITY
#include "application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler_settings.h"
-#include "transport_manager/mock_transport_manager.h"
-#include "policy/policy_types.h"
#include "json/reader.h"
-#include "json/writer.h"
#include "json/value.h"
+#include "json/writer.h"
+#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
+#include "transport_manager/mock_transport_manager.h"
#include "utils/file_system.h"
-#include "utils/custom_string.h"
-#include "policy/usage_statistics/counter.h"
-#include "policy/usage_statistics/statistics_manager.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/counter.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "utils/custom_string.h"
#include "application_manager/mock_application.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/policies/mock_policy_handler_observer.h"
#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_state_controller.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_rpc_service.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_observer.h"
+#include "connection_handler/mock_connection_handler.h"
#include "policy/mock_policy_manager.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
namespace test {
namespace components {
@@ -81,15 +80,13 @@ using namespace application_manager;
using namespace policy;
using namespace utils::custom_string;
using testing::_;
+using ::testing::DoAll;
using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::SetArgReferee;
using ::testing::SetArgPointee;
-using ::testing::DoAll;
using ::testing::SetArgReferee;
-using ::testing::Mock;
typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
@@ -380,6 +377,70 @@ TEST_F(PolicyHandlerTest, ClearUserConsent) {
policy_handler_.ClearUserConsent();
}
+TEST_F(PolicyHandlerTest, AppServiceUpdate_CheckAppService) {
+ // Arrange
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ // Check
+ EXPECT_TRUE(policy_handler_.InitPolicyTable());
+ ChangePolicyManagerToMock();
+ std::string file_name("sdl_pt_update.json");
+ std::ifstream ifile(file_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ json = root.toStyledString();
+ }
+ ifile.close();
+ BinaryMessage msg(json.begin(), json.end());
+ // Checks
+ EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(true));
+ policy_handler_.ReceiveMessageFromSDK("", msg);
+
+ policy_table::AppServiceParameters app_service_params =
+ policy_table::AppServiceParameters();
+ std::string kServiceType = "MEDIA";
+ std::string as_app_id = "1010101010";
+ std::string service_name1 = "SDL Music";
+ std::string service_name2 = "SDL App";
+ (app_service_params)[kServiceType] = policy_table::AppServiceInfo();
+ (app_service_params)[kServiceType].service_names->push_back(service_name2);
+ (app_service_params)[kServiceType].service_names->push_back(service_name1);
+ (app_service_params)[kServiceType].service_names->mark_initialized();
+ policy_table::AppServiceHandledRpc handled_rpc;
+ handled_rpc.function_id = 41;
+ (app_service_params)[kServiceType].handled_rpcs.push_back(handled_rpc);
+ EXPECT_CALL(*mock_policy_manager_, GetAppServiceParameters(_, _))
+ .WillRepeatedly(SetArgPointee<1>(app_service_params));
+
+ ns_smart_device_link::ns_smart_objects::SmartArray requested_handled_rpcs;
+ ns_smart_device_link::ns_smart_objects::SmartObject rpc_id(41);
+ requested_handled_rpcs.push_back(rpc_id);
+
+ ns_smart_device_link::ns_smart_objects::SmartArray fake_handled_rpcs;
+ ns_smart_device_link::ns_smart_objects::SmartObject fake_rpc_id(40);
+ fake_handled_rpcs.push_back(fake_rpc_id);
+
+ EXPECT_TRUE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, service_name1, kServiceType, &requested_handled_rpcs));
+ EXPECT_TRUE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, service_name2, kServiceType, &requested_handled_rpcs));
+ EXPECT_TRUE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, service_name2, kServiceType, NULL));
+ EXPECT_TRUE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, "", kServiceType, NULL));
+
+ EXPECT_FALSE(
+ policy_handler_.CheckAppServiceParameters(as_app_id, "", "", NULL));
+ EXPECT_FALSE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, service_name2, "NAVIGATION", &requested_handled_rpcs));
+ EXPECT_FALSE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, "MUSIC", kServiceType, &requested_handled_rpcs));
+ EXPECT_FALSE(policy_handler_.CheckAppServiceParameters(
+ as_app_id, service_name2, kServiceType, &fake_handled_rpcs));
+}
+
TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK) {
// Arrange
EnablePolicy();
@@ -448,7 +509,8 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_,
- SendOnPermissionsChangeNotification(_, _, _)).Times(0);
+ SendOnPermissionsChangeNotification(_, _, _))
+ .Times(0);
Permissions permissions;
policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions);
@@ -916,7 +978,8 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appPermissionsConsentNeeded = false;
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _))
+ .Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
@@ -1055,7 +1118,8 @@ TEST_F(PolicyHandlerTest,
// Check expectations
// Notification won't be sent
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _))
+ .Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
@@ -2180,7 +2244,8 @@ TEST_F(PolicyHandlerTest,
_,
NULL,
_,
- _)).WillOnce(Return(1u));
+ _))
+ .WillOnce(Return(1u));
EXPECT_CALL(app_manager_, application(kConnectionKey_))
.WillOnce(Return(mock_app_));
@@ -2536,6 +2601,104 @@ TEST_F(PolicyHandlerTest, RemoteAppsUrl_SUCCESS) {
EXPECT_EQ(url, policy_handler_.RemoteAppsUrl());
}
+TEST_F(PolicyHandlerTest, OnSetCloudAppProperties_AllProperties_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ bool enabled = true;
+ std::string app_name = "anAppName";
+ std::string auth_token = "anAuthToken";
+ std::string cloud_transport_type = "aTransportType";
+ mobile_apis::HybridAppPreference::eType hybrid_app_preference =
+ mobile_apis::HybridAppPreference::CLOUD;
+ std::string hybrid_app_preference_str = "CLOUD";
+ std::string endpoint = "anEndpoint";
+
+ StringArray nicknames_vec;
+ nicknames_vec.push_back(app_name);
+
+ smart_objects::SmartObject message(smart_objects::SmartType_Map);
+ smart_objects::SmartObject properties(smart_objects::SmartType_Map);
+ smart_objects::SmartObject nicknames(smart_objects::SmartType_Array);
+
+ properties[strings::app_id] = kPolicyAppId_;
+ nicknames[0] = app_name;
+ properties[strings::nicknames] = nicknames;
+ properties[strings::enabled] = enabled;
+ properties[strings::auth_token] = auth_token;
+ properties[strings::cloud_transport_type] = cloud_transport_type;
+ properties[strings::hybrid_app_preference] = hybrid_app_preference;
+ properties[strings::endpoint] = endpoint;
+ message[strings::msg_params][strings::properties] = properties;
+
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+
+ EXPECT_CALL(*mock_policy_manager_, InitCloudApp(kPolicyAppId_));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetCloudAppEnabled(kPolicyAppId_, enabled));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetAppNicknames(kPolicyAppId_, nicknames_vec));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetAppAuthToken(kPolicyAppId_, auth_token));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetAppCloudTransportType(kPolicyAppId_, cloud_transport_type));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetHybridAppPreference(kPolicyAppId_, hybrid_app_preference_str));
+ EXPECT_CALL(*mock_policy_manager_, SetAppEndpoint(kPolicyAppId_, endpoint));
+ EXPECT_CALL(*mock_policy_manager_,
+ GetCloudAppParameters(kPolicyAppId_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<4>(auth_token), Return(true)));
+ EXPECT_CALL(app_manager_, RefreshCloudAppInformation());
+ EXPECT_CALL(policy_handler_observer,
+ OnAuthTokenUpdated(kPolicyAppId_, auth_token));
+
+ policy_handler_.OnSetCloudAppProperties(message);
+}
+
+TEST_F(PolicyHandlerTest, GetCloudAppParameters_AllProperties_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ bool enabled = true;
+ std::string certificate = "aCertificate";
+ std::string auth_token = "anAuthToken";
+ std::string cloud_transport_type = "aTransportType";
+ std::string hybrid_app_preference_str = "CLOUD";
+ std::string endpoint = "anEndpoint";
+
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+
+ EXPECT_CALL(*mock_policy_manager_,
+ GetCloudAppParameters(kPolicyAppId_, _, _, _, _, _, _))
+ .WillOnce(DoAll(SetArgReferee<1>(enabled),
+ SetArgReferee<2>(endpoint),
+ SetArgReferee<3>(certificate),
+ SetArgReferee<4>(auth_token),
+ SetArgReferee<5>(cloud_transport_type),
+ SetArgReferee<6>(hybrid_app_preference_str),
+ Return(true)));
+
+ bool enabled_out;
+ std::string endpoint_out;
+ std::string cert_out;
+ std::string auth_token_out;
+ std::string ctt_out;
+ std::string hap_out;
+ EXPECT_TRUE(policy_handler_.GetCloudAppParameters(kPolicyAppId_,
+ enabled_out,
+ endpoint_out,
+ cert_out,
+ auth_token_out,
+ ctt_out,
+ hap_out));
+ EXPECT_EQ(enabled, enabled_out);
+ EXPECT_EQ(endpoint, endpoint_out);
+ EXPECT_EQ(certificate, cert_out);
+ EXPECT_EQ(auth_token, auth_token_out);
+ EXPECT_EQ(cloud_transport_type, ctt_out);
+ EXPECT_EQ(hybrid_app_preference_str, hap_out);
+}
+
} // namespace policy_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
index b7caf635c9..818a014a3f 100644
--- a/src/components/application_manager/test/rc_policy_handler_test.cc
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -30,34 +30,34 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <fstream>
#include <string>
#include <vector>
-#include <fstream>
#include "gmock/gmock.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/delegates/app_permission_delegate.h"
-#include "policy/mock_cache_manager.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/policies/delegates/app_permission_delegate.h"
+#include "application_manager/policies/policy_handler.h"
#include "connection_handler/mock_connection_handler_settings.h"
-#include "policy/policy_types.h"
-#include "policy/access_remote.h"
#include "json/reader.h"
-#include "json/writer.h"
#include "json/value.h"
+#include "json/writer.h"
+#include "policy/access_remote.h"
+#include "policy/mock_cache_manager.h"
+#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "interfaces/MOBILE_API.h"
-#include "policy/mock_policy_settings.h"
#include "application_manager/mock_application.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/policies/mock_policy_handler_observer.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/policies/mock_policy_handler_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_manager.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "utils/custom_string.h"
namespace test {
namespace components {
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 112e3c1c39..71e12b2825 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
@@ -32,24 +32,23 @@
#include <stdint.h>
-#include "gtest/gtest.h"
+#include "application_manager/mock_request.h"
#include "application_manager/request_controller.h"
#include "application_manager/request_info.h"
-#include "application_manager/mock_request.h"
+#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/application_impl.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
+#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application_manager.h"
#include "application_manager/event_engine/event_dispatcher.h"
-#include "resumption/last_state.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_request_controller_settings.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/mock_request_controller_settings.h"
-#include "application_manager/mock_application_manager.h"
+#include "application_manager/state_controller.h"
+#include "resumption/last_state.h"
#include "utils/test_async_waiter.h"
namespace test {
@@ -59,10 +58,10 @@ namespace request_controller_test {
using ::application_manager::request_controller::RequestController;
using ::application_manager::request_controller::RequestInfo;
+using ::testing::_;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::_;
typedef NiceMock<application_manager_test::MockRequest> MRequest;
typedef std::shared_ptr<MRequest> RequestPtr;
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 0abef44e9a..a0b1793cf5 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -31,10 +31,10 @@
*/
#include "application_manager/request_info.h"
-#include "application_manager/mock_request.h"
#include <iostream>
-#include <vector>
#include <limits>
+#include <vector>
+#include "application_manager/mock_request.h"
#include "gmock/gmock.h"
namespace request_info = application_manager::request_controller;
diff --git a/src/components/application_manager/test/request_tracker_test.cc b/src/components/application_manager/test/request_tracker_test.cc
index ee09e0a3e0..9175652da6 100644
--- a/src/components/application_manager/test/request_tracker_test.cc
+++ b/src/components/application_manager/test/request_tracker_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "utils/macro.h"
#include "application_manager/request_tracker.h"
#include "application_manager/mock_request_controller_settings.h"
+#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
namespace test {
namespace components {
@@ -246,6 +246,6 @@ TEST_F(RequestTrackerTestClass,
tracker_.Track(app_id, none_level));
}
-} // namespace request_controller
+} // namespace request_controller_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 1c2339096c..a82358b451 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -30,26 +30,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <algorithm>
+#include <string>
-#include "gtest/gtest.h"
-#include "application_manager/resumption/resume_ctrl_impl.h"
-#include "application_manager/usage_statistics.h"
-#include "application_manager/mock_application.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager_impl.h"
#include "application_manager/mock_app_extension.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_resumption_data.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
+#include "application_manager/usage_statistics.h"
+#include "config_profile/profile.h"
+#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/application.h"
#include "utils/data_accessor.h"
-#include "config_profile/profile.h"
-#include "application_manager/mock_message_helper.h"
#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_message_helper.h"
#include "application_manager/mock_state_controller.h"
namespace test {
@@ -64,10 +64,10 @@ using ::testing::Eq;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SetArgReferee;
using ::testing::ReturnPointee;
+using ::testing::ReturnRef;
using ::testing::SaveArg;
+using ::testing::SetArgReferee;
using namespace application_manager_test;
using namespace resumption;
@@ -153,6 +153,7 @@ class ResumeCtrlTest : public ::testing::Test {
ON_CALL(*mock_app_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
ON_CALL(*mock_app_, device()).WillByDefault(Return(kTestDevId_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*mock_app_, is_cloud_app()).WillByDefault(Return(false));
}
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
@@ -500,7 +501,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2);
+ SendAllOnButtonSubscriptionNotificationsForApp(_, _))
+ .Times(2);
const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index 8423520b9f..d67c229cc3 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -30,30 +30,30 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <algorithm>
-#include "gtest/gtest.h"
+#include <string>
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager_settings.h"
+#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
#include "utils/sqlite_wrapper/sql_database.h"
#include "utils/sqlite_wrapper/sql_query.h"
-#include "utils/file_system.h"
#include "application_manager/resumption_data_test.h"
#include "application_manager/test_resumption_data_db.h"
+#include "utils/file_system.h"
-#include "application_manager/resumption/resumption_sql_queries.h"
#include "application_manager/resumption/resumption_data_db.h"
+#include "application_manager/resumption/resumption_sql_queries.h"
namespace test {
namespace components {
namespace resumption_test {
+using application_manager_test::MockApplication;
+using ::testing::_;
using ::testing::NiceMock;
using ::testing::ReturnRef;
-using ::testing::_;
-using application_manager_test::MockApplication;
namespace am = application_manager;
using namespace file_system;
@@ -344,7 +344,8 @@ void ResumptionDataDBTest::CheckCharacters(int64_t global_properties_key) {
while (select_characters.Next()) {
std::string character =
(*keyboard_props_)[am::strings::limited_character_list]
- [characters_idx++].asString();
+ [characters_idx++]
+ .asString();
EXPECT_EQ(character, select_characters.GetString(0));
}
}
@@ -392,16 +393,17 @@ void ResumptionDataDBTest::CheckCommandsData() {
++i;
uint cmd = (*test_commands_map[i])[am::strings::cmd_id].asUInt();
EXPECT_EQ(cmd, select_commands.GetUInteger(1));
- std::string name =
- (*test_commands_map[i])[am::strings::menu_params]
- [am::strings::menu_name].asString();
+ std::string name = (*test_commands_map[i])[am::strings::menu_params]
+ [am::strings::menu_name]
+ .asString();
EXPECT_EQ(name, select_commands.GetString(2));
int position = (*test_commands_map[i])[am::strings::menu_params]
- [am::strings::position].asInt();
+ [am::strings::position]
+ .asInt();
EXPECT_EQ(position, select_commands.GetInteger(4));
- int parent_id =
- (*test_commands_map[i])[am::strings::menu_params]
- [am::hmi_request::parent_id].asInt();
+ int parent_id = (*test_commands_map[i])[am::strings::menu_params]
+ [am::hmi_request::parent_id]
+ .asInt();
EXPECT_EQ(parent_id, select_commands.GetInteger(3));
std::string icon_name =
(*test_commands_map[i])[am::strings::cmd_icon][am::strings::value]
@@ -409,7 +411,8 @@ void ResumptionDataDBTest::CheckCommandsData() {
EXPECT_EQ(icon_name, select_commands.GetString(5));
int icon_type = (*test_commands_map[i])[am::strings::cmd_icon]
- [am::strings::image_type].asInt();
+ [am::strings::image_type]
+ .asInt();
EXPECT_EQ(icon_type, select_commands.GetInteger(6));
j = 0;
@@ -461,12 +464,12 @@ void ResumptionDataDBTest::CheckChoiceSetData() {
std::string menu_name =
command[am::strings::choice_set][choice_idx][am::strings::menu_name]
.asString();
- std::string secondary_text =
- command[am::strings::choice_set][choice_idx]
- [am::strings::secondary_text].asString();
- std::string tertiary_text =
- command[am::strings::choice_set][choice_idx]
- [am::strings::tertiary_text].asString();
+ std::string secondary_text = command[am::strings::choice_set][choice_idx]
+ [am::strings::secondary_text]
+ .asString();
+ std::string tertiary_text = command[am::strings::choice_set][choice_idx]
+ [am::strings::tertiary_text]
+ .asString();
EXPECT_EQ(choice_id, select_choice_set.GetInteger(4));
EXPECT_EQ(menu_name, select_choice_set.GetString(5));
@@ -478,12 +481,12 @@ void ResumptionDataDBTest::CheckChoiceSetData() {
EXPECT_TRUE(select_image.Prepare(kSelectImage));
select_image.Bind(0, select_choice_set.GetLongInt(8));
EXPECT_TRUE(select_image.Exec());
- std::string image_value =
- command[am::strings::choice_set][choice_idx][am::strings::image]
- [am::strings::value].asString();
- int image_type =
- command[am::strings::choice_set][choice_idx][am::strings::image]
- [am::strings::image_type].asInt();
+ std::string image_value = command[am::strings::choice_set][choice_idx]
+ [am::strings::image][am::strings::value]
+ .asString();
+ int image_type = command[am::strings::choice_set][choice_idx]
+ [am::strings::image][am::strings::image_type]
+ .asInt();
EXPECT_EQ(image_value, select_image.GetString(1));
EXPECT_EQ(image_type, select_image.GetInteger(0));
@@ -491,9 +494,9 @@ void ResumptionDataDBTest::CheckChoiceSetData() {
EXPECT_TRUE(select_image.Prepare(kSelectImage));
select_image.Bind(0, select_choice_set.GetLongInt(9));
EXPECT_TRUE(select_image.Exec());
- image_value =
- command[am::strings::choice_set][choice_idx]
- [am::strings::secondary_image][am::strings::value].asString();
+ image_value = command[am::strings::choice_set][choice_idx]
+ [am::strings::secondary_image][am::strings::value]
+ .asString();
image_type =
command[am::strings::choice_set][choice_idx]
[am::strings::secondary_image][am::strings::image_type]
@@ -503,9 +506,9 @@ void ResumptionDataDBTest::CheckChoiceSetData() {
vr_cmd_idx = 0;
}
- std::string vr_comm =
- command[am::strings::choice_set][choice_idx][am::strings::vr_commands]
- [vr_cmd_idx++].asString();
+ std::string vr_comm = command[am::strings::choice_set][choice_idx]
+ [am::strings::vr_commands][vr_cmd_idx++]
+ .asString();
EXPECT_EQ(vr_comm, select_choice_set.GetString(10));
}
}
diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index 40e61a3c53..955309e091 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <algorithm>
+#include <string>
#include "gtest/gtest.h"
-#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_resumption_data.h"
+#include "application_manager/usage_statistics.h"
#include "interfaces/MOBILE_API.h"
#include "resumption/last_state_impl.h"
@@ -51,9 +51,9 @@ namespace components {
namespace resumption_test {
using ::testing::_;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
namespace am = application_manager;
using namespace Json;
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index fe24ea39b6..29718b631c 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -30,16 +30,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <algorithm>
+#include <string>
#include "gtest/gtest.h"
-#include "application_manager/usage_statistics.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
#include "application_manager/mock_resumption_data.h"
+#include "application_manager/usage_statistics.h"
#include "utils/custom_string.h"
-#include "application_manager/application.h"
#include "utils/data_accessor.h"
-#include "application_manager/message_helper.h"
#include "application_manager/resumption_data_test.h"
@@ -47,10 +47,10 @@ namespace test {
namespace components {
namespace resumption_test {
namespace custom_str = utils::custom_string;
+using ::testing::_;
using ::testing::Return;
-using ::testing::ReturnRef;
using ::testing::ReturnPointee;
-using ::testing::_;
+using ::testing::ReturnRef;
void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
EXPECT_EQ(policy_app_id_, resume_app_list[am::strings::app_id].asString());
@@ -79,9 +79,9 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
for (uint32_t i = 0; i < kCountOfCommands_; ++i) {
EXPECT_EQ(i, res_list[i][am::strings::cmd_id].asUInt());
- std::string name =
- (*test_commands_map[i])[am::strings::menu_params]
- [am::strings::menu_name].asString();
+ std::string name = (*test_commands_map[i])[am::strings::menu_params]
+ [am::strings::menu_name]
+ .asString();
EXPECT_EQ(name,
res_list[i][am::strings::menu_params][am::strings::menu_name]
.asString());
@@ -93,7 +93,8 @@ void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
res_list[i][am::strings::menu_params][am::strings::position].asInt());
int parent_id = (*test_commands_map[i])[am::strings::menu_params]
- [am::hmi_request::parent_id].asInt();
+ [am::hmi_request::parent_id]
+ .asInt();
EXPECT_EQ(parent_id,
res_list[i][am::strings::menu_params][am::hmi_request::parent_id]
.asInt());
@@ -150,20 +151,24 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
std::snprintf(numb, 12, "%d", i + j);
std::string test_choice =
(*test_choiceset_map[i])[am::strings::choice_set][j]
- [am::strings::vr_commands][0].asString();
+ [am::strings::vr_commands][0]
+ .asString();
EXPECT_EQ(test_choice, command[am::strings::vr_commands][0].asString());
std::string menu_name =
(*test_choiceset_map[i])[am::strings::choice_set][j]
- [am::strings::menu_name].asString();
+ [am::strings::menu_name]
+ .asString();
EXPECT_EQ(menu_name, command[am::strings::menu_name].asString());
std::string secondary_text =
(*test_choiceset_map[i])[am::strings::choice_set][j]
- [am::strings::secondary_text].asString();
+ [am::strings::secondary_text]
+ .asString();
EXPECT_EQ(secondary_text,
command[am::strings::secondary_text].asString());
std::string tertiary_text =
(*test_choiceset_map[i])[am::strings::choice_set][j]
- [am::strings::tertiary_text].asString();
+ [am::strings::tertiary_text]
+ .asString();
EXPECT_EQ(tertiary_text, command[am::strings::tertiary_text].asString());
std::string image_value =
@@ -181,13 +186,15 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
image_value = (*test_choiceset_map[i])[am::strings::choice_set][j]
[am::strings::secondary_image]
- [am::strings::value].asString();
+ [am::strings::value]
+ .asString();
EXPECT_EQ(
image_value,
command[am::strings::secondary_image][am::strings::value].asString());
image_type = (*test_choiceset_map[i])[am::strings::choice_set][j]
[am::strings::secondary_image]
- [am::strings::image_type].asInt();
+ [am::strings::image_type]
+ .asInt();
EXPECT_EQ(image_type,
command[am::strings::secondary_image][am::strings::image_type]
.asInt());
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
index 0ec902085f..61490ae4af 100644
--- a/src/components/application_manager/test/resumption_sql_queries_test.cc
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -31,17 +31,17 @@
*/
#include <algorithm>
-#include <vector>
-#include <string>
#include <sstream>
+#include <string>
#include <utility>
+#include <vector>
#include "gtest/gtest.h"
-#include "utils/sqlite_wrapper/sql_database.h"
-#include "utils/sqlite_wrapper/sql_query.h"
-#include "utils/file_system.h"
#include "application_manager/resumption/resumption_sql_queries.h"
#include "policy/sql_pt_queries.h"
+#include "utils/file_system.h"
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
namespace test {
namespace components {
@@ -49,8 +49,8 @@ namespace resumption_test {
using namespace ::resumption;
-using std::string;
using std::pair;
+using std::string;
using utils::dbms::SQLDatabase;
using utils::dbms::SQLQuery;
@@ -808,7 +808,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -838,7 +839,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -866,7 +868,8 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -894,7 +897,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -922,7 +926,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -951,7 +956,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -980,7 +986,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1017,7 +1024,8 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1045,7 +1053,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1091,7 +1100,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1122,7 +1132,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1158,7 +1169,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1192,7 +1204,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1236,7 +1249,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1279,7 +1293,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1311,7 +1326,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1326,7 +1342,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key2 =
FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
FillApplicationFilesArrayTable(temp_query, key1, key2);
@@ -1344,7 +1361,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1359,7 +1377,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key2 =
FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
FillApplicationFilesArrayTable(temp_query, key1, key2);
@@ -1383,7 +1402,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) {
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1398,7 +1418,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key).LastInsertId();
+ key)
+ .LastInsertId();
int64_t submenu_key =
FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId();
@@ -1417,7 +1438,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1432,7 +1454,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- key).LastInsertId();
+ key)
+ .LastInsertId();
int64_t submenu_key =
FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId();
@@ -1454,7 +1477,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1469,7 +1493,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key2 =
FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId();
@@ -1494,7 +1519,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1511,7 +1537,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
FillApplicationCommandsArrayTable(temp_query, key1, key2);
// Check before action
const std::string select_count_image = "SELECT COUNT(*) FROM image;";
@@ -1527,7 +1554,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1544,7 +1572,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
FillVRCommandsArrayTable(
temp_query, "tst_vr_command", kVRCommandFromCommand, key2);
@@ -1564,7 +1593,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1582,7 +1612,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
FillApplicationCommandsArrayTable(temp_query, key1, key2);
// Check
@@ -1599,7 +1630,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1617,7 +1649,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
FillApplicationCommandsArrayTable(temp_query, key1, key2);
// Check
@@ -1640,13 +1673,15 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillChoiceTable(temp_query,
2,
"tst_menu_name",
"secondary_txt",
"tst_tert_text",
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key3 = FillApplicationTable(temp_query,
connection_key,
grammarID,
@@ -1658,7 +1693,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key4 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
FillChoiceArrayTable(temp_query, key4, key2);
FillApplicationChoiceSetArrayTable(temp_query, key4, key3);
@@ -1678,7 +1714,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1694,7 +1731,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
FillVRCommandsArrayTable(
temp_query, "tst_vr_command", kVRCommandFromChoice, key2);
@@ -1724,7 +1762,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1740,7 +1779,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) {
false,
app_id2,
device_id,
- key1).LastInsertId();
+ key1)
+ .LastInsertId();
int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
FillChoiceArrayTable(temp_query, key3, key2);
FillApplicationChoiceSetArrayTable(temp_query, key3, key1);
@@ -1773,7 +1813,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoiceArray_ExpectDataDeleted) {
false,
app_id2,
device_id,
- 1).LastInsertId();
+ 1)
+ .LastInsertId();
FillApplicationChoiceSetArrayTable(
temp_query, application_choiceset_table_key, application_table_key);
FillChoiceArrayTable(
@@ -1803,7 +1844,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- 1).LastInsertId();
+ 1)
+ .LastInsertId();
int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
FillApplicationChoiceSetArrayTable(temp_query, key2, key1);
@@ -1838,7 +1880,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id2,
device_id,
- 1).LastInsertId();
+ 1)
+ .LastInsertId();
int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId();
FillApplicationChoiceSetArrayTable(temp_query, key2, key1);
@@ -1864,7 +1907,8 @@ TEST_F(ResumptionSqlQueriesTest,
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1896,7 +1940,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1929,7 +1974,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) {
int64_t key1 = FillImageTable(temp_query,
/*image_type=*/1,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1963,9 +2009,9 @@ TEST_F(ResumptionSqlQueriesTest,
string character_list = "abcdefghij";
int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list)
.LastInsertId();
- int64_t key2 =
- FillGlobalPropertiesTable(
- temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ int64_t key2 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0)
+ .LastInsertId();
FillApplicationTable(temp_query,
connection_key,
grammarID,
@@ -1999,9 +2045,9 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCharacterArray_ExpectDataDeleted) {
string character_list = "abcdefghij";
int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list)
.LastInsertId();
- int64_t key2 =
- FillGlobalPropertiesTable(
- temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ int64_t key2 = FillGlobalPropertiesTable(
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0)
+ .LastInsertId();
FillApplicationTable(temp_query,
connection_key,
grammarID,
@@ -2031,7 +2077,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteTTSChunk_ExpectDataDeleted) {
FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
- temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0)
+ .LastInsertId();
FillApplicationTable(temp_query,
connection_key,
@@ -2087,7 +2134,8 @@ TEST_F(ResumptionSqlQueriesTest,
FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
- temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0)
+ .LastInsertId();
FillApplicationTable(temp_query,
connection_key,
grammarID,
@@ -2121,7 +2169,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) {
SQLQuery temp_query(db());
int64_t glob_prop_key =
FillGlobalPropertiesTable(
- temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId();
+ temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0)
+ .LastInsertId();
FillApplicationTable(temp_query,
connection_key,
grammarID,
@@ -2160,7 +2209,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
ValToPosPair p1(0, "tst_image");
ValToPosPair p2(1, "");
// Check
@@ -2588,7 +2638,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountFiles_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t file_key =
FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
FillApplicationFilesArrayTable(temp_query, app_key, file_key);
@@ -2613,7 +2664,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectFiles_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t file_key =
FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId();
FillApplicationFilesArrayTable(temp_query, app_key, file_key);
@@ -2640,7 +2692,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubMenu_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t submenu_key =
FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId();
FillApplicationSubMenuArrayTable(temp_query, app_key, submenu_key);
@@ -2664,7 +2717,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubMenu_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t submenu_key =
FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId();
@@ -2691,7 +2745,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountCommands_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t command_key =
FillCommandTable(temp_query, 1, "menu_name", 1, 2, 5).LastInsertId();
FillApplicationCommandsArrayTable(temp_query, app_key, command_key);
@@ -2715,11 +2770,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2758,11 +2815,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t choice_key =
FillChoiceTable(
@@ -2814,7 +2873,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubscriptions_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key);
ValToPosPair p1(0, app_id1);
ValToPosPair p2(1, device_id);
@@ -2836,7 +2896,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubscriptions_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key);
ValToPosPair p1(0, app_id1);
ValToPosPair p2(1, device_id);
@@ -2859,7 +2920,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountChoiceSet_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
FillApplicationChoiceSetArrayTable(temp_query, 2, app_key);
ValToPosPair p1(0, app_id1);
ValToPosPair p2(1, device_id);
@@ -2881,11 +2943,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
false,
app_id1,
device_id,
- 9).LastInsertId();
+ 9)
+ .LastInsertId();
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t choice_key =
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2920,7 +2984,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) {
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
// Check
ValToPosPair p1(0, IntToString(image_key));
ValToPosPair p2(1, "");
@@ -2947,7 +3012,8 @@ TEST_F(ResumptionSqlQueriesTest,
false,
app_id1,
device_id,
- glob_prop_key).LastInsertId();
+ glob_prop_key)
+ .LastInsertId();
// Check
ValToPosPair p1(0, app_id1);
@@ -2961,7 +3027,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
test_image,
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -2977,7 +3044,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
false,
app_id1,
device_id,
- glob_prop_key).LastInsertId();
+ glob_prop_key)
+ .LastInsertId();
FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, 3, 7);
// Check
@@ -3001,7 +3069,8 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -3021,7 +3090,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) {
int64_t image_key = FillImageTable(temp_query,
/*image_type=*/2,
"tst_image",
- /*is_template=*/true).LastInsertId();
+ /*is_template=*/true)
+ .LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -3046,8 +3116,9 @@ TEST_F(ResumptionSqlQueriesTest, kChecksCharacter_ExpectDataCorrect) {
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2)
.LastInsertId();
string character_list = "abcdefghijkl";
- int64_t lim_char_list_key = FillTableLimitedCharacterListTable(
- temp_query, character_list).LastInsertId();
+ int64_t lim_char_list_key =
+ FillTableLimitedCharacterListTable(temp_query, character_list)
+ .LastInsertId();
FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key);
// Check
ValToPosPair p1(0, IntToString(glob_prop_key));
@@ -3063,8 +3134,9 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCharacter_ExpectDataCorrect) {
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2)
.LastInsertId();
string character_list = "abcdefghijkl";
- int64_t lim_char_list_key = FillTableLimitedCharacterListTable(
- temp_query, character_list).LastInsertId();
+ int64_t lim_char_list_key =
+ FillTableLimitedCharacterListTable(temp_query, character_list)
+ .LastInsertId();
FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key);
// Check
ValToPosPair p1(0, IntToString(glob_prop_key));
diff --git a/src/components/application_manager/test/rpc_passing_handler_test.cc b/src/components/application_manager/test/rpc_passing_handler_test.cc
new file mode 100644
index 0000000000..fb74a0a7e3
--- /dev/null
+++ b/src/components/application_manager/test/rpc_passing_handler_test.cc
@@ -0,0 +1,440 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+#include "gtest/gtest.h"
+
+#include "application_manager/rpc_passing_handler.h"
+
+#include "application_manager/mock_app_service_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_rpc_handler.h"
+#include "application_manager/mock_rpc_service.h"
+#include "resumption/mock_last_state.h"
+
+#include <vector>
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/semantic_version.h"
+#include "utils/test_async_waiter.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace am = application_manager;
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::InSequence;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Pointee;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+struct PassthroughParams {
+ const uint32_t connection_key;
+ const int32_t correlation_id;
+ smart_objects::SmartObject message;
+ smart_objects::SmartObject forwarded_message;
+};
+
+class RPCPassingHandlerTest : public ::testing::Test {
+ public:
+ RPCPassingHandlerTest()
+ : mock_app_service_manager_(mock_app_manager_, mock_last_state_)
+ , mock_app_ptr_(std::make_shared<NiceMock<MockApplication> >())
+ , version_(utils::SemanticVersion(5, 1, 0)) {}
+
+ ~RPCPassingHandlerTest() {}
+
+ void SetUp() OVERRIDE {
+ rpc_passing_handler_ =
+ new am::RPCPassingHandler(mock_app_service_manager_, mock_app_manager_);
+ app_services_.clear();
+
+ ON_CALL(mock_app_manager_, IncreaseForwardedRequestTimeout(_, _))
+ .WillByDefault(Return());
+ ON_CALL(mock_app_manager_, get_settings())
+ .WillByDefault(ReturnRef(mock_app_manager_settings_));
+
+ ON_CALL(mock_app_manager_settings_, rpc_pass_through_timeout())
+ .WillByDefault(Return(kRPCPassthroughTimeout));
+
+ ON_CALL(mock_app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ ON_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_rpc_service_, SendMessageToMobile(_, _))
+ .WillByDefault(Return());
+
+ ON_CALL(mock_app_manager_, GetAppServiceManager())
+ .WillByDefault(ReturnRef(mock_app_service_manager_));
+ ON_CALL(mock_app_service_manager_, GetActiveServices())
+ .WillByDefault(Return(app_services_));
+
+ ON_CALL(mock_app_manager_, GetRPCHandler())
+ .WillByDefault(ReturnRef(mock_rpc_handler_));
+ ON_CALL(mock_rpc_handler_, ValidateRpcSO(_, _, _, _))
+ .WillByDefault(Return(true));
+
+ ON_CALL(mock_app_manager_, application(_))
+ .WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(*mock_app_ptr_, msg_version()).WillByDefault(ReturnRef(version_));
+ }
+
+ void TearDown() OVERRIDE {
+ delete rpc_passing_handler_;
+ rpc_passing_handler_ = NULL;
+ }
+
+ protected:
+ am::AppService CreateAppService(uint32_t connection_key,
+ const std::string& service_id,
+ const std::string& service_type) {
+ am::AppService app_service;
+
+ app_service.connection_key = connection_key;
+ app_service.mobile_service = true;
+ app_service.default_service = false;
+
+ smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map);
+ record[am::strings::service_id] = service_id;
+ record[am::strings::service_manifest][am::strings::service_type] =
+ service_type;
+ record[am::strings::service_manifest][am::strings::allow_app_consumers] =
+ true;
+ record[am::strings::service_manifest][am::strings::handled_rpcs] =
+ smart_objects::SmartObject(smart_objects::SmartType::SmartType_Array);
+ record[am::strings::service_manifest][am::strings::handled_rpcs][0] =
+ mobile_apis::FunctionID::SendLocationID;
+ record[am::strings::service_published] = true;
+ record[am::strings::service_active] = true;
+ app_service.record = record;
+
+ return app_service;
+ }
+
+ smart_objects::SmartObject CreatePassThroughRequest(uint32_t connection_key,
+ int32_t correlation_id) {
+ smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map);
+ record[am::strings::params][am::strings::connection_key] = connection_key;
+ record[am::strings::params][am::strings::correlation_id] = correlation_id;
+ record[am::strings::params][am::strings::function_id] =
+ mobile_apis::FunctionID::SendLocationID;
+ record[am::strings::params][am::strings::message_type] =
+ am::MessageType::kRequest;
+ record[am::strings::msg_params][am::strings::latitude_degrees] = 50;
+ record[am::strings::msg_params][am::strings::longitude_degrees] = 50;
+ record[am::strings::msg_params][am::strings::location_name] =
+ "TestLocation";
+
+ return record;
+ }
+
+ smart_objects::SmartObject CreatePassThroughResponse(
+ uint32_t connection_key,
+ int32_t correlation_id,
+ const std::string& result_code,
+ bool success,
+ std::string info = std::string()) {
+ smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map);
+ record[am::strings::params][am::strings::connection_key] = connection_key;
+ record[am::strings::params][am::strings::correlation_id] = correlation_id;
+ record[am::strings::params][am::strings::function_id] =
+ mobile_apis::FunctionID::SendLocationID;
+ record[am::strings::params][am::strings::message_type] =
+ am::MessageType::kResponse;
+ record[am::strings::msg_params][am::strings::result_code] = result_code;
+ record[am::strings::msg_params][am::strings::success] = success;
+ record[am::strings::msg_params][am::strings::info] = info;
+
+ return record;
+ }
+
+ void SendRequestToASP(const PassthroughParams& params, uint32_t timeout = 0) {
+ if (timeout == 0) {
+ // If timeout argument is not sepcified
+ timeout = kRPCPassthroughTimeout;
+ }
+
+ // Call RPCPassThrough with request smart object
+
+ // Will call PopulateRPCRequestQueue
+ EXPECT_CALL(mock_app_service_manager_, GetActiveServices())
+ .WillOnce(Return(app_services_));
+
+ // Will call ForwardRequesttoMobile
+ EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout())
+ .WillOnce(Return(timeout));
+ EXPECT_CALL(mock_app_manager_, GetRPCService());
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(Pointee(params.forwarded_message), false));
+
+ bool mobile_result = rpc_passing_handler_->RPCPassThrough(params.message);
+ EXPECT_EQ(mobile_result, true);
+ }
+
+ NiceMock<MockApplicationManager> mock_app_manager_;
+ NiceMock<MockApplicationManagerSettings> mock_app_manager_settings_;
+ MockRPCService mock_rpc_service_;
+ MockRPCHandler mock_rpc_handler_;
+ resumption_test::MockLastState mock_last_state_;
+ MockAppServiceManager mock_app_service_manager_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_ptr_;
+ const utils::SemanticVersion version_;
+ am::RPCPassingHandler* rpc_passing_handler_;
+ std::vector<am::AppService> app_services_;
+
+ uint32_t kRPCPassthroughTimeout = 10000;
+ uint32_t kConnectionKey_ASC = 1;
+ uint32_t kConnectionKey_NAV_ASP = 2;
+ uint32_t kConnectionKey_MEDIA_ASP = 3;
+ int32_t kCorrelationId = 1;
+ const uint32_t MAX_TEST_DURATION = 1000; // 1 second
+};
+
+TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_ForwardToMobile) {
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ SendRequestToASP(request_params);
+}
+
+TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_NoPassthrough) {
+ smart_objects::SmartObject request =
+ CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId);
+
+ // Call RPCPassThrough with request smart object
+
+ // Will call PopulateRPCRequestQueue
+ EXPECT_CALL(mock_app_service_manager_, GetActiveServices())
+ .WillOnce(Return(app_services_));
+ EXPECT_CALL(
+ mock_app_manager_,
+ IncreaseForwardedRequestTimeout(kConnectionKey_ASC, kCorrelationId))
+ .Times(0);
+ // Will return false since there are no active services to handle the rpc
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ bool result = rpc_passing_handler_->RPCPassThrough(request);
+ EXPECT_EQ(result, false);
+}
+
+TEST_F(RPCPassingHandlerTest, RPCPassingTest_RESPONSE_UnknownCorrelationID) {
+ smart_objects::SmartObject invalid_response = CreatePassThroughResponse(
+ kConnectionKey_NAV_ASP, kCorrelationId + 1, "SUCCESS", true);
+
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ SendRequestToASP(request_params);
+
+ // Call RPCPassThrough with response smart object
+ // Will return false since the correlation id does not exist in the map
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ bool result = rpc_passing_handler_->RPCPassThrough(invalid_response);
+ EXPECT_EQ(result, false);
+}
+
+TEST_F(RPCPassingHandlerTest, RPCPassingTest_SUCCESS) {
+ smart_objects::SmartObject response = CreatePassThroughResponse(
+ kConnectionKey_NAV_ASP, kCorrelationId, "SUCCESS", true);
+ smart_objects::SmartObject forwarded_response = CreatePassThroughResponse(
+ kConnectionKey_ASC, kCorrelationId, "SUCCESS", true);
+
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ SendRequestToASP(request_params);
+
+ // Call RPCPassThrough with response smart object
+ // Will ForwardResponseToMobile
+ EXPECT_CALL(mock_app_manager_, GetRPCService());
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(Pointee(forwarded_response), false));
+
+ bool result = rpc_passing_handler_->RPCPassThrough(response);
+ EXPECT_EQ(result, true);
+}
+
+TEST_F(RPCPassingHandlerTest,
+ RPCPassingTest_UNSUPPORTED_REQUEST_ForwardToCore) {
+ smart_objects::SmartObject unsupported_response = CreatePassThroughResponse(
+ kConnectionKey_NAV_ASP, kCorrelationId, "UNSUPPORTED_REQUEST", false);
+ smart_objects::SmartObject forwarded_request =
+ CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId);
+
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ SendRequestToASP(request_params);
+
+ // Call RPCPassThrough with response smart object
+ // Will cycle to core (no other app services in list)
+ EXPECT_CALL(mock_app_manager_, GetRPCHandler());
+ EXPECT_CALL(mock_rpc_handler_, ValidateRpcSO(forwarded_request, _, _, false))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_app_manager_, GetRPCService());
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(Pointee(forwarded_request),
+ am::commands::Command::SOURCE_MOBILE));
+
+ bool result = rpc_passing_handler_->RPCPassThrough(unsupported_response);
+ EXPECT_EQ(result, true);
+}
+
+TEST_F(RPCPassingHandlerTest,
+ RPCPassingTest_UNSUPPORTED_REQUEST_ForwardToMobile) {
+ smart_objects::SmartObject unsupported_response = CreatePassThroughResponse(
+ kConnectionKey_NAV_ASP, kCorrelationId, "UNSUPPORTED_REQUEST", false);
+ smart_objects::SmartObject forwarded_request =
+ CreatePassThroughRequest(kConnectionKey_MEDIA_ASP, kCorrelationId);
+
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+ app_services_.push_back(
+ CreateAppService(kConnectionKey_MEDIA_ASP, "Media service", "MEDIA"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ SendRequestToASP(request_params);
+
+ // Call RPCPassThrough with response smart object
+ // Will cycle to next compatible active app service
+ EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout());
+ EXPECT_CALL(mock_app_manager_, GetRPCService());
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(Pointee(forwarded_request), false));
+
+ bool result = rpc_passing_handler_->RPCPassThrough(unsupported_response);
+ EXPECT_EQ(result, true);
+}
+
+TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_Timeout) {
+ uint32_t timeout_in_ms = 4;
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
+
+ app_services_.push_back(CreateAppService(
+ kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION"));
+
+ PassthroughParams request_params{
+ .connection_key = kConnectionKey_ASC,
+ .correlation_id = kCorrelationId,
+ .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId),
+ .forwarded_message =
+ CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId),
+ };
+
+ // Call RPCPassThrough with request smart object
+
+ // Will call PopulateRPCRequestQueue
+ EXPECT_CALL(mock_app_service_manager_, GetActiveServices())
+ .WillOnce(Return(app_services_));
+
+ // Will call ForwardRequesttoMobile
+ EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout())
+ .WillOnce(Return(timeout_in_ms));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(Pointee(request_params.forwarded_message), false));
+
+ // Request timeout will trigger perform next request
+ // Will cycle to core (no other app services in list)
+ EXPECT_CALL(mock_app_manager_, GetRPCHandler());
+ EXPECT_CALL(mock_rpc_handler_,
+ ValidateRpcSO(request_params.message, _, _, false))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_app_manager_, GetRPCService()).Times(2);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(Pointee(request_params.message),
+ am::commands::Command::SOURCE_MOBILE))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(true)));
+
+ bool mobile_result =
+ rpc_passing_handler_->RPCPassThrough(request_params.message);
+ EXPECT_EQ(mobile_result, true);
+
+ const uint32_t wait_time = MAX_TEST_DURATION + timeout_in_ms;
+ EXPECT_TRUE(waiter->WaitFor(1, wait_time));
+
+ // This sleep prevents a SEGFAULT which occurs after the
+ // RPCPassingHandlerTests are completed and the next test set runs
+ usleep(6000); // sleep 6 ms
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index 59e3f947c3..ad264c8518 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -363,6 +363,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -383,6 +384,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -403,6 +405,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -422,6 +425,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index 23c75e8475..aea3f7700b 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -20,7 +20,13 @@
"nicknames" : [ "SyncProxyTester" ],
"priority" : "EMERGENCY",
"steal_focus" : true,
- "watchdog_timer_ms" : 20000
+ "watchdog_timer_ms" : 20000,
+ "app_services": {
+ "MEDIA": {
+ "service_names" : ["SDL App", "SDL Music"],
+ "handled_rpcs" : [{"function_id": 41}]
+ }
+ }
},
"default" : {
"default_hmi" : "NONE",
@@ -1600,6 +1606,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1618,6 +1625,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1636,6 +1644,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,6 +1662,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
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 1d4cead52b..9621e20629 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
@@ -30,46 +30,46 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
+#include "application_manager/application_manager_impl.h"
#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
#include "application_manager/state_controller_impl.h"
#include "application_manager/usage_statistics.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/mock_application.h"
-#include "connection_handler/mock_connection_handler_settings.h"
#include "connection_handler/connection_handler_impl.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "gtest/gtest.h"
#include "transport_manager/mock_transport_manager.h"
-#include "utils/lock.h"
#include "utils/data_accessor.h"
+#include "utils/lock.h"
-#include "application_manager/message_helper.h"
#include "application_manager/event_engine/event.h"
-#include "application_manager/smart_object_keys.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/smart_object_keys.h"
+#include "connection_handler/mock_connection_handler.h"
#include "policy/mock_policy_settings.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_rpc_service.h"
namespace am = application_manager;
using am::HmiState;
using am::HmiStatePtr;
using am::UsageStatistics;
using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::InSequence;
+using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
-using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::ReturnRef;
using ::testing::SaveArg;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::InSequence;
using ::testing::Truly;
-using ::testing::AtLeast;
namespace test {
namespace components {
@@ -170,34 +170,42 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr simple_app_;
NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
uint32_t simple_app_id_ = 1721;
+ uint32_t simple_hmi_app_id_ = 22770; // random number
am::ApplicationSharedPtr navi_app_;
NiceMock<application_manager_test::MockApplication>* navi_app_ptr_;
uint32_t navi_app_id_ = 1762;
+ uint32_t navi_hmi_app_id_ = 17559;
am::ApplicationSharedPtr media_app_;
NiceMock<application_manager_test::MockApplication>* media_app_ptr_;
uint32_t media_app_id_ = 1801;
+ uint32_t media_hmi_app_id_ = 12751;
am::ApplicationSharedPtr vc_app_;
NiceMock<application_manager_test::MockApplication>* vc_app_ptr_;
uint32_t vc_app_id_ = 1825;
+ uint32_t vc_hmi_app_id_ = 14986;
am::ApplicationSharedPtr media_navi_app_;
NiceMock<application_manager_test::MockApplication>* media_navi_app_ptr_;
uint32_t media_navi_app_id_ = 1855;
+ uint32_t media_navi_hmi_app_id_ = 16194;
am::ApplicationSharedPtr media_vc_app_;
NiceMock<application_manager_test::MockApplication>* media_vc_app_ptr_;
uint32_t media_vc_app_id_ = 1881;
+ uint32_t media_vc_hmi_app_id_ = 12798;
am::ApplicationSharedPtr navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* navi_vc_app_ptr_;
uint32_t navi_vc_app_id_ = 1894;
+ uint32_t navi_vc_hmi_app_id_ = 10807;
am::ApplicationSharedPtr media_navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* media_navi_vc_app_ptr_;
uint32_t media_navi_vc_app_id_ = 1922;
+ uint32_t media_navi_vc_hmi_app_id_ = 21419;
std::vector<am::HmiStatePtr> valid_states_for_audio_app_;
std::vector<am::HmiStatePtr> valid_states_for_not_audio_app_;
@@ -661,6 +669,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr ConfigureApp(
NiceMock<application_manager_test::MockApplication>** app_mock,
uint32_t app_id,
+ uint32_t hmi_app_id,
bool media,
bool navi,
bool vc) {
@@ -670,6 +679,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr app(*app_mock);
ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
+ ON_CALL(**app_mock, hmi_app_id()).WillByDefault(Return(hmi_app_id));
ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
ON_CALL(**app_mock, is_voice_communication_supported())
@@ -871,21 +881,50 @@ class StateControllerImplTest : public ::testing::Test {
}
void ConfigureApps() {
- simple_app_ = ConfigureApp(
- &simple_app_ptr_, simple_app_id_, NOT_MEDIA, NOT_NAVI, NOT_VC);
- media_app_ =
- ConfigureApp(&media_app_ptr_, media_app_id_, MEDIA, NOT_NAVI, NOT_VC);
- navi_app_ =
- ConfigureApp(&navi_app_ptr_, navi_app_id_, NOT_MEDIA, NAVI, NOT_VC);
- vc_app_ = ConfigureApp(&vc_app_ptr_, vc_app_id_, NOT_MEDIA, NOT_NAVI, VC);
- media_navi_app_ = ConfigureApp(
- &media_navi_app_ptr_, media_navi_app_id_, MEDIA, NAVI, NOT_VC);
- media_vc_app_ =
- ConfigureApp(&media_vc_app_ptr_, media_vc_app_id_, MEDIA, NOT_NAVI, VC);
- navi_vc_app_ =
- ConfigureApp(&navi_vc_app_ptr_, navi_vc_app_id_, NOT_MEDIA, NAVI, VC);
- media_navi_vc_app_ = ConfigureApp(
- &media_navi_vc_app_ptr_, media_navi_vc_app_id_, MEDIA, NAVI, VC);
+ simple_app_ = ConfigureApp(&simple_app_ptr_,
+ simple_app_id_,
+ simple_hmi_app_id_,
+ NOT_MEDIA,
+ NOT_NAVI,
+ NOT_VC);
+ media_app_ = ConfigureApp(&media_app_ptr_,
+ media_app_id_,
+ media_hmi_app_id_,
+ MEDIA,
+ NOT_NAVI,
+ NOT_VC);
+ navi_app_ = ConfigureApp(&navi_app_ptr_,
+ navi_app_id_,
+ navi_hmi_app_id_,
+ NOT_MEDIA,
+ NAVI,
+ NOT_VC);
+ vc_app_ = ConfigureApp(
+ &vc_app_ptr_, vc_app_id_, vc_hmi_app_id_, NOT_MEDIA, NOT_NAVI, VC);
+ media_navi_app_ = ConfigureApp(&media_navi_app_ptr_,
+ media_navi_app_id_,
+ media_navi_hmi_app_id_,
+ MEDIA,
+ NAVI,
+ NOT_VC);
+ media_vc_app_ = ConfigureApp(&media_vc_app_ptr_,
+ media_vc_app_id_,
+ media_vc_hmi_app_id_,
+ MEDIA,
+ NOT_NAVI,
+ VC);
+ navi_vc_app_ = ConfigureApp(&navi_vc_app_ptr_,
+ navi_vc_app_id_,
+ navi_vc_hmi_app_id_,
+ NOT_MEDIA,
+ NAVI,
+ VC);
+ media_navi_vc_app_ = ConfigureApp(&media_navi_vc_app_ptr_,
+ media_navi_vc_app_id_,
+ media_navi_vc_hmi_app_id_,
+ MEDIA,
+ NAVI,
+ VC);
applications_list_.push_back(simple_app_);
applications_list_.push_back(media_app_);
applications_list_.push_back(navi_app_);
@@ -914,6 +953,15 @@ class StateControllerImplTest : public ::testing::Test {
ASSERT_EQ(navi_vc_app_->app_id(), navi_vc_app_id_);
ASSERT_EQ(media_navi_vc_app_->app_id(), media_navi_vc_app_id_);
+ ASSERT_EQ(simple_app_->hmi_app_id(), simple_hmi_app_id_);
+ ASSERT_EQ(media_app_->hmi_app_id(), media_hmi_app_id_);
+ ASSERT_EQ(navi_app_->hmi_app_id(), navi_hmi_app_id_);
+ ASSERT_EQ(vc_app_->hmi_app_id(), vc_hmi_app_id_);
+ ASSERT_EQ(media_navi_app_->hmi_app_id(), media_navi_hmi_app_id_);
+ ASSERT_EQ(media_vc_app_->hmi_app_id(), media_vc_hmi_app_id_);
+ ASSERT_EQ(navi_vc_app_->hmi_app_id(), navi_vc_hmi_app_id_);
+ ASSERT_EQ(media_navi_vc_app_->hmi_app_id(), media_navi_vc_hmi_app_id_);
+
ASSERT_FALSE(simple_app_->IsAudioApplication());
ASSERT_TRUE(media_app_->IsAudioApplication());
ASSERT_TRUE(navi_app_->IsAudioApplication());
@@ -988,11 +1036,11 @@ class StateControllerImplTest : public ::testing::Test {
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
- GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
+ GetBCActivateAppRequestToHMI(_, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
ON_CALL(app_manager_mock_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
- ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request))
+ ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request, _))
.WillByDefault(Return(true));
}
@@ -1040,6 +1088,8 @@ class StateControllerImplTest : public ::testing::Test {
application_set_.insert(app);
ON_CALL(app_manager_mock_, application(app->app_id()))
.WillByDefault(Return(app));
+ ON_CALL(app_manager_mock_, application_by_hmi_app(app->hmi_app_id()))
+ .WillByDefault(Return(app));
}
am::HmiStatePtr NoneNotAudibleState() {
@@ -1475,9 +1525,9 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
app_in_full =
- ConfigureApp(&app_in_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
- app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&app_in_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
@@ -1549,11 +1599,11 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_in_full =
- ConfigureApp(&app_in_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&app_in_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1796, 30093, MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_in_full);
InsertApplication(app_moved_to_full);
@@ -1575,11 +1625,11 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
- ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NAVI, NOT_VC);
+ ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NAVI, VC);
+ ConfigureApp(&app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_full);
@@ -1600,12 +1650,12 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
- ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC);
+ ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, VC);
NiceMock<application_manager_test::MockApplication>*
app_moved_to_limited_mock;
- am::ApplicationSharedPtr app_moved_to_limited =
- ConfigureApp(&app_moved_to_limited_mock, 1796, NOT_MEDIA, NOT_NAVI, VC);
+ am::ApplicationSharedPtr app_moved_to_limited = ConfigureApp(
+ &app_moved_to_limited_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, VC);
InsertApplication(app_in_limited);
InsertApplication(app_moved_to_limited);
@@ -1749,8 +1799,8 @@ TEST_F(StateControllerImplTest,
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC);
am::ApplicationSharedPtr limited_app = media_app_;
NiceMock<application_manager_test::MockApplication>* limited_app_mock =
@@ -1758,7 +1808,7 @@ TEST_F(StateControllerImplTest,
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -1786,16 +1836,16 @@ TEST_F(
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
- ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -1823,16 +1873,16 @@ TEST_F(
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock;
- am::ApplicationSharedPtr app_moved_to_full =
- ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+ am::ApplicationSharedPtr app_moved_to_full = ConfigureApp(
+ &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* limited_app_mock;
am::ApplicationSharedPtr limited_app =
- ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+ ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC);
NiceMock<application_manager_test::MockApplication>* full_app_mock;
am::ApplicationSharedPtr full_app =
- ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NAVI, NOT_VC);
+ ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NAVI, NOT_VC);
InsertApplication(app_moved_to_full);
InsertApplication(limited_app);
@@ -1919,12 +1969,6 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
StateLevelPair(LimitedState(), Common_HMILevel::LIMITED));
hmi_states.push_back(
StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND));
- hmi_states.push_back(
- StateLevelPair(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- VideoStreamingState::NOT_STREAMABLE,
- SystemContext::SYSCTXT_MAIN),
- Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
@@ -1941,7 +1985,7 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
SetBCActivateAppRequestToHMI(hmi_level, corr_id);
ON_CALL(app_manager_mock_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
- ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request))
+ ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request, _))
.WillByDefault(Return(true));
EXPECT_CALL(app_manager_mock_, application_id(corr_id))
@@ -2013,7 +2057,8 @@ TEST_F(StateControllerImplTest, SendEventBCActivateApp_HMIReceivesError) {
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
.Times(0);
EXPECT_CALL(app_manager_mock_,
- OnHMILevelChanged(simple_app_->app_id(), _, _)).Times(0);
+ OnHMILevelChanged(simple_app_->app_id(), _, _))
+ .Times(0);
smart_objects::SmartObject message;
message[am::strings::params][am::hmi_response::code] = *it;
@@ -2577,7 +2622,8 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(false));
EXPECT_CALL(message_helper_mock_,
- SendOnResumeAudioSourceToHMI(simple_app_id_, _)).Times(0);
+ SendOnResumeAudioSourceToHMI(simple_app_id_, _))
+ .Times(0);
EXPECT_CALL(*simple_app_ptr_,
SetPostponedState(Truly(HmiStatesComparator(check_state))))
.Times(0);
@@ -2845,14 +2891,7 @@ TEST_F(StateControllerImplTest,
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- const HmiStatePtr state =
- createHmiState(mobile_apis::HMILevel::HMI_FULL,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::VideoStreamingState::NOT_STREAMABLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
-
EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true));
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
@@ -2884,12 +2923,6 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
am::event_engine::Event event(event_id);
event.set_smart_object(msg);
- const HmiStatePtr state =
- createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::VideoStreamingState::NOT_STREAMABLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
- EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
.WillRepeatedly(Return(true));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index dfc694f3c5..b494afb68e 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -33,9 +33,9 @@
#include "application_manager/usage_statistics.h"
#include <memory>
#include "gmock/gmock.h"
-#include "smart_objects/enum_schema_item.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/mock_app_stopwatch.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "smart_objects/enum_schema_item.h"
namespace test {
namespace components {
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 640a186e2b..0166c036c1 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -30,19 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <algorithm>
+#include <string>
#include "gtest/gtest.h"
-#include "application_manager/request_controller.h"
-#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager_impl.h"
-#include "application_manager/message_helper.h"
+#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/mobile/put_file_request.h"
#include "application_manager/commands/mobile/register_app_interface_request.h"
#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/request_controller.h"
#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt
index 4ed382039a..4b545c65ae 100644
--- a/src/components/config_profile/CMakeLists.txt
+++ b/src/components/config_profile/CMakeLists.txt
@@ -35,6 +35,7 @@ include_directories (
${COMPONENTS_DIR}/utils/include/
${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 57e925cd43..0a1e8b2c17 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -34,18 +34,18 @@
#define SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_PROFILE_H_
#include <stdint.h>
-#include <string>
-#include <vector>
#include <list>
#include <map>
-#include "utils/macro.h"
-#include "protocol_handler/protocol_handler_settings.h"
+#include <string>
+#include <vector>
+#include "application_manager/application_manager_settings.h"
#include "connection_handler/connection_handler_settings.h"
#include "hmi_message_handler/hmi_message_handler_settings.h"
#include "media_manager/media_manager_settings.h"
-#include "transport_manager/transport_manager_settings.h"
-#include "application_manager/application_manager_settings.h"
#include "policy/policy_settings.h"
+#include "protocol_handler/protocol_handler_settings.h"
+#include "transport_manager/transport_manager_settings.h"
+#include "utils/macro.h"
namespace profile {
@@ -85,23 +85,23 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& sdl_version() const OVERRIDE;
/**
- * @brief Returns true if HMI should be started, otherwise false
- */
+ * @brief Returns true if HMI should be started, otherwise false
+ */
bool launch_hmi() const OVERRIDE;
#ifdef WEB_HMI
/**
- * @brief Returns link to web hmi
- */
+ * @brief Returns link to web hmi
+ */
std::string link_to_web_hmi() const;
#endif // WEB_HMI
/**
- * @brief Returns application configuration path
- */
+ * @brief Returns application configuration path
+ */
const std::string& app_config_folder() const;
/**
- * @brief Returns application storage path
- */
+ * @brief Returns application storage path
+ */
const std::string& app_storage_folder() const;
/**
@@ -110,24 +110,24 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& app_resource_folder() const;
/**
- * @brief Returns offset from SIGRTMIN for user defined signal
- * SIGLOWVOLTAGE
- * which is used for handling LOW Voltage functionality
- */
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGLOWVOLTAGE
+ * which is used for handling LOW Voltage functionality
+ */
int low_voltage_signal_offset() const;
/**
- * @brief Returns offset from SIGRTMIN for user defined signal
- * SIGWAKEUP
- * which is used for handling LOW Voltage functionality
- */
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGWAKEUP
+ * which is used for handling LOW Voltage functionality
+ */
int wake_up_signal_offset() const;
/**
- * @brief Returns offset from SIGRTMIN for user defined signal
- * SIGIGNITIONOFF
- * which is used for handling LOW Voltage functionality
- */
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGIGNITIONOFF
+ * which is used for handling LOW Voltage functionality
+ */
int ignition_off_signal_offset() const;
/**
@@ -202,8 +202,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint32_t stop_streaming_timeout() const;
/**
- * @brief Returns port for time reports
- */
+ * @brief Returns port for time reports
+ */
const uint16_t& time_testing_port() const;
/**
@@ -228,8 +228,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& vr_commands() const;
/**
- * @brief Returns folder containing all plugins
- */
+ * @brief Returns folder containing all plugins
+ */
const std::string& plugins_folder() const OVERRIDE;
/**
@@ -254,38 +254,38 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint64_t thread_min_stack_size() const;
/**
- * @brief Returns true if audio mixing is supported
- */
+ * @brief Returns true if audio mixing is supported
+ */
bool is_mixing_audio_supported() const;
/**
- * @brief Returns true if video re-decoding enabled
- */
+ * @brief Returns true if video re-decoding enabled
+ */
bool is_redecoding_enabled() const;
/**
- * @brief Returns title for Vr Help
- */
+ * @brief Returns title for Vr Help
+ */
const std::string& vr_help_title() const;
/**
- * @brief Returns application directory quota size
- */
+ * @brief Returns application directory quota size
+ */
const uint32_t& app_dir_quota() const;
/**
- * @brief Returns the video server type
- */
+ * @brief Returns the video server type
+ */
const std::string& video_server_type() const;
/**
- * @brief Returns the audio server type
- */
+ * @brief Returns the audio server type
+ */
const std::string& audio_server_type() const;
/**
- * @brief Returns the video pipe path
- */
+ * @brief Returns the video pipe path
+ */
const std::string& named_video_pipe_path() const;
/**
@@ -300,13 +300,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint32_t& app_hmi_level_none_time_scale() const;
/**
- * @brief Returns path to testing file to which redirects video stream
- */
+ * @brief Returns path to testing file to which redirects video stream
+ */
const std::string& video_stream_file() const;
/**
- * @brief Returns path to testing file to which redirects audio stream
- */
+ * @brief Returns path to testing file to which redirects audio stream
+ */
const std::string& audio_stream_file() const;
/**
@@ -413,6 +413,18 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& transport_manager_tcp_adapter_network_interface()
const OVERRIDE;
+ /**
+ * @brief Returns retry timeout for cloud app connections
+ */
+ uint32_t cloud_app_retry_timeout() const OVERRIDE;
+
+ /**
+ * @brief Returns maximum retry attempts for cloud app connections
+ */
+ uint16_t cloud_app_max_retry_attempts() const OVERRIDE;
+
+ const uint8_t* bluetooth_uuid() const OVERRIDE;
+
// TransportManageMMESettings interface
const std::string& event_mq_name() const OVERRIDE;
@@ -442,8 +454,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<uint32_t>& supported_diag_modes() const OVERRIDE;
/**
- * @brief Returns system files folder path
- */
+ * @brief Returns system files folder path
+ */
const std::string& system_files_path() const OVERRIDE;
/**
@@ -516,6 +528,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& audio_service_transports() const OVERRIDE;
const std::vector<std::string>& video_service_transports() const OVERRIDE;
+ uint32_t rpc_pass_through_timeout() const OVERRIDE;
+ const std::vector<std::string>& embedded_services() const OVERRIDE;
+ const std::string hmi_origin_id() const OVERRIDE;
/**
* @brief Reads a string value from the profile
*
@@ -597,6 +612,10 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const char* const pKey,
bool* out_result) const;
+ std::vector<uint8_t> ReadUint8Container(const char* const pSection,
+ const char* const pKey,
+ bool* out_result) const;
+
/**
* @brief Returns delimiter for SDL-generated TTS chunks
* @return TTS delimiter
@@ -737,9 +756,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const bool enable_app_launch_ios() const OVERRIDE;
/**
- * @brief Returns the millisecond count before timeout
- * for transport change feature occures.
- */
+ * @brief Returns the millisecond count before timeout
+ * for transport change feature occures.
+ */
uint32_t app_transport_change_timer() const OVERRIDE;
/**
@@ -960,6 +979,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
std::string transport_manager_tcp_adapter_network_interface_;
+ uint32_t cloud_app_retry_timeout_;
+ uint16_t cloud_app_max_retry_attempts_;
+ std::vector<uint8_t> bluetooth_uuid_;
std::string tts_delimiter_;
uint32_t audio_data_stopped_timeout_;
uint32_t video_data_stopped_timeout_;
@@ -1051,6 +1073,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
int low_voltage_signal_offset_;
int wake_up_signal_offset_;
int ignition_off_signal_offset_;
+ uint32_t rpc_pass_through_timeout_;
+
+ std::vector<std::string> embedded_services_;
+
+ std::string hmi_origin_id_;
DISALLOW_COPY_AND_ASSIGN(Profile);
};
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
index 3245b096cb..024c75de3e 100644
--- a/src/components/config_profile/src/ini_file.cc
+++ b/src/components/config_profile/src/ini_file.cc
@@ -31,13 +31,13 @@
*/
#include "config_profile/ini_file.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.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"
@@ -157,7 +157,7 @@ char ini_write_value(const char* fname,
const char* item,
const char* value,
uint8_t flag) {
- FILE* rd_fp, * wr_fp = 0;
+ FILE *rd_fp, *wr_fp = 0;
uint16_t i, cr_count;
int32_t wr_result;
bool chapter_found = false;
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 57984324aa..c38b28db5f 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -33,18 +33,18 @@
#include "config_profile/profile.h"
#include <errno.h>
-#include <numeric>
-#include <string.h>
#include <stdlib.h>
-#include <sstream>
+#include <string.h>
#include <algorithm>
+#include <numeric>
+#include <sstream>
#include <string>
#include "config_profile/ini_file.h"
+#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/threads/thread.h"
-#include "utils/file_system.h"
#ifdef ENABLE_SECURITY
#include <openssl/ssl.h>
@@ -81,6 +81,7 @@ const char* kMediaManagerSection = "MEDIA MANAGER";
const char* kGlobalPropertiesSection = "GLOBAL PROPERTIES";
const char* kVrCommandsSection = "VR COMMANDS";
const char* kTransportManagerSection = "TransportManager";
+const char* kCloudAppTransportSection = "CloudAppConnections";
const char* kApplicationManagerSection = "ApplicationManager";
const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS";
const char* kIAPSection = "IAP";
@@ -95,6 +96,7 @@ const char* kTransportRequiredForResumptionSection =
"TransportRequiredForResumption";
const char* kLowBandwidthTransportResumptionLevelSection =
"LowBandwidthTransportResumptionLevel";
+const char* kAppServicesSection = "AppServices";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -154,6 +156,8 @@ const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion";
const char* kUseLastStateKey = "UseLastState";
const char* kTCPAdapterPortKey = "TCPAdapterPort";
const char* kTCPAdapterNetworkInterfaceKey = "TCPAdapterNetworkInterface";
+const char* kCloudAppRetryTimeoutKey = "CloudAppRetryTimeout";
+const char* kCloudAppMaxRetryAttemptsKey = "CloudAppMaxRetryAttempts";
const char* kServerPortKey = "ServerPort";
const char* kVideoStreamingPortKey = "VideoStreamingPort";
const char* kAudioStreamingPortKey = "AudioStreamingPort";
@@ -180,6 +184,7 @@ const char* kAppHmiLevelNoneRequestsTimeScaleKey =
const char* kPendingRequestsAmoundKey = "PendingRequestsAmount";
const char* kSupportedDiagModesKey = "SupportedDiagModes";
const char* kTransportManagerDisconnectTimeoutKey = "DisconnectTimeout";
+const char* kBluetoothUUIDKey = "BluetoothUUID";
const char* kTTSDelimiterKey = "TTSDelimiter";
const char* kRecordingFileNameKey = "RecordingFileName";
const char* kRecordingFileSourceKey = "RecordingFileSource";
@@ -235,6 +240,7 @@ const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB";
const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi";
const char* kAudioServiceTransportsKey = "AudioServiceTransports";
const char* kVideoServiceTransportsKey = "VideoServiceTransports";
+const char* kRpcPassThroughTimeoutKey = "RpcPassThroughTimeout";
const char* kDefaultTransportRequiredForResumptionKey =
"DefaultTransportRequiredForResumption";
@@ -281,6 +287,8 @@ const char* kProjectionLowBandwidthResumptionLevelKey =
"ProjectionLowBandwidthResumptionLevel";
const char* kMediaLowBandwidthResumptionLevelKey =
"MediaLowBandwidthResumptionLevel";
+const char* kHMIOriginIDKey = "HMIOriginID";
+const char* kEmbeddedServicesKey = "EmbeddedServices";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
@@ -318,6 +326,8 @@ const uint32_t kDefaultHubProtocolIndex = 0;
const uint32_t kDefaultHeartBeatTimeout = 0;
const uint16_t kDefaultMaxSupportedProtocolVersion = 5;
const uint16_t kDefautTransportManagerTCPPort = 12345;
+const uint16_t kDefaultCloudAppRetryTimeout = 1000;
+const uint16_t kDefaultCloudAppMaxRetryAttempts = 5;
const uint16_t kDefaultServerPort = 8087;
const uint16_t kDefaultVideoStreamingPort = 5050;
const uint16_t kDefaultAudioStreamingPort = 5080;
@@ -386,6 +396,24 @@ const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
const bool kDefaultMultipleTransportsEnabled = false;
const char* kDefaultLowBandwidthResumptionLevel = "NONE";
+const uint32_t kDefaultRpcPassThroughTimeout = 10000;
+const char* kDefaultHMIOriginId = "HMI_ID";
+const std::vector<uint8_t> kDefaultBluetoothUUID = {0x93,
+ 0x6D,
+ 0xA0,
+ 0x1F,
+ 0x9A,
+ 0xBD,
+ 0x4D,
+ 0x9D,
+ 0x80,
+ 0xC7,
+ 0x02,
+ 0xAF,
+ 0x85,
+ 0xC8,
+ 0x22,
+ 0xA8};
} // namespace
namespace profile {
@@ -452,6 +480,8 @@ Profile::Profile()
, supported_diag_modes_()
, system_files_path_(kDefaultSystemFilesPath)
, transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort)
+ , cloud_app_retry_timeout_(kDefaultCloudAppRetryTimeout)
+ , cloud_app_max_retry_attempts_(kDefaultCloudAppMaxRetryAttempts)
, tts_delimiter_(kDefaultTtsDelimiter)
, audio_data_stopped_timeout_(kDefaultAudioDataStoppedTimeout)
, video_data_stopped_timeout_(kDefaultVideoDataStoppedTimeout)
@@ -499,7 +529,8 @@ Profile::Profile()
, error_description_()
, low_voltage_signal_offset_(kDefaultLowVoltageSignalOffset)
, wake_up_signal_offset_(kDefaultWakeUpSignalOffset)
- , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) {
+ , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset)
+ , rpc_pass_through_timeout_(kDefaultRpcPassThroughTimeout) {
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -784,6 +815,18 @@ const std::string& Profile::transport_manager_tcp_adapter_network_interface()
return transport_manager_tcp_adapter_network_interface_;
}
+uint32_t Profile::cloud_app_retry_timeout() const {
+ return cloud_app_retry_timeout_;
+}
+
+uint16_t Profile::cloud_app_max_retry_attempts() const {
+ return cloud_app_max_retry_attempts_;
+}
+
+const uint8_t* Profile::bluetooth_uuid() const {
+ return bluetooth_uuid_.data();
+}
+
const std::string& Profile::tts_delimiter() const {
return tts_delimiter_;
}
@@ -1063,6 +1106,10 @@ const bool Profile::multiple_transports_enabled() const {
return multiple_transports_enabled_;
}
+uint32_t Profile::rpc_pass_through_timeout() const {
+ return rpc_pass_through_timeout_;
+}
+
const std::vector<std::string>& Profile::secondary_transports_for_bluetooth()
const {
return secondary_transports_for_bluetooth_;
@@ -1099,6 +1146,14 @@ bool Profile::IsFileNamePortable(const std::string& file_name) const {
return true;
}
+const std::vector<std::string>& Profile::embedded_services() const {
+ return embedded_services_;
+}
+
+const std::string Profile::hmi_origin_id() const {
+ return hmi_origin_id_;
+}
+
void Profile::UpdateValues() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1769,6 +1824,31 @@ void Profile::UpdateValues() {
kTCPAdapterNetworkInterfaceKey,
kTransportManagerSection);
+ ReadUIntValue(&cloud_app_retry_timeout_,
+ kDefaultCloudAppRetryTimeout,
+ kCloudAppTransportSection,
+ kCloudAppRetryTimeoutKey);
+
+ LOG_UPDATED_VALUE(cloud_app_retry_timeout_,
+ kCloudAppRetryTimeoutKey,
+ kCloudAppTransportSection);
+
+ ReadUIntValue(&cloud_app_max_retry_attempts_,
+ kDefaultCloudAppMaxRetryAttempts,
+ kCloudAppTransportSection,
+ kCloudAppMaxRetryAttemptsKey);
+
+ LOG_UPDATED_VALUE(cloud_app_max_retry_attempts_,
+ kCloudAppMaxRetryAttemptsKey,
+ kCloudAppTransportSection);
+
+ bool read_result = true;
+ bluetooth_uuid_ = ReadUint8Container(
+ kTransportManagerSection, kBluetoothUUIDKey, &read_result);
+ if (!read_result || bluetooth_uuid_.size() != 16) {
+ bluetooth_uuid_ = kDefaultBluetoothUUID;
+ }
+
// Event MQ
ReadStringValue(
&event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey);
@@ -2202,6 +2282,15 @@ void Profile::UpdateValues() {
kMultipleTransportsEnabledKey,
kMultipleTransportsSection);
+ ReadUIntValue(&rpc_pass_through_timeout_,
+ kDefaultRpcPassThroughTimeout,
+ kAppServicesSection,
+ kRpcPassThroughTimeoutKey);
+
+ LOG_UPDATED_VALUE(rpc_pass_through_timeout_,
+ kRpcPassThroughTimeoutKey,
+ kAppServicesSection);
+
{ // Secondary Transports and ServicesMap
struct KeyPair {
std::vector<std::string>* ini_vector;
@@ -2245,6 +2334,44 @@ void Profile::UpdateValues() {
entry++;
}
}
+
+ ReadStringValue(&hmi_origin_id_,
+ kDefaultHMIOriginId,
+ kAppServicesSection,
+ kHMIOriginIDKey);
+
+ LOG_UPDATED_VALUE(hmi_origin_id_, kHMIOriginIDKey, kAppServicesSection);
+
+ { // App Services map
+ struct KeyPair {
+ std::vector<std::string>* ini_vector;
+ const char* ini_section_name;
+ const char* ini_key_name;
+ } keys[] = {
+ {&embedded_services_, kAppServicesSection, kEmbeddedServicesKey},
+ {NULL, NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_vector != NULL) {
+ bool exist = false;
+ std::vector<std::string> profile_entry = ReadStringContainer(
+ entry->ini_section_name, entry->ini_key_name, &exist, true);
+ if (exist) {
+ *entry->ini_vector = profile_entry;
+
+ const std::string list_with_comma = std::accumulate(
+ profile_entry.begin(),
+ profile_entry.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(
+ list_with_comma, entry->ini_key_name, entry->ini_section_name);
+ }
+ entry++;
+ }
+ }
}
bool Profile::ReadValue(bool* value,
@@ -2350,6 +2477,10 @@ int32_t hex_to_int(const std::string& value) {
return static_cast<int32_t>(strtol(value.c_str(), NULL, 16));
}
+uint8_t hex_to_uint8(const std::string& value) {
+ return static_cast<uint8_t>(strtol(value.c_str(), NULL, 16));
+}
+
std::string trim_string(const std::string& str) {
const char* delims = " \t";
@@ -2361,7 +2492,7 @@ std::string trim_string(const std::string& str) {
return str.substr(start, end - start + 1);
}
-}
+} // namespace
std::vector<int> Profile::ReadIntContainer(const char* const pSection,
const char* const pKey,
@@ -2375,6 +2506,18 @@ std::vector<int> Profile::ReadIntContainer(const char* const pSection,
return value_list;
}
+std::vector<uint8_t> Profile::ReadUint8Container(const char* const pSection,
+ const char* const pKey,
+ bool* out_result) const {
+ const std::vector<std::string> string_list =
+ ReadStringContainer(pSection, pKey, out_result);
+ std::vector<uint8_t> value_list;
+ value_list.resize(string_list.size());
+ std::transform(
+ string_list.begin(), string_list.end(), value_list.begin(), hex_to_uint8);
+ return value_list;
+}
+
std::vector<std::string> Profile::ReadStringContainer(
const char* const pSection,
const char* const pKey,
diff --git a/src/components/config_profile/test/ini_file_test.cc b/src/components/config_profile/test/ini_file_test.cc
index 0443f061a2..ca4f2fc849 100644
--- a/src/components/config_profile/test/ini_file_test.cc
+++ b/src/components/config_profile/test/ini_file_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "config_profile/ini_file.h"
+#include "gtest/gtest.h"
#include "utils/file_system.h"
namespace test {
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index 64bafdd6bf..6dc0434440 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -33,8 +33,8 @@
#include <algorithm>
#include <vector>
-#include "gtest/gtest.h"
#include "config_profile/profile.h"
+#include "gtest/gtest.h"
#include "utils/file_system.h"
#include "utils/threads/thread.h"
diff --git a/src/components/connection_handler/CMakeLists.txt b/src/components/connection_handler/CMakeLists.txt
index fd2aa876cd..8018ea3707 100644
--- a/src/components/connection_handler/CMakeLists.txt
+++ b/src/components/connection_handler/CMakeLists.txt
@@ -36,6 +36,7 @@ include_directories (
${COMPONENTS_DIR}/utils/include/
${ENCRYPTION_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index 4f900bb65e..7e4ab6a24e 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -36,12 +36,12 @@
#include <map>
#include <vector>
-#include "utils/lock.h"
-#include "utils/threads/thread.h"
#include "connection_handler/device.h"
#include "connection_handler/heartbeat_monitor.h"
#include "protocol/service_type.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
#ifdef ENABLE_SECURITY
namespace security_manager {
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
index 1ab70ce702..cca11e5f57 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -33,26 +33,26 @@
#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_IMPL_H_
#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_IMPL_H_
-#include <map>
#include <list>
+#include <map>
#include <string>
#include <vector>
-#include "transport_manager/transport_manager_listener_empty.h"
-#include "protocol_handler/session_observer.h"
-#include "protocol_handler/protocol_handler.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
#include "connection_handler/device.h"
-#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
-#include "connection_handler/connection_handler.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/session_observer.h"
+#include "transport_manager/transport_manager_listener_empty.h"
+#include "utils/lock.h"
#include "utils/logger.h"
#include "utils/macro.h"
#include "utils/message_queue.h"
-#include "utils/lock.h"
-#include "utils/stl_utils.h"
#include "utils/rwlock.h"
+#include "utils/stl_utils.h"
const transport_manager::ConnectionUID kDisabledSecondary = 0xFFFFFFFF;
@@ -81,7 +81,7 @@ class ConnectionHandlerImpl
ConnectionHandlerImpl(const ConnectionHandlerSettings& settings,
transport_manager::TransportManager& tm);
/**
- * \brief Destructor
+ * @brief Destructor
*/
~ConnectionHandlerImpl();
@@ -102,11 +102,21 @@ class ConnectionHandlerImpl
/**
* \brief Connects to all services of device
- * \param deviceHandle Handle of device to connect to
+ * \param device_handle Handle of device to connect to
*/
void ConnectToDevice(connection_handler::DeviceHandle device_handle) OVERRIDE;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ transport_manager::ConnectionStatus GetConnectionStatus(
+ const DeviceHandle& device_handle) const OVERRIDE;
+
+ /**
* @brief RunAppOnDevice allows to run specific application on the certain
*device.
*
@@ -120,6 +130,13 @@ class ConnectionHandlerImpl
void ConnectToAllDevices() OVERRIDE;
+ void AddCloudAppDevice(
+ const std::string& policy_app_id,
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) OVERRIDE;
+
+ void RemoveCloudAppDevice(const DeviceHandle device_id) OVERRIDE;
+
void StartTransportManager() OVERRIDE;
void OnDeviceListUpdated(
@@ -162,6 +179,16 @@ class ConnectionHandlerImpl
void OnScanDevicesFailed(
const transport_manager::SearchDeviceError& error) OVERRIDE;
+ void OnConnectionStatusUpdated() OVERRIDE;
+
+ /**
+ * \brief Notifies about pending connection.
+ *
+ * \param connection_id ID of new connection.
+ **/
+ void OnConnectionPending(
+ const transport_manager::DeviceInfo& device_info,
+ const transport_manager::ConnectionUID connection_id) OVERRIDE;
/**
* \brief Notifies about established connection.
*
@@ -352,6 +379,15 @@ class ConnectionHandlerImpl
const protocol_handler::ServiceType& service_type) const OVERRIDE;
/**
+ * @brief Get cloud app id by connection id
+ * @param connection_id unique connection id
+ * @return the policy app id of the cloud app if the connection is tied to a
+ * cloud app, an empty string otherwise.
+ */
+ std::string GetCloudAppID(
+ const transport_manager::ConnectionUID connection_id) const OVERRIDE;
+
+ /**
* \brief Get device handle by mac address
* \param mac_address uniq address
* \param device_handle
@@ -629,6 +665,12 @@ class ConnectionHandlerImpl
std::map<uint32_t, protocol_handler::SessionContext>
start_service_context_map_;
+ // Map app id -> (cloud_app_endpoint, connection_uid)
+ mutable sync_primitives::Lock cloud_app_id_map_lock_;
+ std::map<std::string,
+ std::pair<std::string, transport_manager::ConnectionUID> >
+ cloud_app_id_map_;
+
/**
* @brief connection object as it's being closed
*/
diff --git a/src/components/connection_handler/include/connection_handler/device.h b/src/components/connection_handler/include/connection_handler/device.h
index 26376c1d8d..1cad7a72c5 100644
--- a/src/components/connection_handler/include/connection_handler/device.h
+++ b/src/components/connection_handler/include/connection_handler/device.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
-#include <string>
#include <map>
+#include <string>
#include <vector>
#include "transport_manager/common.h"
@@ -77,9 +77,9 @@ class Device {
std::string user_friendly_name() const;
/**
- *\brief Also should be used for iOS USB connections
- *(better not know why this same method)
- */
+ *\brief Also should be used for iOS USB connections
+ *(better not know why this same method)
+ */
std::string mac_address() const;
/**
diff --git a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
index cf956353dd..9e04929f79 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -35,11 +35,11 @@
#include <stdint.h>
#include <map>
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
#include "utils/date_time.h"
-#include "utils/macro.h"
#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace connection_handler {
@@ -64,7 +64,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
void RemoveSession(uint8_t session_id);
/**
- * \brief Resets timer preventing session from being killed
+ * \brief Resets timer preventing session from being killed
*/
void KeepAlive(uint8_t session_id);
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 3f5b0e1901..304be9ddb0 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -37,13 +37,13 @@
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/helpers.h"
#include "utils/logger.h"
#include "utils/macro.h"
-#include "utils/helpers.h"
#ifdef ENABLE_SECURITY
-#include "security_manager/ssl_context.h"
#include "security_manager/security_manager.h"
+#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
/**
@@ -190,12 +190,11 @@ bool Connection::AddNewService(uint8_t session_id,
Session& session = session_it->second;
if (session.protocol_version <= protocol_handler::PROTOCOL_VERSION_2 &&
- helpers::Compare<protocol_handler::ServiceType,
- helpers::EQ,
- helpers::ONE>(
- service_type,
- protocol_handler::ServiceType::kAudio,
- protocol_handler::ServiceType::kMobileNav)) {
+ helpers::
+ Compare<protocol_handler::ServiceType, helpers::EQ, helpers::ONE>(
+ service_type,
+ protocol_handler::ServiceType::kAudio,
+ protocol_handler::ServiceType::kMobileNav)) {
LOG4CXX_WARN(logger_,
"Audio and video services are disallowed for protocol version "
"2 or lower");
@@ -265,8 +264,10 @@ bool Connection::RemoveService(uint8_t session_id,
find(service_list.begin(), service_list.end(), service_type);
if (service_list.end() == service_it) {
LOG4CXX_WARN(logger_,
- "Session " << session_id << " didn't established"
- " service " << service_type);
+ "Session " << session_id
+ << " didn't established"
+ " service "
+ << service_type);
return false;
}
service_list.erase(service_it);
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 478127c42a..84609d47b8 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -31,14 +31,14 @@
*/
#include <strings.h>
-#include <string>
-#include <list>
#include <algorithm>
+#include <list>
#include <memory>
+#include <string>
#include "connection_handler/connection_handler_impl.h"
-#include "transport_manager/info.h"
#include "encryption/hashing.h"
+#include "transport_manager/info.h"
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
@@ -95,9 +95,9 @@ void ConnectionHandlerImpl::Stop() {
void ConnectionHandlerImpl::set_connection_handler_observer(
ConnectionHandlerObserver* observer) {
- LOG4CXX_DEBUG(logger_,
- "ConnectionHandlerImpl::set_connection_handler_observer() "
- << observer);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ConnectionHandlerImpl::set_connection_handler_observer() " << observer);
sync_primitives::AutoWriteLock write_lock(connection_handler_observer_lock_);
if (!observer) {
LOG4CXX_WARN(logger_, "Set Null pointer to observer.");
@@ -107,9 +107,9 @@ void ConnectionHandlerImpl::set_connection_handler_observer(
void ConnectionHandlerImpl::set_protocol_handler(
protocol_handler::ProtocolHandler* protocol_handler) {
- LOG4CXX_DEBUG(logger_,
- "ConnectionHandlerImpl::set_protocol_handler()"
- << protocol_handler);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ConnectionHandlerImpl::set_protocol_handler()" << protocol_handler);
if (!protocol_handler) {
LOG4CXX_WARN(logger_, "Set Null pointer to protocol handler.");
}
@@ -142,6 +142,11 @@ void ConnectionHandlerImpl::OnDeviceAdded(
LOG4CXX_AUTO_TRACE(logger_);
auto handle = device_info.device_handle();
+ LOG4CXX_DEBUG(logger_,
+ "OnDeviceAdded!!!: " << handle << " " << device_info.name()
+ << " " << device_info.mac_address() << " "
+ << device_info.connection_type());
+
Device device(handle,
device_info.name(),
device_info.mac_address(),
@@ -244,11 +249,69 @@ void ConnectionHandlerImpl::OnScanDevicesFailed(
LOG4CXX_WARN(logger_, "Scan devices failed. " << error.text());
}
-void ConnectionHandlerImpl::OnConnectionEstablished(
+void ConnectionHandlerImpl::OnConnectionStatusUpdated() {
+ connection_handler_observer_->OnConnectionStatusUpdated();
+}
+
+void ConnectionHandlerImpl::OnConnectionPending(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id) {
LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "OnConnectionEstablished!!!: "
+ << device_info.device_handle() << " " << device_info.name()
+ << " " << device_info.mac_address() << " "
+ << device_info.connection_type());
+ DeviceMap::iterator it = device_list_.find(device_info.device_handle());
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown device!");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Add Pending Connection #" << connection_id << " to the list.");
+
+ std::string endpoint = device_info.mac_address();
+ cloud_app_id_map_lock_.Acquire();
+ for (auto it = cloud_app_id_map_.begin(); it != cloud_app_id_map_.end();
+ ++it) {
+ if (endpoint == it->second.first) {
+ it->second.second = connection_id;
+ break;
+ }
+ }
+ cloud_app_id_map_lock_.Release();
+
+ sync_primitives::AutoWriteLock lock(connection_list_lock_);
+ if (connection_list_.find(connection_id) == connection_list_.end()) {
+ Connection* connection =
+ new Connection(connection_id,
+ device_info.device_handle(),
+ this,
+ get_settings().heart_beat_timeout());
+ connection_list_.insert(
+ ConnectionList::value_type(connection_id, connection));
+
+ connection_handler::DeviceHandle device_id =
+ connection->connection_device_handle();
+
+ connection_handler_observer_->CreatePendingApplication(
+ connection_id, device_info, device_id);
+ } else {
+ connection_handler_observer_->SetPendingApplicationState(connection_id,
+ device_info);
+ }
+}
+
+void ConnectionHandlerImpl::OnConnectionEstablished(
+ const transport_manager::DeviceInfo& device_info,
+ const transport_manager::ConnectionUID connection_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "OnConnectionEstablished!!!: "
+ << device_info.device_handle() << " " << device_info.name()
+ << " " << device_info.mac_address() << " "
+ << device_info.connection_type());
DeviceMap::iterator it = device_list_.find(device_info.device_handle());
if (device_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown device!");
@@ -257,12 +320,14 @@ void ConnectionHandlerImpl::OnConnectionEstablished(
LOG4CXX_DEBUG(logger_,
"Add Connection #" << connection_id << " to the list.");
sync_primitives::AutoWriteLock lock(connection_list_lock_);
- connection_list_.insert(ConnectionList::value_type(
- connection_id,
- new Connection(connection_id,
- device_info.device_handle(),
- this,
- get_settings().heart_beat_timeout())));
+ if (connection_list_.find(connection_id) == connection_list_.end()) {
+ connection_list_.insert(ConnectionList::value_type(
+ connection_id,
+ new Connection(connection_id,
+ device_info.device_handle(),
+ this,
+ get_settings().heart_beat_timeout())));
+ }
}
void ConnectionHandlerImpl::OnConnectionFailed(
@@ -327,9 +392,9 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
if (std::find(force_unprotected_list.begin(),
force_unprotected_list.end(),
service_type) != force_unprotected_list.end()) {
- LOG4CXX_ERROR(logger_,
- "Service " << static_cast<int>(service_type)
- << " shall be protected");
+ LOG4CXX_ERROR(
+ logger_,
+ "Service " << static_cast<int>(service_type) << " shall be protected");
return false;
}
LOG4CXX_DEBUG(logger_,
@@ -621,34 +686,34 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
KeyFromPair(primary_connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
- LOG4CXX_INFO(logger_,
- "Session " << static_cast<uint32_t>(session_id)
- << " to be removed");
+ LOG4CXX_INFO(
+ logger_,
+ "Session " << static_cast<uint32_t>(session_id) << " to be removed");
// old version of protocol doesn't support hash
if (protocol_handler::HASH_ID_NOT_SUPPORTED != *hashCode) {
if (protocol_handler::HASH_ID_WRONG == *hashCode ||
session_key != *hashCode) {
- LOG4CXX_WARN(logger_,
- "Wrong hash_id for session "
- << static_cast<uint32_t>(session_id));
+ LOG4CXX_WARN(
+ logger_,
+ "Wrong hash_id for session " << static_cast<uint32_t>(session_id));
*hashCode = protocol_handler::HASH_ID_WRONG;
return 0;
}
}
if (!connection->RemoveSession(session_id)) {
- LOG4CXX_WARN(logger_,
- "Couldn't remove session "
- << static_cast<uint32_t>(session_id));
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't remove session " << static_cast<uint32_t>(session_id));
return 0;
}
} else {
- LOG4CXX_INFO(logger_,
- "Service " << static_cast<uint32_t>(service_type)
- << " to be removed");
+ LOG4CXX_INFO(
+ logger_,
+ "Service " << static_cast<uint32_t>(service_type) << " to be removed");
if (!connection->RemoveService(session_id, service_type)) {
- LOG4CXX_WARN(logger_,
- "Couldn't remove service "
- << static_cast<uint32_t>(service_type));
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't remove service " << static_cast<uint32_t>(service_type));
return 0;
}
}
@@ -823,6 +888,8 @@ ConnectionHandlerImpl::TransportTypeProfileStringFromDeviceHandle(
return std::string("IAP_USB_DEVICE_MODE");
} else if (connection_type == "CARPLAY_WIRELESS_IOS") {
return std::string("IAP_CARPLAY");
+ } else if (connection_type == "CLOUD_WEBSOCKET") {
+ return std::string("WEBSOCKET");
#ifdef BUILD_TESTS
} else if (connection_type == "BTMAC") {
return std::string("BTMAC");
@@ -1057,6 +1124,18 @@ const uint8_t ConnectionHandlerImpl::GetSessionIdFromSecondaryTransport(
return 0;
}
+std::string ConnectionHandlerImpl::GetCloudAppID(
+ const transport_manager::ConnectionUID connection_id) const {
+ sync_primitives::AutoLock auto_lock(cloud_app_id_map_lock_);
+ for (auto it = cloud_app_id_map_.begin(); it != cloud_app_id_map_.end();
+ ++it) {
+ if (connection_id == it->second.second) {
+ return it->first;
+ }
+ }
+ return std::string();
+}
+
struct CompareMAC {
explicit CompareMAC(const std::string& mac) : mac_(mac) {}
bool operator()(const DeviceMap::value_type& device) {
@@ -1245,6 +1324,11 @@ void ConnectionHandlerImpl::ConnectToDevice(
}
}
+transport_manager::ConnectionStatus ConnectionHandlerImpl::GetConnectionStatus(
+ const DeviceHandle& device_handle) const {
+ return transport_manager_.GetConnectionStatus(device_handle);
+}
+
void ConnectionHandlerImpl::RunAppOnDevice(const std::string& device_mac,
const std::string& bundle_id) const {
for (DeviceMap::const_iterator i = device_list_.begin();
@@ -1267,6 +1351,21 @@ void ConnectionHandlerImpl::ConnectToAllDevices() {
}
}
+void ConnectionHandlerImpl::AddCloudAppDevice(
+ const std::string& policy_app_id,
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) {
+ cloud_app_id_map_lock_.Acquire();
+ cloud_app_id_map_[policy_app_id] =
+ std::make_pair(cloud_properties.endpoint, 0);
+ cloud_app_id_map_lock_.Release();
+ transport_manager_.AddCloudDevice(cloud_properties);
+}
+
+void ConnectionHandlerImpl::RemoveCloudAppDevice(const DeviceHandle device_id) {
+ transport_manager_.RemoveCloudDevice(device_id);
+}
+
void ConnectionHandlerImpl::StartTransportManager() {
LOG4CXX_AUTO_TRACE(logger_);
transport_manager_.Visibility(true);
@@ -1381,9 +1480,9 @@ void ConnectionHandlerImpl::CloseSession(ConnectionHandle connection_handle,
return;
}
- LOG4CXX_DEBUG(logger_,
- "Session with id: " << session_id
- << " has been closed successfully");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Session with id: " << session_id << " has been closed successfully");
}
void ConnectionHandlerImpl::CloseConnectionSessions(
diff --git a/src/components/connection_handler/src/device.cc b/src/components/connection_handler/src/device.cc
index 0ecb439172..515304778b 100644
--- a/src/components/connection_handler/src/device.cc
+++ b/src/components/connection_handler/src/device.cc
@@ -54,9 +54,9 @@ Device::Device(DeviceHandle device_handle,
, mac_address_(mac_address)
, connection_type_(connection_type) {
mac_address_ = encryption::MakeHash(mac_address);
- LOG4CXX_DEBUG(logger_,
- "Device: MAC address - " << mac_address << ", hash - "
- << mac_address_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Device: MAC address - " << mac_address << ", hash - " << mac_address_);
}
DeviceHandle Device::device_handle() const {
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index 4c2d5899af..2b50f1ce1b 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -34,8 +34,8 @@
#include <unistd.h>
#include <utility>
-#include "utils/logger.h"
#include "connection_handler/connection.h"
+#include "utils/logger.h"
namespace connection_handler {
@@ -79,9 +79,9 @@ void HeartBeatMonitor::Process() {
void HeartBeatMonitor::threadMain() {
AutoLock main_lock(main_thread_lock_);
- LOG4CXX_DEBUG(logger_,
- "Start heart beat monitor. Timeout is "
- << default_heartbeat_timeout_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Start heart beat monitor. Timeout is " << default_heartbeat_timeout_);
while (run_) {
heartbeat_monitor_.WaitFor(main_lock, kDefaultCycleTimeout);
Process();
@@ -94,9 +94,9 @@ void HeartBeatMonitor::AddSession(uint8_t session_id) {
LOG4CXX_DEBUG(logger_, "Add session with id " << converted_session_id);
AutoLock auto_lock(sessions_list_lock_);
if (sessions_.end() != sessions_.find(session_id)) {
- LOG4CXX_WARN(logger_,
- "Session with id: " << converted_session_id
- << " already exists");
+ LOG4CXX_WARN(
+ logger_,
+ "Session with id: " << converted_session_id << " already exists");
return;
}
sessions_.insert(
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index 64de24b103..af7009c2f5 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -30,22 +30,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include <fstream>
+#include "connection_handler/connection_handler_impl.h"
#include <stdint.h>
+#include <fstream>
#include <vector>
-#include "connection_handler/connection_handler_impl.h"
+#include "gtest/gtest.h"
#include "protocol/common.h"
// TODO(EZamakhov): move security test
#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
#endif // ENABLE_SECURITY
-#include "protocol_handler/mock_protocol_handler.h"
#include "connection_handler/mock_connection_handler_observer.h"
#include "connection_handler/mock_connection_handler_settings.h"
-#include "transport_manager/mock_transport_manager.h"
#include "encryption/hashing.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "transport_manager/mock_transport_manager.h"
#include "utils/test_async_waiter.h"
namespace test {
@@ -333,7 +333,8 @@ class ConnectionHandlerTest : public ::testing::Test {
connection_handler_->set_connection_handler_observer(
&temp_connection_handler_observer);
EXPECT_CALL(temp_connection_handler_observer,
- OnServiceStartedCallback(_, _, service_type, _)).Times(1);
+ OnServiceStartedCallback(_, _, service_type, _))
+ .Times(1);
connection_handler_->OnSessionStartedCallback(2u,
out_context_.new_session_id_,
@@ -635,7 +636,8 @@ TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack) {
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
EXPECT_CALL(mock_protocol_handler_,
- SendEndSession(uid_, out_context_.new_session_id_)).Times(1);
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .Times(1);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kCommon));
@@ -753,7 +755,8 @@ TEST_F(ConnectionHandlerTest, UpdateDeviceList) {
// New value that sets in OnDeviceListUpdated does not add
EXPECT_CALL(mock_connection_handler_observer,
- OnDeviceListUpdated(CheckDevList(map_with_unused_var))).Times(0);
+ OnDeviceListUpdated(CheckDevList(map_with_unused_var)))
+ .Times(0);
connection_handler_->OnDeviceListUpdated(unused_info);
}
@@ -1021,7 +1024,8 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithMalformedMessage) {
TestAsyncWaiter waiter;
uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_,
- SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .Times(0);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
@@ -1061,7 +1065,8 @@ TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithMalformedMessage) {
TestAsyncWaiter waiter;
uint32_t times = 0;
EXPECT_CALL(mock_protocol_handler_,
- SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .Times(0);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
@@ -2063,7 +2068,8 @@ TEST_F(ConnectionHandlerTest, StartStopSecondarySession) {
secondary_uid);
EXPECT_CALL(mock_connection_handler_observer,
- OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+ OnSecondaryTransportStartedCallback(device_handle_, _))
+ .Times(1);
connection_handler_->OnSecondaryTransportStarted(
uid_, secondary_uid, out_context_.new_session_id_);
@@ -2084,11 +2090,14 @@ TEST_F(ConnectionHandlerTest, StartStopSecondarySession) {
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
EXPECT_CALL(mock_connection_handler_observer,
- OnSecondaryTransportEndedCallback(_)).Times(1);
+ OnSecondaryTransportEndedCallback(_))
+ .Times(1);
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(_, kAudio, _)).Times(1);
+ OnServiceEndedCallback(_, kAudio, _))
+ .Times(1);
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(_, kMobileNav, _)).Times(1);
+ OnServiceEndedCallback(_, kMobileNav, _))
+ .Times(1);
connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
@@ -2120,7 +2129,8 @@ TEST_F(ConnectionHandlerTest, StopSecondarySession_NoService) {
secondary_uid);
EXPECT_CALL(mock_connection_handler_observer,
- OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+ OnSecondaryTransportStartedCallback(device_handle_, _))
+ .Times(1);
connection_handler_->OnSecondaryTransportStarted(
uid_, secondary_uid, out_context_.new_session_id_);
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index 98b83f5fc4..dd86831225 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -34,12 +34,12 @@
#include "gtest/gtest.h"
-#include "protocol/common.h"
#include "connection_handler/connection.h"
-#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/connection_handler_impl.h"
-#include "protocol/service_type.h"
+#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/mock_connection_handler_settings.h"
+#include "protocol/common.h"
+#include "protocol/service_type.h"
#include "transport_manager/mock_transport_manager.h"
#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
diff --git a/src/components/connection_handler/test/device_test.cc b/src/components/connection_handler/test/device_test.cc
index 8c6d0af57a..555bd8ed2a 100644
--- a/src/components/connection_handler/test/device_test.cc
+++ b/src/components/connection_handler/test/device_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "connection_handler/device.h"
#include <gtest/gtest.h>
#include "encryption/hashing.h"
-#include "connection_handler/device.h"
namespace test {
namespace components {
@@ -75,6 +75,6 @@ TEST(ConnectionDevice, MacAddressHash) {
EXPECT_EQ(hashed_mac_address, test_device.mac_address());
}
-} // namespace connection_handlet_test
+} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index ccfff34116..d736255134 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <iostream>
-#include "gtest/gtest.h"
-#include "connection_handler/heartbeat_monitor.h"
+#include <string>
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
+#include "connection_handler/heartbeat_monitor.h"
#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
#include "utils/test_async_waiter.h"
namespace {
@@ -44,14 +44,14 @@ const int32_t MILLISECONDS_IN_SECOND = 1000;
const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
const uint32_t kTime_offset = 20u;
-}
+} // namespace
namespace test {
namespace components {
namespace connection_handler_test {
-using ::testing::DoAll;
using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
class HeartBeatMonitorTest : public testing::Test {
diff --git a/src/components/formatters/CMakeLists.txt b/src/components/formatters/CMakeLists.txt
index ffd6f333e5..86483929e9 100644
--- a/src/components/formatters/CMakeLists.txt
+++ b/src/components/formatters/CMakeLists.txt
@@ -38,6 +38,7 @@ include_directories (
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/smart_objects/include
${COMPONENTS_DIR}/utils/include
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h
index 66ffa0c1c5..b800ac1559 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonBase.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h
@@ -35,8 +35,8 @@
#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
-#include "smart_objects/smart_object.h"
#include "json/json.h"
+#include "smart_objects/smart_object.h"
namespace ns_smart_device_link {
namespace ns_json_handler {
@@ -44,33 +44,33 @@ namespace formatters {
namespace meta_formatter_error_code {
/**
- * @brief Error codes of MetaFormatter represented as bitmask
- **/
+ * @brief Error codes of MetaFormatter represented as bitmask
+ **/
typedef long tMetaFormatterErrorCode;
/**
- * @brief OK, no error
- */
+ * @brief OK, no error
+ */
static const tMetaFormatterErrorCode kErrorOk = 0x0;
/**
- * @brief origin smart object is not function
- */
+ * @brief origin smart object is not function
+ */
static const tMetaFormatterErrorCode kErrorObjectIsNotFunction = 0x01;
/**
- * @brief smart shema describes object which is not function
- */
+ * @brief smart shema describes object which is not function
+ */
static const tMetaFormatterErrorCode kErrorSchemaIsNotFunction = 0x02;
/**
- * @brief result smart object has invalid type (SmartType_Invalid)
- * before passing to MetaFormatter, i.e. result object can not
- * be changed, i.e. result object can not be built
- *
- */
+ * @brief result smart object has invalid type (SmartType_Invalid)
+ * before passing to MetaFormatter, i.e. result object can not
+ * be changed, i.e. result object can not be built
+ *
+ */
static const tMetaFormatterErrorCode kErrorFailedCreateObjectBySchema = 0x04;
-}
+} // namespace meta_formatter_error_code
/**
* @brief The base class for all JSON based formatters.
@@ -102,18 +102,18 @@ class CFormatterJsonBase {
ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
- * @brief The method constructs a JSON object from the input SmartObject
- *
- * @param obj Input SmartObject. Can contain a complex structure of objects.
- * @param value The resulting JSON object. It has the same structure as the
- *input SmartObject.
- */
+ * @brief The method constructs a JSON object from the input SmartObject
+ *
+ * @param obj Input SmartObject. Can contain a complex structure of objects.
+ * @param value The resulting JSON object. It has the same structure as the
+ *input SmartObject.
+ */
static void objToJsonValue(
const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
Json::Value& value);
};
-}
-}
-} // namespace ns_smart_device_link::ns_json_handler::formatters
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index d2fdf87957..b1054100df 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
@@ -32,8 +32,8 @@
#include "json/json.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "CFormatterJsonBase.h"
@@ -126,11 +126,14 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
*
* @param obj input SmartObject
* @param outStr resulting JSON string
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* @return true if success, false otherwise
*/
static bool toString(
const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
- std::string& outStr);
+ std::string& outStr,
+ const bool remove_unknown_parameters = true);
/**
* @brief Creates a SmartObject from a JSON string.
@@ -151,12 +154,15 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @param schema Smart schema which describes 'fake' smart object to be
*formatted
* @param outStr Resulting JSON string
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
const ns_smart_device_link::ns_smart_objects::SmartObject& object,
const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
- std::string& outStr);
+ std::string& outStr,
+ const bool remove_unknown_parameters = true);
};
// ----------------------------------------------------------------------------
@@ -232,8 +238,8 @@ int32_t formatters::CFormatterJsonSDLRPCv1::fromString(
return result;
}
-}
-}
-} // namespace ns_smart_device_link::ns_json_handler::formatters
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index e248954552..ab0289b293 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
@@ -73,11 +73,14 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
*
* @param obj input SmartObject
* @param outStr resulting JSON string
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* @return true if success, false otherwise
*/
static bool toString(
const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
- std::string& outStr);
+ std::string& outStr,
+ const bool remove_unknown_parameters = true);
/**
* @brief Creates a SmartObject from a JSON string.
@@ -128,12 +131,15 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @param schema Smart schema which describes 'fake' smart object to be
*formatted
* @param outStr Resulting JSON string
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
const ns_smart_device_link::ns_smart_objects::SmartObject& object,
const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
- std::string& outStr);
+ std::string& outStr,
+ const bool remove_unknown_parameters = true);
};
template <typename FunctionId, typename MessageType>
@@ -182,8 +188,8 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
return result;
}
-}
-}
-} // namespace ns_smart_device_link::ns_json_handler::formatters
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index a48eab2a6b..c384dbf01d 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -35,10 +35,10 @@
#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
-#include "smart_objects/smart_object.h"
-#include "smart_objects/smart_schema.h"
#include <map>
#include <string>
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
namespace ns_smart_device_link {
namespace ns_json_handler {
@@ -94,7 +94,7 @@ extern const std::string kCode;
* @brief String constant for "message" param name.
*/
extern const std::string kMessage;
-}
+} // namespace strings
/**
* @brief Smart Schema key.
@@ -148,14 +148,14 @@ class CSmartFactory {
*
* @param object SmartObject to attach schema for.
*
- * @param RemoveFakeParameters contains true if need
+ * @param remove_unknown_parameters contains true if need
* to remove fake parameters from smart object otherwise contains false.
*
* @return True if operation was successful or false otherwise.
*/
bool attachSchema(
ns_smart_device_link::ns_smart_objects::SmartObject& object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
@@ -276,7 +276,7 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CSmartFactory(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
ns_smart_device_link::ns_smart_objects::SmartObject& object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {
if (false == object.keyExists(strings::S_PARAMS))
return false;
@@ -286,11 +286,11 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
return false;
MessageTypeEnum msgtype(
- (MessageTypeEnum)
- object[strings::S_PARAMS][strings::S_MESSAGE_TYPE].asInt());
+ (MessageTypeEnum)object[strings::S_PARAMS][strings::S_MESSAGE_TYPE]
+ .asInt());
FunctionIdEnum fid(
- (FunctionIdEnum)
- object[strings::S_PARAMS][strings::S_FUNCTION_ID].asInt());
+ (FunctionIdEnum)object[strings::S_PARAMS][strings::S_FUNCTION_ID]
+ .asInt());
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(fid, msgtype);
@@ -305,7 +305,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
object.setSchema(schemaIterator->second);
schemaIterator->second.applySchema(
- object, RemoveFakeParameters, MessageVersion);
+ object, remove_unknown_parameters, MessageVersion);
return true;
}
@@ -415,6 +415,6 @@ bool operator<(const SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>& l,
return false;
}
-}
-}
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 842e176976..593c837877 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -35,12 +35,12 @@
#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
-#include <string>
#include <sys/stat.h>
+#include <string>
-#include "smart_objects/smart_object.h"
-#include "smart_objects/enum_schema_item.h"
#include "json/json.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
@@ -105,11 +105,13 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*
* @param obj Input SmartObject.
* @param out_str Resulting JSON string.
- *
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* @return true if success, false otherwise.
*/
static bool ToString(const ns_smart_objects::SmartObject& obj,
- std::string& out_str);
+ std::string& out_str,
+ const bool remove_unknown_parameters = true);
/**
* @brief Creates a SmartObject from a JSON string.
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index 36e39301f6..b2ff546bfc 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -44,35 +44,35 @@ namespace ns_json_handler {
namespace formatters {
/**
- * @brief Formats to string the smart object against given schema for given
- *formatter
- *
- * Sample usage:
- * CSmartFactory factory;
- * SmartObject object;
- * CSmartSchmema schema;
- *
- */
+ * @brief Formats to string the smart object against given schema for given
+ *formatter
+ *
+ * Sample usage:
+ * CSmartFactory factory;
+ * SmartObject object;
+ * CSmartSchmema schema;
+ *
+ */
class CMetaFormatter {
public:
/**
- * @brief Creates smart object by the given schema having copied
- * matched tree elements from original object.
- *
- * @param object Original smart object which macthed tree elements
- * will be copied from
- * @param schema Smart schema which describes result smart object
- * @param result_object createdsmart object
- * @return true if successful, false - otherwise
- */
+ * @brief Creates smart object by the given schema having copied
+ * matched tree elements from original object.
+ *
+ * @param object Original smart object which macthed tree elements
+ * will be copied from
+ * @param schema Smart schema which describes result smart object
+ * @param result_object createdsmart object
+ * @return true if successful, false - otherwise
+ */
static bool CreateObjectByPattern(
const ns_smart_device_link::ns_smart_objects::SmartObject& object,
const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
ns_smart_device_link::ns_smart_objects::SmartObject& result_object);
};
+} // namespace formatters
+} // namespace ns_json_handler
} // namespace ns_smart_device_link
-} // namespace ns_smart_device_link::ns_json_handler
-} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc
index af8668543a..6dc3d28f16 100644
--- a/src/components/formatters/src/CFormatterJsonBase.cc
+++ b/src/components/formatters/src/CFormatterJsonBase.cc
@@ -31,8 +31,8 @@
// 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 "json/json.h"
#include "formatters/CFormatterJsonBase.h"
+#include "json/json.h"
#include "utils/convert_utils.h"
void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
index 121fd43131..2f47c83a6b 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
@@ -85,7 +85,8 @@ const std::string CFormatterJsonSDLRPCv1::getMessageType(
// ----------------------------------------------------------------------------
bool CFormatterJsonSDLRPCv1::toString(const smart_objects_ns::SmartObject& obj,
- std::string& outStr) {
+ std::string& outStr,
+ const bool remove_unknown_parameters) {
bool result = false;
try {
Json::Value root(Json::objectValue);
@@ -93,7 +94,8 @@ bool CFormatterJsonSDLRPCv1::toString(const smart_objects_ns::SmartObject& obj,
smart_objects_ns::SmartObject formattedObj(obj);
formattedObj.getSchema().unapplySchema(
- formattedObj); // converts enums(as int32_t) to strings
+ formattedObj,
+ remove_unknown_parameters); // converts enums(as int32_t) to strings
objToJsonValue(formattedObj.getElement(strings::S_MSG_PARAMS), params);
@@ -125,7 +127,8 @@ CFormatterJsonSDLRPCv1::tMetaFormatterErrorCode
CFormatterJsonSDLRPCv1::MetaFormatToString(
const smart_objects_ns::SmartObject& object,
const smart_objects_ns::CSmartSchema& schema,
- std::string& outStr) {
+ std::string& outStr,
+ const bool remove_unknown_parameters) {
meta_formatter_error_code::tMetaFormatterErrorCode result_code =
meta_formatter_error_code::kErrorOk;
@@ -156,10 +159,11 @@ CFormatterJsonSDLRPCv1::MetaFormatToString(
result_code |= meta_formatter_error_code::kErrorSchemaIsNotFunction;
}
- CFormatterJsonSDLRPCv1::toString(tmp_object, outStr);
+ CFormatterJsonSDLRPCv1::toString(
+ tmp_object, outStr, remove_unknown_parameters);
return result_code;
}
-}
-}
-}
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
index ffbb644cc6..bee92fbbee 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
@@ -41,14 +41,16 @@ namespace formatters {
// ----------------------------------------------------------------------------
bool CFormatterJsonSDLRPCv2::toString(const smart_objects_ns::SmartObject& obj,
- std::string& outStr) {
+ std::string& outStr,
+ const bool remove_unknown_parameters) {
bool result = true;
try {
Json::Value root(Json::objectValue);
smart_objects_ns::SmartObject formattedObj(obj);
formattedObj.getSchema().unapplySchema(
- formattedObj); // converts enums(as int32_t) to strings
+ formattedObj,
+ remove_unknown_parameters); // converts enums(as int32_t) to strings
objToJsonValue(formattedObj.getElement(strings::S_MSG_PARAMS), root);
@@ -68,7 +70,8 @@ CFormatterJsonSDLRPCv2::tMetaFormatterErrorCode
CFormatterJsonSDLRPCv2::MetaFormatToString(
const smart_objects_ns::SmartObject& object,
const smart_objects_ns::CSmartSchema& schema,
- std::string& outStr) {
+ std::string& outStr,
+ const bool remove_unknown_parameters) {
meta_formatter_error_code::tMetaFormatterErrorCode result_code =
meta_formatter_error_code::kErrorOk;
@@ -99,10 +102,11 @@ CFormatterJsonSDLRPCv2::MetaFormatToString(
result_code |= meta_formatter_error_code::kErrorSchemaIsNotFunction;
}
- CFormatterJsonSDLRPCv2::toString(tmp_object, outStr);
+ CFormatterJsonSDLRPCv2::toString(
+ tmp_object, outStr, remove_unknown_parameters);
return result_code;
}
-}
-}
-}
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
index d50d04d0e9..07d45d5855 100644
--- a/src/components/formatters/src/formatter_json_rpc.cc
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -57,7 +57,8 @@ const char* FormatterJsonRpc::kData = "data";
const char* FormatterJsonRpc::kMessage = "message";
bool FormatterJsonRpc::ToString(const ns_smart_objects::SmartObject& obj,
- std::string& out_str) {
+ std::string& out_str,
+ const bool remove_unknown_parameters) {
bool result = true;
try {
Json::Value root(Json::objectValue);
@@ -66,7 +67,8 @@ bool FormatterJsonRpc::ToString(const ns_smart_objects::SmartObject& obj,
ns_smart_objects::SmartObject formatted_object(obj);
Json::Value msg_params_json(Json::objectValue);
- formatted_object.getSchema().unapplySchema(formatted_object);
+ formatted_object.getSchema().unapplySchema(formatted_object,
+ remove_unknown_parameters);
bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS);
bool empty_message_params = true;
diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc
index 1cd9c55bbc..91700b3f99 100644
--- a/src/components/formatters/test/CFormatterJsonBase_test.cc
+++ b/src/components/formatters/test/CFormatterJsonBase_test.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
+#include "formatters/CFormatterJsonBase.h"
#include <algorithm>
-#include "json/value.h"
+#include <string>
+#include "formatters/generic_json_formatter.h"
#include "gtest/gtest.h"
#include "json/reader.h"
-#include "formatters/CFormatterJsonBase.h"
-#include "formatters/generic_json_formatter.h"
+#include "json/value.h"
namespace test {
namespace components {
diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc
index 3aba109e58..5bd212f431 100644
--- a/src/components/formatters/test/CSmartFactory_test.cc
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "formatters/SmartFactoryTestHelper.h"
#include "formatters/CSmartFactory.h"
+#include "formatters/SmartFactoryTestHelper.h"
#include "gtest/gtest.h"
namespace test {
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
index 628e9956bb..34cde397aa 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "formatters/create_smartSchema.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/create_smartSchema.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index f397accbd4..6e2e8753ca 100644
--- a/src/components/formatters/test/formatter_json_rpc_test.cc
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -30,18 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "formatters/formatter_json_rpc.h"
-#include <string>
-#include <set>
-#include <algorithm>
#include <json/writer.h>
-#include "gtest/gtest.h"
-#include "formatters/formatter_json_rpc.h"
-#include <string>
+#include <algorithm>
#include <set>
-#include "gtest/gtest.h"
+#include <string>
#include "formatters/CSmartFactory.h"
+#include "formatters/formatter_json_rpc.h"
+#include "gtest/gtest.h"
#include "interfaces/HMI_API_schema.h"
#include "interfaces/MOBILE_API_schema.h"
diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc
index 97840eb110..39f0fd6e7e 100644
--- a/src/components/formatters/test/generic_json_formatter_test.cc
+++ b/src/components/formatters/test/generic_json_formatter_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "formatters/generic_json_formatter.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -169,6 +169,6 @@ TEST(GenericJsonFormatter, FromString) {
result.getElement("subobject").getElement("strField").asString().c_str());
}
-} // formatters
-} // components
-} // test
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
index 4b1ca94b98..08962db120 100644
--- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
+++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
@@ -38,15 +38,15 @@
#include "formatters/CSmartFactory.h"
#include "interfaces/HMI_API_schema.h"
-#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/always_false_schema_item.h"
+#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/array_schema_item.h"
#include "smart_objects/bool_schema_item.h"
-#include "smart_objects/object_schema_item.h"
-#include "smart_objects/string_schema_item.h"
#include "smart_objects/enum_schema_item.h"
#include "smart_objects/number_schema_item.h"
+#include "smart_objects/object_schema_item.h"
#include "smart_objects/schema_item_parameter.h"
+#include "smart_objects/string_schema_item.h"
namespace test {
namespace components {
@@ -107,7 +107,8 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
protected:
typedef std::map<const StructIdentifiersTest::eType,
- std::shared_ptr<ISchemaItem> > TStructsSchemaItems;
+ std::shared_ptr<ISchemaItem> >
+ TStructsSchemaItems;
static std::shared_ptr<ISchemaItem> ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h
index 73ff9ba77b..4fd0f200d3 100644
--- a/src/components/formatters/test/include/formatters/create_smartSchema.h
+++ b/src/components/formatters/test/include/formatters/create_smartSchema.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_
#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_
-#include "formatters/CFormatterJsonSDLRPCv1.h"
#include "SmartFactoryTestHelper.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
namespace test {
namespace components {
diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
index 0ee21d092c..8a2b5abf0d 100644
--- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
+++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
@@ -35,10 +35,10 @@
#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
+#include "create_smartSchema.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
#include "formatters/CSmartFactory.h"
-#include "create_smartSchema.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc
index 87f05ab50e..e405ff68eb 100644
--- a/src/components/formatters/test/meta_formatter_test.cc
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "formatters/meta_formatter.h"
#include "formatters/meta_formatter_test_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -44,7 +44,8 @@ TEST_F(CMetaFormatterTestHelper,
Json::Reader reader;
CSmartFactory<FunctionIDTest::eType,
MessageTypeTest::eType,
- StructIdentifiers::eType> factory_;
+ StructIdentifiers::eType>
+ factory_;
SmartObject object1 = factory_.CreateSmartObject(
FunctionIDTest::RegisterAppInterface, MessageTypeTest::request);
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
index b322510f6c..4f8975fe53 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "formatters/meta_formatter_test_helper.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
index 0d85c30fc2..167e2f84e6 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
@@ -47,12 +47,12 @@ namespace hmi_message_handler {
namespace impl {
/*
-* These dummy classes are here to locally impose strong typing on different
-* kinds of messages
-* Currently there is no type difference between incoming and outgoing messages
-* TODO(ik): replace these with globally defined message types
-* when we have them.
-*/
+ * These dummy classes are here to locally impose strong typing on different
+ * kinds of messages
+ * Currently there is no type difference between incoming and outgoing messages
+ * TODO(ik): replace these with globally defined message types
+ * when we have them.
+ */
struct MessageFromHmi : public MessageSharedPointer {
MessageFromHmi() {}
explicit MessageFromHmi(const MessageSharedPointer& message)
@@ -77,7 +77,7 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
FromHmiQueue;
typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
ToHmiQueue;
-}
+} // namespace impl
class ToHMIThreadImpl;
class FromHMIThreadImpl;
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
index 0a2e3e0f99..544a3ca275 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -31,28 +31,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef MB_CONTROLLER_H
#define MB_CONTROLLER_H
-#include <iostream>
-#include <boost/beast/core.hpp>
-#include <boost/beast/websocket.hpp>
+#include <algorithm>
+#include <atomic>
#include <boost/asio/bind_executor.hpp>
-#include <boost/asio/strand.hpp>
-#include <boost/asio/placeholders.hpp>
#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread/thread.hpp>
-#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
+#include <map>
#include <memory>
#include <string>
#include <thread>
#include <vector>
-#include <map>
#include "json/json.h"
-#include "utils/macro.h"
#include "utils/lock.h"
-#include <atomic>
+#include "utils/macro.h"
#include "websocket_session.h"
using namespace boost::beast::websocket;
@@ -181,6 +180,6 @@ class CMessageBrokerController
std::atomic_bool shutdown_;
};
-} // hmi_message_handler
+} // namespace hmi_message_handler
#endif /* MB_CONTROLLER_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
index 423f331297..41bb7efa5d 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -35,8 +35,8 @@
#include <string>
-#include "hmi_message_handler/mb_controller.h"
#include "hmi_message_handler/hmi_message_adapter_impl.h"
+#include "hmi_message_handler/mb_controller.h"
#include "utils/threads/thread_validator.h"
namespace hmi_message_handler {
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
index 4d177d250f..8edcfc1a36 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -31,43 +31,42 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef WEBSOCKET_SESSION_H
#define WEBSOCKET_SESSION_H
-#include <iostream>
-#include <boost/beast/core.hpp>
-#include <boost/beast/websocket.hpp>
+#include <algorithm>
+#include <atomic>
#include <boost/asio/bind_executor.hpp>
-#include <boost/asio/strand.hpp>
-#include <boost/asio/placeholders.hpp>
#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread/thread.hpp>
-#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <memory>
+#include <mutex>
+#include <queue>
#include <string>
#include <thread>
#include <vector>
-#include <mutex>
-#include <queue>
#include "json/json.h"
-#include "utils/macro.h"
#include "utils/lock.h"
-#include <atomic>
-#include "utils/threads/thread.h"
-#include "utils/threads/message_loop_thread.h"
+#include "utils/macro.h"
#include "utils/message_queue.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/threads/thread.h"
using namespace boost::beast::websocket;
using ::utils::MessageQueue;
#ifdef DEBUG_ON
/**
-* \def DBG_MSG
-* \brief Debug message output with file name and line number.
-* \param x formatted debug message.
-* \return printf construction.
-*/
+ * \def DBG_MSG
+ * \brief Debug message output with file name and line number.
+ * \param x formatted debug message.
+ * \return printf construction.
+ */
#define DBG_MSG(x) \
printf("%s:%d ", __FILE__, __LINE__); \
printf x
@@ -203,6 +202,6 @@ class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
threads::Thread* thread_;
};
-} // hmi_message_handler
+} // namespace hmi_message_handler
#endif /* WEBSOCKET_SESSION_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
index 4f46026039..ffc6ef23a3 100644
--- a/src/components/hmi_message_handler/src/mb_controller.cc
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -337,8 +337,8 @@ bool CMessageBrokerController::addSubscriber(WebsocketSession* ws_session,
bool result = true;
sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
- std::multimap<std::string, WebsocketSession*>::iterator> p =
- mSubscribersList.equal_range(name);
+ std::multimap<std::string, WebsocketSession*>::iterator>
+ p = mSubscribersList.equal_range(name);
if (p.first != p.second) {
std::multimap<std::string, WebsocketSession*>::iterator itr;
for (itr = p.first; itr != p.second; itr++) {
@@ -359,8 +359,8 @@ void CMessageBrokerController::deleteSubscriber(WebsocketSession* ws,
std::string name) {
sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
- std::multimap<std::string, WebsocketSession*>::iterator> p =
- mSubscribersList.equal_range(name);
+ std::multimap<std::string, WebsocketSession*>::iterator>
+ p = mSubscribersList.equal_range(name);
if (p.first != p.second) {
std::multimap<std::string, WebsocketSession*>::iterator itr;
for (itr = p.first; itr != p.second;) {
@@ -380,8 +380,8 @@ int CMessageBrokerController::getSubscribersFd(
sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
- std::multimap<std::string, WebsocketSession*>::iterator> p =
- mSubscribersList.equal_range(name);
+ std::multimap<std::string, WebsocketSession*>::iterator>
+ p = mSubscribersList.equal_range(name);
if (p.first != p.second) {
std::multimap<std::string, WebsocketSession*>::iterator itr;
for (itr = p.first; itr != p.second; itr++) {
@@ -501,4 +501,4 @@ void CMessageBrokerController::processInternalRequest(
int CMessageBrokerController::getNextControllerId() {
return 1000 * mControllersIdCounter++;
}
-}
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index d400cca335..8e45d4ecd9 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -138,6 +138,8 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged");
MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData");
MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings");
+ MessageBrokerController::subscribeTo(
+ "SystemCapability.OnSystemCapabilityUpdated");
LOG4CXX_INFO(logger_, "Subscribed to notifications.");
}
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
index a148f48661..3d18da19d2 100644
--- a/src/components/hmi_message_handler/src/websocket_session.cc
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -29,8 +29,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "hmi_message_handler/websocket_session.h"
-#include "hmi_message_handler/mb_controller.h"
#include <unistd.h>
+#include "hmi_message_handler/mb_controller.h"
using namespace boost::beast::websocket;
namespace hmi_message_handler {
@@ -319,4 +319,4 @@ void WebsocketSession::LoopThreadDelegate::SetShutdown() {
message_queue_.Shutdown();
}
}
-}
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index 73fe76640d..5762566b96 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -40,8 +40,8 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
+using ::testing::Return;
typedef std::shared_ptr<MockHMIMessageAdapterImpl>
MockHMIMessageAdapterImplSPtr;
@@ -74,6 +74,6 @@ TEST(HMIMessageAdapterImplTest, Handler_NULLPointer_CorrectReturnedPointer) {
EXPECT_EQ(NULL, message_adapter_impl->get_handler());
}
-} // namespace hmi_message_helper_test
+} // namespace hmi_message_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index e66f900299..eaa274d0f4 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -30,21 +30,21 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "application_manager/message.h"
#include "hmi_message_handler/hmi_message_handler_impl.h"
+#include "application_manager/message.h"
+#include "gtest/gtest.h"
#include "hmi_message_handler/messagebroker_adapter.h"
-#include "hmi_message_handler/mock_hmi_message_observer.h"
-#include "hmi_message_handler/mock_hmi_message_handler_settings.h"
#include "hmi_message_handler/mock_hmi_message_adapter_impl.h"
+#include "hmi_message_handler/mock_hmi_message_handler_settings.h"
+#include "hmi_message_handler/mock_hmi_message_observer.h"
#include "utils/test_async_waiter.h"
namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::Return;
using ::testing::_;
+using ::testing::Return;
class HMIMessageHandlerImplTest : public ::testing::Test {
public:
diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_adapter_impl.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_adapter_impl.h
index 0ec82b7862..4984fce23d 100644
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_adapter_impl.h
+++ b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_adapter_impl.h
@@ -1,34 +1,34 @@
/*
-* 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.
-*/
+ * 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 "gmock/gmock.h"
#include "hmi_message_handler/hmi_message_adapter_impl.h"
diff --git a/src/components/include/application_manager/app_launch_settings.h b/src/components/include/application_manager/app_launch_settings.h
index 47daf2f87c..fb65997c69 100644
--- a/src/components/include/application_manager/app_launch_settings.h
+++ b/src/components/include/application_manager/app_launch_settings.h
@@ -17,6 +17,6 @@ class AppLaunchSettings {
virtual const std::string& app_storage_folder() const = 0;
};
-} // namespace application_manager
+} // namespace app_launch
#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_SETTINGS_H_
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index e6e5c89f45..521eadf48e 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -34,23 +34,23 @@
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
#include <ctime>
+#include <set>
#include <string>
#include <vector>
-#include <set>
#include "application_manager/application.h"
-#include "application_manager/hmi_capabilities.h"
-#include "application_manager/commands/command.h"
#include "application_manager/command_factory.h"
+#include "application_manager/commands/command.h"
#include "connection_handler/connection_handler.h"
#include "utils/data_accessor.h"
-#include "telemetry_monitor/telemetry_observable.h"
-#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager_settings.h"
-#include "application_manager/state_controller.h"
#include "application_manager/hmi_interfaces.h"
-#include "policy/policy_types.h"
#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/state_controller.h"
+#include "policy/policy_types.h"
+#include "telemetry_monitor/telemetry_observable.h"
+
namespace resumption {
class LastState;
}
@@ -89,6 +89,7 @@ class RPCHandler;
}
class Application;
+class AppServiceManager;
class StateControllerImpl;
struct CommandParametersPermissions;
using policy::RPCParams;
@@ -152,6 +153,8 @@ class ApplicationManager {
connection_handler::ConnectionHandler* handler) = 0;
virtual DataAccessor<ApplicationSet> applications() const = 0;
+ virtual DataAccessor<AppsWaitRegistrationSet> pending_applications()
+ const = 0;
virtual ApplicationSharedPtr application(uint32_t app_id) const = 0;
virtual ApplicationSharedPtr active_application() const = 0;
@@ -167,16 +170,22 @@ class ApplicationManager {
virtual ApplicationSharedPtr application_by_policy_id(
const std::string& policy_app_id) const = 0;
+ 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;
+
virtual AppSharedPtrs applications_by_button(uint32_t button) = 0;
virtual AppSharedPtrs applications_with_navi() = 0;
/**
- * @brief application find application by device and policy identifier
- * @param device_id device id
- * @param policy_app_id poilcy identifier
- * @return pointer to application in case if application exist, in other case
- * return empty shared pointer
- */
+ * @brief application find application by device and policy identifier
+ * @param device_id device id
+ * @param policy_app_id poilcy identifier
+ * @return pointer to application in case if application exist, in other case
+ * return empty shared pointer
+ */
virtual ApplicationSharedPtr application(
const std::string& device_id, const std::string& policy_app_id) const = 0;
@@ -188,6 +197,8 @@ class ApplicationManager {
virtual plugin_manager::RPCPluginManager& GetPluginManager() = 0;
+ virtual AppServiceManager& GetAppServiceManager() = 0;
+
#ifdef BUILD_TESTS
virtual void SetPluginManager(
std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager) = 0;
@@ -283,6 +294,9 @@ class ApplicationManager {
*/
virtual void SendDriverDistractionState(ApplicationSharedPtr application) = 0;
+ virtual void SendGetIconUrlNotifications(
+ const uint32_t connection_key, ApplicationSharedPtr application) = 0;
+
/**
* @brief Checks if Application is subscribed for way points
* @param Application pointer
@@ -394,6 +408,7 @@ class ApplicationManager {
virtual bool is_stopping() const = 0;
virtual bool is_audio_pass_thru_active() const = 0;
+ virtual uint32_t GetNextMobileCorrelationID() = 0;
virtual uint32_t GetNextHMICorrelationID() = 0;
virtual uint32_t GenerateNewHMIAppID() = 0;
@@ -427,6 +442,22 @@ class ApplicationManager {
virtual void OnHMIStartedCooperation() = 0;
+ virtual void DisconnectCloudApp(ApplicationSharedPtr app) = 0;
+
+ virtual void RefreshCloudAppInformation() = 0;
+
+ virtual std::string PolicyIDByIconUrl(const std::string url) = 0;
+
+ virtual void SetIconFileFromSystemRequest(const std::string policy_id) = 0;
+
+ /**
+ * @brief Retrieve the current connection status of a cloud app
+ * @param app A cloud application
+ * @return The current CloudConnectionStatus of app
+ */
+ virtual hmi_apis::Common_CloudConnectionStatus::eType
+ GetCloudAppConnectionStatus(ApplicationConstSharedPtr app) const = 0;
+
virtual bool IsHMICooperating() const = 0;
/**
* @brief Notifies all components interested in Vehicle Data update
@@ -438,8 +469,9 @@ class ApplicationManager {
virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
int value) = 0;
- virtual ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
- smart_objects::SmartObject>& request_for_registration) = 0;
+ virtual ApplicationSharedPtr RegisterApplication(
+ const std::shared_ptr<smart_objects::SmartObject>&
+ request_for_registration) = 0;
virtual void SendUpdateAppList() = 0;
@@ -546,6 +578,9 @@ class ApplicationManager {
uint32_t mobile_correlation_id,
uint32_t new_timeout_value) = 0;
+ virtual void IncreaseForwardedRequestTimeout(
+ uint32_t connection_key, uint32_t mobile_correlation_id) = 0;
+
virtual StateController& state_controller() = 0;
virtual void SetUnregisterAllApplicationsReason(
@@ -609,10 +644,10 @@ class ApplicationManager {
virtual resumption::ResumeCtrl& resume_controller() = 0;
/**
- * @brief hmi_interfaces getter for hmi_interfaces component, that handle
- * hmi_instrfaces state
- * @return reference to hmi_interfaces component
- */
+ * @brief hmi_interfaces getter for hmi_interfaces component, that handle
+ * hmi_instrfaces state
+ * @return reference to hmi_interfaces component
+ */
virtual HmiInterfaces& hmi_interfaces() = 0;
virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
@@ -640,19 +675,19 @@ class ApplicationManager {
virtual void AddAppToTTSGlobalPropertiesList(const uint32_t app_id) = 0;
/**
- * Generate grammar ID
- *
- * @return New grammar ID
- */
+ * Generate grammar ID
+ *
+ * @return New grammar ID
+ */
virtual uint32_t GenerateGrammarID() = 0;
virtual policy::DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const = 0;
/**
- * @brief Handle sequence for unauthorized application
- * @param app_id Application id
- */
+ * @brief Handle sequence for unauthorized application
+ * @param app_id Application id
+ */
virtual void OnAppUnauthorized(const uint32_t& app_id) = 0;
virtual bool ActivateApplication(ApplicationSharedPtr app) = 0;
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index 8fdca4125f..0f73ea94ed 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
-#include "application_manager/request_controller_settings.h"
#include "application_manager/app_launch_settings.h"
+#include "application_manager/request_controller_settings.h"
#include <stdint.h>
-#include <string>
#include <map>
+#include <string>
#include <vector>
namespace application_manager {
@@ -85,6 +85,9 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::string& audio_stream_file() const = 0;
virtual bool use_full_app_id() const = 0;
+ virtual uint32_t rpc_pass_through_timeout() const = 0;
+ virtual uint32_t cloud_app_retry_timeout() const = 0;
+ virtual uint16_t cloud_app_max_retry_attempts() const = 0;
virtual bool use_db_for_resumption() const = 0;
virtual const uint32_t& app_resumption_save_persistent_data_timeout()
const = 0;
@@ -107,6 +110,8 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
virtual const std::string& plugins_folder() const = 0;
+ virtual const std::vector<std::string>& embedded_services() const = 0;
+ virtual const std::string hmi_origin_id() const = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 1283584ef8..215a549579 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -28,17 +28,17 @@
* 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_HMI_CAPABILITIES_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+#include "application_manager/hmi_language_handler.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "json/json.h"
-#include "utils/macro.h"
-#include "application_manager/hmi_language_handler.h"
#include "smart_objects/smart_object.h"
+#include "utils/macro.h"
namespace resumption {
class LastState;
@@ -56,10 +56,10 @@ class HMICapabilities {
virtual ~HMICapabilities() {}
/**
- * @brief return component which follows for correctness of
- * languages
- * @return HMI language handler
- */
+ * @brief return component which follows for correctness of
+ * languages
+ * @return HMI language handler
+ */
virtual HMILanguageHandler& get_hmi_language_handler() = 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 ee9274ead7..708c4ddd32 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -33,22 +33,22 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_INTERFACE_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_INTERFACE_H_
-#include <string>
#include <map>
+#include <queue>
#include <set>
+#include <string>
#include <vector>
-#include <queue>
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_observer.h"
#include "application_manager/application.h"
-#include "policy/usage_statistics/statistics_manager.h"
-#include "utils/custom_string.h"
-#include "utils/callable.h"
+#include "application_manager/policies/policy_handler_observer.h"
+#include "interfaces/MOBILE_API.h"
+#include "policy/cache_manager_interface.h"
#include "policy/policy_settings.h"
-#include "smart_objects/smart_object.h"
-#include "policy/policy_types.h"
#include "policy/policy_table/types.h"
-#include "policy/cache_manager_interface.h"
+#include "policy/policy_types.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "smart_objects/smart_object.h"
+#include "utils/callable.h"
+#include "utils/custom_string.h"
using namespace ::rpc::policy_table_interface_base;
namespace policy {
@@ -105,6 +105,7 @@ class PolicyHandlerInterface {
virtual void GetUpdateUrls(const uint32_t service_type,
EndpointUrls& out_end_points) = 0;
virtual std::string GetLockScreenIconUrl() const = 0;
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0;
virtual uint32_t NextRetryTimeout() = 0;
/**
@@ -193,13 +194,13 @@ class PolicyHandlerInterface {
const DeviceInfo& device_info) = 0;
/**
-*@brief Processes data from OnAppPermissionConsent notification with
-*permissions changes and ExternalConsent status changes done by user
-*@param connection_key Connection key of application, 0 if no key has been
-*provided
-*@param permissions Groups permissions changes
-*@param external_consent_status Customer connectivity settings status changes
-*/
+ *@brief Processes data from OnAppPermissionConsent notification with
+ *permissions changes and ExternalConsent status changes done by user
+ *@param connection_key Connection key of application, 0 if no key has been
+ *provided
+ *@param permissions Groups permissions changes
+ *@param external_consent_status Customer connectivity settings status changes
+ */
#ifdef EXTERNAL_PROPRIETARY_MODE
virtual void OnAppPermissionConsent(
const uint32_t connection_key,
@@ -437,6 +438,91 @@ class PolicyHandlerInterface {
* @return Structure with vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const = 0;
+
+ /**
+ * @brief Checks if a given application is an enabled cloud application
+ * @param policy_app_id Unique application id
+ * @return true if the application is an enabled cloud application,
+ * false otherwise
+ */
+ virtual const bool CheckCloudAppEnabled(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const = 0;
+
+ /**
+ * @brief Callback for when a SetCloudAppProperties message is received from a
+ * mobile app
+ * @param message The SetCloudAppProperties message
+ */
+ virtual void OnSetCloudAppProperties(
+ const smart_objects::SmartObject& message) = 0;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const = 0;
+
+ /**
+ * @brief Check app service parameters from an app against policies
+ * @param policy_app_id Unique application id
+ * @param requested_service_name Service name published by app service
+ * provider
+ * @param requested_service_type Service type published by app service
+ * provider
+ * @param requested_handled_rpcs Vector of requested function ids an app
+ * service wants to handle from consumers
+ */
+ virtual bool CheckAppServiceParameters(
+ const std::string& policy_app_id,
+ const std::string& requested_service_name,
+ const std::string& requested_service_type,
+ smart_objects::SmartArray* requested_handled_rpcs) const = 0;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const = 0;
+
#ifdef EXTERNAL_PROPRIETARY_MODE
/**
* @brief Gets meta information
@@ -540,14 +626,14 @@ class PolicyHandlerInterface {
* @brief Processes data received via OnAppPermissionChanged notification
* from. Being started asyncronously from AppPermissionDelegate class.
* Sets updated permissions and ExternalConsent for registered applications
-*and
+ *and
* applications which already have appropriate group assigned which related to
* devices already known by policy
* @param connection_key Connection key of application, 0 if no key has been
* provided within notification
* @param external_consent_status Customer connectivity settings changes to
-*process
-*@param permissions Permissions changes to process
+ *process
+ *@param permissions Permissions changes to process
*/
#ifdef EXTERNAL_PROPRIETARY_MODE
virtual void OnAppPermissionConsentInternal(
diff --git a/src/components/include/application_manager/policies/policy_handler_observer.h b/src/components/include/application_manager/policies/policy_handler_observer.h
index 1c32102184..9c1091d0a8 100644
--- a/src/components/include/application_manager/policies/policy_handler_observer.h
+++ b/src/components/include/application_manager/policies/policy_handler_observer.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_OBSERVER_H_
#include <map>
-#include <vector>
#include <string>
+#include <vector>
namespace policy {
@@ -48,6 +48,9 @@ class PolicyHandlerObserver {
return false;
}
+ virtual void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) {}
+
virtual void OnPTUFinished(const bool ptu_result) {}
virtual ~PolicyHandlerObserver() {}
diff --git a/src/components/include/application_manager/rpc_handler.h b/src/components/include/application_manager/rpc_handler.h
index 9b6428f32d..f42d7deb2f 100644
--- a/src/components/include/application_manager/rpc_handler.h
+++ b/src/components/include/application_manager/rpc_handler.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
-#include "protocol_handler/protocol_observer.h"
#include "hmi_message_handler/hmi_message_handler.h"
+#include "protocol_handler/protocol_observer.h"
#ifdef TELEMETRY_MONITOR
#include "application_manager/telemetry_observer.h"
@@ -47,11 +47,16 @@ class RPCHandler
: public hmi_message_handler::HMIMessageObserver,
public protocol_handler::ProtocolObserver
#ifdef TELEMETRY_MONITOR
- ,
+ ,
public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
#endif // TELEMETRY_MONITOR
- {
+{
public:
+ virtual bool ValidateRpcSO(smart_objects::SmartObject& message,
+ utils::SemanticVersion& msg_version,
+ rpc::ValidationReport& report_out,
+ bool allow_unknown_parameters) = 0;
+
virtual ~RPCHandler() {}
};
diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h
index 79b4007f71..d052c4ed0a 100644
--- a/src/components/include/application_manager/rpc_service.h
+++ b/src/components/include/application_manager/rpc_service.h
@@ -35,8 +35,8 @@
#include "application_manager/commands/command.h"
#include "application_manager/message.h"
-#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
+#include "protocol_handler/protocol_handler.h"
namespace application_manager {
namespace rpc_service {
@@ -58,7 +58,9 @@ class RPCService {
* @param message pointer to received message
* @return true if command is executed, otherwise return false
*/
- virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
+ virtual bool ManageHMICommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source =
+ commands::Command::SOURCE_HMI) = 0;
/**
* @brief SendMessageToMobile Put message to the queue to be sent to mobile.
@@ -75,6 +77,17 @@ class RPCService {
virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
/**
+ * @brief Check if RPC with function_id can be handled by app services(related
+ * to app services or handled by app services plugin)
+ * @param function_id RPC function id
+ * @param source RPC command source
+ * @param rpc_passing Reference to bool. Set to true to enable rpc pasing
+ * @return true if App Services can handle RPC
+ */
+ virtual bool IsAppServiceRPC(int32_t function_id,
+ commands::Command::CommandSource source) = 0;
+
+ /**
* @brief set_protocol_handler
* @param handler
* set protocol handler
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 8f608488e9..fa0d65eb0c 100644
--- a/src/components/include/application_manager/state_controller.h
+++ b/src/components/include/application_manager/state_controller.h
@@ -33,35 +33,35 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_H_
-#include "stdint.h"
-#include "application_manager/request_controller_settings.h"
-#include "application_manager/application_manager.h"
#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/request_controller_settings.h"
+#include "stdint.h"
namespace application_manager {
class StateController {
public:
virtual void SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
@@ -82,9 +82,6 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level) = 0;
- virtual int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority) = 0;
/**
* @brief OnVideoStreamingStarted process video streaming started
* @param app projection or navigation application starting streaming
diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h
index a50760b547..eb92336b4f 100644
--- a/src/components/include/connection_handler/connection_handler.h
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -33,14 +33,14 @@
#ifndef SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
#define SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
+#include "connection_handler/connection.h"
#include "connection_handler/connection_handler_settings.h"
-#include "transport_manager/transport_manager_listener.h"
-#include "protocol_handler/session_observer.h"
#include "connection_handler/device.h"
-#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
-#include "utils/macro.h"
+#include "protocol_handler/session_observer.h"
+#include "transport_manager/transport_manager_listener.h"
#include "utils/data_accessor.h"
+#include "utils/macro.h"
/**
* \namespace connection_handler
@@ -80,6 +80,16 @@ class ConnectionHandler {
connection_handler::DeviceHandle device_handle) = 0;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ virtual transport_manager::ConnectionStatus GetConnectionStatus(
+ const DeviceHandle& device_handle) const = 0;
+
+ /**
* @brief RunAppOnDevice allows to run specific application on the certain
*device.
*
@@ -93,6 +103,13 @@ class ConnectionHandler {
virtual void ConnectToAllDevices() = 0;
+ virtual void AddCloudAppDevice(
+ const std::string& policy_app_id,
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) = 0;
+
+ virtual void RemoveCloudAppDevice(const DeviceHandle device_id) = 0;
+
/**
* @brief Close the connection revoked by Policy
* @param connection_key pair of connection and session id
@@ -112,6 +129,15 @@ class ConnectionHandler {
virtual uint32_t GetConnectionSessionsCount(uint32_t connection_key) = 0;
/**
+ * @brief Get cloud app id by connection id
+ * @param connection_id unique connection id
+ * @return the policy app id of the cloud app if the connection is tied to a
+ * cloud app, an empty string otherwise.
+ */
+ virtual std::string GetCloudAppID(
+ const transport_manager::ConnectionUID connection_id) const = 0;
+
+ /**
* Gets device id by mac address
* @param mac_address
* @return true if successfully
@@ -132,12 +158,12 @@ class ConnectionHandler {
CloseSessionReason close_reason) = 0;
/**
- * @brief SendEndService allows to end up specific service.
- *
- * @param key application identifier whose service should be closed.
- *
- * @param service_type the service that should be closed.
- */
+ * @brief SendEndService allows to end up specific service.
+ *
+ * @param key application identifier whose service should be closed.
+ *
+ * @param service_type the service that should be closed.
+ */
virtual void SendEndService(uint32_t key, uint8_t service_type) = 0;
/**
@@ -162,9 +188,9 @@ class ConnectionHandler {
uint32_t timeout) = 0;
/**
- * \brief Keep connection associated with the key from being closed by
- * heartbeat monitor
- */
+ * \brief Keep connection associated with the key from being closed by
+ * heartbeat monitor
+ */
virtual void KeepConnectionAlive(uint32_t connection_key,
uint8_t session_id) = 0;
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index 154a2a8e34..48e4263959 100644
--- a/src/components/include/connection_handler/connection_handler_observer.h
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
#include <string>
-#include "connection_handler/device.h"
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
+#include "connection_handler/device.h"
#include "protocol/service_type.h"
#ifdef ENABLE_SECURITY
@@ -161,6 +161,17 @@ class ConnectionHandlerObserver {
*/
virtual void OnSecondaryTransportEndedCallback(const int32_t session_key) = 0;
+ virtual void OnConnectionStatusUpdated() = 0;
+
+ virtual void CreatePendingApplication(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info,
+ connection_handler::DeviceHandle device_id) = 0;
+
+ virtual void SetPendingApplicationState(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/hmi_message_handler/hmi_message_handler.h b/src/components/include/hmi_message_handler/hmi_message_handler.h
index 411d19fb75..0bcc38d380 100644
--- a/src/components/include/hmi_message_handler/hmi_message_handler.h
+++ b/src/components/include/hmi_message_handler/hmi_message_handler.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
-#include "hmi_message_handler/hmi_message_sender.h"
-#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_handler_settings.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
namespace hmi_message_handler {
diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
index e7ba2619ee..5c104312f7 100644
--- a/src/components/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -47,6 +47,6 @@ class HMIMessageObserver {
virtual void OnErrorSending(
std::shared_ptr<application_manager::Message> message) = 0;
};
-}
+} // namespace hmi_message_handler
#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
index 3f70f78a97..c4183f0838 100644
--- a/src/components/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -43,6 +43,6 @@ class HMIMessageSender {
virtual ~HMIMessageSender() {}
virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
};
-}
+} // namespace hmi_message_handler
#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
diff --git a/src/components/include/media_manager/media_manager.h b/src/components/include/media_manager/media_manager.h
index 64acbcbc0b..0998899bc5 100644
--- a/src/components/include/media_manager/media_manager.h
+++ b/src/components/include/media_manager/media_manager.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
#include <string>
-#include "protocol/service_type.h"
#include "media_manager/media_manager_settings.h"
+#include "protocol/service_type.h"
namespace media_manager {
class MediaManager {
diff --git a/src/components/include/media_manager/media_manager_settings.h b/src/components/include/media_manager/media_manager_settings.h
index e48a74b08d..183a7e6f5b 100644
--- a/src/components/include/media_manager/media_manager_settings.h
+++ b/src/components/include/media_manager/media_manager_settings.h
@@ -32,8 +32,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_SETTINGS_H_
-#include <string>
#include <stdint.h>
+#include <string>
namespace media_manager {
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
index c446c87d1b..8299d019f5 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -115,6 +115,16 @@ class PolicyListener {
virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
/**
+ * @brief OnAuthTokenUpdated the callback which signals if an app's auth token
+ * field has been updated during a PTU
+ *
+ * @param policy_app_id the policy app id tied to the updated field.
+ * @param auth_token the value of the updated field.
+ */
+ virtual void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
* @brief OnPTUFinishedd the callback which signals PTU has finished
*
* @param ptu_result the result from the PTU - true if successful,
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 57f6d2f802..331b579365 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -37,12 +37,12 @@
#include "utils/callable.h"
-#include "policy/policy_types.h"
-#include "policy/policy_table/types.h"
+#include "policy/access_remote.h"
+#include "policy/cache_manager_interface.h"
#include "policy/policy_listener.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/cache_manager_interface.h"
-#include "policy/access_remote.h"
namespace policy {
class PolicySettings;
@@ -109,12 +109,21 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- * @return url which point to the resourse where lock screen icon could be
+ * @return url which point to the resource where lock screen icon could be
*obtained.
*/
virtual std::string GetLockScreenIconUrl() const = 0;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the initial
+ *registration
+ *
+ * @return url which point to the resource where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0;
+
+ /**
* @brief PTU is needed, for this PTS has to be formed and sent.
*/
virtual void RequestPTUpdate() = 0;
@@ -509,10 +518,10 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string policy_app_id) const = 0;
/**
- * @brief Gets request subtypes for application
- * @param policy_app_id Unique application id
- * @return request subtypes of application
- */
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
virtual const std::vector<std::string> GetAppRequestSubTypes(
const std::string& policy_app_id) const = 0;
@@ -523,6 +532,108 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const = 0;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const = 0;
+
+ /**
+ * @ brief Initialize new cloud app in the policy table
+ * @ param policy_app_id Application ID
+ */
+ virtual void InitCloudApp(const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) = 0;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) = 0;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) = 0;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) = 0;
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) = 0;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const = 0;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets meta information
* @return meta information
*/
@@ -596,11 +707,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& application_id) = 0;
/**
- * @brief Gets all allowed module types
- * @param policy_app_id unique identifier of application
- * @param modules list of allowed module types
- * @return true if application has allowed modules
- */
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
virtual bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const = 0;
diff --git a/src/components/include/policy/policy_external/policy/policy_settings.h b/src/components/include/policy/policy_external/policy/policy_settings.h
index 7eca5129ad..d9d2493d10 100644
--- a/src/components/include/policy/policy_external/policy/policy_settings.h
+++ b/src/components/include/policy/policy_external/policy/policy_settings.h
@@ -1,7 +1,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
-#include <string>
#include <stdint.h>
+#include <string>
namespace policy {
class PolicySettings {
@@ -17,8 +17,8 @@ class PolicySettings {
virtual const std::string& preloaded_pt_file() const = 0;
/**
- * @brief Returns application storage path
- */
+ * @brief Returns application storage path
+ */
virtual const std::string& app_storage_folder() const = 0;
virtual uint16_t attempts_to_open_policy_db() const = 0;
@@ -34,8 +34,8 @@ class PolicySettings {
virtual bool use_full_app_id() const = 0;
/**
- * @brief Returns system files folder path
- */
+ * @brief Returns system files folder path
+ */
virtual const std::string& system_files_path() const = 0;
virtual ~PolicySettings() {}
diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
index 3f6f555bcc..0907e42142 100644
--- a/src/components/include/policy/policy_regular/policy/policy_listener.h
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -61,12 +61,12 @@ class PolicyListener {
std::map<std::string, StringArray> app_hmi_types) = 0;
/**
- * @brief CanUpdate allows to find active application
- * and check whether related device consented.
- *
- * @return true if there are at least one application has been registered
- * with consented device.
- */
+ * @brief CanUpdate allows to find active application
+ * and check whether related device consented.
+ *
+ * @return true if there are at least one application has been registered
+ * with consented device.
+ */
virtual bool CanUpdate() = 0;
/**
@@ -113,6 +113,16 @@ class PolicyListener {
virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
/**
+ * @brief OnAuthTokenUpdated the callback which signals if an app's auth token
+ * field has been updated during a PTU
+ *
+ * @param policy_app_id the policy app id tied to the updated field.
+ * @param auth_token the value of the updated field.
+ */
+ virtual void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
* Gets devices ids by policy application id
* @param policy_app_id
* @return list devices ids
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index ee0bae7118..f82657ef26 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -33,16 +33,16 @@
#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
-#include <vector>
#include <cstdint>
+#include <vector>
-#include "utils/callable.h"
-#include "policy/policy_types.h"
-#include "policy/policy_table/types.h"
+#include "policy/access_remote.h"
+#include "policy/cache_manager_interface.h"
#include "policy/policy_listener.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/cache_manager_interface.h"
-#include "policy/access_remote.h"
+#include "utils/callable.h"
namespace policy {
class PolicySettings;
@@ -87,12 +87,21 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- * @return url which point to the resourse where lock screen icon could be
+ * @return url which point to the resource where lock screen icon could be
*obtained.
*/
virtual std::string GetLockScreenIconUrl() const = 0;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the initial
+ *registration
+ *
+ * @return url which point to the resource where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets all URLs for sending PTS to from PT itself.
* @param service_type Service specifies user of URL
* @param out_end_points output vector of urls
@@ -503,6 +512,109 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const = 0;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const = 0;
+
+ /**
+ * @ brief Initialize new cloud app in the policy table
+ * @ param policy_app_id Application ID
+ */
+
+ virtual void InitCloudApp(const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) = 0;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) = 0;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) = 0;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) = 0;
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) = 0;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const = 0;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
@@ -576,11 +688,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& application_id) = 0;
/**
- * @brief Gets all allowed module types
- * @param policy_app_id unique identifier of application
- * @param modules list of allowed module types
- * @return true if application has allowed modules
- */
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
virtual bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const = 0;
diff --git a/src/components/include/policy/policy_regular/policy/policy_settings.h b/src/components/include/policy/policy_regular/policy/policy_settings.h
index 35a2d54c3a..3529a32717 100644
--- a/src/components/include/policy/policy_regular/policy/policy_settings.h
+++ b/src/components/include/policy/policy_regular/policy/policy_settings.h
@@ -1,7 +1,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
-#include <string>
#include <stdint.h>
+#include <string>
namespace policy {
class PolicySettings {
@@ -17,8 +17,8 @@ class PolicySettings {
virtual const std::string& preloaded_pt_file() const = 0;
/**
- * @brief Returns application storage path
- */
+ * @brief Returns application storage path
+ */
virtual const std::string& app_storage_folder() const = 0;
virtual uint16_t attempts_to_open_policy_db() const = 0;
@@ -32,8 +32,8 @@ class PolicySettings {
virtual const std::string& policies_snapshot_file_name() const = 0;
/**
- * @brief Returns system files folder path
- */
+ * @brief Returns system files folder path
+ */
virtual const std::string& system_files_path() const = 0;
virtual bool use_full_app_id() const = 0;
diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h
index 56bd5cebd6..f81de4cc81 100644
--- a/src/components/include/protocol/bson_object_keys.h
+++ b/src/components/include/protocol/bson_object_keys.h
@@ -48,6 +48,7 @@ extern const char* video_service_transports;
extern const char* tcp_ip_address;
extern const char* tcp_port;
extern const char* reason;
+extern const char* auth_token;
} // namespace strings
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index 1c95020a96..4b227eeff1 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_COMMON_H_
#define SRC_COMPONENTS_INCLUDE_PROTOCOL_COMMON_H_
-#include "utils/macro.h"
#include "protocol/raw_message.h"
+#include "utils/macro.h"
/**
*\namespace protocol_handlerHandler
@@ -111,20 +111,20 @@ const bool PROTECTION_OFF = false;
*/
enum {
/**
- *\brief Constant: Control type of frame
- */
+ *\brief Constant: Control type of frame
+ */
FRAME_TYPE_CONTROL = 0x00,
/**
- *\brief Constant: Single type of frame.
- */
+ *\brief Constant: Single type of frame.
+ */
FRAME_TYPE_SINGLE = 0x01,
/**
- *\brief Constant: First frame for multiple frames
- */
+ *\brief Constant: First frame for multiple frames
+ */
FRAME_TYPE_FIRST = 0x02,
/**
- *\brief Constant: Consecutive type of frame for multiple frames
- */
+ *\brief Constant: Consecutive type of frame for multiple frames
+ */
FRAME_TYPE_CONSECUTIVE = 0x03,
/**
*\brief Maximum value of frame type field (size 3-bit)
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
index 5171d42593..21b324417c 100644
--- a/src/components/include/protocol/raw_message.h
+++ b/src/components/include/protocol/raw_message.h
@@ -32,10 +32,10 @@
#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
-#include "utils/macro.h"
#include <memory>
-#include "protocol/service_type.h"
#include "protocol/message_priority.h"
+#include "protocol/service_type.h"
+#include "utils/macro.h"
namespace protocol_handler {
/**
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index d65902030b..5e65fc69d4 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -86,27 +86,27 @@ class ProtocolHandler {
/**
* \brief Prepare and send heartbeat message to mobile app
- * \param connection_id Identifier of connection within which
- * session exists
- * \param session_id ID of session to be ended
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
*/
virtual void SendHeartBeat(int32_t connection_id, uint8_t session_id) = 0;
/**
- * \brief Sends ending session to mobile application
- * \param connection_id Identifier of connection within which
- * session exists
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
/**
- * \brief Sends ending session to mobile application
- * \param primary_connection_id Identifier of connection within which
- * service exists
- * \param connection_id Identifier of the actual transport for the service
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
virtual void SendEndService(int32_t primary_connection_id,
int32_t connection_id,
uint8_t session_id,
diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h
index b2bf94de35..0fdbd07aff 100644
--- a/src/components/include/protocol_handler/telemetry_observer.h
+++ b/src/components/include/protocol_handler/telemetry_observer.h
@@ -53,5 +53,5 @@ class PHTelemetryObserver {
virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m) = 0;
virtual ~PHTelemetryObserver() {}
};
-} // protocol_handler
+} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_TELEMETRY_OBSERVER_H_
diff --git a/src/components/include/rpc_base/validation_report.h b/src/components/include/rpc_base/validation_report.h
index 82f265e594..c138ac143f 100644
--- a/src/components/include/rpc_base/validation_report.h
+++ b/src/components/include/rpc_base/validation_report.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
-#include <string>
#include <list>
+#include <string>
namespace rpc {
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 486b6da64f..ba50820a81 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -45,7 +45,7 @@
**security_manager::CryptoManager::CreateSSLContext()
* \brief Creates an instance of \ref SSLContext class
*
- * \fn void
+ * \fn void
*security_manager::CryptoManager::ReleaseSSLContext(security_manager::SSLContext
**context)
* \brief Frees \ref SSLContext instance
@@ -67,19 +67,19 @@ class CryptoManager : public policy::PolicyHandlerObserver {
virtual void ReleaseSSLContext(SSLContext* context) = 0;
virtual std::string LastError() const = 0;
/**
- * @brief IsCertificateUpdateRequired checks if certificate update is needed
- * @param system_time - time with which certificate expiration time
- * should be compared
- * @param certificates_time - certificate expiration time
- * @return True if certificate expired and need to be updated
- * otherwise False
- */
+ * @brief IsCertificateUpdateRequired checks if certificate update is needed
+ * @param system_time - time with which certificate expiration time
+ * should be compared
+ * @param certificates_time - certificate expiration time
+ * @return True if certificate expired and need to be updated
+ * otherwise False
+ */
virtual bool IsCertificateUpdateRequired(
const time_t system_time, const time_t certificates_time) const = 0;
/**
- * \brief Crypto manager settings getter
- * \return pointer to crypto manager settings class
- */
+ * \brief Crypto manager settings getter
+ * \return pointer to crypto manager settings class
+ */
virtual const CryptoManagerSettings& get_settings() const = 0;
virtual ~CryptoManager() {}
};
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
index 61ba43c74f..e02a3a1cbe 100644
--- a/src/components/include/security_manager/security_manager.h
+++ b/src/components/include/security_manager/security_manager.h
@@ -40,8 +40,8 @@
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/session_observer.h"
-#include "security_manager/security_manager_listener.h"
#include "application_manager/policies/policy_handler_observer.h"
+#include "security_manager/security_manager_listener.h"
namespace security_manager {
diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h
index 8aa5b60853..5e66466663 100644
--- a/src/components/include/security_manager/security_query.h
+++ b/src/components/include/security_manager/security_query.h
@@ -35,9 +35,9 @@
#include <stdint.h>
#include <cstddef>
-#include <vector>
-#include <string>
#include <memory>
+#include <string>
+#include <vector>
namespace security_manager {
/**
@@ -187,8 +187,8 @@ class SecurityQuery {
std::string json_message_;
};
/**
-*\brief SmartPointer wrapper
-*/
+ *\brief SmartPointer wrapper
+ */
typedef std::shared_ptr<SecurityQuery> SecurityQueryPtr;
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h
index 7d52c72abe..397cf89347 100644
--- a/src/components/include/security_manager/ssl_context.h
+++ b/src/components/include/security_manager/ssl_context.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SSL_CONTEXT_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SSL_CONTEXT_H_
-#include <cstddef> // for size_t typedef
-#include <string>
#include <ctype.h>
#include <algorithm>
+#include <cstddef> // for size_t typedef
+#include <string>
#include "utils/custom_string.h"
// TODO(EZamakhov): update brief info
@@ -106,11 +106,11 @@ class SSLContext {
virtual bool IsInitCompleted() const = 0;
virtual bool IsHandshakePending() const = 0;
/**
- * @brief GetCertificateDueDate gets certificate expiration date
- * @param due_date - certificate expiration time to be received
- * @return True if certificate expiration date received
- * otherwise False
- */
+ * @brief GetCertificateDueDate gets certificate expiration date
+ * @param due_date - certificate expiration time to be received
+ * @return True if certificate expiration date received
+ * otherwise False
+ */
virtual bool GetCertificateDueDate(time_t& due_date) const = 0;
virtual bool HasCertificate() const = 0;
virtual size_t get_max_block_size(size_t mtu) const = 0;
diff --git a/src/components/include/test/application_manager/mock_app_extension.h b/src/components/include/test/application_manager/mock_app_extension.h
index 5898bc9b72..10a911e799 100644
--- a/src/components/include/test/application_manager/mock_app_extension.h
+++ b/src/components/include/test/application_manager/mock_app_extension.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
-#include "gmock/gmock.h"
#include "application_manager/app_extension.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/application_manager/mock_app_launch_settings.h b/src/components/include/test/application_manager/mock_app_launch_settings.h
index c59eb276ce..57bd708d62 100644
--- a/src/components/include/test/application_manager/mock_app_launch_settings.h
+++ b/src/components/include/test/application_manager/mock_app_launch_settings.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
-#include "gmock/gmock.h"
#include "application_manager/app_launch_settings.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
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 7f5f17a93d..fcedcebcf8 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -33,27 +33,30 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
+#include <memory>
#include <string>
#include <vector>
-#include <memory>
#include "gmock/gmock.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/app_service_manager.h"
#include "application_manager/application_manager_settings.h"
+#include "application_manager/command_factory.h"
#include "application_manager/commands/command.h"
+#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/hmi_capabilities.h"
-#include "application_manager/state_controller.h"
#include "application_manager/message.h"
-#include "resumption/last_state.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/app_launch/app_launch_ctrl.h"
-#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/state_controller.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "resumption/last_state.h"
#include "smart_objects/smart_object.h"
-#include "application_manager/plugin_manager/rpc_plugin_manager.h"
-#include "application_manager/command_factory.h"
namespace test {
namespace components {
@@ -74,6 +77,9 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(connection_handler::ConnectionHandler* handler));
MOCK_CONST_METHOD0(applications,
DataAccessor<application_manager::ApplicationSet>());
+ MOCK_CONST_METHOD0(
+ pending_applications,
+ DataAccessor<application_manager::AppsWaitRegistrationSet>());
MOCK_CONST_METHOD1(
application, application_manager::ApplicationSharedPtr(uint32_t app_id));
MOCK_CONST_METHOD0(active_application,
@@ -91,12 +97,20 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(SetPluginManager,
void(std::unique_ptr<RPCPluginManager>& plugin_manager));
+ MOCK_METHOD0(GetAppServiceManager, application_manager::AppServiceManager&());
+
MOCK_CONST_METHOD1(
application_by_hmi_app,
application_manager::ApplicationSharedPtr(uint32_t hmi_app_id));
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));
MOCK_METHOD1(
applications_by_button,
std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
@@ -124,6 +138,9 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(const std::shared_ptr<application_manager::Application> app));
MOCK_METHOD1(SendDriverDistractionState,
void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD2(SendGetIconUrlNotifications,
+ void(const uint32_t connection_key,
+ application_manager::ApplicationSharedPtr application));
MOCK_METHOD2(RemoveHMIFakeParameters,
void(application_manager::commands::MessageSharedPtr& message,
const hmi_apis::FunctionID::eType& function_id));
@@ -160,19 +177,29 @@ class MockApplicationManager : public application_manager::ApplicationManager {
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_METHOD1(BeginAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
MOCK_METHOD0(OnHMIStartedCooperation, void());
+ MOCK_METHOD1(DisconnectCloudApp,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD0(RefreshCloudAppInformation, void());
+ MOCK_CONST_METHOD1(GetCloudAppConnectionStatus,
+ hmi_apis::Common_CloudConnectionStatus::eType(
+ application_manager::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(PolicyIDByIconUrl, std::string(const std::string url));
+ MOCK_METHOD1(SetIconFileFromSystemRequest, void(const std::string policy_id));
MOCK_CONST_METHOD0(IsHMICooperating, bool());
MOCK_METHOD2(IviInfoUpdated,
void(mobile_apis::VehicleDataType::eType vehicle_info,
int value));
MOCK_METHOD1(RegisterApplication,
- application_manager::ApplicationSharedPtr(const std::shared_ptr<
- smart_objects::SmartObject>& request_for_registration));
+ application_manager::ApplicationSharedPtr(
+ const std::shared_ptr<smart_objects::SmartObject>&
+ request_for_registration));
MOCK_METHOD0(SendUpdateAppList, void());
MOCK_METHOD2(MarkAppsGreyOut,
void(const connection_handler::DeviceHandle handle,
@@ -211,6 +238,8 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value));
+ MOCK_METHOD2(IncreaseForwardedRequestTimeout,
+ void(uint32_t connection_key, uint32_t mobile_correlation_id));
MOCK_METHOD0(state_controller, application_manager::StateController&());
MOCK_METHOD1(SetUnregisterAllApplicationsReason,
void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
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 cfabf41b91..483e78b3f0 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
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_SETTINGS_H_
#include <string>
-#include "gmock/gmock.h"
#include "application_manager/application_manager_settings.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
@@ -90,6 +90,8 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(video_stream_file, const std::string&());
MOCK_CONST_METHOD0(audio_stream_file, const std::string&());
MOCK_CONST_METHOD0(use_full_app_id, bool());
+ MOCK_CONST_METHOD0(cloud_app_retry_timeout, uint32_t());
+ MOCK_CONST_METHOD0(cloud_app_max_retry_attempts, uint16_t());
MOCK_CONST_METHOD0(use_db_for_resumption, bool());
MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout,
const uint32_t&());
@@ -125,6 +127,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_time_scale, const uint32_t&());
MOCK_CONST_METHOD0(app_time_scale_max_requests, const uint32_t&());
MOCK_CONST_METHOD0(pending_requests_amount, const uint32_t&());
+ MOCK_CONST_METHOD0(rpc_pass_through_timeout, uint32_t());
// app_launch::AppLaunchSettings
MOCK_CONST_METHOD0(app_launch_wait_time, const uint16_t());
@@ -134,6 +137,10 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(max_number_of_ios_device, const uint16_t());
MOCK_CONST_METHOD0(wait_time_between_apps, const uint16_t());
MOCK_CONST_METHOD0(enable_app_launch_ios, const bool());
+
+ // AppServices
+ MOCK_CONST_METHOD0(embedded_services, const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(hmi_origin_id, const std::string());
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/mock_request_controller_settings.h b/src/components/include/test/application_manager/mock_request_controller_settings.h
index fe848f4a75..d4d4e29a61 100644
--- a/src/components/include/test/application_manager/mock_request_controller_settings.h
+++ b/src/components/include/test/application_manager/mock_request_controller_settings.h
@@ -37,8 +37,8 @@
#include <string>
#include <vector>
-#include "gmock/gmock.h"
#include "application_manager/request_controller_settings.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/application_manager/mock_rpc_handler.h b/src/components/include/test/application_manager/mock_rpc_handler.h
new file mode 100644
index 0000000000..fb577622ce
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_handler.h
@@ -0,0 +1,41 @@
+#ifndef MOCK_RPC_HANDLER_H
+#define MOCK_RPC_HANDLER_H
+
+#include "application_manager/rpc_handler.h"
+#include "telemetry_monitor/telemetry_observable.h"
+
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRPCHandler : public application_manager::rpc_handler::RPCHandler {
+ public:
+ MOCK_METHOD4(ValidateRpcSO,
+ bool(smart_objects::SmartObject& message,
+ utils::SemanticVersion& msg_version,
+ rpc::ValidationReport& report_out,
+ bool allow_unknown_parameters));
+
+ MOCK_METHOD1(OnMessageReceived,
+ void(protocol_handler::RawMessagePtr message));
+
+ MOCK_METHOD1(OnMobileMessageSent,
+ void(protocol_handler::RawMessagePtr message));
+
+ MOCK_METHOD1(OnMessageReceived,
+ void(std::shared_ptr<application_manager::Message> message));
+
+ MOCK_METHOD1(OnErrorSending,
+ void(std::shared_ptr<application_manager::Message> message));
+
+ MOCK_METHOD1(SetTelemetryObserver,
+ void(application_manager::AMTelemetryObserver* observer));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // MOCK_RPC_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 1f7dd8951b..94ce8ccbb6 100644
--- a/src/components/include/test/application_manager/mock_rpc_plugin.h
+++ b/src/components/include/test/application_manager/mock_rpc_plugin.h
@@ -1,8 +1,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
-#include "gmock/gmock.h"
#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "gmock/gmock.h"
namespace application_manager {
class CommandFactory;
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin_manager.h b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
index 74763f00d6..db0c04624b 100644
--- a/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
+++ b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
@@ -2,8 +2,8 @@
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
#include <string>
-#include "gmock/gmock.h"
#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "gmock/gmock.h"
namespace application_manager {
namespace plugin_manager {
diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h
index 4eddbbe257..fbdc451265 100644
--- a/src/components/include/test/application_manager/mock_rpc_service.h
+++ b/src/components/include/test/application_manager/mock_rpc_service.h
@@ -1,8 +1,8 @@
#ifndef MOCK_RPC_SERVICE_H
#define MOCK_RPC_SERVICE_H
-#include "gmock/gmock.h"
#include "application_manager/rpc_service.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
@@ -10,9 +10,10 @@ namespace application_manager_test {
class MockRPCService : public application_manager::rpc_service::RPCService {
public:
- MOCK_METHOD1(
+ MOCK_METHOD2(
ManageHMICommand,
- bool(const application_manager::commands::MessageSharedPtr message));
+ bool(const application_manager::commands::MessageSharedPtr message,
+ application_manager::commands::Command::CommandSource source));
MOCK_METHOD2(
ManageMobileCommand,
bool(const application_manager::commands::MessageSharedPtr message,
@@ -26,9 +27,13 @@ class MockRPCService : public application_manager::rpc_service::RPCService {
void(protocol_handler::ProtocolHandler* handler));
MOCK_METHOD1(set_hmi_message_handler,
void(hmi_message_handler::HMIMessageHandler* handler));
+ MOCK_METHOD2(
+ IsAppServiceRPC,
+ bool(int32_t function_id,
+ application_manager::commands::Command::CommandSource source));
};
-}
-}
-}
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
#endif // MOCK_RPC_SERVICE_H
diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h
index 0165180a0a..20a84e7f00 100644
--- a/src/components/include/test/application_manager/mock_state_controller.h
+++ b/src/components/include/test/application_manager/mock_state_controller.h
@@ -33,12 +33,11 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_STATE_CONTROLLER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_STATE_CONTROLLER_H_
-#include "gmock/gmock.h"
#include "application_manager/application.h"
#include "application_manager/hmi_state.h"
#include "application_manager/state_controller.h"
+#include "gmock/gmock.h"
#include "interfaces/MOBILE_API.h"
-#include "application_manager/application.h"
namespace test {
namespace components {
@@ -50,24 +49,24 @@ class MockStateController : public am::StateController {
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
am::HmiStatePtr state,
- const bool SendActivateApp));
+ const bool request_hmi_state_change));
MOCK_METHOD5(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp));
+ const bool request_hmi_state_change));
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp));
+ const bool request_hmi_state_change));
MOCK_METHOD6(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp));
+ const bool request_hmi_state_change));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level));
@@ -83,7 +82,7 @@ class MockStateController : public am::StateController {
MOCK_METHOD2(OnApplicationRegistered,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level));
- MOCK_METHOD3(SendBCActivateApp,
+ MOCK_METHOD3(RequestHMIStateChange,
int64_t(am::ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));
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 cb47147074..059442f424 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_INTERFACE_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_INTERFACE_H_
-#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
#include "gmock/gmock.h"
#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
@@ -102,6 +102,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
void(const uint32_t service_type,
policy::EndpointUrls& end_points));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
MOCK_METHOD0(ResetRetrySequence, void());
MOCK_METHOD0(NextRetryTimeout, uint32_t());
MOCK_CONST_METHOD0(TimeoutExchangeSec, uint32_t());
@@ -213,6 +214,31 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
GetAppRequestTypes,
const std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_CONST_METHOD1(GetEnabledCloudApps,
+ void(std::vector<std::string>& enabled_apps));
+ MOCK_CONST_METHOD1(CheckCloudAppEnabled,
+ const bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD7(GetCloudAppParameters,
+ bool(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference));
+ MOCK_METHOD1(OnSetCloudAppProperties,
+ void(const smart_objects::SmartObject& message));
+ MOCK_CONST_METHOD2(
+ GetAppServiceParameters,
+ void(const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters));
+ MOCK_CONST_METHOD4(CheckAppServiceParameters,
+ bool(const std::string& policy_app_id,
+ const std::string& requested_service_name,
+ const std::string& requested_service_type,
+ smart_objects::SmartArray* requested_handled_rpcs));
+ MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
+ bool(const std::string& policy_app_id));
#ifdef EXTERNAL_PROPRIETARY_MODE
MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
index e8ed0e90e2..43e4983368 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
@@ -37,8 +37,8 @@
#include <string>
#include <vector>
-#include "gmock/gmock.h"
#include "application_manager/policies/policy_handler_observer.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
@@ -49,6 +49,9 @@ class MockPolicyHandlerObserver : public ::policy::PolicyHandlerObserver {
MOCK_METHOD1(OnUpdateHMIAppType,
void(std::map<std::string, std::vector<std::string> >));
MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&));
+ MOCK_METHOD2(OnAuthTokenUpdated,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h
index 2de3a0f9a7..41c2f04ebb 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -33,23 +33,23 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_H_
-#include <string>
#include <list>
+#include <string>
#include <vector>
-#include "gmock/gmock.h"
#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
-#include "connection_handler/devices_discovery_starter.h"
#include "connection_handler/connection_handler_settings.h"
+#include "connection_handler/devices_discovery_starter.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
namespace connection_handler_test {
+using connection_handler::CloseSessionReason;
using connection_handler::ConnectionHandle;
using connection_handler::DeviceHandle;
-using connection_handler::CloseSessionReason;
using connection_handler::DevicesDiscoveryStarter;
using connection_handler::SessionTransports;
@@ -60,12 +60,23 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(StartTransportManager, void());
MOCK_METHOD1(ConnectToDevice,
void(connection_handler::DeviceHandle device_handle));
+ MOCK_CONST_METHOD1(
+ GetConnectionStatus,
+ transport_manager::ConnectionStatus(const DeviceHandle& device_handle));
MOCK_CONST_METHOD2(RunAppOnDevice,
void(const std::string&, const std::string&));
MOCK_METHOD0(ConnectToAllDevices, void());
+ MOCK_METHOD2(
+ AddCloudAppDevice,
+ void(const std::string& policy_app_id,
+ const transport_manager::transport_adapter::CloudAppProperties&));
+ MOCK_METHOD1(RemoveCloudAppDevice, void(const DeviceHandle device_id));
MOCK_METHOD1(CloseRevokedConnection, void(uint32_t connection_key));
MOCK_METHOD1(CloseConnection, void(ConnectionHandle connection_handle));
MOCK_METHOD1(GetConnectionSessionsCount, uint32_t(uint32_t connection_key));
+ MOCK_CONST_METHOD1(
+ GetCloudAppID,
+ std::string(const transport_manager::ConnectionUID connection_id));
MOCK_METHOD2(GetDeviceID,
bool(const std::string& mac_address,
DeviceHandle* device_handle));
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
index a9e4349bec..8f7ec90550 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_OBSERVER_H_
-#include "gmock/gmock.h"
#include "connection_handler/connection_handler_observer.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
@@ -74,6 +74,14 @@ class MockConnectionHandlerObserver
const int32_t session_key));
MOCK_METHOD1(OnSecondaryTransportEndedCallback,
void(const int32_t session_key));
+ MOCK_METHOD0(OnConnectionStatusUpdated, void());
+ MOCK_METHOD3(CreatePendingApplication,
+ void(const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info,
+ connection_handler::DeviceHandle device_id));
+ MOCK_METHOD2(SetPendingApplicationState,
+ void(const transport_manager::ConnectionUID connection_id,
+ const transport_manager::DeviceInfo& device_info));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_settings.h b/src/components/include/test/connection_handler/mock_connection_handler_settings.h
index c813455698..38bd41e431 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_settings.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_settings.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_SETTINGS_H_
#include <vector>
-#include "gmock/gmock.h"
#include "connection_handler/connection_handler_settings.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
index 17ec69ccf8..221b353a51 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
#include "gmock/gmock.h"
-#include "utils/singleton.h"
#include "hmi_message_handler/hmi_message_observer.h"
+#include "utils/singleton.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
index a4d50d7cc2..6f754ad2c9 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
@@ -76,6 +76,40 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
MOCK_CONST_METHOD1(IsDeviceConsentCached, bool(const std::string& device_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_CONST_METHOD1(GetEnabledCloudApps,
+ void(std::vector<std::string>& enabled_apps));
+ MOCK_CONST_METHOD7(GetCloudAppParameters,
+ bool(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference));
+ MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id));
+ MOCK_METHOD2(SetCloudAppEnabled,
+ void(const std::string& policy_app_id, const bool enabled));
+ MOCK_METHOD2(SetAppAuthToken,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
+ MOCK_METHOD2(SetAppCloudTransportType,
+ void(const std::string& policy_app_id,
+ const std::string& cloud_transport_type));
+ MOCK_METHOD2(SetAppEndpoint,
+ void(const std::string& policy_app_id,
+ const std::string& endpoint));
+ MOCK_METHOD2(SetAppNicknames,
+ void(const std::string& policy_app_id,
+ const StringArray& nicknames));
+ MOCK_METHOD2(SetHybridAppPreference,
+ void(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference));
+ MOCK_CONST_METHOD2(
+ GetAppServiceParameters,
+ void(const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters));
+ MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
+ bool(const std::string& policy_app_id));
MOCK_CONST_METHOD1(GetDeviceConsent,
DeviceConsent(const std::string& device_id));
MOCK_METHOD2(SetDeviceConsent,
@@ -97,6 +131,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_METHOD2(GetUpdateUrls,
void(const uint32_t service_type, EndpointUrls& out_end_points));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
MOCK_METHOD1(
GetNotificationsNumber,
policy_table::NumberOfNotificationsType(const std::string& priority));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
index 1f570d8699..1e42423a03 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -32,16 +32,16 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
-#include <string>
#include <map>
#include <queue>
+#include <string>
#include <vector>
#include "gmock/gmock.h"
#include "policy/policy_listener.h"
-#include "rpc_base/rpc_base.h"
#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base.h"
#include "utils/custom_string.h"
namespace policy_table = ::rpc::policy_table_interface_base;
@@ -81,6 +81,9 @@ class MockPolicyListener : public ::policy::PolicyListener {
uint32_t timeout_exceed));
MOCK_METHOD0(CanUpdate, bool());
MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
+ MOCK_METHOD2(OnAuthTokenUpdated,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
void(const policy::AppPermissions&, const std::string&));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index aeabf8fdcb..7ebf73ae54 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -40,9 +40,9 @@
#include "policy/policy_types.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
#include "policy/policy_manager.h"
+#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base.h"
namespace policy_table = ::rpc::policy_table_interface_base;
@@ -180,10 +180,45 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD1(OnAppRegisteredOnMobile,
void(const std::string& application_id));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
MOCK_CONST_METHOD1(
GetAppRequestTypes,
const std::vector<std::string>(const std::string policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_CONST_METHOD1(GetEnabledCloudApps,
+ void(std::vector<std::string>& enabled_apps));
+ MOCK_CONST_METHOD7(GetCloudAppParameters,
+ bool(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference));
+ MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id));
+ MOCK_METHOD2(SetCloudAppEnabled,
+ void(const std::string& policy_app_id, const bool enabled));
+ MOCK_METHOD2(SetAppAuthToken,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
+ MOCK_METHOD2(SetAppCloudTransportType,
+ void(const std::string& policy_app_id,
+ const std::string& cloud_transport_type));
+ MOCK_METHOD2(SetAppEndpoint,
+ void(const std::string& policy_app_id,
+ const std::string& endpoint));
+ MOCK_METHOD2(SetAppNicknames,
+ void(const std::string& policy_app_id,
+ const StringArray& nicknames));
+ MOCK_METHOD2(SetHybridAppPreference,
+ void(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference));
+ MOCK_CONST_METHOD2(
+ GetAppServiceParameters,
+ void(const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters));
+ MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
+ bool(const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
MOCK_CONST_METHOD0(HasCertificate, bool());
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
index fe051aaae0..16239bfb76 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
@@ -32,8 +32,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
-#include "gmock/gmock.h"
#include <string>
+#include "gmock/gmock.h"
#include "policy/policy_settings.h"
namespace test {
@@ -52,7 +52,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(use_full_app_id, bool());
};
-} // namespace policy_test
+} // namespace policy_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index 440000dbff..dacdaf202f 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -63,12 +63,45 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD0(TimeoutResponse, int());
MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_CONST_METHOD1(GetEnabledCloudApps,
+ void(std::vector<std::string>& enabled_apps));
+ MOCK_CONST_METHOD7(GetCloudAppParameters,
+ bool(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference));
+ MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id));
+ MOCK_METHOD2(SetCloudAppEnabled,
+ void(const std::string& policy_app_id, const bool enabled));
+ MOCK_METHOD2(SetAppAuthToken,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
+ MOCK_METHOD2(SetAppCloudTransportType,
+ void(const std::string& policy_app_id,
+ const std::string& cloud_transport_type));
+ MOCK_METHOD2(SetAppEndpoint,
+ void(const std::string& policy_app_id,
+ const std::string& endpoint));
+ MOCK_METHOD2(SetAppNicknames,
+ void(const std::string& policy_app_id,
+ const StringArray& nicknames));
+ MOCK_METHOD2(SetHybridAppPreference,
+ void(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference));
MOCK_METHOD1(SetVINValue, bool(const std::string& value));
MOCK_METHOD2(GetUserFriendlyMsg,
std::vector<UserFriendlyMessage>(
const std::vector<std::string>& msg_codes,
const std::string& language));
-
+ MOCK_CONST_METHOD2(
+ GetAppServiceParameters,
+ void(const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters));
+ MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
+ bool(const std::string& policy_app_id));
MOCK_METHOD1(
GetNotificationsNumber,
policy_table::NumberOfNotificationsType(const std::string& priority));
@@ -81,6 +114,7 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD2(GetUpdateUrls,
void(const uint32_t service_type, EndpointUrls& out_end_points));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
MOCK_METHOD2(Init,
bool(const std::string& file_name,
const PolicySettings* settings));
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
index 3b0c1a925e..f409100a49 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
@@ -37,8 +37,8 @@
#include "gmock/gmock.h"
#include "policy/policy_listener.h"
-#include "rpc_base/rpc_base.h"
#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base.h"
#include "utils/custom_string.h"
namespace policy_table = ::rpc::policy_table_interface_base;
@@ -75,6 +75,9 @@ class MockPolicyListener : public ::policy::PolicyListener {
MOCK_METHOD1(OnSnapshotCreated, void(const policy::BinaryMessage& pt_string));
MOCK_METHOD0(CanUpdate, bool());
MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
+ MOCK_METHOD2(OnAuthTokenUpdated,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
void(const policy::AppPermissions&, const std::string&));
MOCK_METHOD3(OnUpdateHMILevel,
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 0e06e9c1a3..73bf2d387b 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -40,8 +40,8 @@
#include "policy/policy_types.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "rpc_base/rpc_base.h"
#include "policy/policy_manager.h"
+#include "rpc_base/rpc_base.h"
namespace policy_table = ::rpc::policy_table_interface_base;
@@ -181,6 +181,40 @@ class MockPolicyManager : public PolicyManager {
GetAppRequestTypes,
const std::vector<std::string>(const std::string policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_CONST_METHOD1(GetEnabledCloudApps,
+ void(std::vector<std::string>& enabled_apps));
+ MOCK_CONST_METHOD7(GetCloudAppParameters,
+ bool(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference));
+ MOCK_METHOD1(InitCloudApp, void(const std::string& policy_app_id));
+ MOCK_METHOD2(SetCloudAppEnabled,
+ void(const std::string& policy_app_id, const bool enabled));
+ MOCK_METHOD2(SetAppAuthToken,
+ void(const std::string& policy_app_id,
+ const std::string& auth_token));
+ MOCK_METHOD2(SetAppCloudTransportType,
+ void(const std::string& policy_app_id,
+ const std::string& cloud_transport_type));
+ MOCK_METHOD2(SetAppEndpoint,
+ void(const std::string& policy_app_id,
+ const std::string& endpoint));
+ MOCK_METHOD2(SetAppNicknames,
+ void(const std::string& policy_app_id,
+ const StringArray& nicknames));
+ MOCK_METHOD2(SetHybridAppPreference,
+ void(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference));
+ MOCK_CONST_METHOD2(
+ GetAppServiceParameters,
+ void(const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters));
+ MOCK_CONST_METHOD1(UnknownRPCPassthroughAllowed,
+ bool(const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
MOCK_CONST_METHOD0(HasCertificate, bool());
@@ -204,6 +238,7 @@ class MockPolicyManager : public PolicyManager {
MOCK_CONST_METHOD0(get_settings, const PolicySettings&());
MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(GetIconUrl, std::string(const std::string& policy_app_id));
MOCK_METHOD1(GetNextUpdateUrl, AppIdURL(const EndpointUrls& urls));
MOCK_CONST_METHOD2(RetrySequenceUrl,
AppIdURL(const struct RetrySequenceURL&,
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
index 6e0acae33c..26c5572d99 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
@@ -32,8 +32,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
-#include "gmock/gmock.h"
#include <string>
+#include "gmock/gmock.h"
#include "policy/policy_settings.h"
namespace test {
@@ -52,7 +52,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(use_full_app_id, bool());
};
-} // namespace policy_test
+} // namespace policy_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h
index f6db0c7097..4468914a26 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -33,9 +33,9 @@
#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_HANDLER_H_
#include "gmock/gmock.h"
-#include "protocol_handler/protocol_packet.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_handler_settings.h"
+#include "protocol_handler/protocol_packet.h"
#include "protocol_handler/session_observer.h"
namespace test {
diff --git a/src/components/include/test/protocol_handler/mock_protocol_observer.h b/src/components/include/test/protocol_handler/mock_protocol_observer.h
index 257ea5ad9f..ef28d80d0b 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_observer.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_observer.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_OBSERVER_H_
-#include "gmock/gmock.h"
#include <string>
+#include "gmock/gmock.h"
#include "protocol_handler/protocol_observer.h"
namespace test {
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index 0d74b15f64..01bb41a96e 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_SESSION_OBSERVER_H_
#include <gmock/gmock.h>
-#include <string>
#include <list>
+#include <string>
#include "protocol_handler/session_observer.h"
#include "transport_manager/common.h"
diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h
index b2c2e3bf17..2b5d99c156 100644
--- a/src/components/include/test/security_manager/mock_security_manager.h
+++ b/src/components/include/test/security_manager/mock_security_manager.h
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SECURITY_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SECURITY_MANAGER_H_
-#include <string>
#include <list>
+#include <string>
#include "gmock/gmock.h"
-#include "utils/byte_order.h"
#include "security_manager/security_manager.h"
#include "security_manager/security_query.h"
+#include "utils/byte_order.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h b/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
index dd07f1d3c8..eb106db9a2 100644
--- a/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
+++ b/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_TELEMETRY_MONITOR_MOCK_TELEMETRY_OBSERVABLE_H_
#define SRC_COMPONENTS_INCLUDE_TEST_TELEMETRY_MONITOR_MOCK_TELEMETRY_OBSERVABLE_H_
+#include "application_manager/telemetry_observer.h"
#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_observable.h"
-#include "application_manager/telemetry_observer.h"
namespace test {
namespace components {
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 cc8bd5ab85..395beeff7b 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager.h
@@ -33,22 +33,22 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_H_
-#include "gmock/gmock.h"
#include <string>
-#include "transport_manager/transport_manager.h"
-#include "transport_manager/transport_adapter/transport_adapter_event.h"
-#include "telemetry_monitor/telemetry_observable.h"
+#include "gmock/gmock.h"
#include "resumption/last_state.h"
+#include "telemetry_monitor/telemetry_observable.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+#include "transport_manager/transport_manager.h"
namespace test {
namespace components {
namespace transport_manager_test {
-using ::transport_manager::DeviceHandle;
using ::transport_manager::ConnectionUID;
-using ::transport_manager::transport_adapter::TransportAdapter;
+using ::transport_manager::DeviceHandle;
using ::transport_manager::TransportAdapterEvent;
using ::transport_manager::TransportManagerListener;
+using ::transport_manager::transport_adapter::TransportAdapter;
/*
* MOCK implementation of ::transport_manager::TransportManager interface
*/
@@ -59,7 +59,14 @@ class MockTransportManager : public ::transport_manager::TransportManager,
MOCK_METHOD1(Init, int(resumption::LastState& last_state));
MOCK_METHOD0(Reinit, int());
MOCK_METHOD0(SearchDevices, int());
+ MOCK_METHOD1(
+ AddCloudDevice,
+ void(const transport_manager::transport_adapter::CloudAppProperties&));
+ MOCK_METHOD1(RemoveCloudDevice, void(const DeviceHandle device_id));
MOCK_METHOD1(ConnectDevice, int(const DeviceHandle));
+ MOCK_CONST_METHOD1(
+ GetConnectionStatus,
+ transport_manager::ConnectionStatus(const DeviceHandle& device_handle));
MOCK_METHOD1(DisconnectDevice, int(const DeviceHandle));
MOCK_METHOD1(Disconnect, int(const ConnectionUID));
MOCK_METHOD1(DisconnectForce, int(const ConnectionUID));
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
index 133dabe732..04408f945b 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_listener.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -55,6 +55,10 @@ class MockTransportManagerListener : public TransportManagerListener {
MOCK_METHOD1(OnDeviceRemoved, void(const DeviceInfo& device_info));
MOCK_METHOD0(OnScanDevicesFinished, void());
MOCK_METHOD1(OnScanDevicesFailed, void(const SearchDeviceError& error));
+ MOCK_METHOD0(OnConnectionStatusUpdated, void());
+ MOCK_METHOD2(OnConnectionPending,
+ void(const DeviceInfo& device_info,
+ const ConnectionUID connection_id));
MOCK_METHOD2(OnConnectionEstablished,
void(const DeviceInfo& device_info,
const ConnectionUID connection_id));
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 3e7c8f36f7..eb12ce1b55 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -33,9 +33,9 @@
#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H_
#include "gmock/gmock.h"
+#include "mock_transport_manager_mme_settings.h"
#include "protocol_handler/protocol_handler.h"
#include "transport_manager/transport_manager_settings.h"
-#include "mock_transport_manager_mme_settings.h"
namespace test {
namespace components {
@@ -63,6 +63,9 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t());
MOCK_CONST_METHOD0(transport_manager_tcp_adapter_network_interface,
std::string&());
+ MOCK_CONST_METHOD0(cloud_app_retry_timeout, uint32_t());
+ MOCK_CONST_METHOD0(cloud_app_max_retry_attempts, uint16_t());
+ MOCK_CONST_METHOD0(bluetooth_uuid, const uint8_t*());
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_device.h b/src/components/include/test/transport_manager/transport_adapter/mock_device.h
index 6829e98d1d..c1e0153a76 100644
--- a/src/components/include/test/transport_manager/transport_adapter/mock_device.h
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_device.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_DEVICE_H_
#include "gmock/gmock.h"
-#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/common.h"
#include "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/transport_adapter/device.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
index eff0abdcd3..3ac6331f71 100644
--- a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_H_
#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
namespace test {
@@ -66,6 +67,9 @@ class MockTransportAdapter
MOCK_METHOD1(ConnectDevice,
::transport_manager::transport_adapter::TransportAdapter::Error(
const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD1(GetConnectionStatus,
+ ::transport_manager::ConnectionStatus(
+ const ::transport_manager::DeviceUID& device_handle));
MOCK_METHOD2(RunAppOnDevice, void(const std::string&, const std::string&));
MOCK_CONST_METHOD0(IsClientOriginatedConnectSupported, bool());
MOCK_METHOD0(
@@ -105,6 +109,8 @@ class MockTransportAdapter
transport_manager::SwitchableDevices());
MOCK_CONST_METHOD0(GetTransportConfiguration,
transport_manager::transport_adapter::TransportConfig());
+ MOCK_METHOD1(CreateDevice, void(const std::string& uid));
+
#ifdef TELEMETRY_MONITOR
MOCK_METHOD0(GetTelemetryObserver,
::transport_manager::TMTelemetryObserver*());
diff --git a/src/components/include/test/utils/test_async_waiter.h b/src/components/include/test/utils/test_async_waiter.h
index fee7672e93..12d6cd04b7 100644
--- a/src/components/include/test/utils/test_async_waiter.h
+++ b/src/components/include/test/utils/test_async_waiter.h
@@ -35,8 +35,8 @@
#include <stdint.h>
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace test {
diff --git a/src/components/include/transport_manager/common.h b/src/components/include/transport_manager/common.h
index 58bcf6bb17..300ce26d0b 100644
--- a/src/components/include/transport_manager/common.h
+++ b/src/components/include/transport_manager/common.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
-#include <vector>
-#include <string>
#include <map>
+#include <string>
+#include <vector>
/**
* @brief - transport_manager namespace
@@ -56,6 +56,8 @@ enum {
E_INTERNAL_ERROR
};
+enum ConnectionStatus { INVALID = -1, PENDING, RETRY, CONNECTED, CLOSING };
+
/**
* @brief Type definition for variable that hold handle of device.
*/
diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h
index ba357dd54b..eb0f702717 100644
--- a/src/components/include/transport_manager/error.h
+++ b/src/components/include/transport_manager/error.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
-#include <string>
#include <memory>
+#include <string>
namespace transport_manager {
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 1ac1424477..184616d714 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_H_
+#include <memory>
#include <string>
#include <vector>
-#include <memory>
#include "transport_manager/common.h"
@@ -58,7 +58,9 @@ class Device {
Device(const std::string& name, const DeviceUID& unique_device_id)
: name_(name)
, unique_device_id_(unique_device_id)
- , keep_on_disconnect_(false) {}
+ , keep_on_disconnect_(false)
+ , status_(ConnectionStatus::PENDING)
+ , retry_count_(0) {}
/**
* Constructor for creating device supporting transport switch
@@ -73,7 +75,9 @@ class Device {
: name_(name)
, unique_device_id_(unique_device_id)
, transport_switch_id_(transport_switch_id)
- , keep_on_disconnect_(false) {}
+ , keep_on_disconnect_(false)
+ , status_(ConnectionStatus::PENDING)
+ , retry_count_(0) {}
/**
* @brief Destructor.
@@ -132,6 +136,44 @@ class Device {
}
/**
+ * @brief Get @link status_ @endlink value
+ * @return current value
+ */
+ inline ConnectionStatus connection_status() const {
+ return status_;
+ }
+
+ /**
+ * @brief Set @link status_ @endlink value
+ * @param status new value
+ */
+ inline void set_connection_status(ConnectionStatus status) {
+ status_ = status;
+ }
+
+ /**
+ * @brief Get @link retry_count_ @endlink value
+ * @return current value
+ */
+ inline uint16_t retry_count() const {
+ return retry_count_;
+ }
+
+ /**
+ * @brief Increment @link retry_count_ @endlink value
+ */
+ inline void next_retry() {
+ retry_count_++;
+ }
+
+ /**
+ * @brief Reset @link retry_count_ @endlink value to 0
+ */
+ inline void reset_retry_count() {
+ retry_count_ = 0;
+ }
+
+ /**
* @brief transport_switch_id Returns id used for transport switching
* flow of device. Filled if applicable, otherwise - empty.
*/
@@ -160,6 +202,10 @@ class Device {
*finished.
**/
bool keep_on_disconnect_;
+
+ ConnectionStatus status_;
+
+ uint16_t retry_count_;
};
typedef std::shared_ptr<Device> DeviceSptr;
typedef std::vector<DeviceSptr> DeviceVector;
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
index ebbf7dae28..1d21ff4ae4 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -36,15 +36,15 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_H_
-#include <string>
-#include <vector>
#include <list>
#include <map>
+#include <string>
+#include <vector>
-#include "transport_manager/transport_adapter/device.h"
+#include "protocol/common.h"
#include "transport_manager/common.h"
#include "transport_manager/error.h"
-#include "protocol/common.h"
+#include "transport_manager/transport_adapter/device.h"
namespace transport_manager {
@@ -64,12 +64,22 @@ enum DeviceType {
IOS_BT,
IOS_USB,
TCP,
+ CLOUD_WEBSOCKET,
IOS_USB_HOST_MODE,
IOS_USB_DEVICE_MODE,
IOS_CARPLAY_WIRELESS, // running on iAP over Carplay wireless transport
UNKNOWN
};
+struct CloudAppProperties {
+ std::string endpoint;
+ std::string certificate;
+ bool enabled;
+ std::string auth_token;
+ std::string cloud_transport_type;
+ std::string hybrid_app_preference;
+};
+
typedef std::map<DeviceType, std::string> DeviceTypes;
/**
@@ -88,6 +98,7 @@ typedef std::list<TransportAdapterListener*> TransportAdapterListenerList;
*/
typedef std::map<std::string, std::string> TransportConfig;
+typedef std::map<std::string, CloudAppProperties> CloudAppTransportConfig;
/**
* @brief TransportConfig keys
*/
@@ -196,6 +207,16 @@ class TransportAdapter {
virtual Error ConnectDevice(const DeviceUID& device_handle) = 0;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ virtual ConnectionStatus GetConnectionStatus(
+ const DeviceUID& device_handle) const = 0;
+
+ /**
* @brief RunAppOnDevice allows to run specific application on the certain
*device.
*
@@ -327,6 +348,8 @@ class TransportAdapter {
*/
virtual TransportConfig GetTransportConfiguration() const = 0;
+ virtual void CreateDevice(const std::string& uid) = 0;
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Return Time metric observer
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
index fd1d693067..79daa51c36 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_EVENT_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_EVENT_H_
+#include "protocol/common.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
-#include "protocol/common.h"
namespace transport_manager {
@@ -58,7 +58,9 @@ enum class EventTypeEnum {
ON_COMMUNICATION_ERROR,
ON_UNEXPECTED_DISCONNECT,
ON_TRANSPORT_SWITCH_REQUESTED,
- ON_TRANSPORT_CONFIG_UPDATED
+ ON_TRANSPORT_CONFIG_UPDATED,
+ ON_CONNECT_PENDING,
+ ON_CONNECTION_STATUS_UPDATED
};
class TransportAdapterEvent {
diff --git a/src/components/include/transport_manager/transport_manager.h b/src/components/include/transport_manager/transport_manager.h
index 0847886c46..275608c315 100644
--- a/src/components/include/transport_manager/transport_manager.h
+++ b/src/components/include/transport_manager/transport_manager.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_H_
+#include "protocol/common.h"
#include "transport_manager/common.h"
-#include "transport_manager/transport_manager_listener.h"
#include "transport_manager/transport_adapter/transport_adapter_event.h"
-#include "protocol/common.h"
+#include "transport_manager/transport_manager_listener.h"
namespace resumption {
class LastState;
@@ -69,12 +69,18 @@ class TransportManager {
virtual int Reinit() = 0;
/**
- * @brief Start scanning for new devices.
- *
- * @return Code error.
- **/
+ * @brief Start scanning for new devices.
+ *
+ * @return Code error.
+ **/
virtual int SearchDevices() = 0;
+ virtual void AddCloudDevice(
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) = 0;
+
+ virtual void RemoveCloudDevice(const DeviceHandle device_id) = 0;
+
/**
* @brief Connect to all applications discovered on device.
*
@@ -85,6 +91,16 @@ class TransportManager {
virtual int ConnectDevice(const DeviceHandle device_id) = 0;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ virtual ConnectionStatus GetConnectionStatus(
+ const DeviceHandle& device_handle) const = 0;
+
+ /**
* @brief Disconnect from all applications connected on device.
*
* @param device_id Handle of device to Disconnect from.
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index 6c3f6e2eaa..a733dc7d1c 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -35,10 +35,10 @@
#include <map>
#include <vector>
+#include "protocol/common.h"
#include "transport_manager/common.h"
-#include "transport_manager/info.h"
#include "transport_manager/error.h"
-#include "protocol/common.h"
+#include "transport_manager/info.h"
namespace transport_manager {
@@ -57,8 +57,8 @@ class TransportManagerListener {
virtual void OnDeviceListUpdated(const std::vector<DeviceInfo>&) = 0;
/**
- * @brief Reaction to "Find new applications" request
- */
+ * @brief Reaction to "Find new applications" request
+ */
virtual void OnFindNewApplicationsRequest() = 0;
/**
@@ -101,6 +101,19 @@ class TransportManagerListener {
virtual void OnScanDevicesFailed(const SearchDeviceError& error) = 0;
/**
+ * @brief Reaction to the event, when the cloud connection status is updated.
+ */
+ virtual void OnConnectionStatusUpdated() = 0;
+
+ /**
+ * @brief Reaction to the event, when connection is pending.
+ *
+ * @param devcie_info Variable that hold information about device.
+ * @param connection_id connection unique identifier.
+ */
+ virtual void OnConnectionPending(const DeviceInfo& device_info,
+ const ConnectionUID connection_id) = 0;
+ /**
* @brief Reaction to the event, when connection is established.
*
* @param devcie_info Variable that hold information about device.
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
index 08b2b77c30..6754540b4c 100644
--- a/src/components/include/transport_manager/transport_manager_listener_empty.h
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -35,8 +35,8 @@
#include <vector>
-#include "transport_manager/transport_manager_listener.h"
#include "protocol/common.h"
+#include "transport_manager/transport_manager_listener.h"
namespace transport_manager {
@@ -59,6 +59,8 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnFindNewApplicationsRequest() OVERRIDE {}
+ void OnConnectionStatusUpdated() OVERRIDE {}
+
/**
* @brief Reaction to the event, when the device is found.
*
@@ -99,6 +101,15 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnScanDevicesFailed(const SearchDeviceError& error) OVERRIDE {}
/**
+ * @brief Reaction to the event, when connection is pending.
+ *
+ * @param devcie_info Variable that hold information about device.
+ * @param connection_id connection unique identifier.
+ */
+ void OnConnectionPending(const DeviceInfo& device_info,
+ const ConnectionUID connection_id) OVERRIDE {}
+
+ /**
* @brief Reaction to the event, when connection is established.
*
* @param devcie_info Variable that hold information about device.
diff --git a/src/components/include/transport_manager/transport_manager_mme_settings.h b/src/components/include/transport_manager/transport_manager_mme_settings.h
index efe26468ab..721df03d34 100644
--- a/src/components/include/transport_manager/transport_manager_mme_settings.h
+++ b/src/components/include/transport_manager/transport_manager_mme_settings.h
@@ -60,6 +60,6 @@ class TransportManagerMMESettings {
virtual uint32_t iap_hub_connection_wait_timeout() const = 0;
};
-}
+} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MME_SETTINGS_H_
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index 3912bbe747..4a183ad22d 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -69,6 +69,18 @@ class TransportManagerSettings : public TransportManagerMMESettings {
*/
virtual const std::string& transport_manager_tcp_adapter_network_interface()
const = 0;
+
+ /**
+ * @brief Returns retry timeout for cloud app connections
+ */
+ virtual uint32_t cloud_app_retry_timeout() const = 0;
+
+ /**
+ * @brief Returns maximum retry attempts for cloud app connections
+ */
+ virtual uint16_t cloud_app_max_retry_attempts() const = 0;
+
+ virtual const uint8_t* bluetooth_uuid() const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/custom_string.h b/src/components/include/utils/custom_string.h
index 7b21e7a64d..0e5ef244f0 100644
--- a/src/components/include/utils/custom_string.h
+++ b/src/components/include/utils/custom_string.h
@@ -81,8 +81,8 @@ class CustomString {
CustomString(size_t n, char c);
/**
- * @brief Returns the length of the string, in terms of characters.
- */
+ * @brief Returns the length of the string, in terms of characters.
+ */
size_t size() const;
/**
diff --git a/src/components/include/utils/logger.h b/src/components/include/utils/logger.h
index 75daa552a2..907f8f4db0 100644
--- a/src/components/include/utils/logger.h
+++ b/src/components/include/utils/logger.h
@@ -35,13 +35,13 @@
#ifdef ENABLE_LOG
#include <errno.h>
-#include <string.h>
-#include <sstream>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/spi/loggingevent.h>
-#include "utils/push_log.h"
-#include "utils/logger_status.h"
+#include <string.h>
+#include <sstream>
#include "utils/auto_trace.h"
+#include "utils/logger_status.h"
+#include "utils/push_log.h"
#endif // ENABLE_LOG
#ifdef ENABLE_LOG
@@ -121,15 +121,15 @@ log4cxx_time_t time_now();
#define LOG4CXX_FATAL(loggerPtr, logEvent) \
LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getFatal(), logEvent)
-#define LOG4CXX_ERROR_WITH_ERRNO(loggerPtr, message) \
- LOG4CXX_ERROR(loggerPtr, \
- message << ", error code " << errno << " (" << strerror(errno) \
- << ")")
+#define LOG4CXX_ERROR_WITH_ERRNO(loggerPtr, message) \
+ LOG4CXX_ERROR( \
+ loggerPtr, \
+ message << ", error code " << errno << " (" << strerror(errno) << ")")
-#define LOG4CXX_WARN_WITH_ERRNO(loggerPtr, message) \
- LOG4CXX_WARN(loggerPtr, \
- message << ", error code " << errno << " (" << strerror(errno) \
- << ")")
+#define LOG4CXX_WARN_WITH_ERRNO(loggerPtr, message) \
+ LOG4CXX_WARN( \
+ loggerPtr, \
+ message << ", error code " << errno << " (" << strerror(errno) << ")")
#else // ENABLE_LOG is OFF
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
index e6f3b6b3ca..00298f690e 100644
--- a/src/components/include/utils/macro.h
+++ b/src/components/include/utils/macro.h
@@ -40,7 +40,7 @@
#include "logger.h"
// A macro to set some action for variable to avoid "unused variable" warning
-#define UNUSED(x) (void) x;
+#define UNUSED(x) (void)x;
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
@@ -133,9 +133,9 @@
#endif
/*
-* @brief Calculate size of na array
-* @param arr array, which size need to calculate
-*/
+ * @brief Calculate size of na array
+ * @param arr array, which size need to calculate
+ */
#define ARRAYSIZE(arr) sizeof(arr) / sizeof(*arr)
#ifdef BUILD_TESTS
@@ -146,9 +146,9 @@
#endif // BUILD_TESTS
/*
-* @brief deprecate a method declaration, a warning will be thrown by your
-* compiler if a method with this macro is used
-*/
+ * @brief deprecate a method declaration, a warning will be thrown by your
+ * compiler if a method with this macro is used
+ */
#if __cplusplus > 201103L
#define DEPRECATED [[deprecated]]
#else
diff --git a/src/components/include/utils/message_queue.h b/src/components/include/utils/message_queue.h
index 093aa4cac2..8dfe7afa52 100644
--- a/src/components/include/utils/message_queue.h
+++ b/src/components/include/utils/message_queue.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MESSAGE_QUEUE_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_MESSAGE_QUEUE_H_
-#include <queue>
#include <algorithm>
+#include <queue>
#include "utils/conditional_variable.h"
#include "utils/lock.h"
@@ -97,9 +97,9 @@ class MessageQueue {
void wait();
/**
- * \brief waitUntilEmpty message queue
- * Wait until message queue is empty
- */
+ * \brief waitUntilEmpty message queue
+ * Wait until message queue is empty
+ */
void WaitUntilEmpty();
/**
@@ -112,8 +112,8 @@ class MessageQueue {
void Shutdown();
/**
- * \brief Clears queue.
- */
+ * \brief Clears queue.
+ */
void Reset();
private:
@@ -131,8 +131,7 @@ class MessageQueue {
};
template <typename T, class Q>
-MessageQueue<T, Q>::MessageQueue()
- : shutting_down_(false) {}
+MessageQueue<T, Q>::MessageQueue() : shutting_down_(false) {}
template <typename T, class Q>
MessageQueue<T, Q>::~MessageQueue() {}
diff --git a/src/components/include/utils/prioritized_queue.h b/src/components/include/utils/prioritized_queue.h
index eb4ba6a6c3..a2eb200012 100644
--- a/src/components/include/utils/prioritized_queue.h
+++ b/src/components/include/utils/prioritized_queue.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_PRIORITIZED_QUEUE_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_PRIORITIZED_QUEUE_H_
-#include <queue>
-#include <map>
#include <algorithm>
+#include <map>
+#include <queue>
#include "utils/macro.h"
diff --git a/src/components/include/utils/rwlock.h b/src/components/include/utils/rwlock.h
index b7e7484b48..5c7735713e 100644
--- a/src/components/include/utils/rwlock.h
+++ b/src/components/include/utils/rwlock.h
@@ -98,15 +98,15 @@ class RWLock {
bool TryAcquireForReading();
/**
- * @brief Try to Acqure read-write lock for writing.
- * Applies a write lock like AcquireForWriting(), with the exception that
+ * @brief Try to Acqure read-write lock for writing.
+ * Applies a write lock like AcquireForWriting(), with the exception that
* the
- * function fails if any thread currently holds rwlock (for reading or
+ * function fails if any thread currently holds rwlock (for reading or
* writing)
- * Invoke of TryAcquireForWriting will not block calling thread and returns
+ * Invoke of TryAcquireForWriting will not block calling thread and returns
* "false"
- * @returns true if lock was acquired and false if was not
- */
+ * @returns true if lock was acquired and false if was not
+ */
bool TryAcquireForWriting();
/**
@@ -126,12 +126,12 @@ class RWLock {
bool AcquireForWriting();
/**
- * @brief Release read-write lock.
- * Releases a lock held on the read-write lock object.
- * Results are undefined if the read-write lock rwlock
- * is not held by the calling thread.
- * @returns true if lock was released and false if was not
- */
+ * @brief Release read-write lock.
+ * Releases a lock held on the read-write lock object.
+ * Results are undefined if the read-write lock rwlock
+ * is not held by the calling thread.
+ * @returns true if lock was released and false if was not
+ */
bool Release();
private:
diff --git a/src/components/include/utils/scope_guard.h b/src/components/include/utils/scope_guard.h
index a425356c0e..a05be6dc11 100644
--- a/src/components/include/utils/scope_guard.h
+++ b/src/components/include/utils/scope_guard.h
@@ -322,5 +322,5 @@ ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj,
const P1& p1) {
return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
}
-}
+} // namespace utils
#endif // SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H_
diff --git a/src/components/include/utils/semantic_version.h b/src/components/include/utils/semantic_version.h
index 5fe7ce1deb..5b2f2a1cdf 100644
--- a/src/components/include/utils/semantic_version.h
+++ b/src/components/include/utils/semantic_version.h
@@ -120,6 +120,6 @@ struct SemanticVersion {
extern const SemanticVersion base_rpc_version;
extern const SemanticVersion rpc_version_5;
-}
+} // namespace utils
#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H \ No newline at end of file
diff --git a/src/components/include/utils/threads/async_runner.h b/src/components/include/utils/threads/async_runner.h
index 64c9d09939..5c88112267 100644
--- a/src/components/include/utils/threads/async_runner.h
+++ b/src/components/include/utils/threads/async_runner.h
@@ -33,14 +33,14 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_ASYNC_RUNNER_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_ASYNC_RUNNER_H_
-#include <string>
#include <queue>
+#include <string>
-#include "thread_delegate.h"
#include "thread.h"
+#include "thread_delegate.h"
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace threads {
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
index add7fc38b8..26ae127b69 100644
--- a/src/components/include/utils/threads/message_loop_thread.h
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_MESSAGE_LOOP_THREAD_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_MESSAGE_LOOP_THREAD_H_
-#include <string>
#include <queue>
+#include <string>
#include "utils/logger.h"
#include "utils/macro.h"
diff --git a/src/components/include/utils/threads/thread.h b/src/components/include/utils/threads/thread.h
index cba79b20bd..6f72679d63 100644
--- a/src/components/include/utils/threads/thread.h
+++ b/src/components/include/utils/threads/thread.h
@@ -40,11 +40,11 @@
#include <ostream>
#include <string>
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
#include "utils/macro.h"
#include "utils/threads/thread_delegate.h"
#include "utils/threads/thread_options.h"
-#include "utils/conditional_variable.h"
-#include "utils/lock.h"
namespace threads {
diff --git a/src/components/include/utils/typed_enum_print.h b/src/components/include/utils/typed_enum_print.h
index e2b903c948..0f3cc41bf8 100644
--- a/src/components/include/utils/typed_enum_print.h
+++ b/src/components/include/utils/typed_enum_print.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
-#include <type_traits>
#include <ostream>
+#include <type_traits>
namespace utils {
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index 3cf1082e90..ae5adc6d2a 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -35,6 +35,7 @@ include_directories (
${COMPONENTS_DIR}/utils/include
${COMPONENTS_DIR}/formatters/include
${COMPONENTS_DIR}/smart_objects/include
+ ${BOOST_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index 35109cad29..989413e26f 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -34,7 +34,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="2.0.0" date="2018-09-05">
+<interface name="Common" version="2.1.0" date="2019-03-18">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -72,6 +72,7 @@
<element name="USB_IOS"/>
<element name="USB_AOA"/>
<element name="WIFI"/>
+ <element name="CLOUD_WEBSOCKET"/>
</enum>
<enum name="ButtonName">
@@ -291,6 +292,18 @@
<element name="REMOTE_CONTROL" />
</enum>
+<enum name="CloudConnectionStatus">
+ <element name="NOT_CONNECTED">
+ <description>No active websocket session or ongoing connection attempts</description>
+ </element>
+ <element name="CONNECTED">
+ <description>Websocket is active</description>
+ </element>
+ <element name="RETRY">
+ <description>Websocket connection failed and retry attempts are ongoing</description>
+ </element>
+</enum>
+
<enum name="WayPointType">
<description>Describes what kind of waypoint is requested/provided.</description>
<element name="ALL" />
@@ -474,6 +487,9 @@
<element name="UNSUPPORTED_HMI_RESOURCE">
<description>By getting this value, SDL unregisters the named application</description>
</element>
+ <element name="CLOSE_CLOUD_CONNECTION">
+ <description>By getting this value, SDL puts the named app to NONE HMILevel. Used by the HMI to close a cloud app connection.</description>
+ </element>
</enum>
<enum name="TextFieldName">
@@ -1094,6 +1110,7 @@
<element name="VEHICLEDATA_FUELRANGE" />
<element name="VEHICLEDATA_ENGINEOILLIFE" />
<element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
+ <element name="VEHICLEDATA_CLOUDAPPVEHICLEID" />
</enum>
<enum name="WiperStatus">
@@ -1254,6 +1271,7 @@
<element name="MEDIA" />
<element name="FOTA" />
<element name="OEM_SPECIFIC"/>
+ <element name="ICON_URL"/>
</enum>
<enum name="ECallConfirmationStatus">
@@ -1827,6 +1845,13 @@
<param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
<description>The speed in KPH</description>
</param>
+ <param name="shifted" type="Boolean" mandatory="false">
+ <description>
+ True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ False, if the GPS data is raw and un-shifted.
+ If not provided, then value is assumed False.
+ </description>
+ </param>
</struct>
<struct name="SisData">
@@ -1862,9 +1887,15 @@
<description> True if the hd radio is on, false is the radio is off</description>
</param>
<param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
- <description>number of HD sub-channels if available</description>
+ <description>
+ Number of HD sub-channels if available.
+ Note that this parameter is deprecated in MOBILE API.
+ </description>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
+ <param name="availableHdChannels" type="Integer" minvalue="0" maxvalue="7" array="true" minsize="0" maxsize="8" mandatory="false">
+ <description>The list of available hd sub-channel indexes. Empty list means no Hd channel is available. Read-only.</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="0" maxvalue="7" mandatory="false">
<description>Current HD sub-channel if available</description>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -1918,9 +1949,17 @@
</description>
</param>
<param name="availableHDsAvailable" type="Boolean" mandatory="false" >
- <description>
+ <description>
Availability of the getting the number of available HD channels.
True: Available, False: Not Available, Not present: Not Available.
+ Note that this parameter is deprecated in MOBILE API
+ </description>
+ </param>
+
+ <param name="availableHdChannelsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the list of available HD sub-channel indexes.
+ True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
<param name="stateAvailable" type="Boolean" mandatory="false" >
@@ -2022,6 +2061,8 @@
<param name="heatedMirrorsEnable" type="Boolean" mandatory="false">
<description>value false means disabled, value true means enabled.</description>
</param>
+ <param name="climateEnable" type="Boolean" mandatory="false">
+ </param>
</struct>
<struct name="ClimateControlCapabilities">
@@ -2123,6 +2164,12 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="climateEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable climate control.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<struct name="EqualizerSettings">
@@ -2618,16 +2665,18 @@
<description>If SDL omits this parameter - none RequestType is allowed for this app</description>
<description>(either this is a pre-registered app or such is dictated by policies).</description>
</param>
- <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>
- The list of SystemRequest's requestSubTypes allowed by policies for the named application.
- If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
- An empty array signifies that any value of requestSubType is allowed for this app.
- If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
- </description>
+ <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ The list of SystemRequest's requestSubTypes allowed by policies for the named application.
+ If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
+ An empty array signifies that any value of requestSubType is allowed for this app.
+ If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
+ </description>
</param>
<param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
<param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="isCloudApplication" type="Boolean" mandatory="false"></param>
+ <param name="cloudConnectionStatus" type="Common.CloudConnectionStatus" mandatory="false"></param>
</struct>
<struct name="MenuParams">
@@ -3341,6 +3390,458 @@
<description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
</param>
</struct>
+
+ <struct name="SyncMsgVersion">
+ <description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application or app service</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
+ </param>
+ </struct>
+
+ <!-- App Services -->
+
+ <enum name="AppServiceType">
+ <element name="MEDIA"/>
+ <element name="WEATHER"/>
+ <element name="NAVIGATION"/>
+ </enum>
+
+ <struct name="MediaServiceManifest">
+ </struct>
+
+ <enum name="MediaType">
+ <element name="MUSIC"/>
+ <element name="PODCAST"/>
+ <element name="AUDIOBOOK"/>
+ <element name="OTHER"/>
+ </enum>
+
+ <struct name="MediaServiceData">
+ <description>This data is related to what a media service should provide</description>
+
+ <param name="mediaType" type="Common.MediaType" mandatory="false">
+ <description>The type of the currently playing or paused track.</description>
+ </param>
+
+ <param name="mediaTitle" type="String" mandatory="false">
+ <description>
+ Music: The name of the current track
+ Podcast: The name of the current episode
+ Audiobook: The name of the current chapter
+ </description>
+ </param>
+
+ <param name="mediaArtist" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album artist
+ Podcast: The provider of the podcast (hosts, network, company)
+ Audiobook: The book author's name
+ </description>
+ </param>
+
+ <param name="mediaAlbum" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album
+ Podcast: The name of the current podcast show
+ Audiobook: The name of the current book
+ </description>
+ </param>
+
+ <param name="playlistName" type="String" mandatory="false">
+ <description>
+ Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
+ Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null
+ Audiobook: Likely not applicable, possibly a collection or "playlist" of books
+ </description>
+ </param>
+
+ <param name="isExplicit" type="Boolean" mandatory="false">
+ <description> Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content</description>
+ </param>
+
+ <param name="trackPlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the track in seconds
+ Podcast: The current progress of the episode in seconds
+ Audiobook: The current progress of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="trackPlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the track in seconds
+ Podcast: The total duration of the episode in seconds
+ Audiobook: The total duration of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the playback queue in seconds
+ Podcast: The current progress of the playback queue in seconds
+ Audiobook: The current progress of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the playback queue in seconds
+ Podcast: The total duration of the playback queue in seconds
+ Audiobook: The total duration of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queueCurrentTrackNumber" type="Integer" mandatory="false">
+ <description>
+ Music: The current number (1 based) of the track in the playback queue
+ Podcast: The current number (1 based) of the episode in the playback queue
+ Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)
+ </description>
+ </param>
+
+ <param name="queueTotalTrackCount" type="Integer" mandatory="false">
+ <description>
+ Music: The total number of tracks in the playback queue
+ Podcast: The total number of episodes in the playback queue
+ Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
+ </description>
+ </param>
+
+ <param name="mediaImage" type="Common.Image" mandatory="false">
+ <description>
+ Music: The album art of the current track
+ Podcast: The podcast or chapter artwork of the current podcast episode
+ Audiobook: The book or chapter artwork of the current audiobook
+ </description>
+ </param>
+ </struct>
+
+ <struct name="WeatherServiceManifest">
+ <param name="currentForecastSupported" type="Boolean" mandatory="false"/>
+ <param name="maxMultidayForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxHourlyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxMinutelyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="weatherForLocationSupported" type="Boolean" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherAlert">
+ <param name="title" type="String" mandatory="false"/>
+ <param name="summary" type="String" mandatory="false"/>
+ <param name="expires" type="Common.DateTime" mandatory="false"/>
+ <param name="regions" type="String" array="true" minsize="1" maxsize="99" mandatory="false"/>
+ <param name="severity" type="String" mandatory="false"/>
+ <param name="timeIssued" type="Common.DateTime" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherData">
+ <param name="currentTemperature" type="Common.Temperature" mandatory="false"/>
+ <param name="temperatureHigh" type="Common.Temperature" mandatory="false"/>
+ <param name="temperatureLow" type="Common.Temperature" mandatory="false"/>
+ <param name="apparentTemperature" type="Common.Temperature" mandatory="false"/>
+ <param name="apparentTemperatureHigh" type="Common.Temperature" mandatory="false"/>
+ <param name="apparentTemperatureLow" type="Common.Temperature" mandatory="false"/>
+
+ <param name="weatherSummary" type="String" mandatory="false"/>
+ <param name="time" type="Common.DateTime" mandatory="false"/>
+ <param name="humidity" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage humidity </description>
+ </param>
+ <param name="cloudCover" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage cloud cover </description>
+ </param>
+ <param name="moonPhase" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage of the moon seen, e.g. 0 = no moon, 0.25 = quarter moon </description>
+ </param>
+
+ <param name="windBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="windGust" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+ <param name="windSpeed" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+
+ <param name="nearestStormBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="nearestStormDistance" type="Integer" mandatory="false">
+ <description> In km </description>
+ </param>
+ <param name="precipAccumulation" type="Float" mandatory="false">
+ <description> cm </description>
+ </param>
+ <param name="precipIntensity" type="Float" mandatory="false">
+ <description> cm of water per hour </description>
+ </param>
+ <param name="precipProbability" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage chance </description>
+ </param>
+ <param name="precipType" type="String" mandatory="false">
+ <description> e.g. "rain", "snow", "sleet", "hail" </description>
+ </param>
+ <param name="visibility" type="Float" mandatory="false">
+ <description> In km </description>
+ </param>
+
+ <param name="weatherIcon" type="Common.Image" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherServiceData">
+ <description> This data is related to what a weather service would provide</description>
+ <param name="location" type="Common.LocationDetails" mandatory="true"/>
+ <param name="currentForecast" type="Common.WeatherData" mandatory="false"/>
+ <param name="minuteForecast" type="Common.WeatherData" array="true" minsize="15" maxsize="60" mandatory="false"/>
+ <param name="hourlyForecast" type="Common.WeatherData" array="true" minsize="1" maxsize="96" mandatory="false"/>
+ <param name="multidayForecast" type="Common.WeatherData" array="true" minsize="1" maxsize="30" mandatory="false"/>
+ <param name="alerts" type="Common.WeatherAlert" array="true" minsize="1" maxsize="10" mandatory="false">
+ <description> This array should be ordered with the first object being the current day</description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceManifest">
+ <param name="acceptsWayPoints" type="Boolean" mandatory="false">
+ <description> Informs the subscriber if this service can actually accept way points. </description>
+ </param>
+ </struct>
+
+ <enum name="NavigationAction">
+ <element name="TURN">
+ <description> Using this action plus a supplied direction can give the type of turn. </description>
+ </element>
+ <element name="EXIT"/>
+ <element name="STAY"/>
+ <element name="MERGE"/>
+ <element name="FERRY"/>
+ <element name="CAR_SHUTTLE_TRAIN"/>
+ <element name="WAYPOINT"/>
+ </enum>
+
+ <enum name="NavigationJunction">
+ <element name="REGULAR">
+ <description> A junction that represents a standard intersection with a single road crossing another. </description>
+ </element>
+ <element name="BIFURCATION">
+ <description> A junction where the road splits off into two paths; a fork in the road. </description>
+ </element>
+ <element name="MULTI_CARRIAGEWAY">
+ <description> A junction that has multiple intersections and paths. </description>
+ </element>
+ <element name="ROUNDABOUT">
+ <description> A junction where traffic moves in a single direction around a central, non-traversable point to reach one of the connecting roads. </description>
+ </element>
+ <element name="TRAVERSABLE_ROUNDABOUT">
+ <description> Similar to a roundabout, however the center of the roundabout is fully traversable. Also known as a mini-roundabout. </description>
+ </element>
+ <element name="JUGHANDLE">
+ <description> A junction where lefts diverge to the right, then curve to the left, converting a left turn to a crossing maneuver. </description>
+ </element>
+ <element name="ALL_WAY_YIELD">
+ <description> Multiple way intersection that allows traffic to flow based on priority; most commonly right of way and first in, first out. </description>
+ </element>
+ <element name="TURN_AROUND">
+ <description> A junction designated for traffic turn arounds. </description>
+ </element>
+ </enum>
+
+ <enum name="Direction">
+ <element name="LEFT"/>
+ <element name="RIGHT"/>
+ </enum>
+
+ <struct name="NavigationInstruction">
+ <param name="locationDetails" type="Common.LocationDetails" mandatory="true"/>
+
+ <param name="action" type="Common.NavigationAction" mandatory="true"/>
+
+ <param name="eta" type="Common.DateTime" mandatory="false"/>
+
+ <param name="bearing" type="Integer" minvalue="0" maxvalue="359" mandatory="false">
+ <description> The angle at which this instruction takes place. For example, 0 would mean straight, less than 45 is bearing right, greater than 135 is sharp right, between 45 and 135 is a regular right, and 180 is a U-Turn, etc. </description>
+ </param>
+
+ <param name="junctionType" type="Common.NavigationJunction" mandatory="false"/>
+
+ <param name="drivingSide" type="Common.Direction" mandatory="false">
+ <description> Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this will determine which direction the turn should take place. </description>
+ </param>
+
+ <param name="details" type="String" mandatory="false">
+ <description> This is a string representation of this instruction, used to display instructions to the users. This is not intended to be read aloud to the users, see the param prompt in NavigationServiceData for that. </description>
+ </param>
+
+ <param name="image" type="Common.Image" mandatory="false">
+ <description> An image representation of this instruction. </description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceData">
+ <description> This data is related to what a navigation service would provide.</description>
+
+ <param name="timeStamp" type="Common.DateTime" mandatory="true">
+ <description> This is the timestamp of when the data was generated. This is to ensure any time or distance given in the data can accurately be adjusted if necessary. </description>
+ </param>
+
+ <param name="origin" type="Common.LocationDetails" mandatory="false"/>
+ <param name="destination" type="Common.LocationDetails" mandatory="false"/>
+ <param name="destinationETA" type="Common.DateTime" mandatory="false"/>
+
+ <param name="instructions" type="Common.NavigationInstruction" array="true" mandatory="false">
+ <description> This array should be ordered with all remaining instructions. The start of this array should always contain the next instruction.</description>
+ </param>
+
+ <param name="nextInstructionETA" type="Common.DateTime" mandatory="false"/>
+ <param name="nextInstructionDistance" type="Float" mandatory="false">
+ <description>The distance to this instruction from current location. This should only be updated ever .1 unit of distance. For more accuracy the consumer can use the GPS location of itself and the next instruction. </description>
+ </param>
+ <param name="nextInstructionDistanceScale" type="Float" mandatory="false">
+ <description>Distance till next maneuver (starting from) from previous maneuver.</description>
+ </param>
+
+ <param name="prompt" type="String" mandatory="false">
+ <description>This is a prompt message that should be conveyed to the user through either display or voice (TTS). This param will change often as it should represent the following: approaching instruction, post instruction, alerts that affect the current navigation session, etc.</description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceManifest">
+ <description> This manifest contains all the information necessary for the service to be published, activated, and consumers able to interact with it </description>
+
+ <param name="serviceName" type="String" mandatory="false">
+ <description> Unique name of this service </description>
+ </param>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description> The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core. </description>
+ </param>
+
+ <param name="serviceIcon" type="Common.Image" mandatory="false">
+ <description> The icon to be associated with this service. Most likely the same as the appIcon.</description>
+ </param>
+
+ <param name="allowAppConsumers" type="Boolean" mandatory="false" defvalue="false">
+ <description> If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false. </description>
+ </param>
+
+ <param name="rpcSpecVersion" type="Common.SyncMsgVersion" mandatory="false">
+ <description> This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable. </description>
+ </param>
+
+ <param name="handledRPCs" type="Integer" array="true" mandatory="false">
+ <description> This field contains the Function IDs for the RPCs that this service intends to handle correctly. This means the service will provide meaningful responses. </description>
+ </param>
+
+ <param name="mediaServiceManifest" type="Common.MediaServiceManifest" mandatory="false"/>
+ <param name="weatherServiceManifest" type="Common.WeatherServiceManifest" mandatory="false"/>
+ <param name="navigationServiceManifest" type="Common.NavigationServiceManifest" mandatory="false"/>
+ </struct>
+
+ <struct name="AppServiceRecord">
+ <description> This is the record of an app service publisher that the module has. It should contain the most up to date information including the service's active state</description>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description> A unique ID tied to this specific service record. The ID is supplied by the module that services publish themselves. </description>
+ </param>
+
+ <param name="serviceManifest" type="Common.AppServiceManifest" mandatory="true">
+ <description> Manifest for the service that this record is for.</description>
+ </param>
+
+ <param name="servicePublished" type="Boolean" mandatory="true">
+ <description> If true, the service is published and available. If false, the service has likely just been unpublished, and should be considered unavailable.</description>
+ </param>
+
+ <param name="serviceActive" type="Boolean" mandatory="true">
+ <description> If true, the service is the active primary service of the supplied service type. It will receive all potential RPCs that are passed through to that service type. If false, it is not the primary service of the supplied type. See servicePublished for its availability. </description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceData">
+ <description> Contains all the current data of the app service. The serviceType will link to which of the service data objects are included in this object (e.g. if the service type is MEDIA, the mediaServiceData param should be included).</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+ <param name="serviceID" type="String" mandatory="true"/>
+
+ <param name="mediaServiceData" type="Common.MediaServiceData" mandatory="false"/>
+ <param name="weatherServiceData" type="Common.WeatherServiceData" mandatory="false"/>
+ <param name="navigationServiceData" type="Common.NavigationServiceData" mandatory="false"/>
+ </struct>
+
+ <enum name="ServiceUpdateReason">
+ <element name="PUBLISHED">
+ <description> The service has just been published with the module and once activated to the primary service of its type, it will be ready for possible consumption.</description>
+ </element>
+ <element name="REMOVED">
+ <description> The service has just been unpublished with the module and is no longer accessible</description>
+ </element>
+ <element name="ACTIVATED">
+ <description> The service is activated as the primary service of this type. All requests dealing with this service type will be handled by this service.</description>
+ </element>
+ <element name="DEACTIVATED">
+ <description> The service has been deactivated as the primary service of its type</description>
+ </element>
+ <element name="MANIFEST_UPDATE">
+ <description> The service has updated its manifest. This could imply updated capabilities. Note: Currently unimplemented </description>
+ </element>
+ </enum>
+
+ <struct name="AppServiceCapability">
+ <param name="updateReason" type="Common.ServiceUpdateReason" mandatory="false">
+ <description> Only included in OnSystemCapabilityUpdated. Update reason for service record.</description>
+ </param>
+ <param name="updatedAppServiceRecord" type="Common.AppServiceRecord" mandatory="true">
+ <description>Service record for a specific app service provider</description>
+ </param>
+ </struct>
+
+ <struct name="AppServicesCapabilities">
+ <description>Capabilities of app services including what service types are supported and the current state of services.</description>
+ <param name="appServices" type="Common.AppServiceCapability" array="true" mandatory="false">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
+
+ <!-- End App Services -->
+
+ <enum name="SystemCapabilityType">
+ <description>Enumerations of all available system capability types</description>
+ <element name="NAVIGATION"/>
+ <element name="PHONE_CALL"/>
+ <element name="VIDEO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
+ <element name="APP_SERVICES" />
+ </enum>
+
+ <struct name="SystemCapability">
+ <description>The systemCapabilityType identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <param name="systemCapabilityType" type="Common.SystemCapabilityType" mandatory="true">
+ <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other param included.</description>
+ </param>
+ <param name="navigationCapability" type="Common.NavigationCapability" mandatory="false">
+ <description>Describes extended capabilities for onboard navigation system </description>
+ </param>
+ <param name="phoneCapability" type="Common.PhoneCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="videoStreamingCapability" type="Common.VideoStreamingCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="appServicesCapabilities" type="Common.AppServicesCapabilities" mandatory="false">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
</interface>
@@ -3428,7 +3929,7 @@
</function>
</interface>
-<interface name="BasicCommunication" version="2.0.0" date="2018-09-05">
+<interface name="BasicCommunication" version="2.1.0" date="2019-03-18">
<function name="GetSystemTime" messagetype="request">
<description>Request from SDL to HMI to obtain current UTC time.</description>
</function>
@@ -3509,6 +4010,14 @@
</function>
<function name="ActivateApp" messagetype="response">
</function>
+ <function name="CloseApplication" messagetype="request">
+ <description>Request from the application to exit the foreground.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ </function>
+ <function name="CloseApplication" messagetype="response">
+ </function>
<function name="OnAppActivated" messagetype="notification">
<description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
<param name="appID" type="Integer" mandatory="true">
@@ -3690,46 +4199,78 @@
</function>
<function name="OnPutFile" messagetype="notification" >
- <description>
- Notification, that comes to HMI when mobile sents file with systemFile flag
- </description>
+ <description>
+ Notification that is sent to HMI when a mobile application uploads a file
+ </description>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
- <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Full Size of file. sends in first OnPutFile notification if file is splited
- into many PutFiles
- </description>
- </param>
+ <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Full Size of file. sends in first OnPutFile notification if file is splited
+ into many PutFiles
+ </description>
+ </param>
- <param name="FileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
+ <param name="FileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+ <param name="isSystemFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If true the system will pass the data thru as it arrives to a predetermined area outside of core.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description> ID of application that uploaded this file. </description>
+ </param>
+ </function>
+
+ <function name="GetFilePath" messagetype="request">
+ <description>This request is sent to retrieve a file path from the HMI.</description>
+ <param name="fileName" type="String" maxlength="255" mandatory="true">
+ <description>File name that should be retrieved.</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="false">
+ <description>Selected file type.</description>
+ </param>
+ <param name="appServiceId" type="String" mandatory="false">
+ <description> ID of the service that should have uploaded the requested file.</description>
</param>
</function>
+ <function name="GetFilePath" messagetype="response">
+ <description> HMI handles the request internally and returns the file path with the response.</description>
+ <param name="filePath" type="String" mandatory="false">
+ <description>Path to file in hmi</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="false">
+ <description>Selected file type.</description>
+ </param>
+ </function>
+
<!-- Policies -->
<function name="GetSystemInfo" messagetype="request">
<description>Request from SDL to HMI to obtain information about head unit system.</description>
@@ -3771,6 +4312,12 @@
<description>Must be 'true' - when the event is started on HMI. Must be 'false' when the event is ended on HMI</description>
</param>
</function>
+ <function name="OnSystemCapabilityUpdated" messagetype="notification">
+ <description>A notification to inform the HMI that a specific system capability has changed.</description>
+ <param name="systemCapability" type="Common.SystemCapability" mandatory="true">
+ <description>The system capability that has been updated</description>
+ </param>
+ </function>
</interface>
<interface name="VR" version="1.1.0" date="2017-04-27">
@@ -4172,9 +4719,10 @@
<function name="DeleteSubMenu" messagetype="response">
</function>
<function name="ShowAppMenu" messagetype="request">
- <description>Request from SDL to show an apps menu or a corresponding sub-menu.</description>
+ <description>Request from SDL to show an app's menu or a corresponding sub-menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="false">
- <description>If ommited the HMI opens the apps menu.
+ <description>
+ If ommited the HMI opens the app's menu.
If set to a sub-menu ID the HMI opens the corresponding sub-menu previously added using `AddSubMenu`.
</description>
</param>
@@ -4807,7 +5355,7 @@
</interface>
-<interface name="VehicleInfo" version="2.0.0" date="2018-09-05">
+<interface name="VehicleInfo" version="2.1.0" date="2019-03-18">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
</function>
@@ -4963,6 +5511,10 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4980,6 +5532,7 @@
<description>Information related to the MyKey feature</description>
</param>
<!-- / Ford Specific Data Items -->
+
</function>
<function name="SubscribeVehicleData" messagetype="response">
<param name="gps" type="Common.VehicleDataResult" mandatory="false">
@@ -5051,6 +5604,10 @@
<param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Common.VehicleDataResult" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -5068,6 +5625,7 @@
<description>Information related to the MyKey feature</description>
</param>
<!-- / Ford Specific Data Items -->
+
</function>
<function name="UnsubscribeVehicleData" messagetype="request">
<description>
@@ -5145,6 +5703,10 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -5162,6 +5724,7 @@
<description>Information related to the MyKey feature</description>
</param>
<!-- / Ford Specific Data Items -->
+
</function>
<function name="UnsubscribeVehicleData" messagetype="response">
<param name="gps" type="Common.VehicleDataResult" mandatory="false">
@@ -5233,6 +5796,10 @@
<param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Common.VehicleDataResult" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -5250,6 +5817,7 @@
<description>Information related to the MyKey feature</description>
</param>
<!-- / Ford Specific Data Items -->
+
</function>
<function name="GetVehicleData" messagetype="request">
<description>Non periodic vehicle data read request.</description>
@@ -5325,6 +5893,11 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -5340,6 +5913,8 @@
<param name="myKey" type="Boolean" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
+
</function>
<function name="GetVehicleData" messagetype="response">
<param name="gps" type="Common.GPSData" mandatory="false">
@@ -5414,6 +5989,11 @@
<param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="String" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -5429,6 +6009,8 @@
<param name="myKey" type="Common.MyKey" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
+
</function>
<function name="OnVehicleData" messagetype="notification">
<description>Callback for the periodic and non periodic vehicle data read function.</description>
@@ -5501,6 +6083,11 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="cloudAppVehicleID" type="String" mandatory="false">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -5516,6 +6103,8 @@
<param name="myKey" type="Common.MyKey" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
+
</function>
</interface>
@@ -5732,7 +6321,7 @@
<description>The module data to retrieve from the vehicle for that type</description>
</param>
<param name="subscribe" type="Boolean" mandatory="false">
- <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
+ <description>If subscribe is true, the head unit will send OnInteriorVehicleData notifications for the module type</description>
</param>
</function>
@@ -5741,7 +6330,7 @@
</param>
<param name="isSubscribed" type="Boolean" mandatory="false" >
<description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send OnInteriorVehicleData notifications for the moduleDescription.
if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
</param>
</function>
@@ -5793,4 +6382,124 @@
</function>
</interface>
+
+<interface name="AppService" version="1.0.0" date="2019-03-18">
+ <description>Interface used for interacting with app services as a producer or consumer</description>
+ <function name="PublishAppService" messagetype="request">
+ <description>Registers a service offered by this app on the module</description>
+
+ <param name="appServiceManifest" type="Common.AppServiceManifest" mandatory="true">
+ <description> The manifest of the service that wishes to be published.</description>
+ </param>
+ </function>
+
+ <function name="PublishAppService" messagetype="response">
+ <description>Response to the request to register a service offered by this app on the module</description>
+
+ <param name="appServiceRecord" type="Common.AppServiceRecord" mandatory="false">
+ <description> If the request was successful, this object will be the current status of the service record for the published service. This will include the Core supplied service ID.</description>
+ </param>
+ </function>
+
+ <function name="OnAppServiceData" messagetype="notification">
+ <description>This notification includes the data that is updated from the specific service. HMI->SDL if the HMI is a producer, SDL->HMI if the HMI is a consumer</description>
+
+ <param name="serviceData" type="Common.AppServiceData" mandatory="true"/>
+ </function>
+
+ <function name="GetAppServiceData" messagetype="request">
+ <description> This request asks the module for current data related to the specific service. It also includes an option to subscribe to that service for future updates</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+
+ <param name="subscribe" type="Boolean" mandatory="false">
+ <description> If true, the consumer is requesting to subscribe to all future updates from the service publisher. If false, the consumer doesn't wish to subscribe and should be unsubscribed if it was previously subscribed.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceData" messagetype="response">
+ <description> This response includes the data that was requested from the specific service</description>
+ <param name="serviceData" type="Common.AppServiceData" mandatory="false"/>
+ </function>
+
+ <function name="PerformAppServiceInteraction" messagetype="request">
+ <param name="serviceUri" type="String" mandatory="true">
+ <description>Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this URI is correct.</description>
+ </param>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The service ID that the app consumer wishes to send this URI.</description>
+ </param>
+
+ <param name="originApp" type="String" mandatory="false">
+ <description>This string is the appID of the app requesting the app service provider take the specific action. This will automatically be set by SDL Core in requests originating from the HMI</description>
+ </param>
+
+ <param name="requestServiceActive" type="Boolean" mandatory="false">
+ <description>This flag signals the requesting consumer would like this service to become the active primary service of the destination's type.</description>
+ </param>
+ </function>
+
+ <function name="PerformAppServiceInteraction" messagetype="response">
+ <param name="serviceSpecificResult" type="String" mandatory="false">
+ <description>The service can provide specific result strings to the consumer through this param.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceRecords" messagetype="request">
+ <param name="serviceType" type="String" mandatory="false">
+ <description>If included, only service records of supplied type will be returned in response. If not included, all service records for all types will be returned. See Common.AppServiceType.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceRecords" messagetype="response">
+ <param name="serviceRecords" type="Common.AppServiceRecord" array="true" mandatory="false">
+ <description>All app service records of requested type.</description>
+ </param>
+ </function>
+
+ <function name="AppServiceActivation" messagetype="request">
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The ID of the service that should have an activation event take place on</description>
+ </param>
+ <param name="activate" type="Boolean" mandatory="true">
+ <description>True if the service is to be activated. False if the app is to be deactivated</description>
+ </param>
+ <param name="setAsDefault" type="Boolean" mandatory="false">
+ <description>True if the service is to be the default service of this type. False if the app is not to be the default</description>
+ </param>
+ </function>
+
+ <function name="AppServiceActivation" messagetype="response">
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The ID of the service that was requested to have an activation event take place</description>
+ </param>
+ <param name="activate" type="Boolean" mandatory="true">
+ <description>True if the service was activated. False if the app was deactivated or unable to be activated</description>
+ </param>
+ <param name="setAsDefault" type="Boolean" mandatory="false">
+ <description>True if the service was set to the default service of this type. False if the app was not to be the default</description>
+ </param>
+ </function>
+
+ <function name="GetActiveServiceConsent" messagetype="request">
+ <description>
+ SDL->HMI. HMI is expected to prompt the user for permission for the app service to take over as the active service.
+ </description>
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The ID of the service to be activated</description>
+ </param>
+ </function>
+
+ <function name="GetActiveServiceConsent" messagetype="response">
+ <param name="activate" type="Boolean" mandatory="true">
+ <description>
+ "true" - If the driver grants permission for the app service to take over as the active service.
+ "false" - If the driver denies permission for the app service to take over as the active service.
+ </description>
+ </param>
+ </function>
+</interface>
</interfaces>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 30b799f889..59af0f6d6c 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-<interface name="SmartDeviceLink RAPI" version="5.0.0" minVersion="1.0" date="2018-10-03">
+<interface name="SmartDeviceLink RAPI" version="6.0.0" minVersion="1.0" date="2019-03-19">
<enum name="Result" internal_scope="base" since="1.0">
<element name="SUCCESS">
<description>The request succeeded</description>
@@ -542,7 +542,37 @@
<element name="VEHICLEDATA_FUELRANGE" since="5.0" />
<element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
<element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
+ <element name="VEHICLEDATA_CLOUDAPPVEHICLEID" since="5.1"/>
</enum>
+
+ <enum name="HybridAppPreference" since="5.1">
+ <description>Enumeration for the user's preference of which app type to use when both are available</description>
+ <element name="MOBILE" />
+ <element name="CLOUD" />
+ <element name="BOTH" />
+ </enum>
+
+ <struct name="CloudAppProperties" since="5.1">
+ <param name="nicknames" type="String" minlength="0" maxlength="100" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>An array of app names a cloud app is allowed to register with. If included in a SetCloudAppProperties request, this value will overwrite the existing "nicknames" field in the app policies section of the policy table.</description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true"/>
+ <param name="enabled" type="Boolean" mandatory="false">
+ <description>If true, cloud app will be included in HMI RPC UpdateAppList</description>
+ </param>
+ <param name="authToken" type="String" maxlength="65535" mandatory="false">
+ <description>Used to authenticate websocket connection on app activation</description>
+ </param>
+ <param name="cloudTransportType" type="String" maxlength="100" mandatory="false">
+ <description>Specifies the connection type Core should use</description>
+ </param>
+ <param name="hybridAppPreference" type="HybridAppPreference" mandatory="false">
+ <description>Specifies the user preference to use the cloud app version or mobile app version when both are available</description>
+ </param>
+ <param name="endpoint" type="String" maxlength="65535" mandatory="false">
+ <description>Specifies the endpoint which Core will attempt to connect to when this app is selected</description>
+ </param>
+ </struct>
<enum name="ButtonName" since="1.0">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
@@ -868,7 +898,7 @@
</enum>
<enum name="TBTState" since="2.0">
- <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
+ <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
<element name="ROUTE_UPDATE_REQUEST" />
<element name="ROUTE_ACCEPTED" />
<element name="ROUTE_REFUSED" />
@@ -937,7 +967,7 @@
<description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
</element>
</enum>
-
+
<enum name="AudioStreamingIndicator" since="5.0">
<element name="PLAY_PAUSE">
<description>
@@ -1984,6 +2014,13 @@
<param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
</history>
</param>
+ <param name="shifted" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ False, if the GPS data is raw and un-shifted.
+ If not provided, then value is assumed False.
+ </description>
+ </param>
</struct>
<struct name="VehicleDataResult" since="2.0">
@@ -2411,6 +2448,7 @@
<element name="MEDIA" />
<element name="FOTA" />
<element name="OEM_SPECIFIC" since="5.0" />
+ <element name="ICON_URL" since="5.1" />
</enum>
<enum name="AppHMIType" since="2.0">
@@ -2554,7 +2592,7 @@
</enum>
<enum name="FunctionID" internal_scope="base" since="1.0">
- <description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
+ <description>Enumeration linking function names with function IDs in SmartDeviceLink protocol. Assumes enumeration starts at value 0.</description>
<element name="RESERVED" value="0" since="1.0" />
<!--
Base Request / Response RPCs
@@ -2608,7 +2646,14 @@
<element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
<element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
<element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
- <element name="ShowAppMenuID" value="50" hexvalue="32" since="5.0" />
+ <element name="SetCloudAppPropertiesID" value="50" hexvalue="32" since="5.1" />
+ <element name="GetCloudAppPropertiesID" value="51" hexvalue="33" since="5.1" />
+ <element name="PublishAppServiceID" value="52" hexvalue="34" since="5.1" />
+ <element name="GetAppServiceDataID" value="53" hexvalue="35" since="5.1" />
+ <element name="GetFileID" value="54" hexvalue="36" since="5.1" />
+ <element name="PerformAppServiceInteractionID" value="55" hexvalue="37" since="5.1" />
+ <element name="CloseApplicationID" value="58" hexvalue="3A" since="6.0" />
+ <element name="ShowAppMenuID" value="59" hexvalue="3B" since="6.0" />
<!--
Base Notifications
@@ -2633,6 +2678,8 @@
<element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
<element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
<element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
+ <element name="OnAppServiceDataID" value="32786" hexvalue="8012" since="5.1" />
+ <element name="OnSystemCapabilityUpdatedID" value="32787" hexvalue="8013" since="5.1" />
<!--
Ford Specific Request / Response RPCs
@@ -2790,6 +2837,7 @@
<element name="PHONE_CALL"/>
<element name="VIDEO_STREAMING"/>
<element name="REMOTE_CONTROL"/>
+ <element name="APP_SERVICES" since="5.1"/>
</enum>
<struct name="NavigationCapability" since="4.5">
@@ -3061,16 +3109,21 @@
<param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
<description> True if the hd radio is on, false if the radio is off</description>
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
- <description>number of HD sub-channels if available</description>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" deprecated="true" since="6.0">
+ <description>Number of HD sub-channels if available</description>
<history>
<param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.0"/>
</history>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <param name="availableHdChannels" type="Integer" minvalue="0" maxvalue="7" array="true" minsize="0" maxsize="8" mandatory="false" since="6.0">
+ <description>The list of available HD sub-channel indexes. Empty list means no Hd channel is available. Read-only. </description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="0" maxvalue="7" mandatory="false" since="6.0">
<description>Current HD sub-channel if available</description>
<history>
<param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.0"/>
</history>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -3121,6 +3174,8 @@
<param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
<description>value false means disabled, value true means enabled.</description>
</param>
+ <param name="climateEnable" type="Boolean" mandatory="false" since="6.0">
+ </param>
</struct>
<struct name="RadioControlCapabilities" since="4.5">
@@ -3162,11 +3217,20 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false">
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" deprecated="true" since="6.0">
<description>
Availability of the getting the number of available HD channels.
True: Available, False: Not Available, Not present: Not Available.
</description>
+ <history>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" since="4.5" until="6.0"/>
+ </history>
+ </param>
+ <param name="availableHdChannelsAvailable" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ Availability of the list of available HD sub-channel indexes.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
</param>
<param name="stateAvailable" type="Boolean" mandatory="false">
<description>
@@ -3307,6 +3371,12 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="climateEnableAvailable" type="Boolean" mandatory="false" since="6.0">
+ <description>
+ Availability of the control of enable/disable climate control.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<struct name="EqualizerSettings" since="5.0">
@@ -3603,24 +3673,6 @@
</struct>
<!-- End of RC -->
- <struct name="SystemCapability" since="4.5">
- <description>The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
- <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
- <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included.</description>
- </param>
- <param name="navigationCapability" type="NavigationCapability" mandatory="false">
- <description>Describes extended capabilities for onboard navigation system </description>
- </param>
- <param name="phoneCapability" type="PhoneCapability" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- </struct>
<enum name="MetadataType" since="4.5">
<element name="mediaTitle">
@@ -3700,7 +3752,435 @@
<description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
</param>
</struct>
+
+ <!-- App Services -->
+
+ <enum name="AppServiceType" platform="documentation" since="5.1">
+ <element name="MEDIA"/>
+ <element name="WEATHER"/>
+ <element name="NAVIGATION"/>
+ </enum>
+
+ <struct name="MediaServiceManifest" since="5.1">
+ </struct>
+
+ <enum name="MediaType" since="5.1">
+ <element name="MUSIC"/>
+ <element name="PODCAST"/>
+ <element name="AUDIOBOOK"/>
+ <element name="OTHER"/>
+ </enum>
+
+ <struct name="MediaServiceData" since="5.1">
+ <description>This data is related to what a media service should provide</description>
+
+ <param name="mediaType" type="MediaType" mandatory="false">
+ <description>The type of the currently playing or paused track.</description>
+ </param>
+
+ <param name="mediaTitle" type="String" mandatory="false">
+ <description>
+ Music: The name of the current track
+ Podcast: The name of the current episode
+ Audiobook: The name of the current chapter
+ </description>
+ </param>
+
+ <param name="mediaArtist" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album artist
+ Podcast: The provider of the podcast (hosts, network, company)
+ Audiobook: The book author's name
+ </description>
+ </param>
+
+ <param name="mediaAlbum" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album
+ Podcast: The name of the current podcast show
+ Audiobook: The name of the current book
+ </description>
+ </param>
+
+ <param name="playlistName" type="String" mandatory="false">
+ <description>
+ Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
+ Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null
+ Audiobook: Likely not applicable, possibly a collection or "playlist" of books
+ </description>
+ </param>
+
+ <param name="isExplicit" type="Boolean" mandatory="false">
+ <description> Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content</description>
+ </param>
+
+ <param name="trackPlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the track in seconds
+ Podcast: The current progress of the episode in seconds
+ Audiobook: The current progress of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="trackPlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the track in seconds
+ Podcast: The total duration of the episode in seconds
+ Audiobook: The total duration of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the playback queue in seconds
+ Podcast: The current progress of the playback queue in seconds
+ Audiobook: The current progress of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the playback queue in seconds
+ Podcast: The total duration of the playback queue in seconds
+ Audiobook: The total duration of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queueCurrentTrackNumber" type="Integer" mandatory="false">
+ <description>
+ Music: The current number (1 based) of the track in the playback queue
+ Podcast: The current number (1 based) of the episode in the playback queue
+ Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)
+ </description>
+ </param>
+
+ <param name="queueTotalTrackCount" type="Integer" mandatory="false">
+ <description>
+ Music: The total number of tracks in the playback queue
+ Podcast: The total number of episodes in the playback queue
+ Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
+ </description>
+ </param>
+ <param name="mediaImage" type="Image" mandatory="false" since="6.0">
+ <description>
+ Music: The album art of the current track
+ Podcast: The podcast or chapter artwork of the current podcast episode
+ Audiobook: The book or chapter artwork of the current audiobook
+ </description>
+ </param>
+ </struct>
+
+ <struct name="WeatherServiceManifest" since="5.1">
+ <param name="currentForecastSupported" type="Boolean" mandatory="false"/>
+ <param name="maxMultidayForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxHourlyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxMinutelyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="weatherForLocationSupported" type="Boolean" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherAlert" since="5.1">
+ <param name="title" type="String" mandatory="false"/>
+ <param name="summary" type="String" mandatory="false"/>
+ <param name="expires" type="DateTime" mandatory="false"/>
+ <param name="regions" type="String" array="true" minsize="1" maxsize="99" mandatory="false"/>
+ <param name="severity" type="String" mandatory="false"/>
+ <param name="timeIssued" type="DateTime" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherData" since="5.1">
+ <param name="currentTemperature" type="Temperature" mandatory="false"/>
+ <param name="temperatureHigh" type="Temperature" mandatory="false"/>
+ <param name="temperatureLow" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperature" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperatureHigh" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperatureLow" type="Temperature" mandatory="false"/>
+ <param name="weatherSummary" type="String" mandatory="false"/>
+ <param name="time" type="DateTime" mandatory="false"/>
+ <param name="humidity" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage humidity </description>
+ </param>
+ <param name="cloudCover" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage cloud cover </description>
+ </param>
+ <param name="moonPhase" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage of the moon seen, e.g. 0 = no moon, 0.25 = quarter moon </description>
+ </param>
+
+ <param name="windBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="windGust" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+ <param name="windSpeed" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+
+ <param name="nearestStormBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="nearestStormDistance" type="Integer" mandatory="false">
+ <description> In km </description>
+ </param>
+ <param name="precipAccumulation" type="Float" mandatory="false">
+ <description> cm </description>
+ </param>
+ <param name="precipIntensity" type="Float" mandatory="false">
+ <description> cm of water per hour </description>
+ </param>
+ <param name="precipProbability" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage chance </description>
+ </param>
+ <param name="precipType" type="String" mandatory="false">
+ <description> e.g. "rain", "snow", "sleet", "hail" </description>
+ </param>
+ <param name="visibility" type="Float" mandatory="false">
+ <description> In km </description>
+ </param>
+
+ <param name="weatherIcon" type="Image" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherServiceData" since="5.1">
+ <description> This data is related to what a weather service would provide</description>
+ <param name="location" type="LocationDetails" mandatory="true"/>
+ <param name="currentForecast" type="WeatherData" mandatory="false"/>
+ <param name="minuteForecast" type="WeatherData" array="true" minsize="15" maxsize="60" mandatory="false"/>
+ <param name="hourlyForecast" type="WeatherData" array="true" minsize="1" maxsize="96" mandatory="false"/>
+ <param name="multidayForecast" type="WeatherData" array="true" minsize="1" maxsize="30" mandatory="false"/>
+ <param name="alerts" type="WeatherAlert" array="true" minsize="1" maxsize="10" mandatory="false">
+ <description> This array should be ordered with the first object being the current day</description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceManifest" since="5.1">
+ <param name="acceptsWayPoints" type="Boolean" mandatory="false">
+ <description> Informs the subscriber if this service can actually accept way points. </description>
+ </param>
+ </struct>
+
+ <enum name="NavigationAction" since="5.1">
+ <element name="TURN">
+ <description> Using this action plus a supplied direction can give the type of turn. </description>
+ </element>
+ <element name="EXIT"/>
+ <element name="STAY"/>
+ <element name="MERGE"/>
+ <element name="FERRY"/>
+ <element name="CAR_SHUTTLE_TRAIN"/>
+ <element name="WAYPOINT"/>
+ </enum>
+
+ <enum name="NavigationJunction" since="5.1">
+ <element name="REGULAR">
+ <description> A junction that represents a standard intersection with a single road crossing another. </description>
+ </element>
+ <element name="BIFURCATION">
+ <description> A junction where the road splits off into two paths; a fork in the road. </description>
+ </element>
+ <element name="MULTI_CARRIAGEWAY">
+ <description> A junction that has multiple intersections and paths. </description>
+ </element>
+ <element name="ROUNDABOUT">
+ <description> A junction where traffic moves in a single direction around a central, non-traversable point to reach one of the connecting roads. </description>
+ </element>
+ <element name="TRAVERSABLE_ROUNDABOUT">
+ <description> Similar to a roundabout, however the center of the roundabout is fully traversable. Also known as a mini-roundabout. </description>
+ </element>
+ <element name="JUGHANDLE">
+ <description> A junction where lefts diverge to the right, then curve to the left, converting a left turn to a crossing maneuver. </description>
+ </element>
+ <element name="ALL_WAY_YIELD">
+ <description> Multiple way intersection that allows traffic to flow based on priority; most commonly right of way and first in, first out. </description>
+ </element>
+ <element name="TURN_AROUND">
+ <description> A junction designated for traffic turn arounds. </description>
+ </element>
+ </enum>
+
+ <enum name="Direction" since="5.1">
+ <element name="LEFT"/>
+ <element name="RIGHT"/>
+ </enum>
+
+ <struct name="NavigationInstruction" since="5.1">
+ <param name="locationDetails" type="LocationDetails" mandatory="true"/>
+
+ <param name="action" type="NavigationAction" mandatory="true"/>
+
+ <param name="eta" type="DateTime" mandatory="false"/>
+
+ <param name="bearing" type="Integer" minvalue="0" maxvalue="359" mandatory="false">
+ <description> The angle at which this instruction takes place. For example, 0 would mean straight, less than 45 is bearing right, greater than 135 is sharp right, between 45 and 135 is a regular right, and 180 is a U-Turn, etc. </description>
+ </param>
+
+ <param name="junctionType" type="NavigationJunction" mandatory="false"/>
+
+ <param name="drivingSide" type="Direction" mandatory="false">
+ <description> Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this will determine which direction the turn should take place. </description>
+ </param>
+
+ <param name="details" type="String" mandatory="false">
+ <description> This is a string representation of this instruction, used to display instructions to the users. This is not intended to be read aloud to the users, see the param prompt in NavigationServiceData for that. </description>
+ </param>
+
+ <param name="image" type="Image" mandatory="false">
+ <description> An image representation of this instruction. </description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceData" since="5.1">
+ <description> This data is related to what a navigation service would provide.</description>
+
+ <param name="timeStamp" type="DateTime" mandatory="true">
+ <description> This is the timestamp of when the data was generated. This is to ensure any time or distance given in the data can accurately be adjusted if necessary. </description>
+ </param>
+
+ <param name="origin" type="LocationDetails" mandatory="false"/>
+ <param name="destination" type="LocationDetails" mandatory="false"/>
+ <param name="destinationETA" type="DateTime" mandatory="false"/>
+
+ <param name="instructions" type="NavigationInstruction" array="true" mandatory="false">
+ <description> This array should be ordered with all remaining instructions. The start of this array should always contain the next instruction.</description>
+ </param>
+
+ <param name="nextInstructionETA" type="DateTime" mandatory="false"/>
+ <param name="nextInstructionDistance" type="Float" mandatory="false">
+ <description>The distance to this instruction from current location. This should only be updated ever .1 unit of distance. For more accuracy the consumer can use the GPS location of itself and the next instruction. </description>
+ </param>
+ <param name="nextInstructionDistanceScale" type="Float" mandatory="false">
+ <description>Distance till next maneuver (starting from) from previous maneuver.</description>
+ </param>
+
+ <param name="prompt" type="String" mandatory="false">
+ <description>This is a prompt message that should be conveyed to the user through either display or voice (TTS). This param will change often as it should represent the following: approaching instruction, post instruction, alerts that affect the current navigation session, etc.</description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceManifest" since="5.1">
+ <description> This manifest contains all the information necessary for the service to be published, activated, and consumers able to interact with it </description>
+
+ <param name="serviceName" type="String" mandatory="false">
+ <description> Unique name of this service </description>
+ </param>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description> The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core. </description>
+ </param>
+
+ <param name="serviceIcon" type="Image" mandatory="false">
+ <description> The icon to be associated with this service. Most likely the same as the appIcon.</description>
+ </param>
+
+ <param name="allowAppConsumers" type="Boolean" mandatory="false" defvalue="false">
+ <description> If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false. </description>
+ </param>
+
+ <param name="rpcSpecVersion" type="SyncMsgVersion" mandatory="false">
+ <description> This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable. </description>
+ </param>
+
+ <param name="handledRPCs" type="Integer" array="true" mandatory="false">
+ <description> This field contains the Function IDs for the RPCs that this service intends to handle correctly. This means the service will provide meaningful responses. </description>
+ </param>
+
+ <param name="mediaServiceManifest" type="MediaServiceManifest" mandatory="false"/>
+ <param name="weatherServiceManifest" type="WeatherServiceManifest" mandatory="false"/>
+ <param name="navigationServiceManifest" type="NavigationServiceManifest" mandatory="false"/>
+ </struct>
+
+ <struct name="AppServiceRecord" since="5.1">
+ <description> This is the record of an app service publisher that the module has. It should contain the most up to date information including the service's active state</description>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description> A unique ID tied to this specific service record. The ID is supplied by the module that services publish themselves. </description>
+ </param>
+
+ <param name="serviceManifest" type="AppServiceManifest" mandatory="true">
+ <description> Manifest for the service that this record is for.</description>
+ </param>
+
+ <param name="servicePublished" type="Boolean" mandatory="true">
+ <description> If true, the service is published and available. If false, the service has likely just been unpublished, and should be considered unavailable.</description>
+ </param>
+
+ <param name="serviceActive" type="Boolean" mandatory="true">
+ <description> If true, the service is the active primary service of the supplied service type. It will receive all potential RPCs that are passed through to that service type. If false, it is not the primary service of the supplied type. See servicePublished for its availability. </description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceData" since="5.1">
+ <description> Contains all the current data of the app service. The serviceType will link to which of the service data objects are included in this object (e.g. if the service type is MEDIA, the mediaServiceData param should be included).</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+ <param name="serviceID" type="String" mandatory="true"/>
+
+ <param name="mediaServiceData" type="MediaServiceData" mandatory="false"/>
+ <param name="weatherServiceData" type="WeatherServiceData" mandatory="false"/>
+ <param name="navigationServiceData" type="NavigationServiceData" mandatory="false"/>
+ </struct>
+
+ <enum name="ServiceUpdateReason" since="5.1">
+ <element name="PUBLISHED">
+ <description> The service has just been published with the module and once activated to the primary service of its type, it will be ready for possible consumption.</description>
+ </element>
+ <element name="REMOVED">
+ <description> The service has just been unpublished with the module and is no longer accessible</description>
+ </element>
+ <element name="ACTIVATED">
+ <description> The service is activated as the primary service of this type. All requests dealing with this service type will be handled by this service.</description>
+ </element>
+ <element name="DEACTIVATED">
+ <description> The service has been deactivated as the primary service of its type</description>
+ </element>
+ <element name="MANIFEST_UPDATE">
+ <description> The service has updated its manifest. This could imply updated capabilities</description>
+ </element>
+ </enum>
+
+ <struct name="AppServiceCapability" since="5.1">
+ <param name="updateReason" type="ServiceUpdateReason" mandatory="false">
+ <description> Only included in OnSystemCapabilityUpdated. Update reason for service record.</description>
+ </param>
+ <param name="updatedAppServiceRecord" type="AppServiceRecord" mandatory="true">
+ <description>Service record for a specific app service provider</description>
+ </param>
+ </struct>
+
+ <struct name="AppServicesCapabilities" since="5.1">
+ <description>Capabilities of app services including what service types are supported and the current state of services.</description>
+ <param name="appServices" type="AppServiceCapability" array="true" mandatory="false">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
+
+ <!-- End App Services -->
+
+ <struct name="SystemCapability" since="4.5">
+ <description>The systemCapabilityType identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other param included.</description>
+ </param>
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ <description>Describes extended capabilities for onboard navigation system </description>
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="appServicesCapabilities" type="AppServicesCapabilities" mandatory="false" since="5.1">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
+
<!-- Requests/Responses -->
<function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
@@ -3977,7 +4457,7 @@
<param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
VR Help Items.
- If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
+ If omitted on supported displays, the default SmartDeviceLink VR help / What Can I Say? screen shall be used.
If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
If omitted and a vrHelpTitle is provided, the request will be rejected.
</description>
@@ -4227,16 +4707,17 @@
</function>
- <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="request" since="5.0">
+ <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="request" since="6.0">
<description>Shows the built in menu view</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="false">
- <description>If omitted the HMI opens the apps menu.
+ <description>
+ If omitted the HMI opens the app's menu.
If set to a sub-menu ID the HMI opens the corresponding sub-menu previously added using `AddSubMenu`.
</description>
</param>
</function>
- <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="response" since="5.0">
+ <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="response" since="6.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4970,6 +5451,9 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -5085,6 +5569,9 @@
<param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="VehicleDataResult" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -5178,6 +5665,9 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -5291,6 +5781,9 @@
<param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="VehicleDataResult" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -5387,6 +5880,9 @@
<param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -5504,6 +6000,9 @@
<param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
+ <param name="cloudAppVehicleID" type="String" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
@@ -6044,7 +6543,68 @@
<description>Provides additional human readable info regarding the result.</description>
</param>
</function>
-
+
+ <function name="GetFile" functionID="GetFileID" messagetype="request" since="5.1">
+ <description>This request is sent to the module to retrieve a file</description>
+ <param name="fileName" type="String" maxlength="255" mandatory="true">
+ <description>File name that should be retrieved</description>
+ </param>
+ <param name="appServiceId" type="String" mandatory="false">
+ <description>ID of the service that should have uploaded the requested file.</description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Selected file type.</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional length in bytes for resuming partial data chunks
+ If offset is set to 0, then length is the total length of the file to be retrieved
+ </description>
+ </param>
+ </function>
+
+ <function name="GetFile" functionID="GetFileID" messagetype="response" since="5.1">
+ <description>This response includes the data that is requested from the specific service</description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="FILE_NOT_FOUND"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <!-- Specific response data -->
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks if offset is set to 0, then length is the total length of the file to be downloaded</description>
+ </param>
+
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>File type that is being sent in response.</description>
+ </param>
+
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false">
+ <description>Additional CRC32 checksum to protect data integrity up to 512 Mbits</description>
+ </param>
+ </function>
+
<function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
<description>
Used to delete a file resident on the module in the app's local cache.
@@ -6426,8 +6986,8 @@
</param>
<param name="subscribe" type="Boolean" mandatory="false" since="4.5.1">
<description>
- If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduleType.
- If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is true, the head unit will register OnInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is false, the head unit will unregister OnInteriorVehicleData notifications for the requested moduleType.
If subscribe is not included, the subscription status of the app for the requested moduleType will remain unchanged.
</description>
<history>
@@ -6585,6 +7145,9 @@
<param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
<description>The type of system capability to get more information on</description>
</param>
+ <param name="subscribe" type="Boolean" mandatory="false" since="5.1">
+ <description>Flag to subscribe to updates of the supplied service capability type. If true, the requester will be subscribed. If false, the requester will not be subscribed and be removed as a subscriber if it was previously subscribed.</description>
+ </param>
</function>
<function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
@@ -6637,7 +7200,201 @@
<element name="GENERIC_ERROR"/>
</param>
</function>
-
+
+ <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="request" since="5.1">
+ <description>
+ RPC used to enable/disable a cloud application and set its cloud-related policy properties
+ </description>
+ <param name="properties" type="CloudAppProperties" mandatory="true">
+ <description> The new cloud application properties </description>
+ </param>
+ </function>
+
+ <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="response" since="5.1">
+ <description>The response to SetCloudAppProperties</description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="GetCloudAppProperties" functionID="GetCloudAppPropertiesID" messagetype="request" since="5.1">
+ <description>
+ RPC used to get the current properties of a cloud application
+ </description>
+ <param name="appID" type="String" maxlength="100" mandatory="true"></param>
+ </function>
+
+ <function name="GetCloudAppProperties" functionID="GetCloudAppPropertiesID" messagetype="response" since="5.1">
+ <description>The response to GetCloudAppProperties</description>
+ <param name="properties" type="CloudAppProperties" mandatory="false">
+ <description> The requested cloud application properties </description>
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PublishAppService" functionID="PublishAppServiceID" messagetype="request" since="5.1">
+ <description>Registers a service offered by this app on the module</description>
+
+ <param name="appServiceManifest" type="AppServiceManifest" mandatory="true">
+ <description> The manifest of the service that wishes to be published.</description>
+ </param>
+ </function>
+
+ <function name="PublishAppService" functionID="PublishAppServiceID" messagetype="response" since="5.1">
+ <description>Response to the request to register a service offered by this app on the module</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="appServiceRecord" type="AppServiceRecord" mandatory="false">
+ <description> If the request was successful, this object will be the current status of the service record for the published service. This will include the Core supplied service ID.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceData" functionID="GetAppServiceDataID" messagetype="request" since="5.1">
+ <description> This request asks the module for current data related to the specific service. It also includes an option to subscribe to that service for future updates</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+
+ <param name="subscribe" type="Boolean" mandatory="false">
+ <description> If true, the consumer is requesting to subscribe to all future updates from the service publisher. If false, the consumer doesn't wish to subscribe and should be unsubscribed if it was previously subscribed.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceData" functionID="GetAppServiceDataID" messagetype="response" since="5.1">
+ <description> This response includes the data that was requested from the specific service</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <!-- Specific response data -->
+ <param name="serviceData" type="AppServiceData" mandatory="false"/>
+ </function>
+
+ <function name="PerformAppServiceInteraction" functionID="PerformAppServiceInteractionID" messagetype="request" since="5.1">
+ <param name="serviceUri" type="String" mandatory="true">
+ <description>Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this URI is correct.</description>
+ </param>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The service ID that the app consumer wishes to send this URI.</description>
+ </param>
+
+ <param name="originApp" type="String" mandatory="true">
+ <description>This string is the appID of the app requesting the app service provider take the specific action.</description>
+ </param>
+
+ <param name="requestServiceActive" type="Boolean" mandatory="false">
+ <description>This flag signals the requesting consumer would like this service to become the active primary service of the destination's type.</description>
+ </param>
+ </function>
+
+ <function name="PerformAppServiceInteraction" functionID="PerformAppServiceInteractionID" messagetype="response" since="5.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result. All results will be available for this response.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="serviceSpecificResult" type="String" mandatory="false">
+ <description>The service can provide specific result strings to the consumer through this param.</description>
+ </param>
+ </function>
+
+ <function name="CloseApplication" functionID="CloseApplicationID" messagetype="request" since="6.0">
+ <description>Request from the application to exit the foreground and enter HMI_NONE.</description>
+ </function>
+
+ <function name="CloseApplication" functionID="CloseApplicationID" messagetype="response" since="6.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <element name="SUCCESS"/>
+ <element name="DISALLOWED"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
@@ -6763,7 +7520,10 @@
<param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
-
+ <param name="cloudAppVehicleID" type="String" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
<!-- Ford Specific Vehicle Data -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -6927,6 +7687,19 @@
<description>Contains a list (zero or more) of module types that are free to access for the application.</description>
</param>
</function>
+
+ <function name="OnAppServiceData" functionID="OnAppServiceDataID" messagetype="notification" since="5.1">
+ <description>This notification includes the data that is updated from the specific service</description>
+
+ <param name="serviceData" type="AppServiceData" mandatory="true"/>
+ </function>
+
+ <function name="OnSystemCapabilityUpdated" functionID="OnSystemCapabilityUpdatedID" messagetype="notification" since="5.1">
+ <description>A notification to inform the connected device that a specific system capability has changed.</description>
+ <param name="systemCapability" type="SystemCapability" mandatory="true">
+ <description>The system capability that has been updated</description>
+ </param>
+ </function>
<!-- ~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific APIs -->
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index 9010d15dc0..6a582b4e3b 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -50,6 +50,7 @@ include_directories(
${POLICY_PATH}/include/
${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
index 54d898b7b2..cd594ee8b1 100644
--- a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
@@ -34,10 +34,10 @@
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
#include <map>
-#include "protocol/common.h"
+#include "connection_handler/connection_handler_impl.h"
#include "media_manager/media_adapter_impl.h"
+#include "protocol/common.h"
#include "utils/threads/thread_delegate.h"
-#include "connection_handler/connection_handler_impl.h"
namespace protocol_handler {
class SessionObserver;
diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
index a246e468b7..cb0ea8aa11 100644
--- a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
@@ -34,11 +34,11 @@
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
#include <string>
-#include "utils/macro.h"
-#include "utils/threads/thread_delegate.h"
+#include "smart_objects/smart_object.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
-#include "smart_objects/smart_object.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
namespace application_manager {
class ApplicationManager;
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
index c615195f94..643657951b 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
@@ -35,6 +35,7 @@
#include <string>
#include "media_manager/media_adapter_listener.h"
+#include "utils/macro.h"
namespace application_manager {
class ApplicationManager;
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
index ded709b1fa..e6b54cc487 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
-#include <net/if.h>
#include <gst/gst.h>
+#include <net/if.h>
#include <string>
#include "utils/lock.h"
diff --git a/src/components/media_manager/include/media_manager/file_streamer_adapter.h b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
index c4c91a98d8..a11b05b2ee 100644
--- a/src/components/media_manager/include/media_manager/file_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_FILE_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_FILE_STREAMER_ADAPTER_H_
-#include <string>
#include <fstream>
+#include <string>
#include "media_manager/streamer_adapter.h"
#include "utils/threads/thread_delegate.h"
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 749356e656..30b05d5c6b 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
@@ -33,13 +33,13 @@
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
-#include <string>
#include <map>
-#include "protocol_handler/protocol_observer.h"
-#include "protocol_handler/protocol_handler.h"
-#include "media_manager/media_manager.h"
+#include <string>
#include "media_manager/media_adapter_impl.h"
#include "media_manager/media_adapter_listener.h"
+#include "media_manager/media_manager.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/protocol_observer.h"
namespace application_manager {
class ApplicationManager;
diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h
index 56bf941f8e..16696e81d1 100644
--- a/src/components/media_manager/include/media_manager/streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/streamer_adapter.h
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_ADAPTER_H_
+#include <atomic>
#include "media_manager/media_adapter_impl.h"
+#include "protocol/raw_message.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include <atomic>
-#include "protocol/raw_message.h"
namespace media_manager {
diff --git a/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
index ad5739bd5f..d3d5111a60 100644
--- a/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
-#include <string>
#include <stdint.h>
+#include <string>
#include "media_manager/socket_streamer_adapter.h"
diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
index 91e3c5465d..581997f610 100644
--- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -29,17 +29,17 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "media_manager/audio/a2dp_source_player_adapter.h"
#include <net/if.h>
-#include <pulse/simple.h>
#include <pulse/error.h>
+#include <pulse/simple.h>
#include <string.h>
#include <utility>
-#include "utils/threads/thread.h"
-#include "media_manager/audio/a2dp_source_player_adapter.h"
-#include "utils/lock.h"
-#include "utils/logger.h"
#include "connection_handler/connection_handler_impl.h"
#include "protocol_handler/session_observer.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
namespace media_manager {
@@ -60,7 +60,7 @@ class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread
// The Sample format to use
static const pa_sample_spec sSampleFormat_;
- pa_simple* s_in, *s_out;
+ pa_simple *s_in, *s_out;
std::string device_;
bool should_be_stopped_;
sync_primitives::Lock should_be_stopped_lock_;
@@ -85,9 +85,9 @@ A2DPSourcePlayerAdapter::~A2DPSourcePlayerAdapter() {
}
void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
- LOG4CXX_INFO(logger_,
- "Starting a2dp playing music for " << application_key
- << " application.");
+ LOG4CXX_INFO(
+ logger_,
+ "Starting a2dp playing music for " << application_key << " application.");
if (application_key != current_application_) {
current_application_ = application_key;
@@ -110,9 +110,9 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
}
void A2DPSourcePlayerAdapter::StopActivity(int32_t application_key) {
- LOG4CXX_INFO(logger_,
- "Stopping 2dp playing for " << application_key
- << " application.");
+ LOG4CXX_INFO(
+ logger_,
+ "Stopping 2dp playing for " << application_key << " application.");
if (application_key != current_application_) {
return;
}
diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
index 23181e7431..078841f2a4 100644
--- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
+++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
@@ -35,20 +35,20 @@
#include <unistd.h>
#endif
-#include <string>
#include <string.h>
-#include "application_manager/application_manager.h"
+#include <string>
#include "application_manager/application_impl.h"
-#include "application_manager/rpc_service.h"
+#include "application_manager/application_manager.h"
#include "application_manager/commands/command.h"
-#include "smart_objects/smart_object.h"
+#include "application_manager/message.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/smart_object_keys.h"
#include "interfaces/MOBILE_API.h"
+#include "media_manager/audio/audio_stream_sender_thread.h"
+#include "media_manager/media_manager_settings.h"
+#include "smart_objects/smart_object.h"
#include "utils/file_system.h"
#include "utils/logger.h"
-#include "media_manager/media_manager_settings.h"
-#include "media_manager/audio/audio_stream_sender_thread.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/message.h"
namespace media_manager {
using sync_primitives::AutoLock;
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 d9735fcbbc..e55efed4ce 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
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "media_manager/audio/from_mic_recorder_adapter.h"
#include <string>
-#include "utils/threads/thread.h"
-#include "utils/logger.h"
#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
-#include "media_manager/audio/from_mic_recorder_adapter.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
namespace media_manager {
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
index 647db1e1a3..721229b250 100644
--- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
+++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/threads/thread.h"
-#include "utils/logger.h"
#include "media_manager/audio/from_mic_recorder_listener.h"
#include "media_manager/audio/audio_stream_sender_thread.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
namespace media_manager {
@@ -63,9 +63,9 @@ void FromMicRecorderListener::OnErrorReceived(int32_t application_key,
const DataForListener& data) {}
void FromMicRecorderListener::OnActivityStarted(int32_t application_key) {
- LOG4CXX_INFO(logger_,
- "FromMicRecorderListener::OnActivityStarted "
- << application_key);
+ LOG4CXX_INFO(
+ logger_,
+ "FromMicRecorderListener::OnActivityStarted " << application_key);
if (application_key == current_application_) {
return;
}
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 5c12614662..a34bdd3f09 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
@@ -84,7 +84,7 @@ void FromMicToFileRecorderThread::set_record_duration(int32_t duration) {
void FromMicToFileRecorderThread::initArgs() {
LOG4CXX_AUTO_TRACE(logger_);
- argv_ = new gchar* [argc_];
+ argv_ = new gchar*[argc_];
argv_[0] = new gchar[14];
argv_[1] = new gchar[3];
@@ -122,7 +122,7 @@ void FromMicToFileRecorderThread::threadMain() {
initArgs();
GstElement* pipeline;
- GstElement* alsasrc, *audioconvert, *capsfilter, *wavenc, *filesink;
+ GstElement *alsasrc, *audioconvert, *capsfilter, *wavenc, *filesink;
GstCaps* audiocaps;
GstBus* bus;
@@ -155,7 +155,7 @@ void FromMicToFileRecorderThread::threadMain() {
{NULL}};
// g_option_context_parse() modifies params, so keep argc_ and argv_
int32_t argc = argc_;
- gchar** argv = new gchar* [argc];
+ gchar** argv = new gchar*[argc];
for (int32_t i = 0; i < argc; i++) {
argv[i] = argv_[i];
}
diff --git a/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
index 429fab01b3..373d92cdde 100644
--- a/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
+++ b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include "media_manager/audio/socket_audio_streamer_adapter.h"
+#include <string>
namespace {
const std::string kHeader =
diff --git a/src/components/media_manager/src/file_streamer_adapter.cc b/src/components/media_manager/src/file_streamer_adapter.cc
index 3418f7d963..7761e13601 100644
--- a/src/components/media_manager/src/file_streamer_adapter.cc
+++ b/src/components/media_manager/src/file_streamer_adapter.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/logger.h"
-#include "utils/file_system.h"
#include "media_manager/file_streamer_adapter.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
namespace media_manager {
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index ec88e910d3..90b891133d 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -31,27 +31,27 @@
*/
#include "media_manager/media_manager_impl.h"
-#include "media_manager/audio/from_mic_recorder_listener.h"
-#include "media_manager/streamer_listener.h"
-#include "application_manager/message_helper.h"
#include "application_manager/application.h"
-#include "application_manager/application_manager.h"
#include "application_manager/application_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "media_manager/audio/from_mic_recorder_listener.h"
+#include "media_manager/streamer_listener.h"
#include "protocol_handler/protocol_handler.h"
#include "utils/file_system.h"
-#include "utils/logger.h"
#include "utils/helpers.h"
+#include "utils/logger.h"
#if defined(EXTENDED_MEDIA_MODE)
#include "media_manager/audio/a2dp_source_player_adapter.h"
#include "media_manager/audio/from_mic_recorder_adapter.h"
#endif
-#include "media_manager/video/socket_video_streamer_adapter.h"
-#include "media_manager/audio/socket_audio_streamer_adapter.h"
-#include "media_manager/video/pipe_video_streamer_adapter.h"
-#include "media_manager/audio/pipe_audio_streamer_adapter.h"
-#include "media_manager/video/file_video_streamer_adapter.h"
#include "media_manager/audio/file_audio_streamer_adapter.h"
+#include "media_manager/audio/pipe_audio_streamer_adapter.h"
+#include "media_manager/audio/socket_audio_streamer_adapter.h"
#include "media_manager/media_manager_settings.h"
+#include "media_manager/video/file_video_streamer_adapter.h"
+#include "media_manager/video/pipe_video_streamer_adapter.h"
+#include "media_manager/video/socket_video_streamer_adapter.h"
namespace media_manager {
@@ -220,9 +220,9 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key,
std::vector<uint8_t> buf;
if (file_system::ReadBinaryFile(record_file_source, buf)) {
if (file_system::Write(file_path, buf)) {
- LOG4CXX_INFO(logger_,
- "File " << record_file_source << " copied to "
- << output_file);
+ LOG4CXX_INFO(
+ logger_,
+ "File " << record_file_source << " copied to " << output_file);
} else {
LOG4CXX_WARN(logger_, "Could not write to file " << 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 8bf14a546e..c692a0e266 100644
--- a/src/components/media_manager/src/pipe_streamer_adapter.cc
+++ b/src/components/media_manager/src/pipe_streamer_adapter.cc
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "media_manager/pipe_streamer_adapter.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "utils/logger.h"
#include "utils/file_system.h"
-#include "media_manager/pipe_streamer_adapter.h"
+#include "utils/logger.h"
namespace media_manager {
@@ -88,9 +88,9 @@ bool PipeStreamerAdapter::PipeStreamer::Connect() {
return false;
}
- LOG4CXX_INFO(logger_,
- "Pipe " << named_pipe_path_
- << " was successfuly opened for writing");
+ LOG4CXX_INFO(
+ logger_,
+ "Pipe " << named_pipe_path_ << " was successfuly opened for writing");
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 60b01c901b..624e388a0c 100644
--- a/src/components/media_manager/src/socket_streamer_adapter.cc
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -30,15 +30,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/select.h>
-#include <netinet/in.h>
+#include "media_manager/socket_streamer_adapter.h"
#include <arpa/inet.h>
#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+#include <sys/types.h>
#include <unistd.h>
#include "utils/logger.h"
-#include "media_manager/socket_streamer_adapter.h"
namespace media_manager {
diff --git a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
index f41954b117..d907211d16 100644
--- a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
+++ b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/logger.h"
-#include "utils/file_system.h"
-#include "config_profile/profile.h"
#include "media_manager/video/video_stream_to_file_adapter.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
namespace media_manager {
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter.h
index 908b371b26..78d44695e5 100644
--- a/src/components/media_manager/test/include/media_manager/mock_media_adapter.h
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_H_
#include "gmock/gmock.h"
-#include "media_manager/media_manager.h"
#include "media_manager/media_adapter.h"
+#include "media_manager/media_manager.h"
namespace test {
namespace components {
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 c77c984a75..9d721fd7cf 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -30,20 +30,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gmock/gmock.h"
#include "media_manager/media_manager_impl.h"
-#include "media_manager/mock_media_adapter.h"
-#include "media_manager/mock_media_adapter_impl.h"
-#include "media_manager/mock_media_adapter_listener.h"
-#include "media_manager/mock_media_manager_settings.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/message.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/state_controller.h"
-#include "protocol_handler/mock_protocol_handler.h"
+#include "gmock/gmock.h"
+#include "media_manager/mock_media_adapter.h"
+#include "media_manager/mock_media_adapter_impl.h"
+#include "media_manager/mock_media_adapter_listener.h"
+#include "media_manager/mock_media_manager_settings.h"
#include "protocol/common.h"
+#include "protocol_handler/mock_protocol_handler.h"
#include "utils/file_system.h"
#include "utils/scope_guard.h"
@@ -58,13 +58,13 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::utils::ScopeGuard;
-using ::utils::MakeGuard;
-using ::testing::NiceMock;
-using ::protocol_handler::ServiceType;
-using ::protocol_handler::RawMessagePtr;
using application_manager::ApplicationSharedPtr;
using application_manager::BinaryData;
+using ::protocol_handler::RawMessagePtr;
+using ::protocol_handler::ServiceType;
+using ::testing::NiceMock;
+using ::utils::MakeGuard;
+using ::utils::ScopeGuard;
namespace {
const uint16_t kVideoStreamingPort = 8901u;
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index c66313240f..bd05291245 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -43,6 +43,7 @@ include_directories (
${COMPONENTS_DIR}/config_profile/include
${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
${JSONCPP_INCLUDE_DIRECTORY}
)
diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h
index fd185af075..eadef088ad 100644
--- a/src/components/policy/policy_external/include/policy/access_remote.h
+++ b/src/components/policy/policy_external/include/policy/access_remote.h
@@ -32,9 +32,9 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
-#include <vector>
#include <ostream>
#include <string>
+#include <vector>
#include "policy/policy_table/types.h"
#include "policy/policy_types.h"
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index d30e7cea24..15eb51565d 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -35,15 +35,15 @@
#include <map>
-#include "policy/pt_representation.h"
+#include "policy/cache_manager_interface.h"
#include "policy/pt_ext_representation.h"
+#include "policy/pt_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/cache_manager_interface.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace policy {
class PolicySettings;
@@ -159,6 +159,108 @@ class CacheManager : public CacheManagerInterface {
virtual const VehicleInfo GetVehicleInfo() const;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const;
+
+ /**
+ * Initializes a new cloud application with default policies
+ * Then adds cloud specific policies
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual void InitCloudApp(const std::string& policy_app_id);
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled);
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token);
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type);
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint);
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames);
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference);
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const;
+
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -192,6 +294,15 @@ class CacheManager : public CacheManagerInterface {
virtual std::string GetLockScreenIconUrl() const;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const;
+
+ /**
* @brief Gets list of URL to send PTS to
* @param service_type If URLs for specific service are preset,
* return them otherwise default URLs.
@@ -687,35 +798,36 @@ class CacheManager : public CacheManagerInterface {
ExternalConsentStatus GetExternalConsentEntities() OVERRIDE;
/**
- * @brief Creates collection of ExternalConsent items known by current
- * functional
- * groupings and appropiate section
- * (disallowed_by_external_consent_entities_on/off) where
- * is item is being holded. If item is not found it's not included into
- * collection
- * @param status Current status containing collection of ExternalConsent items
- * @return Collection of ExternalConsent items mapped to list of groups with
- * section
- * marker where the item is found
- */
+ * @brief Creates collection of ExternalConsent items known by current
+ * functional
+ * groupings and appropiate section
+ * (disallowed_by_external_consent_entities_on/off) where
+ * is item is being holded. If item is not found it's not included into
+ * collection
+ * @param status Current status containing collection of ExternalConsent items
+ * @return Collection of ExternalConsent items mapped to list of groups with
+ * section
+ * marker where the item is found
+ */
GroupsByExternalConsentStatus GetGroupsWithSameEntities(
const ExternalConsentStatus& status) OVERRIDE;
/**
- * @brief Gets collection of links device-to-application from device_data
- * section of policy table if there any application records present, i.e. if
- * any specific user consent is present
- * @return Collection of device-to-application links
- */
+ * @brief Gets collection of links device-to-application from device_data
+ * section of policy table if there any application records present, i.e. if
+ * any specific user consent is present
+ * @return Collection of device-to-application links
+ */
std::map<std::string, std::string> GetKnownLinksFromPT() OVERRIDE;
/**
- * @brief Sets groups permissions affected by customer connectivity settings
- * entities status, i.e. groups assigned to particular application on
- * particular device which have same entities as current ExternalConsent status
- * @param permissions Groups permissions which result current ExternalConsent
- * status
- */
+ * @brief Sets groups permissions affected by customer connectivity settings
+ * entities status, i.e. groups assigned to particular application on
+ * particular device which have same entities as current ExternalConsent
+ * status
+ * @param permissions Groups permissions which result current ExternalConsent
+ * status
+ */
void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE;
#ifdef BUILD_TESTS
diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
index bb9ce14c7f..980ad42dcd 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -39,9 +39,9 @@
#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
-#include "policy/usage_statistics/counter.h"
-#include "policy/policy_types.h"
#include "policy/policy_settings.h"
+#include "policy/policy_types.h"
+#include "policy/usage_statistics/counter.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -166,6 +166,110 @@ class CacheManagerInterface {
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const = 0;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const = 0;
+
+ /**
+ * Initializes a new cloud application with default policies
+ * Then adds cloud specific policies
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual void InitCloudApp(const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) = 0;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) = 0;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) = 0;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) = 0;
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) = 0;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const = 0;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -208,6 +312,15 @@ class CacheManagerInterface {
virtual std::string GetLockScreenIconUrl() const = 0;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get allowed number of notifications
* depending on application priority.
* @param priority Priority of application
@@ -754,9 +867,9 @@ class CacheManagerInterface {
virtual std::string GetCertificate() const = 0;
/**
- * @brief Sets decrypted certificate in policy table
- * @param certificate content of certificate
- */
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
/**
@@ -781,34 +894,35 @@ class CacheManagerInterface {
virtual ExternalConsentStatus GetExternalConsentEntities() = 0;
/**
- * @brief Creates collection of ExternalConsent items known by current
- * functional
- * groupings and appropiate section
- * (disallowed_by_external_consent_entities_on/off) where
- * is item is being holded
- * @param status Current status containing collection of ExternalConsent items
- * @return Collection of ExternalConsent items mapped to list of groups with
- * section
- * marker where the item is found
- */
+ * @brief Creates collection of ExternalConsent items known by current
+ * functional
+ * groupings and appropiate section
+ * (disallowed_by_external_consent_entities_on/off) where
+ * is item is being holded
+ * @param status Current status containing collection of ExternalConsent items
+ * @return Collection of ExternalConsent items mapped to list of groups with
+ * section
+ * marker where the item is found
+ */
virtual GroupsByExternalConsentStatus GetGroupsWithSameEntities(
const ExternalConsentStatus& status) = 0;
/**
- * @brief Gets collection of links device-to-application from device_data
- * section of policy table if there any application records present, i.e. if
- * any specific user consent is present
- * @return Collection of device-to-application links
- */
+ * @brief Gets collection of links device-to-application from device_data
+ * section of policy table if there any application records present, i.e. if
+ * any specific user consent is present
+ * @return Collection of device-to-application links
+ */
virtual std::map<std::string, std::string> GetKnownLinksFromPT() = 0;
/**
- * @brief Sets groups permissions affected by customer connectivity settings
- * entities status, i.e. groups assigned to particular application on
- * particular device which have same entities as current ExternalConsent status
- * @param permissions Groups permissions which result current ExternalConsent
- * status
- */
+ * @brief Sets groups permissions affected by customer connectivity settings
+ * entities status, i.e. groups assigned to particular application on
+ * particular device which have same entities as current ExternalConsent
+ * status
+ * @param permissions Groups permissions which result current ExternalConsent
+ * status
+ */
virtual void SetExternalConsentForApp(
const PermissionConsent& permissions) = 0;
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
index e3cb509c15..bce2559431 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -243,13 +243,13 @@ struct FillActionsForAppPolicies {
*/
struct FillNotificationData {
/**
- * @brief Constructor
- * @param data Output structure with filled data
- * @param group_state Consent of the group processed by instance
- * @param undefined_group_consent Defines how to treat 'undefined' consent
- * @param does_require_user_consent Specifies whether processed group requires
- * user consent
- */
+ * @brief Constructor
+ * @param data Output structure with filled data
+ * @param group_state Consent of the group processed by instance
+ * @param undefined_group_consent Defines how to treat 'undefined' consent
+ * @param does_require_user_consent Specifies whether processed group requires
+ * user consent
+ */
FillNotificationData(Permissions& data,
GroupConsent group_state,
GroupConsent undefined_group_consent,
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 3837dda1fa..2f8f6cf070 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
@@ -35,15 +35,15 @@
#include <list>
-#include "utils/lock.h"
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#include "policy/cache_manager_interface.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
-#include "policy/cache_manager_interface.h"
-#include "policy/update_status_manager.h"
#include "policy/policy_table/functions.h"
+#include "policy/update_status_manager.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/access_remote.h"
-#include "policy/access_remote_impl.h"
+#include "utils/lock.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -209,6 +209,15 @@ class PolicyManagerImpl : public PolicyManager {
std::string GetLockScreenIconUrl() const OVERRIDE;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ std::string GetIconUrl(const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Handler of PTS sending out
*/
void OnUpdateStarted() OVERRIDE;
@@ -533,10 +542,10 @@ class PolicyManagerImpl : public PolicyManager {
void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
/**
- * @brief Get state of request types for given application
- * @param policy_app_id Unique application id
- * @return request type state
- */
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
RequestType::State GetAppRequestTypesState(
const std::string& policy_app_id) const OVERRIDE;
@@ -557,10 +566,10 @@ class PolicyManagerImpl : public PolicyManager {
const std::string policy_app_id) const OVERRIDE;
/**
- * @brief Gets request subtypes for application
- * @param policy_app_id Unique application id
- * @return request subtypes of application
- */
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
const std::vector<std::string> GetAppRequestSubTypes(
const std::string& policy_app_id) const OVERRIDE;
@@ -571,6 +580,108 @@ class PolicyManagerImpl : public PolicyManager {
const VehicleInfo GetVehicleInfo() const OVERRIDE;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const OVERRIDE;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ bool GetCloudAppParameters(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const OVERRIDE;
+
+ /**
+ * @ brief Initialize new cloud app in the policy table
+ * @ param policy_app_id Application ID
+ */
+ void InitCloudApp(const std::string& policy_app_id) OVERRIDE;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) OVERRIDE;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) OVERRIDE;
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) OVERRIDE;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ void GetAppServiceParameters(const std::string& policy_app_id,
+ policy_table::AppServiceParameters*
+ app_service_parameters) const OVERRIDE;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ * @return bool true if allowed
+ */
+ bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
@@ -892,11 +1003,17 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id) OVERRIDE;
/**
- * @brief Gets all allowed module types
- * @param policy_app_id unique identifier of application
- * @param modules list of allowed module types
- * @return true if application has allowed modules
- */
+ * @brief notify listener of updated auth token for a given policy id
+ * @param policy_app_id the app id that has an updated auth token
+ */
+ void SendAuthTokenUpdated(const std::string policy_app_id);
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h
index fe27f1cb57..8f0d5f7efb 100644
--- a/src/components/policy/policy_external/include/policy/policy_table.h
+++ b/src/components/policy/policy_external/include/policy/policy_table.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
+#include "policy/pt_representation.h"
namespace policy {
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index 34864c5602..6733bcb98d 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -96,6 +96,7 @@ enum Parameter {
P_FUEL_RANGE,
P_TIRE_PRESSURE_VALUE,
P_TPMS,
+ P_CLOUD_APP_VEHICLE_ID,
P_LONGTITUDE_DEGREES,
P_LATITUDE_DEGREES,
P_LOCATION_NAME,
@@ -153,6 +154,7 @@ enum RequestType {
RT_MEDIA,
RT_FOTA,
RT_OEM_SPECIFIC,
+ RT_ICON_URL,
RT_EMPTY // Added to allow empty Request Types handling
};
@@ -181,6 +183,12 @@ bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+enum HybridAppPreference { HAP_MOBILE, HAP_CLOUD, HAP_BOTH };
+bool IsValidEnum(HybridAppPreference val);
+const char* EnumToJsonString(HybridAppPreference val);
+bool EnumFromJsonString(const std::string& literal,
+ HybridAppPreference* result);
+
/**
* @brief Enumeration FunctionID.
*
@@ -434,6 +442,41 @@ enum FunctionID {
SendHapticDataID = 49,
/**
+ * @brief SetCloudAppPropertiesID.
+ */
+ SetCloudAppPropertiesID = 50,
+
+ /**
+ * @brief GetCloudAppPropertiesID.
+ */
+ GetCloudAppPropertiesID = 51,
+
+ /**
+ * @brief PublishAppServiceID.
+ */
+ PublishAppServiceID = 52,
+
+ /**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief GetFileID
+ */
+ GetFileID = 54,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
+ * @brief CloseApplicationID.
+ */
+ CloseApplicationID = 58,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -524,6 +567,16 @@ enum FunctionID {
OnRCStatusID = 32785,
/**
+ * @brief OnAppServiceDataID.
+ */
+ OnAppServiceDataID = 32786,
+
+ /**
+ * @brief OnSystemCapabilityUpdatedID
+ */
+ OnSystemCapabilityUpdatedID = 32787,
+
+ /**
* @brief EncodedSyncPDataID.
*/
EncodedSyncPDataID = 65536,
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
index 68e29a97ee..994fd86579 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -52,6 +52,8 @@ struct MessageLanguages;
struct MessageString;
struct RpcParameters;
struct Rpcs;
+struct AppServiceHandledRpc;
+struct AppServiceInfo;
} // namespace policy_table_interface_base
} // namespace rpc
@@ -104,6 +106,13 @@ typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
typedef Strings RequestSubTypes;
+typedef String<0, 255> AppServiceType;
+typedef String<0, 255> AppServiceName;
+typedef Array<AppServiceName, 0, 255> AppServiceNames;
+typedef Array<AppServiceHandledRpc, 0, 255> AppServiceHandledRpcs;
+typedef Map<AppServiceInfo, 0, 255> AppServiceParameters;
+typedef Integer<int32_t, 0, INT32_MAX> FunctionIDInt;
+
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
@@ -111,6 +120,45 @@ typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
+struct AppServiceHandledRpc : CompositeType {
+ public:
+ FunctionIDInt function_id;
+
+ public:
+ AppServiceHandledRpc();
+ ~AppServiceHandledRpc();
+ AppServiceHandledRpc(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ void ReportErrors(rpc::ValidationReport* report__) const;
+
+ private:
+ bool Validate() const;
+};
+
+struct AppServiceInfo : CompositeType {
+ public:
+ Optional<AppServiceNames> service_names;
+ AppServiceHandledRpcs handled_rpcs;
+
+ public:
+ AppServiceInfo();
+ ~AppServiceInfo();
+ AppServiceInfo(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ void ReportErrors(rpc::ValidationReport* report__) const;
+
+ private:
+ bool Validate() const;
+};
+
struct RequestTypes : public RequestsTypeArray {
RequestTypes();
explicit RequestTypes(Json::Value* value);
@@ -177,6 +225,18 @@ struct ApplicationParams : PolicyBase {
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
mutable Optional<ModuleTypes> moduleType;
+ Optional<String<0, 65535> > certificate;
+ // Cloud application params
+ Optional<Enum<HybridAppPreference> > hybrid_app_preference;
+ Optional<String<0, 255> > endpoint;
+ Optional<Boolean> enabled;
+ Optional<String<0, 65535> > auth_token;
+ Optional<String<0, 255> > cloud_transport_type;
+ Optional<String<0, 65535> > icon_url;
+
+ // App Service Params
+ Optional<AppServiceParameters> app_service_parameters;
+ Optional<Boolean> allow_unknown_rpc_passthrough;
public:
ApplicationParams();
diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
index 26af165506..46c8f40a01 100644
--- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
@@ -56,6 +56,7 @@
<element name="fuelRange" />
<element name="tirePressureValue" />
<element name="tpms" />
+ <element name="cloudAppVehicleID" />
</enum>
<enum name="AppHMIType">
@@ -70,6 +71,12 @@
<element name="TESTING" />
<element name="SYSTEM" />
</enum>
+
+ <enum name="HybridAppPreference">
+ <element name="MOBILE" />
+ <element name="CLOUD" />
+ <element name="BOTH" />
+ </enum>
<!-- Common parameters end -->
<!-- app_policies section start -->
@@ -92,8 +99,21 @@
<param name="memory_kb" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/>
<param name="watchdog_timer_ms" type="Integer" minvalue="1"
maxvalue="65225" mandatory="false"/>
- <param name="certificate" type="String" minlength="0" maxlength="255"
+ <param name="certificate" type="String" minlength="0" maxlength="65535"
+ mandatory="false" />
+ <param name="endpoint" type="String" minlength="0" maxlength="255" mandatory="false" />
+ <param name="enabled" type="Boolean" mandatory="false" />
+ <param name="auth_token" type="String" minlength="0" maxlength="65535"
+ mandatory="false" />
+ <param name="cloud_transport_type" type="String" minlength="0" maxlength="255"
+ mandatory="false" />
+ <param name="hybrid_app_preference" type="HybridAppPreference" mandatory="false" />
+ <param name="icon_url" type="String" minlength="0" maxlength="65535"
mandatory="false" />
+ <param name="service_name" type="String" mandatory="false" />
+ <param name="service_type" type="String" mandatory="false" />
+ <param name="handled_rpcs" array="true" mandatory="false" />
+ <param name="allow_unknown_rpc_passthrough" type="Boolean" mandatory="false" />
</struct>
<typedef name="HmiLevels" type="HmiLevel" array="true"
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
index 84d9376a93..7247995f48 100644
--- a/src/components/policy/policy_external/include/policy/policy_types.h
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -34,15 +34,15 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
#include <algorithm>
-#include <string>
-#include <vector>
#include <map>
+#include <memory>
#include <set>
+#include <string>
#include <utility>
-#include <memory>
+#include <vector>
-#include "utils/helpers.h"
#include "transport_manager/common.h"
+#include "utils/helpers.h"
namespace policy {
@@ -119,10 +119,10 @@ typedef std::vector<std::string> StringArray;
enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed };
/**
- * @struct Stores result of check:
- * if HMI Level was allowed for RPC to work in
- * and list of parameters allowed for RPC if specified in PT.
- */
+ * @struct Stores result of check:
+ * if HMI Level was allowed for RPC to work in
+ * and list of parameters allowed for RPC if specified in PT.
+ */
struct CheckPermissionResult {
CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {}
diff --git a/src/components/policy/policy_external/include/policy/pt_ext_representation.h b/src/components/policy/policy_external/include/policy/pt_ext_representation.h
index 0aa284b707..f03947268a 100644
--- a/src/components/policy/policy_external/include/policy/pt_ext_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_ext_representation.h
@@ -280,10 +280,10 @@ class PTExtRepresentation : public virtual PTRepresentation {
virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0;
/**
- * @brief Set app policy to pre_DataConsented policy
- * @param app_id Policy ID of application to be changed
- * @return true, if succeeded, otherwise - false
- */
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
virtual bool SetPredataPolicy(const std::string& app_id) = 0;
/**
diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h
index f25fcc6cab..6eaa718cf0 100644
--- a/src/components/policy/policy_external/include/policy/pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_representation.h
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_
-#include <vector>
#include <string>
-#include "policy/policy_types.h"
-#include "policy/policy_table/types.h"
+#include <vector>
#include "policy/policy_settings.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -268,10 +268,10 @@ class PTRepresentation {
virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
/**
- * Checks if the application has pre_data policy
- * @param app_id application id
- * @return true if application has pre_data policy
- */
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
/**
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h
index bd2097cfe3..889ede9d20 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
#include <string>
-#include "policy/sql_pt_representation.h"
#include "policy/pt_ext_representation.h"
+#include "policy/sql_pt_representation.h"
namespace policy {
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
index dd9e0204e7..5382ff2d6b 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
@@ -66,6 +66,9 @@ extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
extern const std::string kSelectRequestTypes;
extern const std::string kSelectRequestSubTypes;
+extern const std::string kSelectAppServiceTypes;
+extern const std::string kSelectAppServiceNames;
+extern const std::string kSelectAppServiceHandledRpcs;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -80,6 +83,9 @@ extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
extern const std::string kInsertRequestSubType;
+extern const std::string kInsertAppServiceTypes;
+extern const std::string kInsertAppServiceNames;
+extern const std::string kInsertAppServiceHandledRpcs;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -101,6 +107,9 @@ extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
extern const std::string kDeleteRequestType;
extern const std::string kDeleteRequestSubType;
+extern const std::string kDeleteAppServiceTypes;
+extern const std::string kDeleteAppServiceNames;
+extern const std::string kDeleteAppServiceHandledRpcs;
extern const std::string kDeleteDevice;
extern const std::string kIncrementIgnitionCycles;
extern const std::string kResetIgnitionCycles;
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
index 13816eb6c5..826c9b3b6e 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -35,9 +35,9 @@
#include <string>
#include <vector>
+#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -134,6 +134,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool GatherRequestSubType(
const std::string& app_id,
policy_table::RequestSubTypes* request_subtypes) const;
+ bool GatherAppServiceParameters(
+ const std::string& app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -172,6 +175,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveRequestSubType(
const std::string& app_id,
const policy_table::RequestSubTypes& request_subtypes);
+ bool SaveAppServiceParameters(
+ const std::string& app_id,
+ const policy_table::AppServiceParameters& app_service_parameters);
public:
virtual std::string GetLockScreenIconUrl() const;
diff --git a/src/components/policy/policy_external/include/policy/status.h b/src/components/policy/policy_external/include/policy/status.h
index 18789ecf99..336d59e869 100644
--- a/src/components/policy/policy_external/include/policy/status.h
+++ b/src/components/policy/policy_external/include/policy/status.h
@@ -75,41 +75,41 @@ class Status {
const policy::PolicyTableStatus enum_status);
/**
- * @brief Destructor
- */
+ * @brief Destructor
+ */
virtual ~Status();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
virtual void ProcessEvent(UpdateStatusManager* manager,
UpdateEvent event) = 0;
/**
- * @brief Return current status as string value
- * @return Status as string
- */
+ * @brief Return current status as string value
+ * @return Status as string
+ */
const std::string get_status_string() const;
/**
- * @brief Return status as enum value
- * @return Status as enum value
- */
+ * @brief Return status as enum value
+ * @return Status as enum value
+ */
PolicyTableStatus get_status() const;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
virtual bool IsUpdateRequired() const;
/**
- * @brief Check whether update is pending in terms of status
- * @return True if update is pending, otherwise - false
- */
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
virtual bool IsUpdatePending() const;
private:
@@ -128,11 +128,11 @@ class UpToDateStatus : public Status {
UpToDateStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
};
@@ -147,17 +147,17 @@ class UpdateNeededStatus : public Status {
UpdateNeededStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
bool IsUpdateRequired() const OVERRIDE;
};
@@ -172,25 +172,25 @@ class UpdatingStatus : public Status {
UpdatingStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
bool IsUpdateRequired() const OVERRIDE;
/**
- * @brief Check whether update is pending in terms of status
- * @return True if update is pending, otherwise - false
- */
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
bool IsUpdatePending() const OVERRIDE;
};
-}
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
index 3a9e13b83f..9c0e29407e 100644
--- a/src/components/policy/policy_external/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -34,14 +34,13 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
#include "policy/policy_types.h"
-#include "utils/lock.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
+#include "policy/status.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/logger.h"
#include "utils/macro.h"
-#include "policy/status.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace policy {
@@ -235,6 +234,6 @@ class UpdateStatusManager {
UpdateThreadDelegate* update_status_thread_delegate_;
threads::Thread* thread_;
};
-}
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
index c145bb432b..047a545150 100644
--- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
@@ -34,11 +34,11 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
#include <ctime>
-#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
+#include "policy/usage_statistics/statistics_manager.h"
-#include "utils/timer.h"
#include "utils/macro.h"
+#include "utils/timer.h"
namespace usage_statistics {
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index c2c2e91257..bd38f7bf8f 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -33,27 +33,27 @@
#include "policy/cache_manager.h"
#include <algorithm>
-#include <functional>
-#include <ctime>
#include <cmath>
-#include <utility>
+#include <ctime>
+#include <functional>
#include <string>
+#include <utility>
#include <vector>
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "json/reader.h"
#include "json/features.h"
+#include "json/reader.h"
#include "json/writer.h"
-#include "utils/logger.h"
+#include "policy/policy_helper.h"
+#include "policy/policy_table/enums.h"
+#include "policy/sql_pt_ext_representation.h"
+#include "rpc_base/rpc_base.h"
#include "utils/date_time.h"
+#include "utils/file_system.h"
#include "utils/gen_hash.h"
+#include "utils/helpers.h"
+#include "utils/logger.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/enums.h"
-#include "policy/policy_helper.h"
-#include "policy/sql_pt_ext_representation.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -904,9 +904,9 @@ bool CacheManager::HasDeviceSpecifiedConsent(const std::string& device_id,
return false;
}
const std::string consent = is_allowed ? "allowed" : "disallowed";
- LOG4CXX_INFO(logger_,
- "DeviceGetDeviceGroupsFromPolicies is already " << consent
- << ".");
+ LOG4CXX_INFO(
+ logger_,
+ "DeviceGetDeviceGroupsFromPolicies is already " << consent << ".");
return true;
}
@@ -1389,6 +1389,178 @@ const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
return vehicle_info;
}
+void CacheManager::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ enabled_apps.clear();
+ return;
+#else
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::const_iterator it = policies.begin();
+ it != policies.end();
+ ++it) {
+ auto app_policy = (*it).second;
+ if (app_policy.enabled.is_initialized() && *app_policy.enabled) {
+ enabled_apps.push_back((*it).first);
+ }
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+bool CacheManager::GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const {
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ endpoint = app_policy.endpoint.is_initialized() ? *app_policy.endpoint
+ : std::string();
+ auth_token = app_policy.auth_token.is_initialized() ? *app_policy.auth_token
+ : std::string();
+ cloud_transport_type = app_policy.cloud_transport_type.is_initialized()
+ ? *app_policy.cloud_transport_type
+ : std::string();
+ certificate = app_policy.certificate.is_initialized()
+ ? *app_policy.certificate
+ : std::string();
+ hybrid_app_preference =
+ app_policy.hybrid_app_preference.is_initialized()
+ ? EnumToJsonString(*app_policy.hybrid_app_preference)
+ : std::string();
+ enabled = app_policy.enabled.is_initialized() && *app_policy.enabled;
+ return true;
+ }
+ return false;
+}
+
+void CacheManager::InitCloudApp(const std::string& policy_app_id) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator default_iter =
+ policies.find(kDefaultId);
+ policy_table::ApplicationPolicies::const_iterator app_iter =
+ policies.find(policy_app_id);
+ if (default_iter != policies.end()) {
+ if (app_iter == policies.end()) {
+ policies[policy_app_id] = policies[kDefaultId];
+ }
+ }
+ // Add cloud app specific policies
+ Backup();
+}
+
+void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.enabled = enabled;
+ }
+}
+
+void CacheManager::SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.auth_token = auth_token;
+ }
+}
+
+void CacheManager::SetAppCloudTransportType(
+ const std::string& policy_app_id, const std::string& cloud_transport_type) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.cloud_transport_type = cloud_transport_type;
+ }
+}
+
+void CacheManager::SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.endpoint = endpoint;
+ }
+}
+
+void CacheManager::SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ (*(*policy_iter).second.nicknames) = nicknames;
+ }
+}
+
+void CacheManager::SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) {
+ policy_table::HybridAppPreference value;
+ bool valid = EnumFromJsonString(hybrid_app_preference, &value);
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter && valid) {
+ *(*policy_iter).second.hybrid_app_preference = value;
+ }
+}
+
+void CacheManager::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ if (app_policy.app_service_parameters.is_initialized()) {
+ *app_service_parameters = *(app_policy.app_service_parameters);
+ }
+ }
+}
+
+bool CacheManager::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ const auto app_policy = (*policy_iter).second;
+ if (app_policy.allow_unknown_rpc_passthrough.is_initialized()) {
+ return *(app_policy.allow_unknown_rpc_passthrough);
+ }
+ }
+ return false;
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
const std::string& language,
@@ -1491,6 +1663,21 @@ std::string CacheManager::GetLockScreenIconUrl() const {
return std::string("");
}
+std::string CacheManager::GetIconUrl(const std::string& policy_app_id) const {
+ CACHE_MANAGER_CHECK(std::string());
+ std::string url;
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ url = app_policy.icon_url.is_initialized() ? *app_policy.icon_url
+ : std::string();
+ }
+ return url;
+}
+
rpc::policy_table_interface_base::NumberOfNotificationsType
CacheManager::GetNotificationsNumber(const std::string& priority) {
CACHE_MANAGER_CHECK(0);
@@ -2002,9 +2189,9 @@ bool CacheManager::CleanupUnpairedDevices() {
LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
device_data.erase(it_device);
- LOG4CXX_INFO(logger_,
- "Device id " << *iter
- << " had been deleted from device_data section.");
+ LOG4CXX_INFO(
+ logger_,
+ "Device id " << *iter << " had been deleted from device_data section.");
LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
}
is_unpaired_.clear();
@@ -2581,7 +2768,7 @@ ExternalConsentStatus CacheManager::GetExternalConsentEntities() {
policy_table::DisallowedByExternalConsentEntities::const_iterator it_2 =
(*it->second.disallowed_by_external_consent_entities_off).begin();
for (; it_2 !=
- (*it->second.disallowed_by_external_consent_entities_off).end();
+ (*it->second.disallowed_by_external_consent_entities_off).end();
++it_2) {
items.insert(ExternalConsentStatusItem(
it_2->entity_type, it_2->entity_id, EntityStatus::kStatusOff));
@@ -2730,8 +2917,9 @@ void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt,
void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt,
policy_table::PolicyTable& pt) {
LOG4CXX_AUTO_TRACE(logger_);
- pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>(
- new_pt).app_policies_section.device;
+ pt.app_policies_section.device =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.device;
pt.app_policies_section.apps[kDefaultId] =
const_cast<policy_table::PolicyTable&>(new_pt)
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index c9df969bd1..e8855bb11a 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -30,13 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/policy_helper.h"
+#include <string.h>
#include <algorithm>
#include <sstream>
-#include <string.h>
-#include "utils/logger.h"
-#include "utils/custom_string.h"
-#include "policy/policy_helper.h"
#include "policy/policy_manager_impl.h"
+#include "utils/custom_string.h"
+#include "utils/logger.h"
namespace policy {
@@ -360,16 +360,16 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
if (RESULT_NO_CHANGES == result) {
- LOG4CXX_INFO(logger_,
- "Permissions for application:" << app_id
- << " wasn't changed.");
+ LOG4CXX_INFO(
+ logger_,
+ "Permissions for application:" << app_id << " wasn't changed.");
AddResult(app_id, result);
return true;
}
- LOG4CXX_INFO(logger_,
- "Permissions for application:" << app_id
- << " have been changed.");
+ LOG4CXX_INFO(
+ logger_,
+ "Permissions for application:" << app_id << " have been changed.");
if (!IsPredefinedApp(app_policy)) {
SetPendingPermissions(app_policy, result, permissions_diff);
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 a603f122e2..15900f0187 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -32,23 +32,23 @@
#include "policy/policy_manager_impl.h"
#include <algorithm>
-#include <set>
-#include <queue>
+#include <functional>
#include <iterator>
#include <limits>
+#include <queue>
+#include <set>
#include <vector>
-#include <functional>
+#include "config_profile/profile.h"
#include "json/reader.h"
#include "json/writer.h"
+#include "policy/cache_manager.h"
+#include "policy/policy_helper.h"
#include "policy/policy_table.h"
#include "policy/pt_representation.h"
-#include "policy/policy_helper.h"
+#include "policy/update_status_manager.h"
+#include "utils/date_time.h"
#include "utils/file_system.h"
#include "utils/logger.h"
-#include "utils/date_time.h"
-#include "policy/cache_manager.h"
-#include "policy/update_status_manager.h"
-#include "config_profile/profile.h"
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
@@ -271,6 +271,11 @@ std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
return cache_->GetLockScreenIconUrl();
}
+std::string PolicyManagerImpl::GetIconUrl(
+ const std::string& policy_app_id) const {
+ return cache_->GetIconUrl(policy_app_id);
+}
+
/**
* @brief FilterInvalidFunctions filter functions that are absent in schema
* @param rpcs list of functions to filter
@@ -497,6 +502,12 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
} else {
LOG4CXX_INFO(logger_, "app_hmi_types empty");
}
+
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
// If there was a user request for policy table update, it should be started
@@ -725,6 +736,75 @@ const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
+void PolicyManagerImpl::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+ cache_->GetEnabledCloudApps(enabled_apps);
+}
+
+bool PolicyManagerImpl::GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const {
+ return cache_->GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+}
+
+void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id) {
+ cache_->InitCloudApp(policy_app_id);
+}
+
+void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) {
+ cache_->SetCloudAppEnabled(policy_app_id, enabled);
+}
+
+void PolicyManagerImpl::SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ cache_->SetAppAuthToken(policy_app_id, auth_token);
+}
+
+void PolicyManagerImpl::SetAppCloudTransportType(
+ const std::string& policy_app_id, const std::string& cloud_transport_type) {
+ cache_->SetAppCloudTransportType(policy_app_id, cloud_transport_type);
+}
+
+void PolicyManagerImpl::SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) {
+ cache_->SetAppEndpoint(policy_app_id, endpoint);
+}
+
+void PolicyManagerImpl::SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) {
+ cache_->SetAppNicknames(policy_app_id, nicknames);
+}
+
+void PolicyManagerImpl::SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) {
+ cache_->SetHybridAppPreference(policy_app_id, hybrid_app_preference);
+}
+
+void PolicyManagerImpl::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ cache_->GetAppServiceParameters(policy_app_id, app_service_parameters);
+}
+
+bool PolicyManagerImpl::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->UnknownRPCPassthroughAllowed(policy_app_id);
+}
+
void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
@@ -874,8 +954,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
for (; end != parameter; ++parameter) {
if (!result.HasParameter(*parameter)) {
LOG4CXX_DEBUG(logger_,
- "Parameter " << *parameter << " is unknown."
- " Adding to undefined list.");
+ "Parameter " << *parameter
+ << " is unknown."
+ " Adding to undefined list.");
result.list_of_undefined_params.insert(*parameter);
}
}
@@ -910,7 +991,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
"Couldn't find device info for application id "
- "'" << application_id << "'");
+ "'" << application_id
+ << "'");
return;
}
@@ -2033,6 +2115,11 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
return ret;
}
@@ -2104,9 +2191,9 @@ void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
if (GetDefaultHmi(who.app_id, &default_hmi)) {
listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
} else {
- LOG4CXX_WARN(logger_,
- "Couldn't get default HMI level for application "
- << who.app_id);
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't get default HMI level for application " << who.app_id);
}
}
@@ -2141,6 +2228,15 @@ void PolicyManagerImpl::SendAppPermissionsChanged(
listener()->OnPermissionsUpdated(application_id, notification_data);
}
+void PolicyManagerImpl::SendAuthTokenUpdated(const std::string policy_app_id) {
+ bool enabled = false;
+ std::string end, cert, ctt, hap;
+ std::string auth_token;
+ cache_->GetCloudAppParameters(
+ policy_app_id, enabled, end, cert, auth_token, ctt, hap);
+ listener_->OnAuthTokenUpdated(policy_app_id, auth_token);
+}
+
void PolicyManagerImpl::OnPrimaryGroupsChanged(
const std::string& application_id) {
const std::vector<std::string> devices =
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index 27db505e3f..5494b8a881 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -1,4 +1,5 @@
#include "policy/policy_table/enums.h"
+#include <cstring>
namespace rpc {
namespace policy_table_interface_base {
@@ -137,6 +138,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_FUELRANGE:
return true;
+ case P_CLOUD_APP_VEHICLE_ID:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -232,6 +235,8 @@ const char* EnumToJsonString(Parameter val) {
return "instantFuelConsumption";
case P_FUELRANGE:
return "fuelRange";
+ case P_CLOUD_APP_VEHICLE_ID:
+ return "cloudAppVehicleID";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -336,6 +341,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("fuelRange" == literal) {
*result = P_FUELRANGE;
return true;
+ } else if ("cloudAppVehicleID" == literal) {
+ *result = P_CLOUD_APP_VEHICLE_ID;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -621,6 +629,8 @@ bool IsValidEnum(RequestType val) {
return true;
case RT_OEM_SPECIFIC:
return true;
+ case RT_ICON_URL:
+ return true;
case RT_EMPTY:
return true;
default:
@@ -672,6 +682,8 @@ const char* EnumToJsonString(RequestType val) {
return "FOTA";
case RT_OEM_SPECIFIC:
return "OEM_SPECIFIC";
+ case RT_ICON_URL:
+ return "ICON_URL";
case RT_EMPTY:
return "EMPTY";
default:
@@ -764,6 +776,10 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
*result = RT_OEM_SPECIFIC;
return true;
}
+ if ("ICON_URL" == literal) {
+ *result = RT_ICON_URL;
+ return true;
+ }
if ("EMPTY" == literal) {
*result = RT_EMPTY;
return true;
@@ -840,6 +856,38 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
}
}
+bool IsValidEnum(HybridAppPreference val) {
+ return strlen(EnumToJsonString(val)) > 0;
+}
+
+const char* EnumToJsonString(HybridAppPreference val) {
+ switch (val) {
+ case HAP_MOBILE:
+ return "MOBILE";
+ case HAP_CLOUD:
+ return "CLOUD";
+ case HAP_BOTH:
+ return "BOTH";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal,
+ HybridAppPreference* result) {
+ if ("MOBILE" == literal) {
+ *result = HAP_MOBILE;
+ return true;
+ } else if ("CLOUD" == literal) {
+ *result = HAP_CLOUD;
+ return true;
+ } else if ("BOTH" == literal) {
+ *result = HAP_BOTH;
+ return true;
+ }
+ return false;
+}
+
bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
if ("RegisterAppInterface" == literal) {
*result = RegisterAppInterfaceID;
@@ -1081,6 +1129,41 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("SetCloudAppProperties" == literal) {
+ *result = SetCloudAppPropertiesID;
+ return true;
+ }
+
+ if ("GetCloudAppProperties" == literal) {
+ *result = GetCloudAppPropertiesID;
+ return true;
+ }
+
+ if ("PublishAppService" == literal) {
+ *result = PublishAppServiceID;
+ return true;
+ }
+
+ if ("GetFile" == literal) {
+ *result = GetFileID;
+ return true;
+ }
+
+ if ("GetAppServiceData" == literal) {
+ *result = GetAppServiceDataID;
+ return true;
+ }
+
+ if ("PerformAppServiceInteraction" == literal) {
+ *result = PerformAppServiceInteractionID;
+ return true;
+ }
+
+ if ("CloseApplication" == literal) {
+ *result = CloseApplicationID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1171,6 +1254,16 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("OnAppServiceData" == literal) {
+ *result = OnAppServiceDataID;
+ return true;
+ }
+
+ if ("OnSystemCapabilityUpdated" == literal) {
+ *result = OnSystemCapabilityUpdatedID;
+ return true;
+ }
+
if ("EncodedSyncPData" == literal) {
*result = EncodedSyncPDataID;
return true;
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
index 5922a020e6..ca3f8a1648 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -1,5 +1,5 @@
-#include <algorithm>
#include "policy/policy_table/types.h"
+#include <algorithm>
#include "rpc_base/rpc_base_json_inl.h"
namespace rpc {
@@ -221,6 +221,110 @@ void ApplicationPoliciesSection::SetPolicyTableType(PolicyTableType pt_type) {
apps.SetPolicyTableType(pt_type);
}
+// Handled RPC Methods
+AppServiceHandledRpc::AppServiceHandledRpc() : CompositeType(kUninitialized) {}
+
+AppServiceHandledRpc::~AppServiceHandledRpc() {}
+
+AppServiceHandledRpc::AppServiceHandledRpc(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , function_id(impl::ValueMember(value__, "function_id")) {}
+
+Json::Value AppServiceHandledRpc::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("function_id", function_id, &result__);
+ return result__;
+}
+
+bool AppServiceHandledRpc::is_valid() const {
+ if (!function_id.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppServiceHandledRpc::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppServiceHandledRpc::struct_empty() const {
+ if (function_id.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppServiceHandledRpc::SetPolicyTableType(PolicyTableType pt_type) {
+ function_id.SetPolicyTableType(pt_type);
+}
+
+void AppServiceHandledRpc::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!function_id.is_valid()) {
+ function_id.ReportErrors(&report__->ReportSubobject("function_id"));
+ }
+}
+
+// AppServiceInfo methods
+AppServiceInfo::AppServiceInfo() : CompositeType(kUninitialized) {}
+
+AppServiceInfo::~AppServiceInfo() {}
+
+AppServiceInfo::AppServiceInfo(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , service_names(impl::ValueMember(value__, "service_names"))
+ , handled_rpcs(impl::ValueMember(value__, "handled_rpcs")) {}
+
+Json::Value AppServiceInfo::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("service_names", service_names, &result__);
+ impl::WriteJsonField("parameters", handled_rpcs, &result__);
+ return result__;
+}
+
+bool AppServiceInfo::is_valid() const {
+ if (!service_names.is_valid()) {
+ return false;
+ }
+ if (!handled_rpcs.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppServiceInfo::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppServiceInfo::struct_empty() const {
+ if (service_names.is_initialized()) {
+ return false;
+ }
+ if (handled_rpcs.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppServiceInfo::SetPolicyTableType(PolicyTableType pt_type) {
+ service_names.SetPolicyTableType(pt_type);
+ handled_rpcs.SetPolicyTableType(pt_type);
+}
+
+void AppServiceInfo::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!service_names.is_valid()) {
+ service_names.ReportErrors(&report__->ReportSubobject("service_names"));
+ }
+ if (!handled_rpcs.is_valid()) {
+ handled_rpcs.ReportErrors(&report__->ReportSubobject("handled_rpcs"));
+ }
+}
+
// ApplicationParams methods
ApplicationParams::ApplicationParams() : PolicyBase() {}
@@ -241,7 +345,17 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
- , moduleType(impl::ValueMember(value__, "moduleType")) {}
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+ , certificate(impl::ValueMember(value__, "certificate"))
+ , hybrid_app_preference(impl::ValueMember(value__, "hybrid_app_preference"))
+ , endpoint(impl::ValueMember(value__, "endpoint"))
+ , enabled(impl::ValueMember(value__, "enabled"))
+ , auth_token(impl::ValueMember(value__, "auth_token"))
+ , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type"))
+ , icon_url(impl::ValueMember(value__, "icon_url"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services"))
+ , allow_unknown_rpc_passthrough(
+ impl::ValueMember(value__, "allow_unknown_rpc_passthrough")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -253,6 +367,18 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
impl::WriteJsonField("moduleType", moduleType, &result__);
+ impl::WriteJsonField("certificate", certificate, &result__);
+ impl::WriteJsonField(
+ "hybrid_app_preference", hybrid_app_preference, &result__);
+ impl::WriteJsonField("endpoint", endpoint, &result__);
+ impl::WriteJsonField("enabled", enabled, &result__);
+ impl::WriteJsonField("auth_token", auth_token, &result__);
+ impl::WriteJsonField("cloud_transport_type", cloud_transport_type, &result__);
+ impl::WriteJsonField("icon_url", auth_token, &result__);
+ impl::WriteJsonField("app_services", app_service_parameters, &result__);
+ impl::WriteJsonField("allow_unknown_rpc_passthrough",
+ allow_unknown_rpc_passthrough,
+ &result__);
return result__;
}
@@ -277,6 +403,33 @@ bool ApplicationParams::is_valid() const {
if (!moduleType.is_valid()) {
return false;
}
+ if (!certificate.is_valid()) {
+ return false;
+ }
+ if (!endpoint.is_valid()) {
+ return false;
+ }
+ if (!enabled.is_valid()) {
+ return false;
+ }
+ if (!auth_token.is_valid()) {
+ return false;
+ }
+ if (!cloud_transport_type.is_valid()) {
+ return false;
+ }
+ if (!hybrid_app_preference.is_valid()) {
+ return false;
+ }
+ if (!icon_url.is_valid()) {
+ return false;
+ }
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
+ if (!allow_unknown_rpc_passthrough.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -309,6 +462,33 @@ bool ApplicationParams::struct_empty() const {
if (moduleType.is_initialized()) {
return false;
}
+ if (certificate.is_initialized()) {
+ return false;
+ }
+ if (endpoint.is_initialized()) {
+ return false;
+ }
+ if (enabled.is_initialized()) {
+ return false;
+ }
+ if (auth_token.is_initialized()) {
+ return false;
+ }
+ if (cloud_transport_type.is_initialized()) {
+ return false;
+ }
+ if (hybrid_app_preference.is_initialized()) {
+ return false;
+ }
+ if (icon_url.is_initialized()) {
+ return false;
+ }
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
+ if (allow_unknown_rpc_passthrough.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -357,6 +537,36 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
+ if (!certificate.is_valid()) {
+ certificate.ReportErrors(&report__->ReportSubobject("certificate"));
+ }
+ if (!endpoint.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("endpoint"));
+ }
+ if (!enabled.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("enabled"));
+ }
+ if (!auth_token.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("auth_token"));
+ }
+ if (!cloud_transport_type.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("cloud_transport_type"));
+ }
+ if (!hybrid_app_preference.is_valid()) {
+ moduleType.ReportErrors(
+ &report__->ReportSubobject("hybrid_app_preference"));
+ }
+ if (!icon_url.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("icon_url"));
+ }
+ if (!app_service_parameters.is_valid()) {
+ app_service_parameters.ReportErrors(
+ &report__->ReportSubobject("app_services"));
+ }
+ if (!allow_unknown_rpc_passthrough.is_valid()) {
+ allow_unknown_rpc_passthrough.ReportErrors(
+ &report__->ReportSubobject("allow_unknown_rpc_passthrough"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -367,6 +577,14 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
moduleType.SetPolicyTableType(pt_type);
+ certificate.SetPolicyTableType(pt_type);
+ endpoint.SetPolicyTableType(pt_type);
+ enabled.SetPolicyTableType(pt_type);
+ cloud_transport_type.SetPolicyTableType(pt_type);
+ hybrid_app_preference.SetPolicyTableType(pt_type);
+ icon_url.SetPolicyTableType(pt_type);
+ app_service_parameters.SetPolicyTableType(pt_type);
+ allow_unknown_rpc_passthrough.SetPolicyTableType(pt_type);
}
// RpcParameters methods
diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc
index 9b227615d8..f9c3f82793 100644
--- a/src/components/policy/policy_external/src/policy_table/validation.cc
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -1,15 +1,15 @@
-#include <iostream>
#include <algorithm>
+#include <iostream>
#include "policy/policy_table/types.h"
-#include "utils/logger.h"
#include "utils/helpers.h"
+#include "utils/logger.h"
namespace {
bool IsPredefinedApplication(const std::string& app_id) {
using namespace rpc::policy_table_interface_base;
return kPreDataConsentApp == app_id || kDefaultApp == app_id;
}
-}
+} // namespace
namespace rpc {
namespace policy_table_interface_base {
@@ -102,9 +102,9 @@ bool ApplicationPoliciesSection::Validate() const {
}
if (!app_request_types.is_valid()) {
- LOG4CXX_WARN(logger_,
- "Invalid RequestTypes for " << app_id
- << " Will be cleaned up.");
+ LOG4CXX_WARN(
+ logger_,
+ "Invalid RequestTypes for " << app_id << " Will be cleaned up.");
app_request_types.CleanUp();
if (app_request_types.is_cleaned_up()) {
if (PT_PRELOADED == pt_type) {
@@ -194,6 +194,14 @@ bool ApplicationParams::ValidateModuleTypes() const {
return true;
}
+bool AppServiceHandledRpc::Validate() const {
+ return true;
+}
+
+bool AppServiceInfo::Validate() const {
+ return true;
+}
+
bool ApplicationParams::Validate() const {
if (is_initialized()) {
if (preconsented_groups.is_initialized()) {
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
index afb1180692..2c24bbc522 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
@@ -205,7 +205,11 @@ const std::string kUpdateGroupPermissions =
const std::string kInsertApplication =
"INSERT OR IGNORE INTO `application`(`id`, `keep_context`, `steal_focus`, "
" `default_hmi`, `priority_value`, `is_revoked`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( ?, ?, ?, ?, ?, ?, ?, ?) ";
+ " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
+ " `endpoint`, `enabled`, `auth_token`, "
+ " `cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`) "
+ "VALUES "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
@@ -232,8 +236,10 @@ const std::string kSelectPreconsentedGroupsId =
const std::string kSelectAppPolicies =
"SELECT `id`, `priority_value`, `default_hmi`, `keep_context`, "
- "`steal_focus`, "
- " `memory_kb`, `heart_beat_timeout_ms` FROM `application`";
+ " `steal_focus`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, "
+ " `hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, "
+ " `cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough` "
+ "FROM `application`";
const std::string kSelectFunctionalGroupNames =
"SELECT `id`, `user_consent_prompt`, `name`"
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
index a43b22a3b8..e4711a3cd2 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
@@ -29,15 +29,15 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/sql_pt_ext_representation.h"
#include <algorithm>
#include <utility>
-#include "utils/logger.h"
-#include "policy/sql_pt_ext_representation.h"
-#include "policy/sql_wrapper.h"
-#include "policy/sql_pt_queries.h"
-#include "policy/sql_pt_ext_queries.h"
-#include "policy/policy_helper.h"
#include "policy/cache_manager.h"
+#include "policy/policy_helper.h"
+#include "policy/sql_pt_ext_queries.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/sql_wrapper.h"
+#include "utils/logger.h"
namespace policy {
@@ -675,6 +675,21 @@ bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled rpcs.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from service names.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled service types.");
+ return false;
+ }
+
// First, all predefined apps (e.g. default, pre_DataConsent) should be saved,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -729,6 +744,10 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
// Stop saving other params, since predefined permissions already set
return true;
}
@@ -752,6 +771,31 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
app_query.Bind(5, app.second.is_null());
app_query.Bind(6, *app.second.memory_kb);
app_query.Bind(7, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
+ app.second.certificate.is_initialized()
+ ? app_query.Bind(8, *app.second.certificate)
+ : app_query.Bind(8);
+ app.second.hybrid_app_preference.is_initialized()
+ ? app_query.Bind(9,
+ std::string(policy_table::EnumToJsonString(
+ *app.second.hybrid_app_preference)))
+ : app_query.Bind(9);
+ app.second.endpoint.is_initialized()
+ ? app_query.Bind(10, *app.second.endpoint)
+ : app_query.Bind(10);
+ app.second.enabled.is_initialized() ? app_query.Bind(11, *app.second.enabled)
+ : app_query.Bind(11);
+ app.second.auth_token.is_initialized()
+ ? app_query.Bind(12, *app.second.auth_token)
+ : app_query.Bind(12);
+ app.second.cloud_transport_type.is_initialized()
+ ? app_query.Bind(13, *app.second.cloud_transport_type)
+ : app_query.Bind(13);
+ app.second.icon_url.is_initialized()
+ ? app_query.Bind(14, *app.second.icon_url)
+ : app_query.Bind(14);
+ app.second.allow_unknown_rpc_passthrough.is_initialized()
+ ? app_query.Bind(15, *app.second.allow_unknown_rpc_passthrough)
+ : app_query.Bind(15);
if (!app_query.Exec() || !app_query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into application.");
@@ -786,6 +830,11 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -873,7 +922,24 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
params.steal_focus = query.GetBoolean(4);
*params.memory_kb = query.GetInteger(5);
*params.heart_beat_timeout_ms = query.GetUInteger(6);
+ if (!query.IsNull(7)) {
+ *params.certificate = query.GetString(7);
+ }
+ // Read cloud app properties
+ policy_table::HybridAppPreference hap;
+ bool valid = policy_table::EnumFromJsonString(query.GetString(8), &hap);
+ if (valid) {
+ *params.hybrid_app_preference = hap;
+ }
+ *params.endpoint = query.GetString(9);
+ if (!query.IsNull(10)) {
+ *params.enabled = query.GetBoolean(10);
+ }
+ *params.auth_token = query.GetString(11);
+ *params.cloud_transport_type = query.GetString(12);
+ *params.icon_url = query.GetString(13);
+ *params.allow_unknown_rpc_passthrough = query.GetBoolean(14);
const auto& gather_app_id = ((*policies).apps[app_id].is_string())
? (*policies).apps[app_id].get_string()
: app_id;
@@ -906,6 +972,10 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
if (!GatherRequestSubType(gather_app_id, &*params.RequestSubType)) {
return false;
}
+ if (!GatherAppServiceParameters(gather_app_id,
+ &*params.app_service_parameters)) {
+ return false;
+ }
GatherPreconsentedGroup(gather_app_id, &*params.preconsented_groups);
(*policies).apps[app_id] = params;
}
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 97d75731ea..f4cac214a5 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -98,6 +98,9 @@ const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `hmi_level`( "
" `value` VARCHAR(45) PRIMARY KEY NOT NULL "
"); "
+ "CREATE TABLE IF NOT EXISTS `hybrid_app_preference`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
"CREATE TABLE IF NOT EXISTS `notifications_by_priority`( "
" `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL, "
" `value` INTEGER NOT NULL, "
@@ -147,6 +150,14 @@ const std::string kCreateSchema =
" `is_predata` BOOLEAN, "
" `memory_kb` INTEGER NOT NULL, "
" `heart_beat_timeout_ms` INTEGER NOT NULL, "
+ " `certificate` VARCHAR(65535), "
+ " `hybrid_app_preference_value` VARCHAR(255), "
+ " `endpoint` VARCHAR(255), "
+ " `enabled` BOOLEAN, "
+ " `auth_token` VARCHAR(65535), "
+ " `cloud_transport_type` VARCHAR(255), "
+ " `icon_url` VARCHAR(65535), "
+ " `allow_unknown_rpc_passthrough` BOOLEAN, "
" `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, "
" CONSTRAINT `fk_application_hmi_level1` "
" FOREIGN KEY(`default_hmi`) "
@@ -154,11 +165,17 @@ const std::string kCreateSchema =
" CONSTRAINT `fk_application_priorities1` "
" FOREIGN KEY(`priority_value`) "
" REFERENCES `priority`(`value`) "
+ " CONSTRAINT `fk_application_hybrid_app_preference1` "
+ " FOREIGN KEY(`hybrid_app_preference_value`) "
+ " REFERENCES `hybrid_app_preference`(`value`) "
"); "
"CREATE INDEX IF NOT EXISTS `application.fk_application_hmi_level1_idx` "
" ON `application`(`default_hmi`); "
"CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx` "
" ON `application`(`priority_value`); "
+ "CREATE INDEX IF NOT EXISTS "
+ "`application.fk_application_hybrid_app_preference1` "
+ " ON `application`(`hybrid_app_preference_value`); "
"CREATE TABLE IF NOT EXISTS `app_group`( "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
@@ -286,6 +303,30 @@ const std::string kCreateSchema =
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `app_service_types`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `service_type` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " CONSTRAINT `fk_service_type_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `app_service_names`( "
+ " `service_type_id` INTEGER NOT NULL, "
+ " `service_name` VARCHAR(45), "
+ " PRIMARY KEY(`service_name`,`service_type_id`), "
+ " CONSTRAINT `fk_service_name_service_type_id` "
+ " FOREIGN KEY(`service_type_id`) "
+ " REFERENCES `app_service_types`(`id`) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `app_service_handled_rpcs`( "
+ " `service_type_id` INTEGER NOT NULL, "
+ " `function_id` INTEGER, "
+ " PRIMARY KEY(`function_id`,`service_type_id`), "
+ " CONSTRAINT `fk_function_id_service_type_id` "
+ " FOREIGN KEY(`service_type_id`) "
+ " REFERENCES `app_service_types`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
" ON `app_type`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
@@ -430,6 +471,9 @@ const std::string kInsertInitData =
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('LIMITED'); "
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('BACKGROUND'); "
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('NONE'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('MOBILE'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('CLOUD'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('BOTH'); "
"INSERT OR IGNORE INTO `version` (`number`) VALUES('0'); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
"";
@@ -491,6 +535,9 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `app_type`; "
"DROP TABLE IF EXISTS `request_type`; "
"DROP TABLE IF EXISTS `request_subtype`; "
+ "DROP TABLE IF EXISTS `app_service_types`; "
+ "DROP TABLE IF EXISTS `app_service_names`; "
+ "DROP TABLE IF EXISTS `app_service_handled_rpcs`; "
"DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
"DROP TABLE IF EXISTS `nickname`; "
"DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
@@ -532,6 +579,7 @@ const std::string kDropSchema =
"`notifications_by_priority.fk_notifications_by_priority_priority1_idx`; "
"DROP TABLE IF EXISTS `notifications_by_priority`; "
"DROP TABLE IF EXISTS `hmi_level`; "
+ "DROP TABLE IF EXISTS `hybrid_app_preference`; "
"DROP TABLE IF EXISTS `priority`; "
"DROP TABLE IF EXISTS `functional_group`; "
"DROP TABLE IF EXISTS `module_config`; "
@@ -628,8 +676,11 @@ const std::string kInsertRpcWithParameter =
const std::string kInsertApplication =
"INSERT OR IGNORE INTO `application` (`id`, `priority_value`, "
- "`is_revoked`, `memory_kb`,"
- " `heart_beat_timeout_ms`) VALUES (?,?,?,?,?)";
+ "`is_revoked`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, "
+ "`hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, "
+ "`cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`) "
+ "VALUES "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)";
const std::string kInsertAppGroup =
"INSERT INTO `app_group` (`application_id`, `functional_group_id`)"
@@ -650,6 +701,21 @@ const std::string kInsertRequestSubType =
"`request_subtype`) "
"VALUES (?, ?)";
+const std::string kInsertAppServiceTypes =
+ "INSERT INTO `app_service_types` (`id`, "
+ "`service_type`, `application_id`) "
+ "VALUES (?, ?, ?)";
+
+const std::string kInsertAppServiceNames =
+ "INSERT INTO `app_service_names` (`service_type_id`, "
+ "`service_name`) "
+ "VALUES (?, ?)";
+
+const std::string kInsertAppServiceHandledRpcs =
+ "INSERT INTO `app_service_handled_rpcs` (`service_type_id`, "
+ "`function_id`) "
+ "VALUES (?, ?)";
+
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
const std::string kInsertMessageType =
@@ -752,7 +818,11 @@ const std::string kSelectUserMsgsVersion =
const std::string kSelectAppPolicies =
"SELECT `id`, `priority_value`, `memory_kb`, "
- " `heart_beat_timeout_ms` FROM `application`";
+ " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
+ " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, `icon_url`, "
+ " `allow_unknown_rpc_passthrough` "
+ "FROM "
+ " `application`";
const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
@@ -779,6 +849,21 @@ const std::string kSelectRequestSubTypes =
"`application_id` "
"= ?";
+const std::string kSelectAppServiceTypes =
+ "SELECT `id`, `service_type` FROM `app_service_types` WHERE "
+ "`application_id` "
+ "= ?";
+
+const std::string kSelectAppServiceNames =
+ "SELECT DISTINCT `service_name` FROM `app_service_names` WHERE "
+ "`service_type_id` "
+ "= ?";
+
+const std::string kSelectAppServiceHandledRpcs =
+ "SELECT DISTINCT `function_id` FROM `app_service_handled_rpcs` WHERE "
+ "`service_type_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -826,6 +911,13 @@ const std::string kDeleteRequestType = "DELETE FROM `request_type`";
const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+const std::string kDeleteAppServiceTypes = "DELETE FROM `app_service_types`";
+
+const std::string kDeleteAppServiceNames = "DELETE FROM `app_service_names`";
+
+const std::string kDeleteAppServiceHandledRpcs =
+ "DELETE FROM `app_service_handled_rpcs`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
@@ -849,15 +941,22 @@ const std::string kDeleteAppGroupByApplicationId =
const std::string kInsertApplicationFull =
"INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, "
- " `memory_kb`, `heart_beat_timeout_ms`) "
- " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ " `is_predata`, `memory_kb`, `heart_beat_timeout_ms`, "
+ " `certificate`, `hybrid_app_preference_value`, `endpoint`, `enabled`, "
+ " `auth_token`, `cloud_transport_type`, `icon_url`, "
+ "`allow_unknown_rpc_passthrough`) "
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
const std::string kSelectApplicationFull =
"SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
" `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
- " `heart_beat_timeout_ms` FROM `application` WHERE `id` = ?";
+ " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
+ " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, "
+ "`icon_url`, "
+ " `allow_unknown_rpc_passthrough` "
+ "FROM `application` "
+ "WHERE `id` = ?";
const std::string kSelectDBVersion =
"SELECT `db_version_hash` from `_internal_data`";
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 c8b367c8ec..1bb0cf0fa1 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -30,24 +30,24 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sstream>
-#include <stdlib.h>
-#include <stdint.h>
#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <unistd.h>
+#include <sstream>
-#include "utils/logger.h"
+#include "config_profile/profile.h"
+#include "policy/cache_manager.h"
+#include "policy/policy_helper.h"
+#include "policy/sql_pt_ext_queries.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/sql_wrapper.h"
#include "utils/date_time.h"
-#include "utils/sqlite_wrapper/sql_database.h"
#include "utils/file_system.h"
#include "utils/gen_hash.h"
-#include "policy/sql_pt_representation.h"
-#include "policy/sql_wrapper.h"
-#include "policy/sql_pt_ext_queries.h"
-#include "policy/sql_pt_queries.h"
-#include "policy/policy_helper.h"
-#include "policy/cache_manager.h"
-#include "config_profile/profile.h"
+#include "utils/logger.h"
+#include "utils/sqlite_wrapper/sql_database.h"
namespace policy {
@@ -130,9 +130,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id,
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectRpc)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement from rpcs"
- << query.LastError().text());
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect select statement from rpcs" << query.LastError().text());
return;
}
query.Bind(0, app_id);
@@ -408,9 +408,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings* settings) {
utils::dbms::SQLQuery check_first_run(db());
if (check_first_run.Prepare(sql_pt::kIsFirstRun) &&
check_first_run.Next()) {
- LOG4CXX_INFO(logger_,
- "Selecting is first run "
- << check_first_run.GetBoolean(0));
+ LOG4CXX_INFO(
+ logger_,
+ "Selecting is first run " << check_first_run.GetBoolean(0));
if (check_first_run.GetBoolean(0)) {
utils::dbms::SQLQuery set_not_first_run(db());
set_not_first_run.Exec(sql_pt::kSetNotFirstRun);
@@ -761,6 +761,24 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
*params.memory_kb = query.GetInteger(2);
*params.heart_beat_timeout_ms = query.GetUInteger(3);
+ if (!query.IsNull(4)) {
+ *params.certificate = query.GetString(4);
+ }
+
+ // Read cloud app properties
+ policy_table::HybridAppPreference hap;
+ bool valid = policy_table::EnumFromJsonString(query.GetString(5), &hap);
+ if (valid) {
+ *params.hybrid_app_preference = hap;
+ }
+ *params.endpoint = query.GetString(6);
+ if (!query.IsNull(7)) {
+ *params.enabled = query.GetBoolean(7);
+ }
+ *params.auth_token = query.GetString(8);
+ *params.cloud_transport_type = query.GetString(9);
+ *params.icon_url = query.GetString(10);
+ *params.allow_unknown_rpc_passthrough = query.GetBoolean(11);
const auto& gather_app_id = ((*policies).apps[app_id].is_string())
? (*policies).apps[app_id].get_string()
: app_id;
@@ -793,6 +811,10 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherRequestSubType(gather_app_id, &*params.RequestSubType)) {
return false;
}
+ if (!GatherAppServiceParameters(gather_app_id,
+ &*params.app_service_parameters)) {
+ return false;
+ }
(*policies).apps[app_id] = params;
}
@@ -984,6 +1006,21 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled rpcs.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from service names.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled service types.");
+ return false;
+ }
+
// All predefined apps (e.g. default, pre_DataConsent) should be saved first,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -1035,6 +1072,30 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
app_query.Bind(2, app.second.is_null());
app_query.Bind(3, *app.second.memory_kb);
app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
+ app.second.certificate.is_initialized()
+ ? app_query.Bind(5, *app.second.certificate)
+ : app_query.Bind(5);
+ app.second.hybrid_app_preference.is_initialized()
+ ? app_query.Bind(6,
+ std::string(policy_table::EnumToJsonString(
+ *app.second.hybrid_app_preference)))
+ : app_query.Bind(6);
+ app.second.endpoint.is_initialized() ? app_query.Bind(7, *app.second.endpoint)
+ : app_query.Bind(7);
+ app.second.enabled.is_initialized() ? app_query.Bind(8, *app.second.enabled)
+ : app_query.Bind(8);
+ app.second.auth_token.is_initialized()
+ ? app_query.Bind(9, *app.second.auth_token)
+ : app_query.Bind(9);
+ app.second.cloud_transport_type.is_initialized()
+ ? app_query.Bind(10, *app.second.cloud_transport_type)
+ : app_query.Bind(10);
+ app.second.icon_url.is_initialized()
+ ? app_query.Bind(11, *app.second.icon_url)
+ : app_query.Bind(11);
+ app.second.allow_unknown_rpc_passthrough.is_initialized()
+ ? app_query.Bind(12, *app.second.allow_unknown_rpc_passthrough)
+ : app_query.Bind(12);
if (!app_query.Exec() || !app_query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into application.");
@@ -1071,6 +1132,10 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveRequestType(app.first, *app.second.RequestType)) {
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
return true;
}
@@ -1118,9 +1183,9 @@ bool SQLPTRepresentation::SaveAppGroup(
query.Bind(0, app_id);
query.Bind(1, *it);
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert into app group."
- << query.LastError().text());
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect insert into app group." << query.LastError().text());
return false;
}
}
@@ -1235,6 +1300,85 @@ bool SQLPTRepresentation::SaveRequestSubType(
return true;
}
+bool SQLPTRepresentation::SaveAppServiceParameters(
+ const std::string& app_id,
+ const policy_table::AppServiceParameters& app_service_parameters) {
+ LOG4CXX_INFO(logger_, "Save app service parameters");
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt::kInsertAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app service types");
+ return false;
+ }
+ policy_table::AppServiceParameters::const_iterator it;
+ for (it = app_service_parameters.begin(); it != app_service_parameters.end();
+ ++it) {
+ // Create service type id from hashing app_id and service_type
+ std::string str_to_hash = std::string(app_id + it->first);
+ const long int id = abs(CacheManager::GenerateHash(str_to_hash));
+ query.Bind(0, static_cast<int64_t>(id));
+ query.Bind(1, it->first);
+ query.Bind(2, app_id);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Insert execute failed for into app service types");
+ return false;
+ }
+
+ // Insert app names array into db
+ utils::dbms::SQLQuery service_name_query(db());
+ if (!service_name_query.Prepare(sql_pt::kInsertAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app service names");
+ return false;
+ }
+
+ auto app_service_names = it->second.service_names;
+
+ if (app_service_names.is_initialized() && app_service_names->empty()) {
+ // App service names is an empty array
+ LOG4CXX_DEBUG(logger_, "App Service Names is Empty Array");
+ service_name_query.Bind(0, static_cast<int64_t>(id));
+ service_name_query.Bind(1);
+ if (!service_name_query.Exec() || !service_name_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into empty app service names");
+ return false;
+ }
+ } else {
+ policy_table::AppServiceNames::const_iterator names_it;
+ for (names_it = app_service_names->begin();
+ names_it != app_service_names->end();
+ ++names_it) {
+ service_name_query.Bind(0, static_cast<int64_t>(id));
+ service_name_query.Bind(1, *names_it);
+ if (!service_name_query.Exec() || !service_name_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app service names");
+ return false;
+ }
+ }
+ }
+
+ // Insert handled rpcs array into db
+ utils::dbms::SQLQuery handled_rpcs_query(db());
+ if (!handled_rpcs_query.Prepare(sql_pt::kInsertAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for app service handled rpcs");
+ return false;
+ }
+
+ auto handled_rpcs = it->second.handled_rpcs;
+ policy_table::AppServiceHandledRpcs::const_iterator rpc_it;
+ for (rpc_it = handled_rpcs.begin(); rpc_it != handled_rpcs.end();
+ ++rpc_it) {
+ handled_rpcs_query.Bind(0, static_cast<int64_t>(id));
+ handled_rpcs_query.Bind(1, static_cast<int32_t>(rpc_it->function_id));
+ if (!handled_rpcs_query.Exec() || !handled_rpcs_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app service handled rpcs");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
bool SQLPTRepresentation::SaveModuleMeta(const policy_table::ModuleMeta& meta) {
// Section Module Meta is empty for SDL specific
return true;
@@ -1661,6 +1805,63 @@ bool SQLPTRepresentation::GatherRequestSubType(
return true;
}
+bool SQLPTRepresentation::GatherAppServiceParameters(
+ const std::string& app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ LOG4CXX_INFO(logger_, "Gather app service info");
+ utils::dbms::SQLQuery service_type_query(db());
+ if (!service_type_query.Prepare(sql_pt::kSelectAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from service_types");
+ return false;
+ }
+
+ utils::dbms::SQLQuery service_name_query(db());
+ if (!service_name_query.Prepare(sql_pt::kSelectAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from app_service_names");
+ return false;
+ }
+
+ utils::dbms::SQLQuery handled_rpcs_query(db());
+ if (!handled_rpcs_query.Prepare(sql_pt::kSelectAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from app_service_handled_rpcs");
+ return false;
+ }
+
+ service_type_query.Bind(0, app_id);
+ while (service_type_query.Next()) {
+ const int service_type_id = service_type_query.GetInteger(0);
+ std::string service_type = service_type_query.GetString(1);
+ (*app_service_parameters)[service_type] = policy_table::AppServiceInfo();
+
+ service_name_query.Bind(0, service_type_id);
+ while (service_name_query.Next()) {
+ LOG4CXX_DEBUG(logger_, "Loading service name");
+ (*app_service_parameters)[service_type].service_names->push_back(
+ service_name_query.GetString(0));
+ (*app_service_parameters)[service_type].service_names->mark_initialized();
+ }
+
+ handled_rpcs_query.Bind(0, service_type_id);
+ while (handled_rpcs_query.Next()) {
+ policy_table::AppServiceHandledRpc handled_rpc;
+ handled_rpc.function_id = handled_rpcs_query.GetInteger(0);
+ (*app_service_parameters)[service_type].handled_rpcs.push_back(
+ handled_rpc);
+ }
+
+ if (!service_name_query.Reset()) {
+ LOG4CXX_ERROR(logger_, "Could not reset service_name query");
+ return false;
+ }
+ if (!handled_rpcs_query.Reset()) {
+ LOG4CXX_ERROR(logger_, "Could not reset handled_rpcs query");
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -2006,6 +2207,12 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
return false;
}
+ policy_table::AppServiceParameters app_service_parameters;
+ if (!GatherAppServiceParameters(kDefaultId, &app_service_parameters) ||
+ !SaveAppServiceParameters(app_id, app_service_parameters)) {
+ return false;
+ }
+
policy_table::Strings default_groups;
bool ret = (GatherAppGroup(kDefaultId, &default_groups) &&
SaveAppGroup(app_id, default_groups));
@@ -2107,7 +2314,7 @@ bool SQLPTRepresentation::CopyApplication(const std::string& source,
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kInsertApplicationFull)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application full.");
return false;
}
query.Bind(0, destination);
@@ -2125,6 +2332,22 @@ bool SQLPTRepresentation::CopyApplication(const std::string& source,
: query.Bind(7, source_app.GetBoolean(6));
query.Bind(8, source_app.GetInteger(7));
query.Bind(9, source_app.GetInteger(8));
+ source_app.IsNull(9) ? query.Bind(10)
+ : query.Bind(10, source_app.GetString(9));
+ source_app.IsNull(10) ? query.Bind(11)
+ : query.Bind(11, source_app.GetString(10));
+ source_app.IsNull(11) ? query.Bind(12)
+ : query.Bind(12, source_app.GetString(11));
+ source_app.IsNull(12) ? query.Bind(13)
+ : query.Bind(13, source_app.GetBoolean(12));
+ source_app.IsNull(13) ? query.Bind(14)
+ : query.Bind(14, source_app.GetString(13));
+ source_app.IsNull(14) ? query.Bind(15)
+ : query.Bind(15, source_app.GetString(14));
+ source_app.IsNull(15) ? query.Bind(16)
+ : query.Bind(16, source_app.GetString(15));
+ source_app.IsNull(16) ? query.Bind(17)
+ : query.Bind(17, source_app.GetBoolean(16));
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Failed inserting into application.");
diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc
index d46f6a315a..5165c46edb 100644
--- a/src/components/policy/policy_external/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
-#include <cassert>
#include "policy/usage_statistics/counter.h"
+#include <cassert>
#include "utils/date_time.h"
#include "utils/timer_task_impl.h"
diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc
index 22b19c878e..af166f96ad 100644
--- a/src/components/policy/policy_external/test/counter_test.cc
+++ b/src/components/policy/policy_external/test/counter_test.cc
@@ -29,12 +29,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/usage_statistics/counter.h"
#include "gtest/gtest.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "policy/usage_statistics/counter.h"
-using ::testing::StrictMock;
using ::testing::InSequence;
+using ::testing::StrictMock;
namespace test {
namespace components {
@@ -179,6 +179,6 @@ TEST(
// Act
hmi_full_stopwatch.WriteTime();
}
-} // namespace usage_statistics
-} // components
+} // namespace usage_statistics_test
+} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h
index 3225e79e01..b307270b10 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h
@@ -37,10 +37,10 @@
#include "gmock/gmock.h"
+#include "mock_pt_representation.h"
+#include "policy/policy_table/types.h"
#include "policy/pt_ext_representation.h"
#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-#include "mock_pt_representation.h"
namespace policy_table = ::rpc::policy_table_interface_base;
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
index 3870e4ece1..33d4c46e64 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
@@ -37,9 +37,9 @@
#include "gmock/gmock.h"
+#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
namespace policy_table = ::rpc::policy_table_interface_base;
diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
index 23701e86de..65972e0a82 100644
--- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
+++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
@@ -40,16 +40,16 @@
#include "policy/policy_manager_impl.h"
#include "policy/mock_cache_manager.h"
-#include "policy/mock_update_status_manager.h"
#include "policy/mock_policy_listener.h"
#include "policy/mock_policy_settings.h"
+#include "policy/mock_update_status_manager.h"
namespace test {
namespace components {
namespace policy_test {
-using ::testing::NiceMock;
using ::policy::PolicyManagerImpl;
+using ::testing::NiceMock;
typedef std::multimap<std::string, policy_table::Rpcs&>
UserConsentPromptToRpcsConnections;
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
index 4cd71d6004..c5f4b90120 100644
--- a/src/components/policy/policy_external/test/json/PTU.json
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -485,6 +485,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -509,6 +510,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -533,6 +535,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -556,6 +559,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
index 9c9436144e..01cca4a6fd 100644
--- a/src/components/policy/policy_external/test/json/PTU2.json
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -485,6 +485,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -509,6 +510,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -533,6 +535,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -556,6 +559,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
index 279051e7bf..f48f246114 100644
--- a/src/components/policy/policy_external/test/json/PTU3.json
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -485,6 +485,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -509,6 +510,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -533,6 +535,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -556,6 +559,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
index 08027f2786..1e99e7442c 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -1605,6 +1605,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1623,6 +1624,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1641,6 +1643,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1658,6 +1661,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
index a88bcfbd08..dc40c3a182 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -1608,6 +1608,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1626,6 +1627,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1644,6 +1646,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1661,6 +1664,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
index 250bfb21f2..3fcc71ca72 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -1605,6 +1605,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1623,6 +1624,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1641,6 +1643,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1658,6 +1661,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
index 85910c098c..03a5e8d203 100644
--- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -1604,6 +1604,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1622,6 +1623,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1640,6 +1642,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1657,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
index 1c1b04ca2b..b5dd0bfff5 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
index 51690d7b8e..8fa8e6f3d0 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
index cfa6c4010c..589cdc7a81 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
index d7177f2251..9b580b2a08 100644
--- a/src/components/policy/policy_external/test/json/ptu2_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -497,6 +497,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -521,6 +522,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -545,6 +547,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -568,6 +571,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
index 6a531dd2ad..8d18a9e336 100644
--- a/src/components/policy/policy_external/test/json/ptu_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index 59e3f947c3..ad264c8518 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
@@ -363,6 +363,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -383,6 +384,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -403,6 +405,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -422,6 +425,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
index a4491fd449..909fd2cb2f 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -2321,6 +2321,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -2343,6 +2344,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -2365,6 +2367,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2386,6 +2389,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
index 83c4ccf15c..87fac7c76c 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -497,6 +497,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -521,6 +522,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -545,6 +547,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -568,6 +571,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index 7b882c6ceb..440963ba48 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
@@ -1622,6 +1622,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1640,6 +1641,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1658,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1675,6 +1678,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index 7d90275328..5900acbcfb 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
@@ -1622,6 +1622,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1640,6 +1641,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1658,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1675,6 +1678,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
index 807b0eb312..b3affeb91d 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -1606,6 +1606,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1624,6 +1625,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1642,6 +1644,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1659,6 +1662,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
index 3d0a004dbe..639d0143c8 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
index 6a36f1f9c5..53216cab3d 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
index 3303d56844..a529dc9a3b 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
index e7a33ba2c0..a57791e248 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
index 08739f9d6a..5a633e7c95 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
index 21396b8cac..86c121491b 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
index 5aa467a23c..2b57912016 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -496,6 +496,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -520,6 +521,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -544,6 +546,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -567,6 +570,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 5827ab287a..acf18c5706 100644
--- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
@@ -20,7 +20,13 @@
"nicknames" : [ "SyncProxyTester" ],
"priority" : "EMERGENCY",
"steal_focus" : true,
- "heart_beat_timeout_ms": 5000
+ "heart_beat_timeout_ms": 5000,
+ "app_services": {
+ "MEDIA": {
+ "service_names" : ["SDL App", "SDL Music"],
+ "handled_rpcs" : [{"function_id": 41}]
+ }
+ }
},
"default" : {
"default_hmi" : "NONE",
@@ -1598,6 +1604,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1616,6 +1623,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1634,6 +1642,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1651,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index 93d4e19751..066b5756e2 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -30,19 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdint.h>
#include <fstream>
#include <string>
#include <vector>
-#include <stdint.h>
#include "gtest/gtest.h"
#include "policy/policy_manager_impl_test_base.h"
#include "policy/policy_table/types.h"
+#include "json/reader.h"
#include "utils/date_time.h"
#include "utils/gen_hash.h"
-#include "json/reader.h"
namespace test {
namespace components {
@@ -1713,6 +1713,6 @@ TEST_F(
CompareRequestTypesContainers(correct_types, received_types);
}
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index c1ff31f748..3c6377cf5f 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -63,9 +63,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
Json::Value val2(Json::arrayValue);
val2[0] = hmi_level_[index_];
val[new_data.new_field_value_]["hmi_levels"] = val2;
- root["policy_table"]["functional_groupings"][new_data
- .new_field_name_]["rpcs"] =
- val;
+ root["policy_table"]["functional_groupings"][new_data.new_field_name_]
+ ["rpcs"] = val;
root["policy_table"]["functional_groupings"][new_data.new_field_name_]
["user_consent_prompt"] = new_data.new_field_name_;
}
@@ -333,6 +332,6 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) {
EXPECT_TRUE(result);
}
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc
index 2f1cc5a9d3..f886108463 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc
@@ -29,15 +29,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include <fstream>
+#include "gtest/gtest.h"
#include "mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
-using ::testing::_;
-using ::policy::PolicyManagerImpl;
using ::policy::BinaryMessage;
using ::policy::MockPolicyListener;
+using ::policy::PolicyManagerImpl;
+using ::testing::_;
namespace test {
namespace components {
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index 6521db7c36..47b3959aee 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -32,16 +32,16 @@
#include <fstream>
-#include "json/reader.h"
-#include "gtest/gtest.h"
#include <utility>
+#include "gtest/gtest.h"
+#include "json/reader.h"
#include "policy/policy_manager_impl_test_base.h"
using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using ::testing::SetArgReferee;
-using ::testing::AtLeast;
namespace test {
namespace components {
@@ -345,6 +345,37 @@ TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(app_id_2_));
}
+TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) {
+ // Arrange
+ std::string kServiceType = "MEDIA";
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ GetPTU("json/valid_sdl_pt_update.json");
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Try to add existing app
+ policy_table::AppServiceParameters app_service_parameters =
+ policy_table::AppServiceParameters();
+ policy_manager_->GetAppServiceParameters(app_id_2_, &app_service_parameters);
+
+ ASSERT_FALSE(app_service_parameters.find(kServiceType) ==
+ app_service_parameters.end());
+
+ auto service_names = *(app_service_parameters[kServiceType].service_names);
+
+ ASSERT_TRUE(service_names.is_initialized());
+ ASSERT_EQ(service_names.size(), 2u);
+ EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App");
+ EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music");
+
+ auto handled_rpcs = app_service_parameters[kServiceType].handled_rpcs;
+
+ ASSERT_TRUE(handled_rpcs.is_initialized());
+ EXPECT_EQ(handled_rpcs[0].function_id, 41);
+
+ // Check no update required
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
TEST_F(
PolicyManagerImplTest_ExternalConsent,
ExternalConsent_SetExternalConsentStatusWhileAppExists_ExpectUserConsentsUpdateForApp) {
@@ -1120,6 +1151,6 @@ TEST_F(
EXPECT_EQ(Boolean(false), updated_group_2->second);
}
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 13efa39805..82d87cd7ba 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -30,17 +30,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
-#include <fstream>
#include <stdint.h>
+#include <fstream>
+#include <string>
#include <vector>
#include "policy/policy_manager_impl_test_base.h"
#include "utils/file_system.h"
-#include "utils/gen_hash.h"
#include "json/reader.h"
+#include "utils/gen_hash.h"
#include "policy/mock_pt_ext_representation.h"
@@ -48,10 +48,10 @@ namespace test {
namespace components {
namespace policy_test {
+using ::testing::_;
+using ::testing::ContainerEq;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::ContainerEq;
-using ::testing::_;
// Help functions
char GenRandomChar(char range_from, char range_to) {
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index 93cfa36277..c58ae00ff4 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -670,6 +670,6 @@ TEST_F(
policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
}
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
index b87598b986..a9c7667ba6 100644
--- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
@@ -29,27 +29,27 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
-#include <map>
+#include "policy/sql_pt_ext_representation.h"
#include <algorithm>
-#include <utility>
-#include <string>
-#include <iterator>
#include <iostream>
+#include <iterator>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
#include "gtest/gtest.h"
-#include "policy/sql_pt_ext_representation.h"
-#include "utils/gen_hash.h"
-#include "utils/file_system.h"
-#include "sqlite_wrapper/sql_query.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
#include "policy/mock_policy_settings.h"
+#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base.h"
+#include "sqlite_wrapper/sql_query.h"
+#include "utils/file_system.h"
+#include "utils/gen_hash.h"
using namespace ::policy;
namespace policy_table = rpc::policy_table_interface_base;
-using std::string;
using std::map;
using std::pair;
+using std::string;
using std::vector;
using testing::ReturnRef;
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 b0f340b0f2..9e6e18b77d 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
@@ -29,38 +29,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
-#include <string>
-#include <algorithm>
-#include <fstream>
#include <stdio.h>
#include <sys/stat.h>
+#include <algorithm>
+#include <fstream>
#include <memory>
+#include <string>
+#include <vector>
#include "gtest/gtest.h"
-#include "policy/sql_pt_representation.h"
-#include "utils/file_system.h"
-#include "utils/system.h"
-#include "policy/sql_wrapper.h"
-#include "policy/policy_types.h"
-#include "json/writer.h"
#include "json/reader.h"
-#include "policy/policy_table/types.h"
+#include "json/writer.h"
+#include "policy/mock_policy_settings.h"
#include "policy/policy_table/enums.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/sql_wrapper.h"
#include "rpc_base/rpc_base.h"
-#include "policy/mock_policy_settings.h"
+#include "utils/file_system.h"
+#include "utils/system.h"
namespace policy_table = rpc::policy_table_interface_base;
-using policy::SQLPTRepresentation;
using policy::CheckPermissionResult;
-using policy::UserFriendlyMessage;
using policy::EndpointUrls;
+using policy::SQLPTRepresentation;
+using policy::UserFriendlyMessage;
using policy::VehicleInfo;
-using testing::ReturnRef;
-using testing::Return;
-using testing::NiceMock;
using testing::Mock;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
namespace test {
namespace components {
@@ -406,8 +406,8 @@ TEST_F(SQLPTRepresentationTest,
query.Prepare(query_select);
query.Next();
- // 33 - is current total tables number created by schema
- const int policy_tables_number = 33;
+ // 37 - is current total tables number created by schema
+ const int policy_tables_number = 37;
ASSERT_EQ(policy_tables_number, query.GetInteger(0));
const std::string query_select_count_of_iap_buffer_full =
diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc
index bf443bb201..f5192471cc 100644
--- a/src/components/policy/policy_external/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_external/test/update_status_manager_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/update_status_manager.h"
#include "gtest/gtest.h"
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
-#include "policy/update_status_manager.h"
#include "utils/conditional_variable.h"
@@ -43,8 +43,8 @@ namespace policy_test {
using namespace ::policy;
using ::testing::_;
-using ::testing::Return;
using testing::NiceMock;
+using ::testing::Return;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
@@ -105,7 +105,7 @@ class WaitAsync {
const uint32_t timeout_;
sync_primitives::ConditionalVariable cond_var_;
};
-}
+} // namespace
ACTION_P(NotifyAsync, waiter) {
waiter->Notify();
@@ -298,6 +298,6 @@ TEST_F(UpdateStatusManagerTest,
EXPECT_FALSE(manager_->IsAppsSearchInProgress());
}
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index a5533302a5..3679b2efea 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -39,6 +39,7 @@ include_directories (
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/config_profile/include
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
set(POLICY_TABLE_PATHS
diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h
index c4de9b7e1f..c0df6b729f 100644
--- a/src/components/policy/policy_regular/include/policy/access_remote.h
+++ b/src/components/policy/policy_regular/include/policy/access_remote.h
@@ -32,9 +32,9 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
-#include <vector>
#include <ostream>
#include <string>
+#include <vector>
#include "policy/policy_table/types.h"
#include "policy/policy_types.h"
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index 48e00f7049..30732f685c 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -35,15 +35,15 @@
#include <map>
+#include "policy/cache_manager_interface.h"
#include "policy/pt_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/cache_manager_interface.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/lock.h"
-#include "utils/conditional_variable.h"
#include "policy/policy_types.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace policy {
class PolicySettings;
@@ -147,6 +147,108 @@ class CacheManager : public CacheManagerInterface {
virtual const VehicleInfo GetVehicleInfo() const;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const;
+
+ /**
+ * Initializes a new cloud application with default policies
+ * Then adds cloud specific policies
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual void InitCloudApp(const std::string& policy_app_id);
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled);
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token);
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type);
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint);
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames);
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(const std::string& policy_app_id,
+ const std::string& hybrid_app_preference);
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const;
+
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -186,6 +288,15 @@ class CacheManager : public CacheManagerInterface {
virtual std::string GetLockScreenIconUrl() const;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const;
+
+ /**
* @brief Get allowed number of notifications
* depending on application priority.
* @param priority Priority of application
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
index 10a6ea7f89..da15a4ecab 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -36,10 +36,10 @@
#include <string>
#include <vector>
-#include "policy/usage_statistics/counter.h"
-#include "policy/policy_types.h"
#include "policy/policy_settings.h"
#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+#include "policy/usage_statistics/counter.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -152,6 +152,109 @@ class CacheManagerInterface {
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ virtual void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const = 0;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ virtual bool GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const = 0;
+
+ /**
+ * Initializes a new cloud application with default policies
+ * Then adds cloud specific policies
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual void InitCloudApp(const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ virtual void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) = 0;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ virtual void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) = 0;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ virtual void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) = 0;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ virtual void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) = 0;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ virtual void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) = 0;
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ virtual void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) = 0;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ virtual void GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const = 0;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ */
+ virtual bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
@@ -192,6 +295,15 @@ class CacheManagerInterface {
virtual std::string GetLockScreenIconUrl() const = 0;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ virtual std::string GetIconUrl(const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get allowed number of notifications
* depending on application priority.
* @param priority Priority of application
@@ -348,10 +460,10 @@ class CacheManagerInterface {
std::string& default_hmi) const = 0;
/**
- * Gets HMI types from specific policy
- * @param app_id ID application
- * @return list of HMI types
- */
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
virtual const policy_table::AppHMITypes* GetHMITypes(
const std::string& app_id) = 0;
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
index 3ca0f93ebd..4c697858f5 100644
--- a/src/components/policy/policy_regular/include/policy/policy_helper.h
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -246,6 +246,6 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
* @return true, if succeded, otherwise - false
*/
bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
-}
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
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 51d4ee88aa..1860f7e591 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
@@ -33,21 +33,21 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
-#include <string>
-#include <list>
#include <cstdint>
+#include <list>
+#include <string>
-#include "utils/lock.h"
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#include "policy/cache_manager_interface.h"
+#include "policy/policy_helper.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
-#include "policy/cache_manager_interface.h"
-#include "policy/update_status_manager.h"
#include "policy/policy_table/functions.h"
+#include "policy/update_status_manager.h"
#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/policy_helper.h"
+#include "utils/lock.h"
#include "utils/timer.h"
-#include "policy/access_remote.h"
-#include "policy/access_remote_impl.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -117,6 +117,15 @@ class PolicyManagerImpl : public PolicyManager {
std::string GetLockScreenIconUrl() const OVERRIDE;
/**
+ * @brief Get Icon Url used for showing a cloud apps icon before the intial
+ *registration
+ *
+ * @return url which point to the resourse where icon could be
+ *obtained.
+ */
+ std::string GetIconUrl(const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief PTU is needed, for this PTS has to be formed and sent.
*/
bool RequestPTUpdate() OVERRIDE;
@@ -565,6 +574,109 @@ class PolicyManagerImpl : public PolicyManager {
const VehicleInfo GetVehicleInfo() const OVERRIDE;
/**
+ * @brief Get a list of enabled cloud applications
+ * @param enabled_apps List filled with the policy app id of each enabled
+ * cloud application
+ */
+ void GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const OVERRIDE;
+
+ /**
+ * @brief Get cloud app policy information, all fields that aren't set for a
+ * given app will be filled with empty strings
+ * @param policy_app_id Unique application id
+ * @param enabled Whether or not the app is enabled
+ * @param endpoint Filled with the endpoint used to connect to the cloud
+ * application
+ * @param certificate Filled with the certificate used to for creating a
+ * secure connection to the cloud application
+ * @param auth_token Filled with the token used for authentication when
+ * reconnecting to the cloud app
+ * @param cloud_transport_type Filled with the transport type used by the
+ * cloud application (ex. "WSS")
+ * @param hybrid_app_preference Filled with the hybrid app preference for the
+ * cloud application set by the user
+ */
+ bool GetCloudAppParameters(const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const OVERRIDE;
+
+ /**
+ * @ brief Initialize new cloud app in the policy table
+ * @ param policy_app_id Application ID
+ */
+
+ void InitCloudApp(const std::string& policy_app_id) OVERRIDE;
+
+ /**
+ * @brief Enable or disable a cloud application in the HMI
+ * @param enabled Cloud app enabled state
+ */
+ void SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) OVERRIDE;
+
+ /**
+ * @brief Set an app's auth token
+ * @param auth_token Cloud app authentication token
+ */
+ void SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's transport type
+ * @param cloud_transport_type Cloud app transport type
+ */
+ void SetAppCloudTransportType(
+ const std::string& policy_app_id,
+ const std::string& cloud_transport_type) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's endpoint url
+ * @param endpoint URL for websocket connection
+ */
+ void SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) OVERRIDE;
+
+ /**
+ * @brief Set a cloud app's nicknames
+ * @param nicknames Nicknames for cloud app
+ */
+ void SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) OVERRIDE;
+
+ /**
+ * @brief Set the user preference for how a hybrid (cloud and mobile) app
+ * should be used
+ * @param hybrid_app_preference Hybrid app user preference
+ */
+ void SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) OVERRIDE;
+
+ /**
+ * @brief Get app service parameters from the policy table
+ * @param policy_app_id Unique application id
+ * @param app_service_parameters Pointer to struct containing all app service
+ * information
+ */
+ void GetAppServiceParameters(const std::string& policy_app_id,
+ policy_table::AppServiceParameters*
+ app_service_parameters) const OVERRIDE;
+
+ /**
+ * @brief Check if an app can send unknown rpc requests to an app service
+ * provider
+ * @param policy_app_id Unique application id
+ * @return bool true if allowed
+ */
+ bool UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
@@ -840,11 +952,17 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id) OVERRIDE;
/**
- * @brief Gets all allowed module types
- * @param policy_app_id unique identifier of application
- * @param modules list of allowed module types
- * @return true if application has allowed modules
- */
+ * @brief notify listener of updated auth token for a given policy id
+ * @param policy_app_id the app id that has an updated auth token
+ */
+ void SendAuthTokenUpdated(const std::string policy_app_id);
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 1f10db9f6f..c7d9bc793b 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -86,6 +86,7 @@ enum Parameter {
P_STEERINGWHEELANGLE,
P_ENGINEOILLIFE,
P_MYKEY,
+ P_CLOUD_APP_VEHICLE_ID,
P_AIRBAGSTATUS,
P_BODYINFORMATION,
P_CLUSTERMODESTATUS,
@@ -167,6 +168,12 @@ bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+enum HybridAppPreference { HAP_MOBILE, HAP_CLOUD, HAP_BOTH };
+bool IsValidEnum(HybridAppPreference val);
+const char* EnumToJsonString(HybridAppPreference val);
+bool EnumFromJsonString(const std::string& literal,
+ HybridAppPreference* result);
+
/**
* @brief Enumeration FunctionID.
*
@@ -420,6 +427,41 @@ enum FunctionID {
SendHapticDataID = 49,
/**
+ * @brief SetCloudAppPropertiesID.
+ */
+ SetCloudAppPropertiesID = 50,
+
+ /**
+ * @brief GetCloudAppPropertiesID.
+ */
+ GetCloudAppPropertiesID = 51,
+
+ /**
+ * @brief PublishAppServiceID.
+ */
+ PublishAppServiceID = 52,
+
+ /**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief GetFileID
+ */
+ GetFileID = 54,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
+ * @brief CloseApplicationID.
+ */
+ CloseApplicationID = 58,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -510,6 +552,16 @@ enum FunctionID {
OnRCStatusID = 32785,
/**
+ * @brief OnAppServiceDataID.
+ */
+ OnAppServiceDataID = 32786,
+
+ /**
+ * @brief OnSystemCapabilityUpdatedID
+ */
+ OnSystemCapabilityUpdatedID = 32787,
+
+ /**
* @brief EncodedSyncPDataID.
*/
EncodedSyncPDataID = 65536,
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
index e201251745..e41069a86c 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -50,6 +50,8 @@ struct MessageLanguages;
struct MessageString;
struct RpcParameters;
struct Rpcs;
+struct AppServiceHandledRpc;
+struct AppServiceInfo;
} // namespace policy_table_interface_base
} // namespace rpc
@@ -98,6 +100,13 @@ typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
typedef Strings RequestSubTypes;
+typedef String<0, 255> AppServiceType;
+typedef String<0, 255> AppServiceName;
+typedef Array<AppServiceName, 0, 255> AppServiceNames;
+typedef Array<AppServiceHandledRpc, 0, 255> AppServiceHandledRpcs;
+typedef Map<AppServiceInfo, 0, 255> AppServiceParameters;
+typedef Integer<int32_t, 0, INT32_MAX> FunctionIDInt;
+
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
@@ -105,6 +114,45 @@ typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
+struct AppServiceHandledRpc : CompositeType {
+ public:
+ FunctionIDInt function_id;
+
+ public:
+ AppServiceHandledRpc();
+ ~AppServiceHandledRpc();
+ AppServiceHandledRpc(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ void ReportErrors(rpc::ValidationReport* report__) const;
+
+ private:
+ bool Validate() const;
+};
+
+struct AppServiceInfo : CompositeType {
+ public:
+ Optional<AppServiceNames> service_names;
+ AppServiceHandledRpcs handled_rpcs;
+
+ public:
+ AppServiceInfo();
+ ~AppServiceInfo();
+ AppServiceInfo(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ void ReportErrors(rpc::ValidationReport* report__) const;
+
+ private:
+ bool Validate() const;
+};
+
struct PolicyBase : CompositeType {
public:
Enum<Priority> priority;
@@ -142,8 +190,19 @@ struct ApplicationParams : PolicyBase {
Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
- Optional<String<0, 255> > certificate;
+ Optional<String<0, 65535> > certificate;
mutable Optional<ModuleTypes> moduleType;
+ // Cloud application params
+ Optional<Enum<HybridAppPreference> > hybrid_app_preference;
+ Optional<String<0, 255> > endpoint;
+ Optional<Boolean> enabled;
+ Optional<String<0, 65535> > auth_token;
+ Optional<String<0, 255> > cloud_transport_type;
+ Optional<String<0, 65535> > icon_url;
+
+ // App Service Params
+ Optional<AppServiceParameters> app_service_parameters;
+ Optional<Boolean> allow_unknown_rpc_passthrough;
public:
ApplicationParams();
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
index 276a0a5dca..0be5919126 100644
--- a/src/components/policy/policy_regular/include/policy/policy_types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -34,15 +34,15 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
#include <algorithm>
-#include <string>
-#include <vector>
#include <map>
+#include <memory>
#include <set>
+#include <string>
#include <utility>
-#include <memory>
+#include <vector>
-#include "utils/helpers.h"
#include "transport_manager/common.h"
+#include "utils/helpers.h"
namespace policy {
@@ -119,10 +119,10 @@ typedef std::vector<std::string> StringArray;
enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed };
/**
- * @struct Stores result of check:
- * if HMI Level was allowed for RPC to work in
- * and list of parameters allowed for RPC if specified in PT.
- */
+ * @struct Stores result of check:
+ * if HMI Level was allowed for RPC to work in
+ * and list of parameters allowed for RPC if specified in PT.
+ */
struct CheckPermissionResult {
CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {}
diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h
index 378a294532..0534b27093 100644
--- a/src/components/policy/policy_regular/include/policy/pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/pt_representation.h
@@ -33,12 +33,12 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_
-#include <vector>
-#include <string>
#include <memory>
-#include "policy/policy_types.h"
-#include "policy/policy_table/types.h"
+#include <string>
+#include <vector>
#include "policy/policy_settings.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
#include "utils/macro.h"
namespace policy {
@@ -265,10 +265,10 @@ class PTRepresentation {
virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
/**
- * Checks if the application has pre_data policy
- * @param app_id application id
- * @return true if application has pre_data policy
- */
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
/**
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
index 191873efe0..bada9a003a 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
@@ -66,6 +66,9 @@ extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
extern const std::string kSelectRequestTypes;
extern const std::string kSelectRequestSubTypes;
+extern const std::string kSelectAppServiceTypes;
+extern const std::string kSelectAppServiceNames;
+extern const std::string kSelectAppServiceHandledRpcs;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -80,6 +83,9 @@ extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
extern const std::string kInsertRequestSubType;
+extern const std::string kInsertAppServiceTypes;
+extern const std::string kInsertAppServiceNames;
+extern const std::string kInsertAppServiceHandledRpcs;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -100,6 +106,9 @@ extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
extern const std::string kDeleteRequestType;
extern const std::string kDeleteRequestSubType;
+extern const std::string kDeleteAppServiceTypes;
+extern const std::string kDeleteAppServiceNames;
+extern const std::string kDeleteAppServiceHandledRpcs;
extern const std::string kDeleteDevice;
extern const std::string kIncrementIgnitionCycles;
extern const std::string kResetIgnitionCycles;
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
index 0e9302dfac..e95620fbc2 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -35,9 +35,9 @@
#include <string>
#include <vector>
+#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -133,6 +133,10 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool GatherRequestSubType(
const std::string& app_id,
policy_table::RequestSubTypes* request_subtypes) const;
+ bool GatherAppServiceParameters(
+ const std::string& app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const;
+
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -171,6 +175,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveRequestSubType(
const std::string& app_id,
const policy_table::RequestSubTypes& request_subtypes);
+ bool SaveAppServiceParameters(
+ const std::string& app_id,
+ const policy_table::AppServiceParameters& app_service_parameters);
public:
bool UpdateRequired() const;
diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h
index c1ea2de4c1..8fd3ff559e 100644
--- a/src/components/policy/policy_regular/include/policy/status.h
+++ b/src/components/policy/policy_regular/include/policy/status.h
@@ -75,41 +75,41 @@ class Status {
const policy::PolicyTableStatus enum_status);
/**
- * @brief Destructor
- */
+ * @brief Destructor
+ */
virtual ~Status();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
virtual void ProcessEvent(UpdateStatusManagerInterface* manager,
UpdateEvent event) = 0;
/**
- * @brief Return current status as string value
- * @return Status as string
- */
+ * @brief Return current status as string value
+ * @return Status as string
+ */
virtual const std::string get_status_string() const;
/**
- * @brief Return status as enum value
- * @return Status as enum value
- */
+ * @brief Return status as enum value
+ * @return Status as enum value
+ */
virtual PolicyTableStatus get_status() const;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
virtual bool IsUpdateRequired() const;
/**
- * @brief Check whether update is pending in terms of status
- * @return True if update is pending, otherwise - false
- */
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
virtual bool IsUpdatePending() const;
private:
@@ -128,11 +128,11 @@ class UpToDateStatus : public Status {
UpToDateStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManagerInterface* manager,
UpdateEvent event) OVERRIDE;
};
@@ -148,18 +148,18 @@ class UpdateNeededStatus : public Status {
UpdateNeededStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManagerInterface* manager,
UpdateEvent event) OVERRIDE;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
bool IsUpdateRequired() const OVERRIDE;
};
@@ -174,26 +174,26 @@ class UpdatingStatus : public Status {
UpdatingStatus();
/**
- * @brief Process event by setting next status in case event can affect
- * current status or ignores the event
- * @param manager Status manager pointer
- * @param event Event which needs to be processed
- */
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
void ProcessEvent(UpdateStatusManagerInterface* manager,
UpdateEvent event) OVERRIDE;
/**
- * @brief Check whether update is required in terms of status
- * @return True if update is required, otherwise - false
- */
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
bool IsUpdateRequired() const OVERRIDE;
/**
- * @brief Check whether update is pending in terms of status
- * @return True if update is pending, otherwise - false
- */
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
bool IsUpdatePending() const OVERRIDE;
};
-}
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h
index c90acd4957..0c79bf0ba4 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -33,15 +33,14 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
-#include "policy/update_status_manager_interface.h"
#include "policy/policy_types.h"
-#include "utils/lock.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
+#include "policy/update_status_manager_interface.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace policy {
@@ -216,6 +215,6 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
bool app_registered_from_non_consented_device_;
sync_primitives::Lock apps_search_in_progress_lock_;
};
-}
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
index 72ae5fd9e0..bd88815012 100644
--- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
@@ -34,11 +34,11 @@
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
#include <ctime>
-#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
+#include "policy/usage_statistics/statistics_manager.h"
-#include "utils/timer.h"
#include "utils/macro.h"
+#include "utils/timer.h"
namespace usage_statistics {
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index bd95fc8e7c..94ce52b6f1 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -33,19 +33,19 @@
#include "policy/cache_manager.h"
#include <algorithm>
-#include <functional>
-#include <ctime>
#include <cmath>
+#include <ctime>
+#include <functional>
#include <sstream>
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "json/reader.h"
#include "json/features.h"
+#include "json/reader.h"
#include "json/writer.h"
-#include "utils/logger.h"
#include "utils/date_time.h"
+#include "utils/file_system.h"
#include "utils/gen_hash.h"
+#include "utils/helpers.h"
+#include "utils/logger.h"
#include "utils/macro.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
@@ -682,6 +682,180 @@ const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
return vehicle_info;
}
+void CacheManager::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ enabled_apps.clear();
+ return;
+#else
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::const_iterator it = policies.begin();
+ it != policies.end();
+ ++it) {
+ auto app_policy = (*it).second;
+ if (app_policy.enabled.is_initialized() && *app_policy.enabled) {
+ enabled_apps.push_back((*it).first);
+ }
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
+bool CacheManager::GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const {
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ endpoint = app_policy.endpoint.is_initialized() ? *app_policy.endpoint
+ : std::string();
+ auth_token = app_policy.auth_token.is_initialized() ? *app_policy.auth_token
+ : std::string();
+ cloud_transport_type = app_policy.cloud_transport_type.is_initialized()
+ ? *app_policy.cloud_transport_type
+ : std::string();
+ certificate = app_policy.certificate.is_initialized()
+ ? *app_policy.certificate
+ : std::string();
+ hybrid_app_preference =
+ app_policy.hybrid_app_preference.is_initialized()
+ ? EnumToJsonString(*app_policy.hybrid_app_preference)
+ : std::string();
+ enabled = app_policy.enabled.is_initialized() && *app_policy.enabled;
+ return true;
+ }
+ return false;
+}
+
+void CacheManager::InitCloudApp(const std::string& policy_app_id) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator default_iter =
+ policies.find(kDefaultId);
+ policy_table::ApplicationPolicies::const_iterator app_iter =
+ policies.find(policy_app_id);
+
+ if (default_iter != policies.end()) {
+ if (app_iter == policies.end()) {
+ policies[policy_app_id] = policies[kDefaultId];
+ }
+ }
+ // Add cloud app specific policies
+
+ Backup();
+}
+
+void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.enabled = enabled;
+ }
+}
+
+void CacheManager::SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.auth_token = auth_token;
+ }
+}
+
+void CacheManager::SetAppCloudTransportType(
+ const std::string& policy_app_id, const std::string& cloud_transport_type) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.cloud_transport_type = cloud_transport_type;
+ }
+}
+
+void CacheManager::SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ *(*policy_iter).second.endpoint = endpoint;
+ }
+}
+
+void CacheManager::SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) {
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ (*(*policy_iter).second.nicknames) = nicknames;
+ }
+}
+
+void CacheManager::SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) {
+ policy_table::HybridAppPreference value;
+ bool valid = EnumFromJsonString(hybrid_app_preference, &value);
+ policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter && valid) {
+ *(*policy_iter).second.hybrid_app_preference = value;
+ }
+}
+
+void CacheManager::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ if (app_policy.app_service_parameters.is_initialized()) {
+ *app_service_parameters = *(app_policy.app_service_parameters);
+ }
+ }
+}
+
+bool CacheManager::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ const auto app_policy = (*policy_iter).second;
+ if (app_policy.allow_unknown_rpc_passthrough.is_initialized()) {
+ return *(app_policy.allow_unknown_rpc_passthrough);
+ }
+ }
+ return false;
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes, const std::string& language) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -778,6 +952,21 @@ std::string CacheManager::GetLockScreenIconUrl() const {
return std::string("");
}
+std::string CacheManager::GetIconUrl(const std::string& policy_app_id) const {
+ CACHE_MANAGER_CHECK(std::string());
+ std::string url;
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
+ if (policies.end() != policy_iter) {
+ auto app_policy = (*policy_iter).second;
+ url = app_policy.icon_url.is_initialized() ? *app_policy.icon_url
+ : std::string();
+ }
+ return url;
+}
+
rpc::policy_table_interface_base::NumberOfNotificationsType
CacheManager::GetNotificationsNumber(const std::string& priority) {
CACHE_MANAGER_CHECK(0);
@@ -1717,8 +1906,9 @@ void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt,
void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt,
policy_table::PolicyTable& pt) {
LOG4CXX_AUTO_TRACE(logger_);
- pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>(
- new_pt).app_policies_section.device;
+ pt.app_policies_section.device =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.device;
pt.app_policies_section.apps[kDefaultId] =
const_cast<policy_table::PolicyTable&>(new_pt)
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index bae9fceb49..5fa0b314b3 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -30,13 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/policy_helper.h"
+#include <string.h>
#include <algorithm>
#include <sstream>
-#include <string.h>
-#include "utils/logger.h"
-#include "utils/custom_string.h"
-#include "policy/policy_helper.h"
#include "policy/policy_manager_impl.h"
+#include "utils/custom_string.h"
+#include "utils/logger.h"
namespace policy {
@@ -355,15 +355,15 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
}
if (RESULT_NO_CHANGES == result) {
- LOG4CXX_INFO(logger_,
- "Permissions for application:" << app_id
- << " wasn't changed.");
+ LOG4CXX_INFO(
+ logger_,
+ "Permissions for application:" << app_id << " wasn't changed.");
return true;
}
- LOG4CXX_INFO(logger_,
- "Permissions for application:" << app_id
- << " have been changed.");
+ LOG4CXX_INFO(
+ logger_,
+ "Permissions for application:" << app_id << " have been changed.");
if (IsPredefinedApp(app_policy)) {
for (const policy_table::ApplicationPolicies::value_type& app :
@@ -853,4 +853,4 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
return true;
}
-}
+} // namespace policy
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 4985035629..0884fc53b6 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -32,22 +32,22 @@
#include "policy/policy_manager_impl.h"
#include <algorithm>
-#include <set>
-#include <queue>
#include <iterator>
#include <limits>
+#include <queue>
+#include <set>
#include "json/reader.h"
#include "json/writer.h"
+#include "policy/policy_helper.h"
#include "policy/policy_table.h"
#include "policy/pt_representation.h"
-#include "policy/policy_helper.h"
+#include "utils/date_time.h"
#include "utils/file_system.h"
#include "utils/logger.h"
-#include "utils/date_time.h"
+#include "config_profile/profile.h"
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
-#include "config_profile/profile.h"
#include "utils/timer_task_impl.h"
#include "policy/access_remote.h"
@@ -217,7 +217,7 @@ void FilterInvalidApplicationParameters(
}
app_params.AppHMIType->swap(valid_app_hmi_types);
- // Filter RquestTypes array
+ // Filter RequestTypes array
policy_table::RequestTypes valid_request_types;
const policy_table::RequestTypes& request_types = *(app_params.RequestType);
for (const auto& request_type : request_types) {
@@ -368,6 +368,12 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
} else {
LOG4CXX_INFO(logger_, "app_hmi_types empty" << pt_content.size());
}
+
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
// If there was a user request for policy table update, it should be started
@@ -443,6 +449,11 @@ std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
return cache_->GetLockScreenIconUrl();
}
+std::string PolicyManagerImpl::GetIconUrl(
+ const std::string& policy_app_id) const {
+ return cache_->GetIconUrl(policy_app_id);
+}
+
void PolicyManagerImpl::StartPTExchange() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -544,6 +555,75 @@ const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
+void PolicyManagerImpl::GetEnabledCloudApps(
+ std::vector<std::string>& enabled_apps) const {
+ cache_->GetEnabledCloudApps(enabled_apps);
+}
+
+bool PolicyManagerImpl::GetCloudAppParameters(
+ const std::string& policy_app_id,
+ bool& enabled,
+ std::string& endpoint,
+ std::string& certificate,
+ std::string& auth_token,
+ std::string& cloud_transport_type,
+ std::string& hybrid_app_preference) const {
+ return cache_->GetCloudAppParameters(policy_app_id,
+ enabled,
+ endpoint,
+ certificate,
+ auth_token,
+ cloud_transport_type,
+ hybrid_app_preference);
+}
+
+void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id) {
+ cache_->InitCloudApp(policy_app_id);
+}
+
+void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id,
+ const bool enabled) {
+ cache_->SetCloudAppEnabled(policy_app_id, enabled);
+}
+
+void PolicyManagerImpl::SetAppAuthToken(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ cache_->SetAppAuthToken(policy_app_id, auth_token);
+}
+
+void PolicyManagerImpl::SetAppCloudTransportType(
+ const std::string& policy_app_id, const std::string& cloud_transport_type) {
+ cache_->SetAppCloudTransportType(policy_app_id, cloud_transport_type);
+}
+
+void PolicyManagerImpl::SetAppEndpoint(const std::string& policy_app_id,
+ const std::string& endpoint) {
+ cache_->SetAppEndpoint(policy_app_id, endpoint);
+}
+
+void PolicyManagerImpl::SetAppNicknames(const std::string& policy_app_id,
+ const StringArray& nicknames) {
+ cache_->SetAppNicknames(policy_app_id, nicknames);
+}
+
+void PolicyManagerImpl::SetHybridAppPreference(
+ const std::string& policy_app_id,
+ const std::string& hybrid_app_preference) {
+ cache_->SetHybridAppPreference(policy_app_id, hybrid_app_preference);
+}
+
+void PolicyManagerImpl::GetAppServiceParameters(
+ const std::string& policy_app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ cache_->GetAppServiceParameters(policy_app_id, app_service_parameters);
+}
+
+bool PolicyManagerImpl::UnknownRPCPassthroughAllowed(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->UnknownRPCPassthroughAllowed(policy_app_id);
+}
+
void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
const PTString& app_id,
const PTString& hmi_level,
@@ -595,7 +675,8 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
"Couldn't find device info for application id "
- "'" << application_id << "'");
+ "'" << application_id
+ << "'");
return;
}
@@ -1294,6 +1375,11 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
if (!certificate_data.empty()) {
listener_->OnCertificateUpdated(certificate_data);
}
+ std::vector<std::string> enabled_apps;
+ cache_->GetEnabledCloudApps(enabled_apps);
+ for (auto it = enabled_apps.begin(); it != enabled_apps.end(); ++it) {
+ SendAuthTokenUpdated(*it);
+ }
}
return ret;
}
@@ -1372,9 +1458,9 @@ void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
if (GetDefaultHmi(who.app_id, &default_hmi)) {
listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
} else {
- LOG4CXX_WARN(logger_,
- "Couldn't get default HMI level for application "
- << who.app_id);
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't get default HMI level for application " << who.app_id);
}
}
@@ -1409,6 +1495,15 @@ void PolicyManagerImpl::SendAppPermissionsChanged(
listener()->OnPermissionsUpdated(application_id, notification_data);
}
+void PolicyManagerImpl::SendAuthTokenUpdated(const std::string policy_app_id) {
+ bool enabled = false;
+ std::string end, cert, ctt, hap;
+ std::string auth_token;
+ cache_->GetCloudAppParameters(
+ policy_app_id, enabled, end, cert, auth_token, ctt, hap);
+ listener_->OnAuthTokenUpdated(policy_app_id, auth_token);
+}
+
void PolicyManagerImpl::OnPrimaryGroupsChanged(
const std::string& application_id) {
const std::vector<std::string> devices =
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 428e18d0bd..39957e49ea 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -1,5 +1,5 @@
-// This file is generated, do not edit
#include "policy/policy_table/enums.h"
+#include <cstring>
namespace rpc {
namespace policy_table_interface_base {
@@ -138,6 +138,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_FUELRANGE:
return true;
+ case P_CLOUD_APP_VEHICLE_ID:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -204,6 +206,8 @@ const char* EnumToJsonString(Parameter val) {
return "instantFuelConsumption";
case P_FUELRANGE:
return "fuelRange";
+ case P_CLOUD_APP_VEHICLE_ID:
+ return "cloudAppVehicleID";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -280,6 +284,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("fuelRange" == literal) {
*result = P_FUELRANGE;
return true;
+ } else if ("cloudAppVehicleID" == literal) {
+ *result = P_CLOUD_APP_VEHICLE_ID;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -662,6 +669,7 @@ bool IsValidEnum(ModuleType val) {
return false;
}
}
+
const char* EnumToJsonString(ModuleType val) {
switch (val) {
case MT_CLIMATE:
@@ -709,6 +717,38 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
return false;
}
+bool IsValidEnum(HybridAppPreference val) {
+ return strlen(EnumToJsonString(val)) > 0;
+}
+
+const char* EnumToJsonString(HybridAppPreference val) {
+ switch (val) {
+ case HAP_MOBILE:
+ return "MOBILE";
+ case HAP_CLOUD:
+ return "CLOUD";
+ case HAP_BOTH:
+ return "BOTH";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal,
+ HybridAppPreference* result) {
+ if ("MOBILE" == literal) {
+ *result = HAP_MOBILE;
+ return true;
+ } else if ("CLOUD" == literal) {
+ *result = HAP_CLOUD;
+ return true;
+ } else if ("BOTH" == literal) {
+ *result = HAP_BOTH;
+ return true;
+ }
+ return false;
+}
+
bool IsValidEnum(FunctionID val) {
switch (val) {
case RegisterAppInterfaceID:
@@ -807,6 +847,20 @@ bool IsValidEnum(FunctionID val) {
return true;
case SendHapticDataID:
return true;
+ case SetCloudAppPropertiesID:
+ return true;
+ case GetCloudAppPropertiesID:
+ return true;
+ case PublishAppServiceID:
+ return true;
+ case GetFileID:
+ return true;
+ case GetAppServiceDataID:
+ return true;
+ case PerformAppServiceInteractionID:
+ return true;
+ case CloseApplicationID:
+ return true;
case OnHMIStatusID:
return true;
case OnAppInterfaceUnregisteredID:
@@ -843,6 +897,8 @@ bool IsValidEnum(FunctionID val) {
return true;
case OnRCStatusID:
return true;
+ case OnAppServiceDataID:
+ return true;
case EncodedSyncPDataID:
return true;
case SyncPDataID:
@@ -851,6 +907,8 @@ bool IsValidEnum(FunctionID val) {
return true;
case OnSyncPDataID:
return true;
+ case OnSystemCapabilityUpdatedID:
+ return true;
default:
return false;
}
@@ -954,6 +1012,20 @@ const char* EnumToJsonString(FunctionID val) {
return "GetSystemCapability";
case SendHapticDataID:
return "SendHapticData";
+ case SetCloudAppPropertiesID:
+ return "SetCloudAppProperties";
+ case GetCloudAppPropertiesID:
+ return "GetCloudAppProperties";
+ case PublishAppServiceID:
+ return "PublishAppService";
+ case GetFileID:
+ return "GetFile";
+ case GetAppServiceDataID:
+ return "GetAppServiceData";
+ case PerformAppServiceInteractionID:
+ return "PerformAppServiceInteraction";
+ case CloseApplicationID:
+ return "CloseApplication";
case OnHMIStatusID:
return "OnHMIStatus";
case OnAppInterfaceUnregisteredID:
@@ -990,6 +1062,8 @@ const char* EnumToJsonString(FunctionID val) {
return "OnWayPointChange";
case OnRCStatusID:
return "OnRCStatus";
+ case OnAppServiceDataID:
+ return "OnAppServiceData";
case EncodedSyncPDataID:
return "EncodedSyncPData";
case SyncPDataID:
@@ -998,6 +1072,8 @@ const char* EnumToJsonString(FunctionID val) {
return "OnEncodedSyncPData";
case OnSyncPDataID:
return "OnSyncPData";
+ case OnSystemCapabilityUpdatedID:
+ return "OnSystemCapabilityUpdated";
default:
return "";
}
@@ -1244,6 +1320,41 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("SetCloudAppProperties" == literal) {
+ *result = SetCloudAppPropertiesID;
+ return true;
+ }
+
+ if ("GetCloudAppProperties" == literal) {
+ *result = GetCloudAppPropertiesID;
+ return true;
+ }
+
+ if ("PublishAppService" == literal) {
+ *result = PublishAppServiceID;
+ return true;
+ }
+
+ if ("GetFile" == literal) {
+ *result = GetFileID;
+ return true;
+ }
+
+ if ("GetAppServiceData" == literal) {
+ *result = GetAppServiceDataID;
+ return true;
+ }
+
+ if ("PerformAppServiceInteraction" == literal) {
+ *result = PerformAppServiceInteractionID;
+ return true;
+ }
+
+ if ("CloseApplication" == literal) {
+ *result = CloseApplicationID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1334,6 +1445,16 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("OnAppServiceData" == literal) {
+ *result = OnAppServiceDataID;
+ return true;
+ }
+
+ if ("OnSystemCapabilityUpdated" == literal) {
+ *result = OnSystemCapabilityUpdatedID;
+ return true;
+ }
+
if ("EncodedSyncPData" == literal) {
*result = EncodedSyncPDataID;
return true;
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index 851ed1bd18..bdf1329dee 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -149,6 +149,109 @@ void ApplicationPoliciesSection::SetPolicyTableType(PolicyTableType pt_type) {
device.SetPolicyTableType(pt_type);
apps.SetPolicyTableType(pt_type);
}
+// Handled RPC Methods
+AppServiceHandledRpc::AppServiceHandledRpc() : CompositeType(kUninitialized) {}
+
+AppServiceHandledRpc::~AppServiceHandledRpc() {}
+
+AppServiceHandledRpc::AppServiceHandledRpc(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , function_id(impl::ValueMember(value__, "function_id")) {}
+
+Json::Value AppServiceHandledRpc::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("function_id", function_id, &result__);
+ return result__;
+}
+
+bool AppServiceHandledRpc::is_valid() const {
+ if (!function_id.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppServiceHandledRpc::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppServiceHandledRpc::struct_empty() const {
+ if (function_id.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppServiceHandledRpc::SetPolicyTableType(PolicyTableType pt_type) {
+ function_id.SetPolicyTableType(pt_type);
+}
+
+void AppServiceHandledRpc::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!function_id.is_valid()) {
+ function_id.ReportErrors(&report__->ReportSubobject("function_id"));
+ }
+}
+
+// AppServiceInfo methods
+AppServiceInfo::AppServiceInfo() : CompositeType(kUninitialized) {}
+
+AppServiceInfo::~AppServiceInfo() {}
+
+AppServiceInfo::AppServiceInfo(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , service_names(impl::ValueMember(value__, "service_names"))
+ , handled_rpcs(impl::ValueMember(value__, "handled_rpcs")) {}
+
+Json::Value AppServiceInfo::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("service_names", service_names, &result__);
+ impl::WriteJsonField("parameters", handled_rpcs, &result__);
+ return result__;
+}
+
+bool AppServiceInfo::is_valid() const {
+ if (!service_names.is_valid()) {
+ return false;
+ }
+ if (!handled_rpcs.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppServiceInfo::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppServiceInfo::struct_empty() const {
+ if (service_names.is_initialized()) {
+ return false;
+ }
+ if (handled_rpcs.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppServiceInfo::SetPolicyTableType(PolicyTableType pt_type) {
+ service_names.SetPolicyTableType(pt_type);
+ handled_rpcs.SetPolicyTableType(pt_type);
+}
+
+void AppServiceInfo::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!service_names.is_valid()) {
+ service_names.ReportErrors(&report__->ReportSubobject("service_names"));
+ }
+ if (!handled_rpcs.is_valid()) {
+ handled_rpcs.ReportErrors(&report__->ReportSubobject("handled_rpcs"));
+ }
+}
// ApplicationParams methods
ApplicationParams::ApplicationParams() : PolicyBase(), groups() {}
@@ -167,8 +270,17 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
- , certificate(impl::ValueMember(value__, "certificate"), "not_specified")
- , moduleType(impl::ValueMember(value__, "moduleType")) {}
+ , certificate(impl::ValueMember(value__, "certificate"))
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+ , hybrid_app_preference(impl::ValueMember(value__, "hybrid_app_preference"))
+ , endpoint(impl::ValueMember(value__, "endpoint"))
+ , enabled(impl::ValueMember(value__, "enabled"))
+ , auth_token(impl::ValueMember(value__, "auth_token"))
+ , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type"))
+ , icon_url(impl::ValueMember(value__, "icon_url"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services"))
+ , allow_unknown_rpc_passthrough(
+ impl::ValueMember(value__, "allow_unknown_rpc_passthrough")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -180,7 +292,19 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
+ impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("moduleType", moduleType, &result__);
+ impl::WriteJsonField(
+ "hybrid_app_preference", hybrid_app_preference, &result__);
+ impl::WriteJsonField("endpoint", endpoint, &result__);
+ impl::WriteJsonField("enabled", enabled, &result__);
+ impl::WriteJsonField("auth_token", auth_token, &result__);
+ impl::WriteJsonField("cloud_transport_type", cloud_transport_type, &result__);
+ impl::WriteJsonField("icon_url", auth_token, &result__);
+ impl::WriteJsonField("app_services", app_service_parameters, &result__);
+ impl::WriteJsonField("allow_unknown_rpc_passthrough",
+ allow_unknown_rpc_passthrough,
+ &result__);
return result__;
}
@@ -212,6 +336,30 @@ bool ApplicationParams::is_valid() const {
if (!moduleType.is_valid()) {
return false;
}
+ if (!endpoint.is_valid()) {
+ return false;
+ }
+ if (!enabled.is_valid()) {
+ return false;
+ }
+ if (!auth_token.is_valid()) {
+ return false;
+ }
+ if (!cloud_transport_type.is_valid()) {
+ return false;
+ }
+ if (!hybrid_app_preference.is_valid()) {
+ return false;
+ }
+ if (!icon_url.is_valid()) {
+ return false;
+ }
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
+ if (!allow_unknown_rpc_passthrough.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -250,6 +398,30 @@ bool ApplicationParams::struct_empty() const {
if (moduleType.is_initialized()) {
return false;
}
+ if (endpoint.is_initialized()) {
+ return false;
+ }
+ if (enabled.is_initialized()) {
+ return false;
+ }
+ if (auth_token.is_initialized()) {
+ return false;
+ }
+ if (cloud_transport_type.is_initialized()) {
+ return false;
+ }
+ if (hybrid_app_preference.is_initialized()) {
+ return false;
+ }
+ if (icon_url.is_initialized()) {
+ return false;
+ }
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
+ if (allow_unknown_rpc_passthrough.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -288,6 +460,33 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
+ if (!endpoint.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("endpoint"));
+ }
+ if (!enabled.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("enabled"));
+ }
+ if (!auth_token.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("auth_token"));
+ }
+ if (!cloud_transport_type.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("cloud_transport_type"));
+ }
+ if (!hybrid_app_preference.is_valid()) {
+ moduleType.ReportErrors(
+ &report__->ReportSubobject("hybrid_app_preference"));
+ }
+ if (!icon_url.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("icon_url"));
+ }
+ if (!app_service_parameters.is_valid()) {
+ app_service_parameters.ReportErrors(
+ &report__->ReportSubobject("app_services"));
+ }
+ if (!allow_unknown_rpc_passthrough.is_valid()) {
+ allow_unknown_rpc_passthrough.ReportErrors(
+ &report__->ReportSubobject("allow_unknown_rpc_passthrough"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -300,6 +499,13 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
moduleType.SetPolicyTableType(pt_type);
+ endpoint.SetPolicyTableType(pt_type);
+ enabled.SetPolicyTableType(pt_type);
+ cloud_transport_type.SetPolicyTableType(pt_type);
+ hybrid_app_preference.SetPolicyTableType(pt_type);
+ icon_url.SetPolicyTableType(pt_type);
+ app_service_parameters.SetPolicyTableType(pt_type);
+ allow_unknown_rpc_passthrough.SetPolicyTableType(pt_type);
}
// RpcParameters methods
diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc
index 714dfaae5a..059c18d00e 100644
--- a/src/components/policy/policy_regular/src/policy_table/validation.cc
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -7,7 +7,7 @@ bool IsTypeInvalid(
rpc::Enum<rpc::policy_table_interface_base::RequestType> request) {
return !request.is_valid();
}
-}
+} // namespace
namespace rpc {
namespace policy_table_interface_base {
@@ -177,6 +177,14 @@ bool ApplicationParams::ValidateModuleTypes() const {
return true;
}
+bool AppServiceHandledRpc::Validate() const {
+ return true;
+}
+
+bool AppServiceInfo::Validate() const {
+ return true;
+}
+
bool ApplicationParams::Validate() const {
return ValidateModuleTypes();
}
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 f5ccffce3b..a97b0ab153 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -84,6 +84,9 @@ const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `hmi_level`( "
" `value` VARCHAR(45) PRIMARY KEY NOT NULL "
"); "
+ "CREATE TABLE IF NOT EXISTS `hybrid_app_preference`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
"CREATE TABLE IF NOT EXISTS `notifications_by_priority`( "
" `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL, "
" `value` INTEGER NOT NULL, "
@@ -133,7 +136,14 @@ const std::string kCreateSchema =
" `is_predata` BOOLEAN, "
" `memory_kb` INTEGER NOT NULL, "
" `heart_beat_timeout_ms` INTEGER NOT NULL, "
- " `certificate` VARCHAR(45), "
+ " `certificate` VARCHAR(65535), "
+ " `hybrid_app_preference_value` VARCHAR(255), "
+ " `endpoint` VARCHAR(255), "
+ " `enabled` BOOLEAN, "
+ " `auth_token` VARCHAR(65535), "
+ " `cloud_transport_type` VARCHAR(255), "
+ " `icon_url` VARCHAR(65535), "
+ " `allow_unknown_rpc_passthrough` BOOLEAN, "
" `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, "
" CONSTRAINT `fk_application_hmi_level1` "
" FOREIGN KEY(`default_hmi`) "
@@ -141,11 +151,17 @@ const std::string kCreateSchema =
" CONSTRAINT `fk_application_priorities1` "
" FOREIGN KEY(`priority_value`) "
" REFERENCES `priority`(`value`) "
+ " CONSTRAINT `fk_application_hybrid_app_preference1` "
+ " FOREIGN KEY(`hybrid_app_preference_value`) "
+ " REFERENCES `hybrid_app_preference`(`value`) "
"); "
"CREATE INDEX IF NOT EXISTS `application.fk_application_hmi_level1_idx` "
" ON `application`(`default_hmi`); "
"CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx` "
" ON `application`(`priority_value`); "
+ "CREATE INDEX IF NOT EXISTS "
+ "`application.fk_application_hybrid_app_preference1` "
+ " ON `application`(`hybrid_app_preference_value`); "
"CREATE TABLE IF NOT EXISTS `app_group`( "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
@@ -273,6 +289,30 @@ const std::string kCreateSchema =
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `app_service_types`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `service_type` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " CONSTRAINT `fk_service_type_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `app_service_names`( "
+ " `service_type_id` INTEGER NOT NULL, "
+ " `service_name` VARCHAR(45), "
+ " PRIMARY KEY(`service_name`,`service_type_id`), "
+ " CONSTRAINT `fk_service_name_service_type_id` "
+ " FOREIGN KEY(`service_type_id`) "
+ " REFERENCES `app_service_types`(`id`) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `app_service_handled_rpcs`( "
+ " `service_type_id` INTEGER NOT NULL, "
+ " `function_id` INTEGER, "
+ " PRIMARY KEY(`function_id`,`service_type_id`), "
+ " CONSTRAINT `fk_function_id_service_type_id` "
+ " FOREIGN KEY(`service_type_id`) "
+ " REFERENCES `app_service_types`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
" ON `app_type`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
@@ -391,6 +431,9 @@ const std::string kInsertInitData =
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('LIMITED'); "
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('BACKGROUND'); "
"INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('NONE'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('MOBILE'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('CLOUD'); "
+ "INSERT OR IGNORE INTO `hybrid_app_preference`(`value`) VALUES ('BOTH'); "
"INSERT OR IGNORE INTO `version` (`number`) VALUES('0'); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
"";
@@ -450,6 +493,9 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `app_type`; "
"DROP TABLE IF EXISTS `request_type`; "
"DROP TABLE IF EXISTS `request_subtype`; "
+ "DROP TABLE IF EXISTS `app_service_types`; "
+ "DROP TABLE IF EXISTS `app_service_names`; "
+ "DROP TABLE IF EXISTS `app_service_handled_rpcs`; "
"DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
"DROP TABLE IF EXISTS `nickname`; "
"DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
@@ -491,6 +537,7 @@ const std::string kDropSchema =
"`notifications_by_priority.fk_notifications_by_priority_priority1_idx`; "
"DROP TABLE IF EXISTS `notifications_by_priority`; "
"DROP TABLE IF EXISTS `hmi_level`; "
+ "DROP TABLE IF EXISTS `hybrid_app_preference`; "
"DROP TABLE IF EXISTS `priority`; "
"DROP TABLE IF EXISTS `functional_group`; "
"DROP TABLE IF EXISTS `module_config`; "
@@ -578,8 +625,11 @@ const std::string kInsertRpcWithParameter =
const std::string kInsertApplication =
"INSERT OR IGNORE INTO `application` (`id`, `priority_value`, "
- "`is_revoked`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `certificate`) VALUES (?,?,?,?,?,?)";
+ "`is_revoked`, `memory_kb`, `heart_beat_timeout_ms`, `certificate`, "
+ "`hybrid_app_preference_value`, `endpoint`, `enabled`, `auth_token`, "
+ "`cloud_transport_type`, `icon_url`, `allow_unknown_rpc_passthrough`) "
+ "VALUES "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)";
const std::string kInsertAppGroup =
"INSERT INTO `app_group` (`application_id`, `functional_group_id`)"
@@ -600,6 +650,21 @@ const std::string kInsertRequestSubType =
"`request_subtype`) "
"VALUES (?, ?)";
+const std::string kInsertAppServiceTypes =
+ "INSERT INTO `app_service_types` (`id`, "
+ "`service_type`, `application_id`) "
+ "VALUES (?, ?, ?)";
+
+const std::string kInsertAppServiceNames =
+ "INSERT INTO `app_service_names` (`service_type_id`, "
+ "`service_name`) "
+ "VALUES (?, ?)";
+
+const std::string kInsertAppServiceHandledRpcs =
+ "INSERT INTO `app_service_handled_rpcs` (`service_type_id`, "
+ "`function_id`) "
+ "VALUES (?, ?)";
+
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
const std::string kInsertMessageType =
@@ -688,7 +753,11 @@ const std::string kSelectUserMsgsVersion =
const std::string kSelectAppPolicies =
"SELECT `id`, `priority_value`, `memory_kb`, "
- " `heart_beat_timeout_ms`, `certificate` FROM `application`";
+ " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
+ " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, `icon_url`, "
+ " `allow_unknown_rpc_passthrough` "
+ "FROM "
+ " `application`";
const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
@@ -715,6 +784,21 @@ const std::string kSelectRequestSubTypes =
"`application_id` "
"= ?";
+const std::string kSelectAppServiceTypes =
+ "SELECT `id`, `service_type` FROM `app_service_types` WHERE "
+ "`application_id` "
+ "= ?";
+
+const std::string kSelectAppServiceNames =
+ "SELECT DISTINCT `service_name` FROM `app_service_names` WHERE "
+ "`service_type_id` "
+ "= ?";
+
+const std::string kSelectAppServiceHandledRpcs =
+ "SELECT DISTINCT `function_id` FROM `app_service_handled_rpcs` WHERE "
+ "`service_type_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -762,6 +846,13 @@ const std::string kDeleteRequestType = "DELETE FROM `request_type`";
const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+const std::string kDeleteAppServiceTypes = "DELETE FROM `app_service_types`";
+
+const std::string kDeleteAppServiceNames = "DELETE FROM `app_service_names`";
+
+const std::string kDeleteAppServiceHandledRpcs =
+ "DELETE FROM `app_service_handled_rpcs`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
@@ -785,15 +876,22 @@ const std::string kDeleteAppGroupByApplicationId =
const std::string kInsertApplicationFull =
"INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, "
- " `memory_kb`, `heart_beat_timeout_ms`, `certificate`) "
- " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ " `is_predata`, `memory_kb`, `heart_beat_timeout_ms`, "
+ " `certificate`, `hybrid_app_preference_value`, `endpoint`, `enabled`, "
+ " `auth_token`, `cloud_transport_type`, `icon_url`, "
+ "`allow_unknown_rpc_passthrough`) "
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
const std::string kSelectApplicationFull =
"SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
" `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `certificate` FROM `application` WHERE `id` = "
+ " `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
+ " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`, "
+ "`icon_url`, "
+ " `allow_unknown_rpc_passthrough` "
+ "FROM `application` "
+ "WHERE `id` = "
"?";
const std::string kSelectDBVersion =
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 75f8be74eb..20ba9ec651 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -30,22 +30,22 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sstream>
-#include <stdlib.h>
-#include <stdint.h>
#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <unistd.h>
+#include <sstream>
-#include "utils/logger.h"
+#include "config_profile/profile.h"
+#include "policy/cache_manager.h"
+#include "policy/policy_helper.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/sql_wrapper.h"
#include "utils/date_time.h"
#include "utils/file_system.h"
#include "utils/gen_hash.h"
-#include "policy/sql_pt_representation.h"
-#include "policy/sql_wrapper.h"
-#include "policy/sql_pt_queries.h"
-#include "policy/policy_helper.h"
-#include "policy/cache_manager.h"
-#include "config_profile/profile.h"
+#include "utils/logger.h"
namespace policy {
@@ -81,9 +81,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id,
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectRpc)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement from rpcs"
- << query.LastError().text());
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect select statement from rpcs" << query.LastError().text());
return;
}
query.Bind(0, app_id);
@@ -378,9 +378,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings* settings) {
utils::dbms::SQLQuery check_first_run(db());
if (check_first_run.Prepare(sql_pt::kIsFirstRun) &&
check_first_run.Next()) {
- LOG4CXX_INFO(logger_,
- "Selecting is first run "
- << check_first_run.GetBoolean(0));
+ LOG4CXX_INFO(
+ logger_,
+ "Selecting is first run " << check_first_run.GetBoolean(0));
if (check_first_run.GetBoolean(0)) {
utils::dbms::SQLQuery set_not_first_run(db());
set_not_first_run.Exec(sql_pt::kSetNotFirstRun);
@@ -716,12 +716,26 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
params.priority = priority;
*params.memory_kb = query.GetInteger(2);
-
*params.heart_beat_timeout_ms = query.GetUInteger(3);
- if (!query.IsNull(3)) {
+ if (!query.IsNull(4)) {
*params.certificate = query.GetString(4);
}
+ // Read cloud app properties
+ policy_table::HybridAppPreference hap;
+ bool valid = policy_table::EnumFromJsonString(query.GetString(5), &hap);
+ if (valid) {
+ *params.hybrid_app_preference = hap;
+ }
+ *params.endpoint = query.GetString(6);
+ if (!query.IsNull(7)) {
+ *params.enabled = query.GetBoolean(7);
+ }
+ *params.auth_token = query.GetString(8);
+ *params.cloud_transport_type = query.GetString(9);
+ *params.icon_url = query.GetString(10);
+ *params.allow_unknown_rpc_passthrough = query.GetBoolean(11);
+
const auto& gather_app_id = ((*policies).apps[app_id].is_string())
? (*policies).apps[app_id].get_string()
: app_id;
@@ -754,6 +768,11 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
+ if (!GatherAppServiceParameters(gather_app_id,
+ &*params.app_service_parameters)) {
+ return false;
+ }
+
(*policies).apps[app_id] = params;
}
return true;
@@ -930,6 +949,21 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled rpcs.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from service names.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from handled service types.");
+ return false;
+ }
+
// All predefined apps (e.g. default, pre_DataConsent) should be saved first,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -984,6 +1018,28 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
app.second.certificate.is_initialized()
? app_query.Bind(5, *app.second.certificate)
: app_query.Bind(5);
+ app.second.hybrid_app_preference.is_initialized()
+ ? app_query.Bind(6,
+ std::string(policy_table::EnumToJsonString(
+ *app.second.hybrid_app_preference)))
+ : app_query.Bind(6);
+ app.second.endpoint.is_initialized() ? app_query.Bind(7, *app.second.endpoint)
+ : app_query.Bind(7);
+ app.second.enabled.is_initialized() ? app_query.Bind(8, *app.second.enabled)
+ : app_query.Bind(8);
+ app.second.auth_token.is_initialized()
+ ? app_query.Bind(9, *app.second.auth_token)
+ : app_query.Bind(9);
+ app.second.cloud_transport_type.is_initialized()
+ ? app_query.Bind(10, *app.second.cloud_transport_type)
+ : app_query.Bind(10);
+ app.second.icon_url.is_initialized()
+ ? app_query.Bind(11, *app.second.icon_url)
+ : app_query.Bind(11);
+ app.second.allow_unknown_rpc_passthrough.is_initialized()
+ ? app_query.Bind(12, *app.second.allow_unknown_rpc_passthrough)
+ : app_query.Bind(12);
+
if (!app_query.Exec() || !app_query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into application.");
return false;
@@ -1022,6 +1078,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -1064,9 +1125,9 @@ bool SQLPTRepresentation::SaveAppGroup(
query.Bind(0, app_id);
query.Bind(1, *it);
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert into app group."
- << query.LastError().text());
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect insert into app group." << query.LastError().text());
return false;
}
}
@@ -1181,6 +1242,85 @@ bool SQLPTRepresentation::SaveRequestSubType(
return true;
}
+bool SQLPTRepresentation::SaveAppServiceParameters(
+ const std::string& app_id,
+ const policy_table::AppServiceParameters& app_service_parameters) {
+ LOG4CXX_INFO(logger_, "Save app service parameters");
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt::kInsertAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app service types");
+ return false;
+ }
+ policy_table::AppServiceParameters::const_iterator it;
+ for (it = app_service_parameters.begin(); it != app_service_parameters.end();
+ ++it) {
+ // Create service type id from hashing app_id and service_type
+ std::string str_to_hash = std::string(app_id + it->first);
+ const long int id = abs(CacheManager::GenerateHash(str_to_hash));
+ query.Bind(0, static_cast<int64_t>(id));
+ query.Bind(1, it->first);
+ query.Bind(2, app_id);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Insert execute failed for into app service types");
+ return false;
+ }
+
+ // Insert app names array into db
+ utils::dbms::SQLQuery service_name_query(db());
+ if (!service_name_query.Prepare(sql_pt::kInsertAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app service names");
+ return false;
+ }
+
+ auto app_service_names = it->second.service_names;
+
+ if (app_service_names.is_initialized() && app_service_names->empty()) {
+ // App service names is an empty array
+ LOG4CXX_DEBUG(logger_, "App Service Names is Empty Array");
+ service_name_query.Bind(0, static_cast<int64_t>(id));
+ service_name_query.Bind(1);
+ if (!service_name_query.Exec() || !service_name_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into empty app service names");
+ return false;
+ }
+ } else {
+ policy_table::AppServiceNames::const_iterator names_it;
+ for (names_it = app_service_names->begin();
+ names_it != app_service_names->end();
+ ++names_it) {
+ service_name_query.Bind(0, static_cast<int64_t>(id));
+ service_name_query.Bind(1, *names_it);
+ if (!service_name_query.Exec() || !service_name_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app service names");
+ return false;
+ }
+ }
+ }
+
+ // Insert handled rpcs array into db
+ utils::dbms::SQLQuery handled_rpcs_query(db());
+ if (!handled_rpcs_query.Prepare(sql_pt::kInsertAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for app service handled rpcs");
+ return false;
+ }
+
+ auto handled_rpcs = it->second.handled_rpcs;
+ policy_table::AppServiceHandledRpcs::const_iterator rpc_it;
+ for (rpc_it = handled_rpcs.begin(); rpc_it != handled_rpcs.end();
+ ++rpc_it) {
+ handled_rpcs_query.Bind(0, static_cast<int64_t>(id));
+ handled_rpcs_query.Bind(1, static_cast<int32_t>(rpc_it->function_id));
+ if (!handled_rpcs_query.Exec() || !handled_rpcs_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app service handled rpcs");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
bool SQLPTRepresentation::SaveModuleMeta(const policy_table::ModuleMeta& meta) {
utils::dbms::SQLQuery query(db());
@@ -1619,6 +1759,64 @@ bool SQLPTRepresentation::GatherRequestSubType(
return true;
}
+bool SQLPTRepresentation::GatherAppServiceParameters(
+ const std::string& app_id,
+ policy_table::AppServiceParameters* app_service_parameters) const {
+ LOG4CXX_INFO(logger_, "Gather app service info");
+ utils::dbms::SQLQuery service_type_query(db());
+ if (!service_type_query.Prepare(sql_pt::kSelectAppServiceTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from service_types");
+ return false;
+ }
+
+ utils::dbms::SQLQuery service_name_query(db());
+ if (!service_name_query.Prepare(sql_pt::kSelectAppServiceNames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from app_service_names");
+ return false;
+ }
+
+ utils::dbms::SQLQuery handled_rpcs_query(db());
+ if (!handled_rpcs_query.Prepare(sql_pt::kSelectAppServiceHandledRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from app_service_handled_rpcs");
+ return false;
+ }
+
+ service_type_query.Bind(0, app_id);
+ while (service_type_query.Next()) {
+ const int service_type_id = service_type_query.GetInteger(0);
+ std::string service_type = service_type_query.GetString(1);
+ LOG4CXX_WARN(logger_, "Load service type from pt: " << service_type);
+ (*app_service_parameters)[service_type] = policy_table::AppServiceInfo();
+
+ service_name_query.Bind(0, service_type_id);
+ while (service_name_query.Next()) {
+ LOG4CXX_DEBUG(logger_, "Loading service name");
+ (*app_service_parameters)[service_type].service_names->push_back(
+ service_name_query.GetString(0));
+ (*app_service_parameters)[service_type].service_names->mark_initialized();
+ }
+
+ handled_rpcs_query.Bind(0, service_type_id);
+ while (handled_rpcs_query.Next()) {
+ policy_table::AppServiceHandledRpc handled_rpc;
+ handled_rpc.function_id = handled_rpcs_query.GetInteger(0);
+ (*app_service_parameters)[service_type].handled_rpcs.push_back(
+ handled_rpc);
+ }
+
+ if (!service_name_query.Reset()) {
+ LOG4CXX_ERROR(logger_, "Could not reset service_name query");
+ return false;
+ }
+ if (!handled_rpcs_query.Reset()) {
+ LOG4CXX_ERROR(logger_, "Could not reset handled_rpcs query");
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -1969,6 +2167,12 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
return false;
}
+ policy_table::AppServiceParameters app_service_parameters;
+ if (!GatherAppServiceParameters(kDefaultId, &app_service_parameters) ||
+ !SaveAppServiceParameters(app_id, app_service_parameters)) {
+ return false;
+ }
+
return SetIsDefault(app_id, true);
}
@@ -2084,6 +2288,21 @@ bool SQLPTRepresentation::CopyApplication(const std::string& source,
query.Bind(9, source_app.GetInteger(8));
source_app.IsNull(9) ? query.Bind(10)
: query.Bind(10, source_app.GetString(9));
+ source_app.IsNull(10) ? query.Bind(11)
+ : query.Bind(11, source_app.GetString(10));
+ source_app.IsNull(11) ? query.Bind(12)
+ : query.Bind(12, source_app.GetString(11));
+ source_app.IsNull(12) ? query.Bind(13)
+ : query.Bind(13, source_app.GetBoolean(12));
+ source_app.IsNull(13) ? query.Bind(14)
+ : query.Bind(14, source_app.GetString(13));
+ source_app.IsNull(14) ? query.Bind(15)
+ : query.Bind(15, source_app.GetString(14));
+ source_app.IsNull(15) ? query.Bind(16)
+ : query.Bind(16, source_app.GetString(15));
+ source_app.IsNull(16) ? query.Bind(17)
+ : query.Bind(17, source_app.GetBoolean(16));
+
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Failed inserting into application.");
return false;
diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
index ed16fa3e8d..340f900cac 100644
--- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
-#include <cassert>
#include "policy/usage_statistics/counter.h"
+#include <cassert>
#include "utils/date_time.h"
#include "utils/timer_task_impl.h"
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index 2f4735dd66..dbf16598f0 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 806ab8bcc0..2c0063f69a 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index 28396be29a..d579fd3e3f 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index 4592e228df..84b6404010 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -362,6 +362,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -382,6 +383,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -402,6 +404,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -421,6 +424,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
index f79bb683f8..d9dba45ef2 100644
--- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "policy/access_remote_impl.h"
+#include "gtest/gtest.h"
namespace policy {
diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc
index d11bcec2ac..c09347fd9c 100644
--- a/src/components/policy/policy_regular/test/counter_test.cc
+++ b/src/components/policy/policy_regular/test/counter_test.cc
@@ -31,11 +31,11 @@
#include "gmock/gmock.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/counter.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
-using ::testing::StrictMock;
using ::testing::InSequence;
+using ::testing::StrictMock;
namespace test {
namespace components {
diff --git a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h
index 78b7add643..aa6fb0828b 100644
--- a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h
+++ b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h
@@ -152,7 +152,7 @@ class DBMS {
};
#endif // __QNX__
-} // namespace policy
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
index 72f183175c..44f7733985 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
@@ -37,9 +37,9 @@
#include "gmock/gmock.h"
+#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
namespace policy_table = ::rpc::policy_table_interface_base;
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index ff054b3cc4..39ff0efa7e 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -30,39 +30,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
+#include <ctime>
#include <fstream>
#include <string>
-#include <ctime>
+#include <vector>
+#include "gtest/gtest.h"
#include "json/reader.h"
#include "json/writer.h"
-#include "gtest/gtest.h"
#include "config_profile/profile.h"
+#include "policy/mock_cache_manager.h"
+#include "policy/mock_policy_listener.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/mock_update_status_manager.h"
#include "policy/policy_manager_impl.h"
#include "policy/policy_table/enums.h"
#include "policy/policy_table/types.h"
-#include "policy/mock_policy_settings.h"
-#include "policy/mock_policy_listener.h"
-#include "policy/mock_cache_manager.h"
-#include "policy/mock_update_status_manager.h"
-#include "utils/macro.h"
-#include "utils/file_system.h"
#include "utils/date_time.h"
+#include "utils/file_system.h"
+#include "utils/macro.h"
-#include "utils/gen_hash.h"
#include "policy/mock_access_remote.h"
+#include "utils/gen_hash.h"
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SetArgReferee;
-using ::testing::NiceMock;
using ::testing::_;
-using ::testing::SetArgReferee;
using ::testing::AtLeast;
+using ::testing::DoAll;
+using ::testing::NiceMock;
using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
using ::policy::PolicyManagerImpl;
using ::policy::PolicyTable;
@@ -834,6 +833,37 @@ TEST_F(
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
}
+TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) {
+ std::string kServiceType = "MEDIA";
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ GetPTU("valid_sdl_pt_update.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ // Try to add existing app
+ policy_table::AppServiceParameters app_service_parameters =
+ policy_table::AppServiceParameters();
+ manager->GetAppServiceParameters(app_id2, &app_service_parameters);
+
+ ASSERT_FALSE(app_service_parameters.find(kServiceType) ==
+ app_service_parameters.end());
+
+ auto service_names = *(app_service_parameters[kServiceType].service_names);
+
+ ASSERT_TRUE(service_names.is_initialized());
+ ASSERT_EQ(service_names.size(), 2u);
+ EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App");
+ EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music");
+
+ auto handled_rpcs = app_service_parameters[kServiceType].handled_rpcs;
+
+ ASSERT_TRUE(handled_rpcs.is_initialized());
+ EXPECT_EQ(handled_rpcs[0].function_id, 41);
+
+ // Check no update required
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+}
+
TEST_F(PolicyManagerImplTest2,
PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
// Arrange
@@ -901,9 +931,8 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
date_time::MILLISECONDS_IN_SECOND;
const uint32_t first_retry = timeout_after_x_seconds;
EXPECT_EQ(first_retry, manager->NextRetryTimeout());
- uint32_t next_retry =
- first_retry +
- seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND;
+ uint32_t next_retry = first_retry + seconds_between_retries[0].asInt() *
+ date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
next_retry =
first_retry + next_retry +
@@ -946,9 +975,8 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
Json::Value val2(Json::arrayValue);
val2[0] = hmi_level[index];
val[new_data.new_field_value_]["hmi_levels"] = val2;
- root["policy_table"]["functional_groupings"][new_data
- .new_field_name_]["rpcs"] =
- val;
+ root["policy_table"]["functional_groupings"][new_data.new_field_name_]
+ ["rpcs"] = val;
root["policy_table"]["functional_groupings"][new_data.new_field_name_]
["user_consent_prompt"] = new_data.new_field_name_;
}
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 2a05a94f8b..9013971990 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -498,6 +498,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -522,6 +523,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -546,6 +548,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -569,6 +572,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index b0d9117568..892a77f970 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -498,6 +498,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -522,6 +523,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -546,6 +548,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -569,6 +572,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index 59e3f947c3..ad264c8518 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -363,6 +363,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -383,6 +384,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -403,6 +405,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -422,6 +425,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index 7b882c6ceb..440963ba48 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1622,6 +1622,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1640,6 +1641,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1658,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1675,6 +1678,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index 7d90275328..5900acbcfb 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1622,6 +1622,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1640,6 +1641,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1658,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1675,6 +1678,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index 909e4d5238..6f5e223cae 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1600,6 +1600,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1618,6 +1619,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1636,6 +1638,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,6 +1656,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
index 7d192515dc..d456aa26e4 100644
--- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -29,39 +29,39 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
-#include <string>
+#include <stdio.h>
+#include <sys/stat.h>
#include <algorithm>
#include <fstream>
#include <memory>
-#include <stdio.h>
-#include <sys/stat.h>
+#include <string>
+#include <vector>
#include "gtest/gtest.h"
+#include "json/reader.h"
+#include "json/writer.h"
#include "policy/driver_dbms.h"
-#include "policy/sql_pt_representation.h"
-#include "policy/policy_types.h"
#include "policy/mock_policy_settings.h"
-#include "policy/policy_table/types.h"
#include "policy/policy_table/enums.h"
-#include "json/writer.h"
-#include "json/reader.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+#include "policy/sql_pt_representation.h"
#include "rpc_base/rpc_base.h"
#include "utils/file_system.h"
#include "utils/sqlite_wrapper/sql_database.h"
namespace policy_table = rpc::policy_table_interface_base;
-using policy::SQLPTRepresentation;
using policy::CheckPermissionResult;
-using policy::UserFriendlyMessage;
using policy::EndpointUrls;
+using policy::SQLPTRepresentation;
+using policy::UserFriendlyMessage;
using policy::VehicleInfo;
-using testing::ReturnRef;
-using testing::Return;
-using testing::NiceMock;
using testing::Mock;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
namespace test {
namespace components {
@@ -124,6 +124,13 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
policy_table::ApplicationPoliciesSection* policies) const {
return ::SQLPTRepresentation::GatherApplicationPoliciesSection(policies);
}
+
+ bool GatherAppServiceParameters(
+ const std::string& app_id,
+ policy_table::AppServiceParameters* policies) const {
+ return ::SQLPTRepresentation::GatherAppServiceParameters(app_id, policies);
+ }
+
virtual void GatherDeviceData(policy_table::DeviceData* data) const {
::SQLPTRepresentation::GatherDeviceData(data);
}
@@ -314,6 +321,23 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["1234"]["keep_context"] = Json::Value(false);
app_policies["1234"]["steal_focus"] = Json::Value(false);
app_policies["1234"]["RequestType"] = Json::Value(Json::arrayValue);
+ app_policies["1234"]["app_services"] = Json::Value(Json::objectValue);
+ app_policies["1234"]["icon_url"] =
+ Json::Value("http:://www.sdl.com/image.png");
+ app_policies["1234"]["app_services"]["MEDIA"] =
+ Json::Value(Json::objectValue);
+ app_policies["1234"]["app_services"]["MEDIA"]["service_names"] =
+ Json::Value(Json::arrayValue);
+ app_policies["1234"]["app_services"]["MEDIA"]["service_names"][0] =
+ Json::Value("SDL App");
+ app_policies["1234"]["app_services"]["MEDIA"]["service_names"][1] =
+ Json::Value("SDL Music");
+ app_policies["1234"]["app_services"]["MEDIA"]["handled_rpcs"] =
+ Json::Value(Json::arrayValue);
+ app_policies["1234"]["app_services"]["MEDIA"]["handled_rpcs"][0] =
+ Json::Value(Json::objectValue);
+ app_policies["1234"]["app_services"]["MEDIA"]["handled_rpcs"][0]
+ ["function_id"] = Json::Value(41);
app_policies["device"] = Json::Value(Json::objectValue);
app_policies["device"]["groups"] = Json::Value(Json::arrayValue);
@@ -426,8 +450,8 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->RefreshDB());
// Check PT structure destroyed and tables number is 0
- // There are 29 tables in the database, now.
- const int32_t total_tables_number = 29;
+ // There are 33 tables in the database, now.
+ const int32_t total_tables_number = 33;
ASSERT_EQ(total_tables_number, dbms->FetchOneInt(query_select));
const char* query_select_count_of_iap_buffer_full =
"SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
@@ -1706,6 +1730,28 @@ TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) {
GatherDeviceData(&devices);
EXPECT_EQ(3u, devices.size());
+
+ const std::string kAppId = "1234";
+ const std::string kServiceType = "MEDIA";
+ policy_table::AppServiceParameters app_service_parameters;
+ GatherAppServiceParameters(kAppId, &app_service_parameters);
+ ASSERT_FALSE(app_service_parameters.find(kServiceType) ==
+ app_service_parameters.end());
+ auto service_names = *(app_service_parameters[kServiceType].service_names);
+ EXPECT_TRUE(service_names.is_initialized());
+ ASSERT_EQ(service_names.size(), 2u);
+ EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App");
+ EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music");
+
+ auto handled_rpcs = app_service_parameters[kServiceType].handled_rpcs;
+
+ EXPECT_TRUE(handled_rpcs.is_initialized());
+ EXPECT_EQ(handled_rpcs[0].function_id, 41);
+
+ policy_table::ApplicationPolicies& apps = policies.apps;
+ auto icon_url = *(apps[kAppId].icon_url);
+
+ EXPECT_EQ(std::string(icon_url), "http:://www.sdl.com/image.png");
}
} // namespace policy_test
diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc
index 244858554f..459913fe72 100644
--- a/src/components/policy/policy_regular/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "policy/update_status_manager.h"
#include "gtest/gtest.h"
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
-#include "policy/update_status_manager.h"
namespace test {
namespace components {
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 5827ab287a..acf18c5706 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -20,7 +20,13 @@
"nicknames" : [ "SyncProxyTester" ],
"priority" : "EMERGENCY",
"steal_focus" : true,
- "heart_beat_timeout_ms": 5000
+ "heart_beat_timeout_ms": 5000,
+ "app_services": {
+ "MEDIA": {
+ "service_names" : ["SDL App", "SDL Music"],
+ "handled_rpcs" : [{"function_id": 41}]
+ }
+ }
},
"default" : {
"default_hmi" : "NONE",
@@ -1598,6 +1604,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1616,6 +1623,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"vin",
@@ -1634,6 +1642,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1651,6 +1660,7 @@
"headLampStatus",
"instantFuelConsumption",
"fuelRange",
+ "cloudAppVehicleID",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc
index 11160d7082..acafd3dbd2 100644
--- a/src/components/protocol/src/bson_object_keys.cc
+++ b/src/components/protocol/src/bson_object_keys.cc
@@ -18,6 +18,7 @@ const char* video_service_transports = "videoServiceTransports";
const char* tcp_ip_address = "tcpIpAddress";
const char* tcp_port = "tcpPort";
const char* reason = "reason";
+const char* auth_token = "authToken";
} // namespace strings
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index ff8678b826..ed3aaaf24c 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -65,6 +65,7 @@ endforeach()
add_library(ProtocolHandler ${SOURCES})
+add_dependencies(ProtocolHandler libbson)
target_link_libraries(ProtocolHandler ${LIBRARIES})
if(BUILD_TESTS)
diff --git a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
index 4633be6c6e..82bf563bc5 100644
--- a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
@@ -34,9 +34,9 @@
#include <map>
#include <vector>
-#include "utils/macro.h"
#include "protocol_handler/protocol_packet.h"
#include "transport_manager/common.h"
+#include "utils/macro.h"
namespace protocol_handler {
diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
index 84ec3c9e30..3da63bd79f 100644
--- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
+++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
@@ -33,13 +33,13 @@
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_MULTIFRAME_BUILDER_H_
-#include <map>
-#include <ostream> // std::basic_ostream
-#include <iterator> // std::ostream_iterator
#include <algorithm> // std::copy
+#include <iterator> // std::ostream_iterator
+#include <map>
+#include <ostream> // std::basic_ostream
-#include "utils/date_time.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/date_time.h"
/**
*\namespace protocol_handlerHandler
@@ -86,36 +86,36 @@ typedef std::map<ConnectionID, SessionToFrameMap> MultiFrameMap;
class MultiFrameBuilder {
public:
/**
- * @brief Constructor
- */
+ * @brief Constructor
+ */
MultiFrameBuilder();
/**
- *\brief Set timeout of waiting CONSECUTIVE frames
- */
+ *\brief Set timeout of waiting CONSECUTIVE frames
+ */
void set_waiting_timeout(const uint32_t consecutive_frame_wait_msecs);
/**
- * @brief Add connection for pending data
- * @return true on success
- */
+ * @brief Add connection for pending data
+ * @return true on success
+ */
bool AddConnection(const ConnectionID connection_id);
/**
- * @brief Clear all data related to connection_id
- * @return true on success
- */
+ * @brief Clear all data related to connection_id
+ * @return true on success
+ */
bool RemoveConnection(const ConnectionID connection_id);
/**
- *\brief Pop assembled and expired frames
- */
+ *\brief Pop assembled and expired frames
+ */
ProtocolFramePtrList PopMultiframes();
/**
- *\brief Handle Single or Consecutive frame
- * @return RESULT_OK on success, or RESULT_FAIL in case of any error
- */
+ *\brief Handle Single or Consecutive frame
+ * @return RESULT_OK on success, or RESULT_FAIL in case of any error
+ */
RESULT_CODE AddFrame(const ProtocolFramePtr packet);
private:
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 3e7d64e9d2..15996bb4e2 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
@@ -33,33 +33,33 @@
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
+#include <stdint.h>
#include <map>
#include <memory>
#include <set>
-#include <stdint.h>
#include <utility> // std::make_pair
#include <vector>
-#include "utils/prioritized_queue.h"
#include "utils/message_queue.h"
+#include "utils/prioritized_queue.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/messagemeter.h"
#include "utils/custom_string.h"
+#include "utils/messagemeter.h"
#include "utils/semantic_version.h"
+#include "application_manager/policies/policy_handler_observer.h"
+#include "connection_handler/connection_handler.h"
+#include "protocol_handler/incoming_data_handler.h"
+#include "protocol_handler/multiframe_builder.h"
#include "protocol_handler/protocol_handler.h"
-#include "protocol_handler/protocol_packet.h"
#include "protocol_handler/protocol_handler_settings.h"
-#include "protocol_handler/session_observer.h"
#include "protocol_handler/protocol_observer.h"
-#include "protocol_handler/incoming_data_handler.h"
-#include "protocol_handler/multiframe_builder.h"
+#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/session_observer.h"
#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
-#include "transport_manager/transport_adapter/transport_adapter.h"
-#include "connection_handler/connection_handler.h"
-#include "application_manager/policies/policy_handler_observer.h"
#ifdef TELEMETRY_MONITOR
#include "protocol_handler/telemetry_observer.h"
@@ -67,8 +67,8 @@
#endif // TELEMETRY_MONITOR
#ifdef ENABLE_SECURITY
-#include "security_manager/security_manager.h"
#include "protocol_handler/handshake_handler.h"
+#include "security_manager/security_manager.h"
#endif // ENABLE_SECURITY
namespace connection_handler {
@@ -110,7 +110,8 @@ struct RawFordMessageFromMobile : public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ ServiceTypeFromByte(get()->service_type()))
+ .OrderingValue();
}
};
@@ -122,7 +123,8 @@ struct RawFordMessageToMobile : public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ ServiceTypeFromByte(get()->service_type()))
+ .OrderingValue();
}
// Signals whether connection to mobile must be closed after processing this
// message
@@ -131,9 +133,11 @@ struct RawFordMessageToMobile : public ProtocolFramePtr {
// Short type names for prioritized message queues
typedef threads::MessageLoopThread<
- utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
+ utils::PrioritizedQueue<RawFordMessageFromMobile> >
+ FromMobileQueue;
typedef threads::MessageLoopThread<
- utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+ utils::PrioritizedQueue<RawFordMessageToMobile> >
+ ToMobileQueue;
// Type to allow easy mapping between a device type and transport
// characteristics
@@ -141,7 +145,8 @@ typedef enum {
TT_NONE = -1,
TT_USB = 0,
TT_BLUETOOTH = 1,
- TT_WIFI = 2
+ TT_WIFI = 2,
+ TT_WEBSOCKET = 3
} TransportType;
struct TransportDescription {
@@ -175,10 +180,10 @@ class ProtocolHandlerImpl
public impl::FromMobileQueue::Handler,
public impl::ToMobileQueue::Handler
#ifdef TELEMETRY_MONITOR
- ,
+ ,
public telemetry_monitor::TelemetryObservable<PHTelemetryObserver>
#endif // TELEMETRY_MONITOR
- {
+{
public:
/**
* @brief Constructor
@@ -251,20 +256,20 @@ class ProtocolHandlerImpl
void SendHeartBeat(int32_t connection_id, uint8_t session_id);
/**
- * \brief Sends ending session to mobile application
- * \param connection_id Identifier of connection within which
- * session exists
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
void SendEndSession(int32_t connection_id, uint8_t session_id);
/**
- * \brief Sends ending session to mobile application
- * \param primary_connection_id Identifier of connection within which
- * service exists
- * \param connection_id Identifier of the actual transport for the service
- * \param session_id ID of session to be ended
- */
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
void SendEndService(int32_t primary_connection_id,
int32_t connection_id,
uint8_t session_id,
@@ -428,6 +433,9 @@ class ProtocolHandlerImpl
void NotifySessionStarted(const SessionContext& context,
std::vector<std::string>& rejected_params) OVERRIDE;
+ void OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) OVERRIDE;
+
#ifdef BUILD_TESTS
const impl::FromMobileQueue& get_from_mobile_queue() const {
return raw_ford_messages_from_mobile_;
@@ -512,6 +520,10 @@ class ProtocolHandlerImpl
void OnTMMessageSendFailed(const transport_manager::DataSendError& error,
const RawMessagePtr message) OVERRIDE;
+ void OnConnectionPending(
+ const transport_manager::DeviceInfo& device_info,
+ const transport_manager::ConnectionUID connection_id) OVERRIDE;
+
void OnConnectionEstablished(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id) OVERRIDE;
@@ -773,6 +785,10 @@ class ProtocolHandlerImpl
sync_primitives::Lock start_session_frame_map_lock_;
StartSessionFrameMap start_session_frame_map_;
+ // Map policy app id -> auth token
+ sync_primitives::Lock auth_token_map_lock_;
+ std::map<std::string, std::string> auth_token_map_;
+
bool tcp_enabled_;
std::string tcp_port_;
std::string tcp_ip_address_;
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
index de4af84915..215c63c685 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -34,9 +34,9 @@
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
#include <list>
-#include "utils/macro.h"
#include "protocol/common.h"
#include "transport_manager/common.h"
+#include "utils/macro.h"
/**
*\namespace protocol_handlerHandler
@@ -275,8 +275,8 @@ class ProtocolPacket {
/*End of Deserialization*/
/**
- * \brief Getter for Connection Identifier
- */
+ * \brief Getter for Connection Identifier
+ */
ConnectionID connection_id() const;
/**
@@ -285,13 +285,13 @@ class ProtocolPacket {
void set_connection_id(ConnectionID connection_id);
/**
- * \brief Getter for data payload size
- */
+ * \brief Getter for data payload size
+ */
uint32_t payload_size() const;
/**
- * \brief Getter for full header information
- */
+ * \brief Getter for full header information
+ */
const ProtocolHeader& packet_header() const;
private:
@@ -311,9 +311,9 @@ class ProtocolPacket {
uint32_t payload_size_;
/**
- * \brief Connection Identifier
- * Obtained from connection_handler
- */
+ * \brief Connection Identifier
+ * Obtained from connection_handler
+ */
ConnectionID connection_id_;
DISALLOW_COPY_AND_ASSIGN(ProtocolPacket);
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index 775d77db66..fa0b375018 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -36,8 +36,8 @@
#include "protocol_handler/protocol_handler_impl.h"
#include "protocol_handler/protocol_packet.h"
-#include "security_manager/security_manager.h"
#include "protocol_handler/session_observer.h"
+#include "security_manager/security_manager.h"
namespace protocol_handler {
diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc
index 4944ea9cc7..566b36f46d 100644
--- a/src/components/protocol_handler/src/incoming_data_handler.cc
+++ b/src/components/protocol_handler/src/incoming_data_handler.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "protocol_handler/incoming_data_handler.h"
-#include "utils/logger.h"
#include "protocol/common.h"
+#include "utils/logger.h"
namespace protocol_handler {
diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc
index c34e2ec640..d7cfc6f90e 100644
--- a/src/components/protocol_handler/src/multiframe_builder.cc
+++ b/src/components/protocol_handler/src/multiframe_builder.cc
@@ -36,8 +36,8 @@
#include "utils/logger.h"
-#include "utils/lock.h"
#include "utils/date_time.h"
+#include "utils/lock.h"
namespace protocol_handler {
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index d03030b747..222ca635d0 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -32,20 +32,20 @@
#include "protocol_handler/protocol_handler_impl.h"
#include <arpa/inet.h> // for INET6_ADDRSTRLEN
-#include <memory.h>
-#include <algorithm> // std::find
#include <bson_object.h>
+#include <memory.h>
#include <protocol/bson_object_keys.h>
+#include <algorithm> // std::find
#include "connection_handler/connection_handler_impl.h"
+#include "protocol/common.h"
#include "protocol_handler/session_observer.h"
#include "utils/byte_order.h"
#include "utils/helpers.h"
-#include "protocol/common.h"
#ifdef ENABLE_SECURITY
-#include "security_manager/ssl_context.h"
#include "security_manager/security_manager.h"
+#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
namespace protocol_handler {
@@ -59,10 +59,11 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
std::string ConvertPacketDataToString(const uint8_t* data,
const size_t data_size);
-const size_t kStackSize = 65536;
+const size_t kStackSize = 131072;
-utils::SemanticVersion defaultProtocolVersion(5, 1, 0);
-utils::SemanticVersion minMultipleTransportsVersion(5, 1, 0);
+utils::SemanticVersion default_protocol_version(5, 2, 0);
+utils::SemanticVersion min_multiple_transports_version(5, 1, 0);
+utils::SemanticVersion min_cloud_app_version(5, 2, 0);
ProtocolHandlerImpl::ProtocolHandlerImpl(
const ProtocolHandlerSettings& settings,
@@ -309,16 +310,16 @@ void ProtocolHandlerImpl::SendStartSessionAck(
&params, strings::hash_id)));
// Minimum protocol version supported by both
- utils::SemanticVersion* minVersion =
+ utils::SemanticVersion* min_version =
(full_version.major_version_ < PROTOCOL_VERSION_5)
- ? &defaultProtocolVersion
+ ? &default_protocol_version
: utils::SemanticVersion::min(full_version,
- defaultProtocolVersion);
- char protocolVersionString[256];
- strncpy(protocolVersionString, (*minVersion).toString().c_str(), 255);
+ default_protocol_version);
+ char protocol_version_string[256];
+ strncpy(protocol_version_string, (*min_version).toString().c_str(), 255);
const bool protocol_ver_written = bson_object_put_string(
- &params, strings::protocol_version, protocolVersionString);
+ &params, strings::protocol_version, protocol_version_string);
UNUSED(protocol_ver_written);
LOG4CXX_DEBUG(
logger_,
@@ -327,12 +328,12 @@ void ProtocolHandlerImpl::SendStartSessionAck(
<< bson_object_get_string(&params, strings::protocol_version));
LOG4CXX_INFO(logger_,
- "Protocol Version String " << protocolVersionString);
+ "Protocol Version String " << protocol_version_string);
std::vector<std::string> secondaryTransports;
std::vector<int32_t> audioServiceTransports;
std::vector<int32_t> videoServiceTransports;
- if (*minVersion >= minMultipleTransportsVersion) {
+ if (*min_version >= min_multiple_transports_version) {
if (ParseSecondaryTransportConfiguration(connection_id,
secondaryTransports,
audioServiceTransports,
@@ -410,10 +411,23 @@ void ProtocolHandlerImpl::SendStartSessionAck(
connection_handler_.SetSecondaryTransportID(session_id,
kDisabledSecondary);
}
+
+ std::string policy_app_id =
+ connection_handler_.GetCloudAppID(connection_id);
+ if (*min_version >= min_cloud_app_version && !policy_app_id.empty()) {
+ sync_primitives::AutoLock lock(auth_token_map_lock_);
+ auto it = auth_token_map_.find(policy_app_id);
+ if (it != auth_token_map_.end()) {
+ char auth_token[65536];
+ strncpy(auth_token, it->second.c_str(), 65535);
+ auth_token[sizeof(auth_token) - 1] = '\0';
+ bson_object_put_string(&params, strings::auth_token, auth_token);
+ }
+ }
}
- uint8_t* payloadBytes = bson_object_to_bytes(&params);
- ptr->set_data(payloadBytes, bson_object_size(&params));
- free(payloadBytes);
+ uint8_t* payload_bytes = bson_object_to_bytes(&params);
+ ptr->set_data(payload_bytes, bson_object_size(&params));
+ free(payload_bytes);
} else {
set_hash_id(hash_id, *ptr);
}
@@ -961,9 +975,9 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
LOG4CXX_DEBUG(logger_, "Proccessed " << protocol_frames.size() << " frames");
if (result != RESULT_OK) {
if (result == RESULT_MALFORMED_OCCURS) {
- LOG4CXX_WARN(logger_,
- "Malformed message occurs, connection id "
- << connection_key);
+ LOG4CXX_WARN(
+ logger_,
+ "Malformed message occurs, connection id " << connection_key);
if (!get_settings().malformed_message_filtering()) {
LOG4CXX_DEBUG(logger_, "Malformed message filterign disabled");
session_observer_.OnMalformedMessageCallback(connection_key);
@@ -1087,6 +1101,10 @@ void ProtocolHandlerImpl::OnTMMessageSendFailed(
<< "Error_text: " << error.text());
}
+void ProtocolHandlerImpl::OnConnectionPending(
+ const transport_manager::DeviceInfo& device_info,
+ const transport_manager::ConnectionUID connection_id) {}
+
void ProtocolHandlerImpl::OnConnectionEstablished(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id) {
@@ -1181,6 +1199,17 @@ void ProtocolHandlerImpl::OnTransportConfigUpdated(
}
}
+void ProtocolHandlerImpl::OnAuthTokenUpdated(const std::string& policy_app_id,
+ const std::string& auth_token) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(auth_token_map_lock_);
+ if (auth_token.empty()) {
+ auth_token_map_.erase(policy_app_id);
+ } else {
+ auth_token_map_[policy_app_id] = auth_token;
+ }
+}
+
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
if (!packet) {
@@ -1256,9 +1285,9 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
const bool is_final_message) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- " data size " << data_size << " max_frame_size "
- << max_frame_size);
+ LOG4CXX_DEBUG(
+ logger_,
+ " data size " << data_size << " max_frame_size " << max_frame_size);
// remainder of last frame
const size_t lastframe_remainder = data_size % max_frame_size;
@@ -1472,11 +1501,18 @@ uint32_t get_hash_id(const ProtocolPacket& packet) {
return HASH_ID_WRONG;
}
if (packet.protocol_version() >= PROTOCOL_VERSION_5) {
- BsonObject obj = bson_object_from_bytes(packet.data());
- const uint32_t hash_id =
- (uint32_t)bson_object_get_int32(&obj, strings::hash_id);
- bson_object_deinitialize(&obj);
- return hash_id;
+ BsonObject obj;
+ size_t obj_size = bson_object_from_bytes_len(
+ &obj, packet.data(), packet.total_data_bytes());
+ if (obj_size > 0) {
+ const uint32_t hash_id =
+ (uint32_t)bson_object_get_int32(&obj, strings::hash_id);
+ bson_object_deinitialize(&obj);
+ return hash_id;
+ } else {
+ LOG4CXX_WARN(logger_, "Failed to parse BSON field for hash ID");
+ return HASH_ID_WRONG;
+ }
} else {
const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
const uint32_t hash_le = BE_TO_LE32(hash_be);
@@ -1608,7 +1644,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
BsonObject bson_obj;
if (packet->data() != NULL) {
- bson_obj = bson_object_from_bytes(packet->data());
+ size_t bson_obj_size = bson_object_from_bytes_len(
+ &bson_obj, packet->data(), packet->total_data_bytes());
+ if (bson_obj_size == 0) {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse BSON field of start service packet");
+ bson_object_initialize_default(&bson_obj);
+ }
} else {
bson_object_initialize_default(&bson_obj);
}
@@ -1681,13 +1723,12 @@ void ProtocolHandlerImpl::NotifySessionStarted(
start_session_frame_map_.erase(it);
}
- const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
const uint8_t protocol_version = packet->protocol_version();
if (0 == context.new_session_id_) {
LOG4CXX_WARN(logger_,
"Refused by session_observer to create service "
- << static_cast<int32_t>(service_type) << " type.");
+ << packet->service_type() << " type.");
SendStartSessionNAck(context.connection_id_,
packet->session_id(),
protocol_version,
@@ -1702,33 +1743,42 @@ void ProtocolHandlerImpl::NotifySessionStarted(
// when video service is successfully started, copy input parameters
// ("width", "height", "videoProtocol", "videoCodec") to the ACK packet
if (packet->service_type() == kMobileNav && packet->data() != NULL) {
- BsonObject req_param = bson_object_from_bytes(packet->data());
- BsonElement* element = NULL;
-
- if ((element = bson_object_get(&req_param, strings::height)) != NULL &&
- element->type == TYPE_INT32) {
- bson_object_put_int32(start_session_ack_params.get(),
- strings::height,
- bson_object_get_int32(&req_param, strings::height));
- }
- if ((element = bson_object_get(&req_param, strings::width)) != NULL &&
- element->type == TYPE_INT32) {
- bson_object_put_int32(start_session_ack_params.get(),
- strings::width,
- bson_object_get_int32(&req_param, strings::width));
- }
- char* protocol =
- bson_object_get_string(&req_param, strings::video_protocol);
- if (protocol != NULL) {
- bson_object_put_string(
- start_session_ack_params.get(), strings::video_protocol, protocol);
- }
- char* codec = bson_object_get_string(&req_param, strings::video_codec);
- if (codec != NULL) {
- bson_object_put_string(
- start_session_ack_params.get(), strings::video_codec, codec);
+ BsonObject req_param;
+ size_t req_param_size = bson_object_from_bytes_len(
+ &req_param, packet->data(), packet->total_data_bytes());
+ if (req_param_size > 0) {
+ BsonElement* element = NULL;
+
+ if ((element = bson_object_get(&req_param, strings::height)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(
+ start_session_ack_params.get(),
+ strings::height,
+ bson_object_get_int32(&req_param, strings::height));
+ }
+ if ((element = bson_object_get(&req_param, strings::width)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(
+ start_session_ack_params.get(),
+ strings::width,
+ bson_object_get_int32(&req_param, strings::width));
+ }
+ char* protocol =
+ bson_object_get_string(&req_param, strings::video_protocol);
+ if (protocol != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_protocol, protocol);
+ }
+ char* codec = bson_object_get_string(&req_param, strings::video_codec);
+ if (codec != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_codec, codec);
+ }
+ bson_object_deinitialize(&req_param);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse BSON field of start service (video)");
}
- bson_object_deinitialize(&req_param);
}
std::shared_ptr<utils::SemanticVersion> fullVersion;
@@ -1737,21 +1787,30 @@ void ProtocolHandlerImpl::NotifySessionStarted(
// could still be a payload, in which case we can get the real protocol
// version
if (packet->service_type() == kRpc && packet->data() != NULL) {
- BsonObject request_params = bson_object_from_bytes(packet->data());
- char* version_param =
- bson_object_get_string(&request_params, strings::protocol_version);
- std::string version_string(version_param == NULL ? "" : version_param);
- fullVersion = std::make_shared<utils::SemanticVersion>(version_string);
- // Constructed payloads added in Protocol v5
- if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
- rejected_params.push_back(std::string(strings::protocol_version));
+ BsonObject request_params;
+ size_t request_params_size = bson_object_from_bytes_len(
+ &request_params, packet->data(), packet->total_data_bytes());
+ if (request_params_size > 0) {
+ char* version_param =
+ bson_object_get_string(&request_params, strings::protocol_version);
+ std::string version_string(version_param == NULL ? "" : version_param);
+ fullVersion = std::make_shared<utils::SemanticVersion>(version_string);
+ // Constructed payloads added in Protocol v5
+ if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
+ rejected_params.push_back(std::string(strings::protocol_version));
+ }
+ bson_object_deinitialize(&request_params);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse start service packet for version string");
+ fullVersion = std::make_shared<utils::SemanticVersion>();
}
- bson_object_deinitialize(&request_params);
} else {
fullVersion = std::make_shared<utils::SemanticVersion>();
}
#ifdef ENABLE_SECURITY
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
// for packet is encrypted and security plugin is enable
if (context.is_protected_ && security_manager_) {
const uint32_t connection_key = session_observer_.KeyFromPair(
@@ -1851,9 +1910,9 @@ void ProtocolHandlerImpl::NotifySessionStarted(
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
const ProtocolPacket& packet) {
const ConnectionID connection_id = packet.connection_id();
- LOG4CXX_DEBUG(logger_,
- "Sending heart beat acknowledgment for connection "
- << connection_id);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Sending heart beat acknowledgment for connection " << connection_id);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
connection_id, packet.session_id(), protocol_version)) {
@@ -1889,9 +1948,9 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
const uint32_t connection_key = session_observer_.KeyFromPair(
frame->connection_id(), frame->session_id());
- LOG4CXX_DEBUG(logger_,
- "Result frame" << frame << "for connection "
- << connection_key);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Result frame" << frame << "for connection " << connection_key);
const RawMessagePtr rawMessage(new RawMessage(connection_key,
frame->protocol_version(),
frame->data(),
@@ -1918,9 +1977,9 @@ bool ProtocolHandlerImpl::TrackMessage(const uint32_t& connection_key) {
if (frequency_time > 0u && frequency_count > 0u) {
const size_t message_frequency =
message_meter_.TrackMessage(connection_key);
- LOG4CXX_DEBUG(logger_,
- "Frequency of " << connection_key << " is "
- << message_frequency);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Frequency of " << connection_key << " is " << message_frequency);
if (message_frequency > frequency_count) {
LOG4CXX_WARN(logger_,
"Frequency of " << connection_key << " is marked as high.");
@@ -1946,9 +2005,9 @@ bool ProtocolHandlerImpl::TrackMalformedMessage(const uint32_t& connection_key,
<< malformed_message_frequency);
if (!get_settings().malformed_message_filtering() ||
malformed_message_frequency > malformed_frequency_count) {
- LOG4CXX_WARN(logger_,
- "Malformed frequency of " << connection_key
- << " is marked as high.");
+ LOG4CXX_WARN(
+ logger_,
+ "Malformed frequency of " << connection_key << " is marked as high.");
session_observer_.OnMalformedMessageCallback(connection_key);
malformed_message_meter_.RemoveIdentifier(connection_key);
return true;
@@ -1998,7 +2057,8 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
"Message to mobile app: connection id "
<< static_cast<int>(message->connection_id())
<< ";"
- " dataSize: " << message->data_size()
+ " dataSize: "
+ << message->data_size()
<< " ;"
" protocolVersion "
<< static_cast<int>(message->protocol_version()));
@@ -2245,7 +2305,10 @@ const impl::TransportTypes transportTypes = {
impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
std::make_pair(
std::string("IAP_CARPLAY"),
- impl::TransportDescription(impl::TransportType::TT_WIFI, true, false))};
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, false)),
+ std::make_pair(std::string("WEBSOCKET"),
+ impl::TransportDescription(
+ impl::TransportType::TT_WEBSOCKET, false, false))};
const impl::TransportDescription
ProtocolHandlerImpl::GetTransportTypeFromConnectionType(
@@ -2400,9 +2463,9 @@ void ProtocolHandlerImpl::GenerateServiceTransportsForStartSessionAck(
std::vector<std::string>::const_iterator it = service_transports.begin();
for (; it != service_transports.end(); it++) {
const utils::custom_string::CustomString transport(*it);
- LOG4CXX_TRACE(logger_,
- "Service Allowed to run on " << transport.c_str()
- << " transport");
+ LOG4CXX_TRACE(
+ logger_,
+ "Service Allowed to run on " << transport.c_str() << " transport");
if (!fPrimaryAdded &&
(transport.CompareIgnoreCase(primary_connection_type.c_str()) ||
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index d5422e11bc..3473b8e5c5 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -30,17 +30,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdint.h>
#include <memory.h>
-#include <new>
-#include <memory>
+#include <stdint.h>
#include <cstring>
#include <limits>
+#include <memory>
+#include <new>
#include "protocol/common.h"
#include "protocol_handler/protocol_packet.h"
-#include "utils/macro.h"
#include "utils/byte_order.h"
+#include "utils/macro.h"
#include "utils/semantic_version.h"
namespace protocol_handler {
@@ -118,9 +118,9 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message,
case PROTOCOL_VERSION_4:
case PROTOCOL_VERSION_5: {
if (messageSize < PROTOCOL_HEADER_V2_SIZE) {
- LOG4CXX_DEBUG(logger_,
- "Message size less " << PROTOCOL_HEADER_V2_SIZE
- << " bytes");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Message size less " << PROTOCOL_HEADER_V2_SIZE << " bytes");
return;
}
messageId = read_be_uint32(message + 8);
@@ -255,9 +255,9 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
// ServiceType shall be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B
// (Video), 0x0F (Bulk)
if (ServiceTypeFromByte(header.serviceType) == kInvalidServiceType) {
- LOG4CXX_WARN(logger_,
- "Invalide service type"
- << static_cast<int>(header.serviceType));
+ LOG4CXX_WARN(
+ logger_,
+ "Invalide service type" << static_cast<int>(header.serviceType));
return RESULT_FAIL;
}
// Check frame info for each frame type
diff --git a/src/components/protocol_handler/src/protocol_payload.cc b/src/components/protocol_handler/src/protocol_payload.cc
index aa011bdf0f..8916fe91b0 100644
--- a/src/components/protocol_handler/src/protocol_payload.cc
+++ b/src/components/protocol_handler/src/protocol_payload.cc
@@ -44,7 +44,7 @@ static const size_t kCorrelationIdBits = 32;
static const size_t kJsonSizeBits = 32;
static const size_t PayloadHeaderBits =
kRpcTypeBits + kRpcFunctionIdBits + kCorrelationIdBits + kJsonSizeBits;
-}
+} // namespace
namespace protocol_handler {
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 8f68003ada..a099cff225 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,10 +32,10 @@
#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 "gmock/gmock.h"
#include <ios>
#include <string>
#include <vector>
+#include "gmock/gmock.h"
#include "protocol/raw_message.h"
#include "protocol_handler/protocol_packet.h"
@@ -43,11 +43,11 @@ namespace test {
namespace components {
namespace protocol_handler_test {
+using protocol_handler::FRAME_DATA_START_SERVICE_NACK;
+using protocol_handler::FRAME_TYPE_CONTROL;
using protocol_handler::ProtocolPacket;
using protocol_handler::RawMessagePtr;
using protocol_handler::RESULT_CODE;
-using protocol_handler::FRAME_TYPE_CONTROL;
-using protocol_handler::FRAME_DATA_START_SERVICE_NACK;
bool CheckRegularMatches(const ProtocolPacket& packet,
RESULT_CODE result,
diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
index 9abf5d69af..fff102dde9 100644
--- a/src/components/protocol_handler/test/incoming_data_handler_test.cc
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <gtest/gtest.h>
-#include <vector>
#include <list>
+#include <vector>
-#include "utils/macro.h"
#include "protocol_handler/incoming_data_handler.h"
+#include "utils/macro.h"
namespace test {
namespace components {
@@ -91,7 +91,7 @@ class IncomingDataHandlerTest : public ::testing::Test {
FrameList actual_frames;
RESULT_CODE result_code;
size_t malformed_occurs;
- uint8_t* some_data, *some_data2;
+ uint8_t *some_data, *some_data2;
size_t some_data_size, some_data2_size;
uint32_t protov1_message_id;
uint32_t some_message_id;
@@ -251,8 +251,8 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) {
it != actual_frames.end();
++it, ++it_exp) {
// TODO(EZamakhov): investigate valgrind warning (unitialized value)
- EXPECT_EQ(**it, **it_exp) << "Element number "
- << std::distance(mobile_packets.begin(), it_exp);
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
}
}
@@ -654,8 +654,8 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
it != actual_frames.end();
++it, ++it_exp) {
// TODO(EZamakhov): investigate valgrind warning (unitialized value)
- EXPECT_EQ(**it, **it_exp) << "Element number "
- << std::distance(mobile_packets.begin(), it_exp);
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
}
}
@@ -754,8 +754,8 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
it != actual_frames.end();
++it, ++it_exp) {
// TODO(EZamakhov): investigate valgrind warning (unitialized value)
- EXPECT_EQ(**it, **it_exp) << "Element number "
- << std::distance(mobile_packets.begin(), it_exp);
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
}
}
diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc
index f919ec92af..2859aeb8ae 100644
--- a/src/components/protocol_handler/test/multiframe_builder_test.cc
+++ b/src/components/protocol_handler/test/multiframe_builder_test.cc
@@ -29,12 +29,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include <vector>
-#include <map>
#include <algorithm>
-#include <utility>
#include <limits>
+#include <map>
+#include <utility>
+#include <vector>
+#include "gtest/gtest.h"
#include "protocol_handler/multiframe_builder.h"
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 51284dfcda..e23223c2c8 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -29,19 +29,19 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include <string>
-#include "protocol_handler/protocol_handler.h"
-#include "protocol_handler/protocol_handler_impl.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
#include "protocol/bson_object_keys.h"
#include "protocol/common.h"
#include "protocol_handler/control_message_matcher.h"
#include "protocol_handler/mock_protocol_handler.h"
-#include "protocol_handler/mock_protocol_observer.h"
#include "protocol_handler/mock_protocol_handler_settings.h"
+#include "protocol_handler/mock_protocol_observer.h"
#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "connection_handler/connection_handler_impl.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/protocol_handler_impl.h"
#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
@@ -50,8 +50,8 @@
#include "utils/mock_system_time_handler.h"
#include "utils/semantic_version.h"
-#include "utils/test_async_waiter.h"
#include <bson_object.h>
+#include "utils/test_async_waiter.h"
namespace transport_manager {
namespace transport_adapter {
@@ -59,8 +59,8 @@ namespace transport_adapter {
const char* tc_enabled = "enabled";
const char* tc_tcp_port = "tcp_port";
const char* tc_tcp_ip_address = "tcp_ip_address";
-}
-}
+} // namespace transport_adapter
+} // namespace transport_manager
namespace test {
namespace components {
@@ -70,50 +70,50 @@ namespace protocol_handler_test {
#define NEW_SESSION_ID 0u
#define SESSION_START_REJECT 0u
// Protocol Handler Entities
-using protocol_handler::ProtocolHandlerImpl;
-using protocol_handler::ServiceType;
-using protocol_handler::RawMessage;
-using protocol_handler::RawMessagePtr;
-using protocol_handler::PROTECTION_ON;
-using protocol_handler::PROTECTION_OFF;
-using protocol_handler::PROTOCOL_VERSION_1;
-using protocol_handler::PROTOCOL_VERSION_2;
-using protocol_handler::PROTOCOL_VERSION_3;
-using protocol_handler::PROTOCOL_VERSION_4;
-using protocol_handler::PROTOCOL_VERSION_5;
-using protocol_handler::PROTOCOL_VERSION_MAX;
-using protocol_handler::FRAME_TYPE_CONTROL;
-using protocol_handler::FRAME_TYPE_SINGLE;
-using protocol_handler::FRAME_TYPE_FIRST;
-using protocol_handler::FRAME_TYPE_CONSECUTIVE;
-using protocol_handler::FRAME_TYPE_MAX_VALUE;
-using protocol_handler::MAXIMUM_FRAME_DATA_V2_SIZE;
-using protocol_handler::FRAME_DATA_START_SERVICE;
-using protocol_handler::FRAME_DATA_START_SERVICE_ACK;
-using protocol_handler::FRAME_DATA_END_SERVICE_NACK;
-using protocol_handler::FRAME_DATA_END_SERVICE_ACK;
using protocol_handler::FRAME_DATA_END_SERVICE;
+using protocol_handler::FRAME_DATA_END_SERVICE_ACK;
+using protocol_handler::FRAME_DATA_END_SERVICE_NACK;
+using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_HEART_BEAT;
using protocol_handler::FRAME_DATA_HEART_BEAT_ACK;
-using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
-using protocol_handler::FRAME_DATA_SINGLE;
-using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT;
using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK;
using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK;
+using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
+using protocol_handler::FRAME_DATA_SINGLE;
+using protocol_handler::FRAME_DATA_START_SERVICE;
+using protocol_handler::FRAME_DATA_START_SERVICE_ACK;
using protocol_handler::FRAME_DATA_TRANSPORT_EVENT_UPDATE;
-using protocol_handler::kRpc;
-using protocol_handler::kControl;
+using protocol_handler::FRAME_TYPE_CONSECUTIVE;
+using protocol_handler::FRAME_TYPE_CONTROL;
+using protocol_handler::FRAME_TYPE_FIRST;
+using protocol_handler::FRAME_TYPE_MAX_VALUE;
+using protocol_handler::FRAME_TYPE_SINGLE;
using protocol_handler::kAudio;
-using protocol_handler::kMobileNav;
using protocol_handler::kBulk;
+using protocol_handler::kControl;
using protocol_handler::kInvalidServiceType;
+using protocol_handler::kMobileNav;
+using protocol_handler::kRpc;
+using protocol_handler::MAXIMUM_FRAME_DATA_V2_SIZE;
+using protocol_handler::PROTECTION_OFF;
+using protocol_handler::PROTECTION_ON;
+using protocol_handler::PROTOCOL_VERSION_1;
+using protocol_handler::PROTOCOL_VERSION_2;
+using protocol_handler::PROTOCOL_VERSION_3;
+using protocol_handler::PROTOCOL_VERSION_4;
+using protocol_handler::PROTOCOL_VERSION_5;
+using protocol_handler::PROTOCOL_VERSION_MAX;
+using protocol_handler::ProtocolHandlerImpl;
+using protocol_handler::RawMessage;
+using protocol_handler::RawMessagePtr;
+using protocol_handler::ServiceType;
// For TM states
-using transport_manager::TransportManagerListener;
using test::components::security_manager_test::MockSystemTimeHandler;
-using transport_manager::E_SUCCESS;
using transport_manager::DeviceInfo;
+using transport_manager::E_SUCCESS;
+using transport_manager::TransportManagerListener;
#ifdef ENABLE_SECURITY
// For security
using ContextCreationStrategy =
@@ -122,21 +122,21 @@ using ContextCreationStrategy =
// For CH entities
using connection_handler::DeviceHandle;
// Google Testing Framework Entities
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::ReturnRefOfCopy;
-using ::testing::ReturnNull;
+using ::testing::_;
using ::testing::An;
using ::testing::AnyOf;
using ::testing::AtLeast;
using ::testing::ByRef;
using ::testing::DoAll;
-using ::testing::SaveArg;
using ::testing::Eq;
-using ::testing::_;
using ::testing::Invoke;
-using ::testing::SetArgReferee;
+using ::testing::Return;
+using ::testing::ReturnNull;
+using ::testing::ReturnRef;
+using ::testing::ReturnRefOfCopy;
+using ::testing::SaveArg;
using ::testing::SetArgPointee;
+using ::testing::SetArgReferee;
typedef std::vector<uint8_t> UCharDataVector;
@@ -149,7 +149,7 @@ namespace {
const uint32_t kAsyncExpectationsTimeout = 10000u;
const uint32_t kMicrosecondsInMillisecond = 1000u;
const uint32_t kAddSessionWaitTimeMs = 100u;
-}
+} // namespace
class ProtocolHandlerImplTest : public ::testing::Test {
protected:
@@ -214,9 +214,11 @@ class ProtocolHandlerImplTest : public ::testing::Test {
void TearDown() OVERRIDE {
const_cast<protocol_handler::impl::FromMobileQueue&>(
- protocol_handler_impl->get_from_mobile_queue()).WaitDumpQueue();
+ protocol_handler_impl->get_from_mobile_queue())
+ .WaitDumpQueue();
const_cast<protocol_handler::impl::ToMobileQueue&>(
- protocol_handler_impl->get_to_mobile_queue()).WaitDumpQueue();
+ protocol_handler_impl->get_to_mobile_queue())
+ .WaitDumpQueue();
}
// Emulate connection establish
@@ -383,6 +385,9 @@ class ProtocolHandlerImplTest : public ::testing::Test {
const std::vector<int32_t>& expected_audio_service_transports,
const std::vector<int32_t>& expected_video_service_transports);
+ void VerifyCloudAppParamsInStartSessionAck(const std::string& policy_app_id,
+ char* auth_token);
+
testing::NiceMock<MockProtocolHandlerSettings> protocol_handler_settings_mock;
std::shared_ptr<ProtocolHandlerImpl> protocol_handler_impl;
TransportManagerListener* tm_listener;
@@ -1920,6 +1925,117 @@ void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
bson_object_deinitialize(&expected_obj);
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+void ProtocolHandlerImplTest::VerifyCloudAppParamsInStartSessionAck(
+ const std::string& policy_app_id, char* auth_token) {
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 2, 0);
+ char full_version_string[] = "5.2.0";
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(connection_handler_mock, GetCloudAppID(connection_id))
+ .WillOnce(Return(policy_app_id));
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(false));
+ std::vector<std::string> empty_vec;
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillRepeatedly(ReturnRef(empty_vec));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillRepeatedly(ReturnRef(empty_vec));
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return("WEBSOCKET"));
+
+ // Prepare expected BSON parameters. When we add another param in Start
+ // Service ACK frame in future, it should be also added here.
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+
+ // secondaryTransports
+ BsonArray secondary_transports;
+ bson_array_initialize(&secondary_transports, 0);
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::secondary_transports,
+ &secondary_transports);
+
+ BsonArray audio_service_transports;
+ bson_array_initialize(&audio_service_transports, 1);
+ bson_array_add_int32(&audio_service_transports, 1);
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::audio_service_transports,
+ &audio_service_transports);
+
+ BsonArray video_service_transports;
+ bson_array_initialize(&video_service_transports, 1);
+ bson_array_add_int32(&video_service_transports, 1);
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::video_service_transports,
+ &video_service_transports);
+
+ // authToken
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::auth_token, auth_token);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
PROTECTION_OFF,
@@ -1938,6 +2054,8 @@ void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
.WillOnce(ReturnNull());
#endif // ENABLE_SECURITY
+ protocol_handler_impl->OnAuthTokenUpdated(policy_app_id,
+ std::string(auth_token));
protocol_handler_impl->SendStartSessionAck(connection_id,
session_id,
input_protocol_version,
@@ -2468,6 +2586,18 @@ TEST_F(ProtocolHandlerImplTest, StartSessionAck_PrimaryTransportUSBHostMode) {
expected_video_service_transports);
}
+TEST_F(ProtocolHandlerImplTest, StartSessionAck_CloudAppAuthTokenAvailable) {
+ std::string policy_id = "policy_id";
+ char auth_token[] = "Sample auth token";
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifyCloudAppParamsInStartSessionAck(policy_id, auth_token);
+}
+
TEST_F(ProtocolHandlerImplTest,
TransportEventUpdate_afterVersionNegotiation_TCPEnabled) {
TestAsyncWaiter waiter;
@@ -3510,7 +3640,8 @@ TEST_F(ProtocolHandlerImplTest,
SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
FRAME_DATA_HEART_BEAT_ACK,
PROTECTION_OFF,
- kControl))).Times(0);
+ kControl)))
+ .Times(0);
// Act
SendControlMessage(
PROTECTION_OFF, kControl, session_id, FRAME_DATA_HEART_BEAT);
@@ -3700,7 +3831,8 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) {
SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
FRAME_DATA_SERVICE_DATA_ACK,
PROTECTION_OFF,
- kMobileNav))).Times(0);
+ kMobileNav)))
+ .Times(0);
protocol_handler_impl->SendFramesNumber(connection_key, 0);
diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc
index 5554bfd280..e69e44dbac 100644
--- a/src/components/protocol_handler/test/protocol_header_validator_test.cc
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -31,11 +31,11 @@
*/
#include <gtest/gtest.h>
-#include <vector>
#include <list>
+#include <vector>
-#include "utils/macro.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/macro.h"
namespace {
const size_t MAXIMUM_FRAME_DATA_V3_SIZE = 131072;
diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc
index 71c7726243..e4ea4be61f 100644
--- a/src/components/protocol_handler/test/protocol_packet_test.cc
+++ b/src/components/protocol_handler/test/protocol_packet_test.cc
@@ -30,42 +30,42 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include <vector>
+#include "gtest/gtest.h"
-#include "utils/macro.h"
-#include "protocol_handler/protocol_packet.h"
#include "protocol/common.h"
+#include "protocol_handler/protocol_packet.h"
+#include "utils/macro.h"
namespace test {
namespace components {
namespace protocol_handler_test {
-using protocol_handler::RawMessagePtr;
-using protocol_handler::ProtocolPacket;
using protocol_handler::ConnectionID;
-using protocol_handler::FRAME_TYPE_MAX_VALUE;
using protocol_handler::FRAME_DATA_FIRST;
-using protocol_handler::FRAME_TYPE_FIRST;
-using protocol_handler::PROTOCOL_VERSION_1;
-using protocol_handler::PROTOCOL_VERSION_3;
-using protocol_handler::PROTECTION_OFF;
-using protocol_handler::RESULT_CODE;
-using protocol_handler::RESULT_OK;
-using protocol_handler::RESULT_FAIL;
+using protocol_handler::FRAME_DATA_HEART_BEAT;
+using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
+using protocol_handler::FRAME_DATA_START_SERVICE_ACK;
using protocol_handler::FRAME_TYPE_CONTROL;
-using protocol_handler::kControl;
-using protocol_handler::kRpc;
+using protocol_handler::FRAME_TYPE_FIRST;
+using protocol_handler::FRAME_TYPE_MAX_VALUE;
using protocol_handler::kAudio;
-using protocol_handler::kMobileNav;
using protocol_handler::kBulk;
+using protocol_handler::kControl;
using protocol_handler::kInvalidServiceType;
-using protocol_handler::FRAME_DATA_HEART_BEAT;
-using protocol_handler::FRAME_DATA_START_SERVICE_ACK;
-using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
+using protocol_handler::kMobileNav;
+using protocol_handler::kRpc;
+using protocol_handler::PROTECTION_OFF;
using protocol_handler::PROTOCOL_HEADER_V1_SIZE;
using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
+using protocol_handler::PROTOCOL_VERSION_1;
+using protocol_handler::PROTOCOL_VERSION_3;
using protocol_handler::PROTOCOL_VERSION_MAX;
+using protocol_handler::ProtocolPacket;
+using protocol_handler::RawMessagePtr;
+using protocol_handler::RESULT_CODE;
+using protocol_handler::RESULT_FAIL;
+using protocol_handler::RESULT_OK;
class ProtocolPacketTest : public ::testing::Test {
protected:
diff --git a/src/components/protocol_handler/test/protocol_payload_test.cc b/src/components/protocol_handler/test/protocol_payload_test.cc
index e56f8aadff..e89e6c7395 100644
--- a/src/components/protocol_handler/test/protocol_payload_test.cc
+++ b/src/components/protocol_handler/test/protocol_payload_test.cc
@@ -33,10 +33,10 @@
#include <gtest/gtest.h>
#include <vector>
-#include "utils/macro.h"
-#include "utils/bitstream.h"
-#include "protocol_handler/protocol_payload.h"
#include "protocol/common.h"
+#include "protocol_handler/protocol_payload.h"
+#include "utils/bitstream.h"
+#include "utils/macro.h"
namespace test {
namespace components {
diff --git a/src/components/resumption/src/last_state_impl.cc b/src/components/resumption/src/last_state_impl.cc
index 4d3fd1526c..564266e19c 100644
--- a/src/components/resumption/src/last_state_impl.cc
+++ b/src/components/resumption/src/last_state_impl.cc
@@ -78,4 +78,4 @@ void LastStateImpl::LoadStateFromFileSystem() {
LOG4CXX_WARN(logger_, "No valid last state was found.");
}
-} // resumption
+} // namespace resumption
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h
index 10b494465c..611c333e4d 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -57,7 +57,7 @@ const std::string omitted_validation_info = "should be omitted in ";
const std::string required_validation_info = "is required in ";
std::string PolicyTableTypeToString(const PolicyTableType pt_type);
-}
+} // namespace policy_table_interface_base
template <typename T>
class Range;
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
index b6b47c2ed8..07a85eaa22 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
@@ -46,8 +46,7 @@ namespace rpc {
* Range helper class
*/
template <typename T>
-Range<T>::Range(T min, T max)
- : min_(min), max_(max) {}
+Range<T>::Range(T min, T max) : min_(min), max_(max) {}
template <typename T>
T Range<T>::min() const {
@@ -236,8 +235,7 @@ template <size_t minlen, size_t maxlen>
const Range<size_t> String<minlen, maxlen>::length_range_(minlen, maxlen);
template <size_t minlen, size_t maxlen>
-String<minlen, maxlen>::String()
- : PrimitiveType(kUninitialized) {}
+String<minlen, maxlen>::String() : PrimitiveType(kUninitialized) {}
template <size_t minlen, size_t maxlen>
String<minlen, maxlen>::String(const std::string& value)
@@ -288,8 +286,7 @@ String<minlen, maxlen>::operator const std::string&() const {
* Enum class
*/
template <typename T>
-Enum<T>::Enum()
- : PrimitiveType(kUninitialized), value_(EnumType()) {}
+Enum<T>::Enum() : PrimitiveType(kUninitialized), value_(EnumType()) {}
template <typename T>
Enum<T>::Enum(EnumType value)
@@ -311,8 +308,7 @@ Enum<T>::operator EnumType() const {
* Array class
*/
template <typename T, size_t minsize, size_t maxsize>
-Array<T, minsize, maxsize>::Array()
- : CompositeType(kUninitialized) {}
+Array<T, minsize, maxsize>::Array() : CompositeType(kUninitialized) {}
template <typename T, size_t minsize, size_t maxsize>
template <typename U>
@@ -401,13 +397,11 @@ void Array<T, minsize, maxsize>::SetPolicyTableType(
* Map class
*/
template <typename T, size_t minsize, size_t maxsize>
-Map<T, minsize, maxsize>::Map()
- : CompositeType(kUninitialized) {}
+Map<T, minsize, maxsize>::Map() : CompositeType(kUninitialized) {}
template <typename T, size_t minsize, size_t maxsize>
template <typename U>
-Map<T, minsize, maxsize>::Map(const U& value)
- : CompositeType(kUninitialized) {
+Map<T, minsize, maxsize>::Map(const U& value) : CompositeType(kUninitialized) {
for (typename U::const_iterator i = value.begin(), e = value.end(); i != e;
++i) {
// Explicitly convert that value to T because all rpc_types have explicit
@@ -499,13 +493,11 @@ void Map<T, minsize, maxsize>::SetPolicyTableType(
* Nullable class
*/
template <typename T>
-Nullable<T>::Nullable()
- : marked_null_(false) {}
+Nullable<T>::Nullable() : marked_null_(false) {}
template <typename T>
template <typename U>
-Nullable<T>::Nullable(const U& value)
- : T(value), marked_null_(false) {}
+Nullable<T>::Nullable(const U& value) : T(value), marked_null_(false) {}
template <typename T>
template <typename U>
@@ -623,8 +615,7 @@ void rpc::Optional<T>::SetPolicyTableType(
* Stringifyable class
*/
template <typename T>
-Stringifyable<T>::Stringifyable()
- : predefined_string_("") {}
+Stringifyable<T>::Stringifyable() : predefined_string_("") {}
template <typename T>
template <typename U>
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
index 6c8bb359af..871778b29a 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_JSON_INL_H_
#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_JSON_INL_H_
-#include "rpc_base/rpc_base.h"
#include "json/value.h"
+#include "rpc_base/rpc_base.h"
namespace rpc {
@@ -206,6 +206,7 @@ String<minlen, maxlen>::String(const Json::Value* value,
if (!is_initialized()) {
value_state_ = kValid;
} else if (is_valid()) {
+ value_ = value->asString();
value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
}
}
diff --git a/src/components/rpc_base/test/rpc_base_test.cc b/src/components/rpc_base/test/rpc_base_test.cc
index d81e01db6c..dc0a1df128 100644
--- a/src/components/rpc_base/test/rpc_base_test.cc
+++ b/src/components/rpc_base/test/rpc_base_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rpc_base/rpc_base.h"
#include "gtest/gtest.h"
#include "json/writer.h"
#include "rpc_base/gtest_support.h"
-#include "rpc_base/rpc_base.h"
namespace test {
namespace components {
diff --git a/src/components/rpc_base/test/validation_report_test.cc b/src/components/rpc_base/test/validation_report_test.cc
index 10effe7dd2..5d3785d6cb 100644
--- a/src/components/rpc_base/test/validation_report_test.cc
+++ b/src/components/rpc_base/test/validation_report_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rpc_base/validation_report.h"
#include <string>
#include "gtest/gtest.h"
-#include "rpc_base/validation_report.h"
namespace test {
namespace components {
diff --git a/src/components/security_manager/CMakeLists.txt b/src/components/security_manager/CMakeLists.txt
index 88bc1ddab4..272c7aad2f 100644
--- a/src/components/security_manager/CMakeLists.txt
+++ b/src/components/security_manager/CMakeLists.txt
@@ -39,6 +39,7 @@ include_directories(
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/application_manager/include/
${JSONCPP_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
${APR_INCLUDE_DIRECTORY}
)
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
index 5fd7a95155..46fd1a5995 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -33,19 +33,19 @@
#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_IMPL_H_
#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_IMPL_H_
-#include <stdint.h>
#include <openssl/bio.h>
-#include <openssl/ssl.h>
#include <openssl/err.h>
-#include <string>
+#include <openssl/ssl.h>
+#include <stdint.h>
#include <map>
+#include <string>
#include "security_manager/crypto_manager.h"
-#include "security_manager/ssl_context.h"
#include "security_manager/security_manager_settings.h"
+#include "security_manager/ssl_context.h"
-#include "utils/macro.h"
#include "utils/lock.h"
+#include "utils/macro.h"
namespace security_manager {
class CryptoManagerImpl : public CryptoManager {
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
index f20d3e4034..47cc557976 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
@@ -1,8 +1,8 @@
#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_SETTINGS_IMPL_H_
#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_SETTINGS_IMPL_H_
-#include "security_manager/security_manager_settings.h"
#include "config_profile/profile.h"
+#include "security_manager/security_manager_settings.h"
namespace security_manager {
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 c53d39ba87..f2a417a43d 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
@@ -34,18 +34,18 @@
#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_IMPL_H_
#include <list>
-#include <string>
-#include <set>
#include <memory>
+#include <set>
+#include <string>
#include "utils/macro.h"
#include "utils/message_queue.h"
#include "utils/threads/message_loop_thread.h"
+#include "protocol/common.h"
+#include "protocol_handler/protocol_handler.h"
#include "security_manager/security_manager.h"
#include "security_manager/security_query.h"
-#include "protocol_handler/protocol_handler.h"
-#include "protocol/common.h"
#include "utils/system_time_handler.h"
namespace security_manager {
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 90ae0177ec..cb42d5b46c 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -33,22 +33,22 @@
#include "security_manager/crypto_manager_impl.h"
#include <openssl/bio.h>
-#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/pkcs12.h>
+#include <openssl/ssl.h>
-#include <fstream>
-#include <iostream>
#include <stdio.h>
-#include <ctime>
#include <algorithm>
+#include <ctime>
+#include <fstream>
+#include <iostream>
#include "security_manager/security_manager.h"
-#include "utils/logger.h"
#include "utils/atomic.h"
+#include "utils/date_time.h"
+#include "utils/logger.h"
#include "utils/macro.h"
#include "utils/scope_guard.h"
-#include "utils/date_time.h"
#define TLS1_1_MINIMAL_VERSION 0x1000103fL
#define CONST_SSL_METHOD_MINIMAL_VERSION 0x00909000L
@@ -84,7 +84,7 @@ void free_ctx(SSL_CTX** ctx) {
*ctx = NULL;
}
}
-}
+} // namespace
CryptoManagerImpl::CryptoManagerImpl(
const std::shared_ptr<const CryptoManagerSettings> set)
@@ -156,9 +156,9 @@ bool CryptoManagerImpl::Init() {
LOG4CXX_DEBUG(logger_,
"Peer verification "
<< (get_settings().verify_peer() ? "enabled" : "disabled"));
- LOG4CXX_DEBUG(logger_,
- "CA certificate file is \"" << get_settings().ca_cert_path()
- << '"');
+ LOG4CXX_DEBUG(
+ logger_,
+ "CA certificate file is \"" << get_settings().ca_cert_path() << '"');
#if OPENSSL_VERSION_NUMBER < CONST_SSL_METHOD_MINIMAL_VERSION
SSL_METHOD* method;
@@ -387,9 +387,9 @@ bool CryptoManagerImpl::SaveCertificateData(
UNUSED(cert_guard);
if (1 != BIO_reset(bio_cert)) {
- LOG4CXX_WARN(logger_,
- "Unabled to reset BIO in order to read private key, "
- << LastError());
+ LOG4CXX_WARN(
+ logger_,
+ "Unabled to reset BIO in order to read private key, " << LastError());
}
EVP_PKEY* pkey = NULL;
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 70f835fb93..dd71828d73 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -32,12 +32,12 @@
#include "security_manager/security_manager_impl.h"
#include <functional>
-#include "security_manager/crypto_manager_impl.h"
+#include "json/json.h"
#include "protocol_handler/protocol_packet.h"
-#include "utils/logger.h"
+#include "security_manager/crypto_manager_impl.h"
#include "utils/byte_order.h"
-#include "json/json.h"
#include "utils/helpers.h"
+#include "utils/logger.h"
namespace security_manager {
@@ -448,9 +448,9 @@ bool SecurityManagerImpl::ProccessHandshakeData(
const uint32_t seqNumber = inMessage->get_header().seq_number;
const uint32_t connection_key = inMessage->get_connection_key();
- LOG4CXX_DEBUG(logger_,
- "Received " << inMessage->get_data_size()
- << " bytes handshake data ");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Received " << inMessage->get_data_size() << " bytes handshake data ");
if (!inMessage->get_data_size()) {
const std::string error_text("SendHandshakeData: null arguments size.");
diff --git a/src/components/security_manager/src/security_query.cc b/src/components/security_manager/src/security_query.cc
index 60233dde5e..fecfc4d723 100644
--- a/src/components/security_manager/src/security_query.cc
+++ b/src/components/security_manager/src/security_query.cc
@@ -32,8 +32,8 @@
#include "security_manager/security_query.h"
#include <cstring>
-#include "utils/macro.h"
#include "utils/byte_order.h"
+#include "utils/macro.h"
namespace security_manager {
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 67be17db63..357d9556fb 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -33,14 +33,14 @@
#include <assert.h>
#include <memory.h>
-#include <map>
+#include <time.h>
#include <algorithm>
+#include <map>
#include <vector>
-#include <time.h>
#include <openssl/bio.h>
-#include <openssl/ssl.h>
#include <openssl/err.h>
+#include <openssl/ssl.h>
#include "utils/macro.h"
@@ -249,9 +249,9 @@ CryptoManagerImpl::SSLContextImpl::CheckCertContext() {
<< start_seconds << " seconds");
return Handshake_Result_NotYetValid;
} else {
- LOG4CXX_DEBUG(logger_,
- "Time since certificate validity " << start_seconds
- << "seconds");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Time since certificate validity " << start_seconds << "seconds");
}
if (end_seconds < 0) {
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 5e096194f3..d30fa5ef23 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -35,17 +35,17 @@
#else
#include <openssl/ssl.h>
#endif //__QNXNTO__
-#include <limits>
#include <fstream>
+#include <limits>
#include <sstream>
#include "gtest/gtest.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/mock_security_manager_settings.h"
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
namespace {
const size_t kUpdatesBeforeHour = 24;
@@ -62,7 +62,7 @@ const std::string kFordCipher = SSL3_TXT_RSA_DES_192_CBC3_SHA;
// Used cipher from ford protocol requirement
const std::string kFordCipher = TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384;
#endif
-}
+} // namespace
namespace test {
namespace components {
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index aff7cbca2d..21af54f67b 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -30,20 +30,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <memory>
+#include <string>
#include "gtest/gtest.h"
-#include "utils/byte_order.h"
#include "protocol/common.h"
#include "security_manager/security_manager_impl.h"
+#include "utils/byte_order.h"
#include "protocol_handler/mock_protocol_handler.h"
#include "protocol_handler/mock_session_observer.h"
-#include "security_manager/mock_security_manager.h"
-#include "security_manager/mock_ssl_context.h"
#include "security_manager/mock_crypto_manager.h"
+#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_security_manager_listener.h"
+#include "security_manager/mock_ssl_context.h"
#include "utils/mock_system_time_handler.h"
#include "utils/test_async_waiter.h"
@@ -52,28 +52,28 @@ namespace test {
namespace components {
namespace security_manager_test {
-using protocol_handler::PROTOCOL_VERSION_2;
-using protocol_handler::ServiceType;
-using protocol_handler::kControl;
-using protocol_handler::kRpc;
using protocol_handler::kAudio;
-using protocol_handler::kMobileNav;
using protocol_handler::kBulk;
+using protocol_handler::kControl;
using protocol_handler::kInvalidServiceType;
-using protocol_handler::RawMessagePtr;
+using protocol_handler::kMobileNav;
+using protocol_handler::kRpc;
+using protocol_handler::PROTOCOL_VERSION_2;
using protocol_handler::RawMessage;
+using protocol_handler::RawMessagePtr;
+using protocol_handler::ServiceType;
-using security_manager::SecurityQuery;
-using security_manager::SSLContext;
using security_manager::SecurityManager;
using security_manager::SecurityManagerImpl;
+using security_manager::SecurityQuery;
+using security_manager::SSLContext;
using security_manager_test::InternalErrorWithErrId;
+using ::testing::_;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnNull;
-using ::testing::DoAll;
using ::testing::SetArgPointee;
-using ::testing::_;
namespace {
// Sample data for handshake data emulation
@@ -92,7 +92,7 @@ uint8_t* handshake_data_out_pointer = handshake_data_out;
const size_t handshake_data_out_size =
sizeof(handshake_data_out) / sizeof(handshake_data_out[0]);
const uint32_t kAsyncExpectationsTimeout = 10000u;
-}
+} // namespace
class SecurityManagerTest : public ::testing::Test {
protected:
@@ -104,8 +104,9 @@ class SecurityManagerTest : public ::testing::Test {
void SetUp() OVERRIDE {
security_manager_->set_session_observer(&mock_session_observer);
security_manager_->set_protocol_handler(&mock_protocol_handler);
- mock_sm_listener.reset(new testing::StrictMock<
- security_manager_test::MockSecurityManagerListener>());
+ mock_sm_listener.reset(
+ new testing::StrictMock<
+ security_manager_test::MockSecurityManagerListener>());
security_manager_->AddListener(mock_sm_listener.get());
}
@@ -170,8 +171,9 @@ class SecurityManagerTest : public ::testing::Test {
mock_ssl_context_new;
testing::StrictMock<security_manager_test::MockSSLContext>
mock_ssl_context_exists;
- std::unique_ptr<testing::StrictMock<
- security_manager_test::MockSecurityManagerListener> > mock_sm_listener;
+ std::unique_ptr<
+ testing::StrictMock<security_manager_test::MockSecurityManagerListener> >
+ mock_sm_listener;
std::unique_ptr<MockSystemTimeHandler> mock_system_time_handler;
std::shared_ptr<SecurityManagerImpl> security_manager_;
};
@@ -290,7 +292,8 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
EXPECT_CALL(mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_NOT_SUPPORTED),
- kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
// It could be any query id
SecurityQuery::INVALID_QUERY_ID);
@@ -385,7 +388,8 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_ID),
- kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
@@ -575,7 +579,8 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
EmulateMobileMessageHandshake(NULL, 0);
@@ -606,7 +611,8 @@ TEST_F(SecurityManagerTest,
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SERVICE_NOT_PROTECTED),
- kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
// Expect notifying listeners (unsuccess)
diff --git a/src/components/security_manager/test/security_query_matcher.cc b/src/components/security_manager/test/security_query_matcher.cc
index 3b7f4dd298..1bf22bf8cd 100644
--- a/src/components/security_manager/test/security_query_matcher.cc
+++ b/src/components/security_manager/test/security_query_matcher.cc
@@ -33,8 +33,8 @@
#include <string>
#include "gmock/gmock.h"
-#include "utils/byte_order.h"
#include "security_manager/security_query.h"
+#include "utils/byte_order.h"
namespace test {
namespace components {
diff --git a/src/components/security_manager/test/security_query_test.cc b/src/components/security_manager/test/security_query_test.cc
index 80da10ea72..6becddaaf9 100644
--- a/src/components/security_manager/test/security_query_test.cc
+++ b/src/components/security_manager/test/security_query_test.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
#include <string>
+#include <vector>
#include "gtest/gtest.h"
-#include "security_manager/security_query.h"
#include "protocol_handler/protocol_payload.h"
-#include "utils/byte_order.h"
#include "security_manager/mock_security_manager.h"
+#include "security_manager/security_query.h"
+#include "utils/byte_order.h"
// Test values for compare after serialization and byteorder conversion
#define SEQ_NUMBER 0x12345678u
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 05eeb802ad..e4d6c308bb 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -30,21 +30,21 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
+#include <openssl/ssl.h>
#include <fstream>
#include <sstream>
#include <string>
-#include <openssl/ssl.h>
+#include "gtest/gtest.h"
#include "security_manager/crypto_manager.h"
#include "security_manager/crypto_manager_impl.h"
+#include "security_manager/mock_security_manager_settings.h"
#include "security_manager/ssl_context.h"
#include "utils/custom_string.h"
-#include "security_manager/mock_security_manager_settings.h"
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
namespace {
const std::string kCaPath = "";
@@ -98,14 +98,14 @@ class SSLTest : public testing::Test {
static void SetCertificate(const std::string& file_name,
std::string& out_certificate_data) {
std::ifstream certificate_file(file_name.c_str());
- ASSERT_TRUE(certificate_file.is_open()) << "Could not open " << file_name
- << "certificate data file";
+ ASSERT_TRUE(certificate_file.is_open())
+ << "Could not open " << file_name << "certificate data file";
std::stringstream certificate;
certificate << certificate_file.rdbuf();
certificate_file.close();
out_certificate_data = certificate.str();
- ASSERT_FALSE(out_certificate_data.empty()) << file_name
- << " data file is empty";
+ ASSERT_FALSE(out_certificate_data.empty())
+ << file_name << " data file is empty";
}
virtual void SetUp() OVERRIDE {
diff --git a/src/components/smart_objects/CMakeLists.txt b/src/components/smart_objects/CMakeLists.txt
index 84da05ce03..ef84c52ab9 100644
--- a/src/components/smart_objects/CMakeLists.txt
+++ b/src/components/smart_objects/CMakeLists.txt
@@ -34,6 +34,7 @@ include_directories(
${COMPONENTS_DIR}/include
${COMPONENTS_DIR}/smart_objects/include
${COMPONENTS_DIR}/utils/include
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
index bfa39af10a..05c53ec582 100644
--- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -53,12 +53,17 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
private:
CAlwaysFalseSchemaItem();
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
index 4750c280e5..a2d305d0f9 100644
--- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -53,12 +53,17 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
private:
CAlwaysTrueSchemaItem();
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 a81fdd637e..0e19d2237e 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
@@ -34,8 +34,8 @@
#include <stddef.h>
-#include "smart_objects/schema_item.h"
#include "smart_objects/always_true_schema_item.h"
+#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "utils/semantic_version.h"
@@ -68,23 +68,28 @@ class CArraySchemaItem : public ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
/**
* @brief Apply schema.
*
* @param Object Object to apply schema.
- *
- * @param RemoveFakeParameters contains true if need to remove fake parameters
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion =
utils::SemanticVersion()) OVERRIDE;
@@ -92,8 +97,11 @@ class CArraySchemaItem : public ISchemaItem {
* @brief Unapply schema.
*
* @param Object Object to unapply schema.
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
**/
- void unapplySchema(SmartObject& Object) OVERRIDE;
+ void unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) OVERRIDE;
/**
* @brief Build smart object by smart schema having copied matched
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
index 5978fcb282..16dbad4426 100644
--- a/src/components/smart_objects/include/smart_objects/default_shema_item.h
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -53,12 +53,17 @@ class CDefaultSchemaItem : public ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
/**
* @brief Set default value to an object.
@@ -105,12 +110,13 @@ template <typename Type>
errors::eType CDefaultSchemaItem<Type>::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (getSmartType() != Object.getType()) {
- std::string validation_info = "Incorrect type, expected: " +
- SmartObject::typeToString(getSmartType()) +
- ", got: " +
- SmartObject::typeToString(Object.getType());
+ std::string validation_info =
+ "Incorrect type, expected: " +
+ SmartObject::typeToString(getSmartType()) +
+ ", got: " + SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
return errors::INVALID_VALUE;
} else {
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 cbba5bd7cd..053ad98395 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
@@ -41,8 +41,8 @@
#include "smart_objects/default_shema_item.h"
-#include "utils/semantic_version.h"
#include <boost/optional.hpp>
+#include "utils/semantic_version.h"
namespace ns_smart_device_link {
namespace ns_smart_objects {
@@ -108,12 +108,17 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
/**
* @brief Return the correct history signature based on message version.
* @param signatures Vector reference of enums history items.
@@ -129,18 +134,22 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* and tries to convert it to integer according to element-to-string
* map.
* @param Object Object to apply schema.
- * @param RemoveFakeParameters contains true if need to remove fake parameters
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion =
utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
**/
- void unapplySchema(SmartObject& Object) OVERRIDE;
+ void unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) OVERRIDE;
private:
/**
@@ -220,11 +229,10 @@ class EnumConversionHelper {
static bool EnumToString(const EnumType value, std::string* str) {
const char* cstr;
- if (EnumToCString(value, &cstr)) {
- return false;
- }
- if (str) {
+ bool success = EnumToCString(value, &cstr);
+ if (success && str) {
*str = cstr;
+ return true;
}
return false;
}
@@ -307,16 +315,20 @@ template <typename EnumType>
errors::eType TEnumSchemaItem<EnumType>::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (SmartType_Integer != Object.getType()) {
std::string validation_info;
if (SmartType_String == Object.getType()) {
+ if (allow_unknown_enums) {
+ return errors::OK;
+ }
validation_info = "Invalid enum value: " + Object.asString();
} else {
- validation_info = "Incorrect type, expected: " +
- SmartObject::typeToString(SmartType_Integer) +
- " (enum), got: " +
- SmartObject::typeToString(Object.getType());
+ validation_info =
+ "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Integer) +
+ " (enum), got: " + SmartObject::typeToString(Object.getType());
}
report__->set_validation_info(validation_info);
return errors::INVALID_VALUE;
@@ -366,7 +378,7 @@ errors::eType TEnumSchemaItem<EnumType>::validate(
template <typename EnumType>
void TEnumSchemaItem<EnumType>::applySchema(
SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {
if (SmartType_String == Object.getType()) {
EnumType enum_val = static_cast<EnumType>(-1);
@@ -377,7 +389,8 @@ void TEnumSchemaItem<EnumType>::applySchema(
}
template <typename EnumType>
-void TEnumSchemaItem<EnumType>::unapplySchema(SmartObject& Object) {
+void TEnumSchemaItem<EnumType>::unapplySchema(
+ SmartObject& Object, const bool remove_unknown_parameters) {
if (SmartType_Integer == Object.getType()) {
const char* str;
if (ConversionHelper::EnumToCString(static_cast<EnumType>(Object.asInt()),
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 6481605daf..c3767e8e48 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
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
-#include <typeinfo>
#include <limits>
+#include <typeinfo>
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
@@ -70,12 +70,17 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
private:
/**
@@ -108,10 +113,11 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
};
template <typename NumberType>
-std::shared_ptr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
- NumberType>::create(const TSchemaItemParameter<NumberType>& MinValue,
- const TSchemaItemParameter<NumberType>& MaxValue,
- const TSchemaItemParameter<NumberType>& DefaultValue) {
+std::shared_ptr<TNumberSchemaItem<NumberType> >
+TNumberSchemaItem<NumberType>::create(
+ const TSchemaItemParameter<NumberType>& MinValue,
+ const TSchemaItemParameter<NumberType>& MaxValue,
+ const TSchemaItemParameter<NumberType>& DefaultValue) {
return std::shared_ptr<TNumberSchemaItem<NumberType> >(
new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue));
}
@@ -137,7 +143,8 @@ template <typename NumberType>
errors::eType TNumberSchemaItem<NumberType>::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (!isValidNumberType(Object.getType())) {
SmartType expectedType = (typeid(double) == typeid(Object.getType()))
? SmartType_Double
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 45d161320b..7f51ae5678 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
@@ -33,12 +33,12 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
#include <map>
-#include <string>
#include <set>
+#include <string>
+#include <boost/optional.hpp>
#include "utils/macro.h"
#include "utils/semantic_version.h"
-#include <boost/optional.hpp>
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
@@ -109,27 +109,36 @@ class CObjectSchemaItem : public ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
/**
* @brief Apply schema.
* @param Object Object to apply schema.
- * @param RemoveFakeParameters contains true if need to remove fake parameters
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion =
utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
**/
- void unapplySchema(SmartObject& Object) OVERRIDE;
+ void unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) OVERRIDE;
/**
* @brief Build smart object by smart schema having copied matched
* parameters from pattern smart object
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
index 24c642c0ba..fa5f6d3adc 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -58,13 +58,18 @@ class ISchemaItem {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* message if an error occurs
- * @param MessageVersion to check mobile RPC version against RPC Spec Histor
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
virtual errors::eType validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false);
/**
* @brief Set default value to an object.
@@ -88,21 +93,25 @@ class ISchemaItem {
* @brief Apply schema.
*
* @param Object Object to apply schema.
- * @param RemoveFakeParameters contains true if need to remove fake parameters
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* from smart object otherwise contains false.
**/
virtual void applySchema(
ns_smart_device_link::ns_smart_objects::SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Unapply schema.
*
* @param Object Object to unapply schema.
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
**/
virtual void unapplySchema(
- ns_smart_device_link::ns_smart_objects::SmartObject& Object);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object,
+ const bool remove_unknown_parameters = true);
/**
* @brief Build smart object by smart schema having copied matched
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index 2abc221972..f3aab0fc1e 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -33,15 +33,15 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
+#include <map>
#include <set>
-#include <string>
#include <sstream>
+#include <string>
#include <vector>
-#include <map>
+#include "rpc_base/validation_report.h"
#include "smart_objects/smart_schema.h"
#include "utils/custom_string.h"
-#include "rpc_base/validation_report.h"
namespace ns_smart_device_link {
namespace ns_smart_objects {
@@ -299,8 +299,8 @@ class SmartObject FINAL {
bool operator==(const int64_t Value) const;
/**
- * @name Support of type: uint64_t
- * @{
+ * @name Support of type: uint64_t
+ * @{
**/
/**
@@ -676,11 +676,16 @@ class SmartObject FINAL {
*
* @param report__ object for reporting errors during validation
* @param messageVersion of the mobile app to check against RPC Spec Schema
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return Result of validation.
*/
errors::eType validate(
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false);
/**
* @brief Sets new schema
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index 5e1497fdde..936f49c11e 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -32,8 +32,8 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
-#include "utils/macro.h"
#include "smart_objects/schema_item.h"
+#include "utils/macro.h"
namespace ns_smart_device_link {
namespace ns_smart_objects {
@@ -66,12 +66,17 @@ class CSmartSchema FINAL {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& messageVersion =
- utils::SemanticVersion()) const;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& messageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) const;
/**
* @brief Set new root schema item.
@@ -85,22 +90,26 @@ class CSmartSchema FINAL {
*
* @param Object Object to apply schema.
*
- * @param RemoveFakeParameters contains true if need to remove fake parameters
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
* from smart object otherwise contains false.
**/
void applySchema(
SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief The reverse SmartObject conversion using schema.
*
* @param object Object to convert.
+ * @param remove_unknown_parameters contains true if need to remove unknown
+ *parameters
*/
// TODO(cpplint): Is this a non-const reference?
// If so, make const or use a pointer.
- void unapplySchema(SmartObject& object);
+ void unapplySchema(SmartObject& object,
+ const bool remove_unknown_parameters = true);
/**
* @brief Build smart object by smart schema having copied matched
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
index 5b37db584d..7104ff47a9 100644
--- a/src/components/smart_objects/include/smart_objects/string_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -65,12 +65,17 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @param allow_unknown_enums
+ * false - unknown enum values (left as string values after applySchema)
+ * will be considered invalid.
+ * true - such values will be considered valid.
* @return ns_smart_objects::errors::eType
**/
- errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion =
- utils::SemanticVersion()) OVERRIDE;
+ errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion(),
+ const bool allow_unknown_enums = false) OVERRIDE;
private:
/**
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
index ca247eed09..4f8f4584af 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -44,7 +44,8 @@ std::shared_ptr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
errors::eType CAlwaysFalseSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
report__->set_validation_info("Generic error");
return errors::ERROR;
}
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
index 983733165c..855bfef2a0 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -42,7 +42,8 @@ std::shared_ptr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
errors::eType CAlwaysTrueSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
return errors::OK;
}
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 7d5f8bcf84..9420fe020f 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -45,12 +45,13 @@ std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
errors::eType CArraySchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (SmartType_Array != Object.getType()) {
- std::string validation_info = "Incorrect type, expected: " +
- SmartObject::typeToString(SmartType_Array) +
- ", got: " +
- SmartObject::typeToString(Object.getType());
+ std::string validation_info =
+ "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Array) +
+ ", got: " + SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
return errors::INVALID_VALUE;
}
@@ -80,7 +81,8 @@ errors::eType CArraySchemaItem::validate(
const errors::eType result =
mElementSchemaItem->validate(Object.getElement(i),
&report__->ReportSubobject(strVal.str()),
- MessageVersion);
+ MessageVersion,
+ allow_unknown_enums);
if (errors::OK != result) {
return result;
}
@@ -90,20 +92,21 @@ errors::eType CArraySchemaItem::validate(
void CArraySchemaItem::applySchema(
SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array == Object.getType()) {
for (size_t i = 0U; i < Object.length(); ++i) {
mElementSchemaItem->applySchema(
- Object[i], RemoveFakeParameters, MessageVersion);
+ Object[i], remove_unknown_parameters, MessageVersion);
}
}
}
-void CArraySchemaItem::unapplySchema(SmartObject& Object) {
+void CArraySchemaItem::unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) {
if (SmartType_Array == Object.getType()) {
for (size_t i = 0U; i < Object.length(); ++i) {
- mElementSchemaItem->unapplySchema(Object[i]);
+ mElementSchemaItem->unapplySchema(Object[i], remove_unknown_parameters);
}
}
}
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index 742c2ec353..be1c73fb85 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -40,7 +40,7 @@ namespace {
const char connection_key[] = "connection_key";
const char binary_data[] = "binary_data";
const char app_id[] = "appID";
-}
+} // namespace
namespace ns_smart_device_link {
namespace ns_smart_objects {
@@ -110,12 +110,13 @@ std::shared_ptr<CObjectSchemaItem> CObjectSchemaItem::create(
errors::eType CObjectSchemaItem::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (SmartType_Map != object.getType()) {
- std::string validation_info = "Incorrect type, expected: " +
- SmartObject::typeToString(SmartType_Map) +
- ", got: " +
- SmartObject::typeToString(object.getType());
+ std::string validation_info =
+ "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Map) +
+ ", got: " + SmartObject::typeToString(object.getType());
report__->set_validation_info(validation_info);
return errors::INVALID_VALUE;
}
@@ -142,8 +143,11 @@ errors::eType CObjectSchemaItem::validate(
errors::eType result = errors::OK;
// Check if MessageVersion matches schema version
- result = correct_member.mSchemaItem->validate(
- field, &report__->ReportSubobject(key), MessageVersion);
+ result =
+ correct_member.mSchemaItem->validate(field,
+ &report__->ReportSubobject(key),
+ MessageVersion,
+ allow_unknown_enums);
if (errors::OK != result) {
return result;
}
@@ -154,13 +158,13 @@ errors::eType CObjectSchemaItem::validate(
void CObjectSchemaItem::applySchema(
SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != Object.getType()) {
return;
}
- if (RemoveFakeParameters) {
+ if (remove_unknown_parameters) {
RemoveFakeParams(Object, MessageVersion);
}
@@ -173,16 +177,17 @@ void CObjectSchemaItem::applySchema(
if (member.mSchemaItem->setDefaultValue(default_value)) {
Object[key] = default_value;
member.mSchemaItem->applySchema(
- Object[key], RemoveFakeParameters, MessageVersion);
+ Object[key], remove_unknown_parameters, MessageVersion);
}
} else {
member.mSchemaItem->applySchema(
- Object[key], RemoveFakeParameters, MessageVersion);
+ Object[key], remove_unknown_parameters, MessageVersion);
}
}
}
-void CObjectSchemaItem::unapplySchema(SmartObject& Object) {
+void CObjectSchemaItem::unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) {
if (SmartType_Map != Object.getType()) {
return;
}
@@ -191,7 +196,7 @@ void CObjectSchemaItem::unapplySchema(SmartObject& Object) {
const std::string& key = it->first;
// move next to avoid wrong iterator on erase
++it;
- if (mMembers.end() == mMembers.find(key)) {
+ if (mMembers.end() == mMembers.find(key) && remove_unknown_parameters) {
// remove fake params
Object.erase(key);
}
@@ -202,7 +207,7 @@ void CObjectSchemaItem::unapplySchema(SmartObject& Object) {
const std::string& key = it->first;
const SMember& member = it->second;
if (Object.keyExists(key)) {
- member.mSchemaItem->unapplySchema(Object[key]);
+ member.mSchemaItem->unapplySchema(Object[key], remove_unknown_parameters);
}
}
}
@@ -239,8 +244,7 @@ void CObjectSchemaItem::RemoveFakeParams(
mMembers.find(key);
if (mMembers.end() == members_it
// FIXME(EZamakhov): Remove illegal usage of filed in AM
- &&
- key.compare(connection_key) != 0 && key.compare(binary_data) != 0 &&
+ && key.compare(connection_key) != 0 && key.compare(binary_data) != 0 &&
key.compare(app_id) != 0) {
++it;
Object.erase(key);
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 5e9358092a..8c40e2c7bd 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -38,7 +38,8 @@ namespace ns_smart_objects {
errors::eType ISchemaItem::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
return errors::ERROR;
}
@@ -51,10 +52,11 @@ bool ISchemaItem::hasDefaultValue(SmartObject& Object) {
}
void ISchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {}
-void ISchemaItem::unapplySchema(SmartObject& Object) {}
+void ISchemaItem::unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) {}
void ISchemaItem::BuildObjectBySchema(const SmartObject& pattern_object,
SmartObject& result_object) {}
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index 1322757ab1..eb1c737aff 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -34,13 +34,12 @@
#include <errno.h>
#include <inttypes.h>
-#include <limits>
#include <stdlib.h>
#include <algorithm>
-#include <sstream>
#include <iomanip>
#include <iterator>
#include <limits>
+#include <sstream>
namespace ns_smart_device_link {
namespace ns_smart_objects {
@@ -701,6 +700,9 @@ void SmartObject::duplicate(const SmartObject& OtherObject) {
case SmartType_Integer:
newData.int_value = OtherObject.m_data.int_value;
break;
+ case SmartType_UInteger:
+ newData.int_value = OtherObject.m_data.int_value;
+ break;
case SmartType_Double:
newData.double_value = OtherObject.m_data.double_value;
break;
@@ -875,8 +877,10 @@ bool SmartObject::isValid() const {
errors::eType SmartObject::validate(
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
- return m_schema.validate(*this, report__, MessageVersion);
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
+ return m_schema.validate(
+ *this, report__, MessageVersion, allow_unknown_enums);
}
void SmartObject::setSchema(const CSmartSchema& schema) {
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index f7cd22c4bc..4ab5e5ff23 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -43,8 +43,10 @@ CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
errors::eType CSmartSchema::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) const {
- return mSchemaItem->validate(object, report__, MessageVersion);
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) const {
+ return mSchemaItem->validate(
+ object, report__, MessageVersion, allow_unknown_enums);
}
void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
@@ -52,13 +54,14 @@ void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
}
void CSmartSchema::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion) {
- mSchemaItem->applySchema(Object, RemoveFakeParameters, MessageVersion);
+ mSchemaItem->applySchema(Object, remove_unknown_parameters, MessageVersion);
}
-void CSmartSchema::unapplySchema(SmartObject& Object) {
- mSchemaItem->unapplySchema(Object);
+void CSmartSchema::unapplySchema(SmartObject& Object,
+ const bool remove_unknown_parameters) {
+ mSchemaItem->unapplySchema(Object, remove_unknown_parameters);
}
void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object,
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index 0288ad85e8..c4382174d0 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "smart_objects/smart_object.h"
#include "smart_objects/string_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
namespace ns_smart_device_link {
@@ -49,12 +49,13 @@ std::shared_ptr<CStringSchemaItem> CStringSchemaItem::create(
errors::eType CStringSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
- const utils::SemanticVersion& MessageVersion) {
+ const utils::SemanticVersion& MessageVersion,
+ const bool allow_unknown_enums) {
if (SmartType_String != Object.getType()) {
- std::string validation_info = "Incorrect type, expected: " +
- SmartObject::typeToString(SmartType_String) +
- ", got: " +
- SmartObject::typeToString(Object.getType());
+ std::string validation_info =
+ "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_String) +
+ ", got: " + SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
return errors::INVALID_VALUE;
}
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index 1f514672fd..cded041bcc 100644
--- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -34,8 +34,8 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/always_false_schema_item.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
index 7f26a4968a..54a9c8684f 100644
--- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -34,8 +34,8 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/always_true_schema_item.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
index 28f435ee43..a22a27399d 100644
--- a/src/components/smart_objects/test/ArraySchemaItem_test.cc
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -34,8 +34,8 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/array_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "smart_objects/string_schema_item.h"
namespace test {
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index ed0043925b..7400729116 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -34,8 +34,8 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/bool_schema_item.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
index 646e60bf61..51085040c5 100644
--- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -32,18 +32,18 @@
#include <string>
+#include "formatters/CSmartFactory.h"
+#include "formatters/generic_json_formatter.h"
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
-#include "smart_objects/smart_schema.h"
#include "smart_objects/array_schema_item.h"
#include "smart_objects/bool_schema_item.h"
-#include "smart_objects/string_schema_item.h"
#include "smart_objects/enum_schema_item.h"
#include "smart_objects/number_schema_item.h"
-#include "smart_objects/schema_item_parameter.h"
#include "smart_objects/object_schema_item.h"
-#include "formatters/generic_json_formatter.h"
-#include "formatters/CSmartFactory.h"
+#include "smart_objects/schema_item_parameter.h"
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
+#include "smart_objects/string_schema_item.h"
#include "utils/semantic_version.h"
namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
@@ -89,7 +89,7 @@ namespace Keys {
const char RESULT_CODE[] = "resultCode";
const char INFO[] = "info";
const char SUCCESS[] = "success";
-}
+} // namespace Keys
class ObjectSchemaItemTest : public ::testing::Test {
protected:
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
index edfa563336..4f675ab181 100644
--- a/src/components/smart_objects/test/EnumSchemaItem_test.cc
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -32,8 +32,8 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/smart_object.h"
#include "smart_objects/string_schema_item.h"
#include <string>
@@ -278,5 +278,5 @@ const test::components::SmartObjects::SchemaItem::TestType::eType
test::components::SmartObjects::SchemaItem::TestType::MASTER_RESET,
test::components::SmartObjects::SchemaItem::TestType::FACTORY_DEFAULTS,
test::components::SmartObjects::SchemaItem::TestType::APP_UNAUTHORIZED};
-}
-}
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
index eb227e4e9b..04010be3f3 100644
--- a/src/components/smart_objects/test/NumberSchemaItem_test.cc
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -33,8 +33,8 @@
#include <string>
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
#include "smart_objects/number_schema_item.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
index 7d95a40b26..edcb09c604 100644
--- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -36,21 +36,21 @@
#include "gmock/gmock.h"
-#include "smart_objects/smart_object.h"
-#include "smart_objects/smart_schema.h"
-#include "smart_objects/schema_item.h"
-#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "smart_objects/array_schema_item.h"
#include "smart_objects/bool_schema_item.h"
-#include "smart_objects/object_schema_item.h"
-#include "smart_objects/string_schema_item.h"
#include "smart_objects/enum_schema_item.h"
#include "smart_objects/number_schema_item.h"
+#include "smart_objects/object_schema_item.h"
+#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
+#include "smart_objects/string_schema_item.h"
-#include <string>
#include <time.h>
+#include <string>
namespace test {
namespace components {
@@ -783,5 +783,5 @@ const test::components::SmartObjects::SmartObjectConvertionTimeTest::
MessageTypeTest::response,
test::components::SmartObjects::SmartObjectConvertionTimeTest::
MessageTypeTest::notification};
-}
-}
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
index cfb6785db7..d2382be51d 100644
--- a/src/components/smart_objects/test/SmartObjectDraft_test.cc
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -37,8 +37,8 @@
#include "smart_objects/smart_object.h"
-using ::testing::ElementsAre;
using ::testing::ContainerEq;
+using ::testing::ElementsAre;
namespace test {
namespace components {
diff --git a/src/components/smart_objects/test/map_performance_test.cc b/src/components/smart_objects/test/map_performance_test.cc
index b0544a94d4..be29a93553 100644
--- a/src/components/smart_objects/test/map_performance_test.cc
+++ b/src/components/smart_objects/test/map_performance_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <map>
#include <string>
#include <vector>
-#include <map>
#include "gmock/gmock.h"
@@ -59,7 +59,7 @@ void MakeMapObject(Map& obj, const int size) {
obj[i_key] = array;
}
}
-}
+} // namespace
TEST(SmartObjectPerformanceTest, SmartObjectMapPerformance) {
Map object;
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
index 11273e332f..ebf39e6b5c 100644
--- a/src/components/smart_objects/test/smart_object_performance_test.cc
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <set>
+#include <string>
#include "gmock/gmock.h"
@@ -58,7 +58,7 @@ void MakeMapObject(SmartObject& obj, const int size) {
obj[i_key] = array;
}
}
-}
+} // namespace
TEST(SmartObjectPerformanceTest, SmartObjectPerformance) {
SmartObject object;
diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt
index bb33857ecd..093413ef3b 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -50,6 +50,7 @@ include_directories (
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
index eabaf0a5e4..7ee5729c9b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
@@ -35,8 +35,8 @@
#include <string>
-#include "telemetry_monitor/metric_wrapper.h"
#include "telemetry_monitor/application_manager_observer.h"
+#include "telemetry_monitor/metric_wrapper.h"
namespace telemetry_monitor {
@@ -48,5 +48,5 @@ class ApplicationManagerMetricWrapper : public MetricWrapper {
message_metric;
virtual Json::Value GetJsonMetric();
};
-}
+} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_METRIC_WRAPPER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
index 31a3ceea12..826bc66c7f 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_OBSERVER_H_
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_OBSERVER_H_
-#include "utils/message_queue.h"
#include "application_manager/telemetry_observer.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
+#include "utils/message_queue.h"
namespace telemetry_monitor {
@@ -50,5 +50,5 @@ class ApplicationManagerObserver
private:
TelemetryMonitor* telemetry_monitor_;
};
-}
+} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/json_keys.h b/src/components/telemetry_monitor/include/telemetry_monitor/json_keys.h
index 899c76b2e8..94911bcaef 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/json_keys.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/json_keys.h
@@ -47,6 +47,6 @@ const char connection_key[] = "connection_key";
const char stime[] = "stime";
const char utime[] = "utime";
const char memory[] = "RAM";
-}
-}
+} // namespace strings
+} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_JSON_KEYS_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
index 431e255c7b..f69efada82 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_METRIC_WRAPPER_H_
#include <string>
-#include "utils/resource_usage.h"
#include "json/json.h"
+#include "utils/resource_usage.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
index dfe7f4b964..a3af8e7048 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
@@ -35,8 +35,8 @@
#include <string>
-#include "telemetry_monitor/metric_wrapper.h"
#include "protocol_handler_observer.h"
+#include "telemetry_monitor/metric_wrapper.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
index ff7b9da9d6..b7d8f6da2b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -35,16 +35,16 @@
#include <string>
-#include "utils/message_queue.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-#include "telemetry_monitor/metric_wrapper.h"
+#include "application_manager/application_manager.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol_handler_observer.h"
#include "telemetry_monitor/application_manager_observer.h"
-#include "application_manager/application_manager_impl.h"
+#include "telemetry_monitor/metric_wrapper.h"
#include "telemetry_monitor/transport_manager_observer.h"
#include "transport_manager/transport_manager_impl.h"
-#include "protocol_handler_observer.h"
-#include "protocol_handler/protocol_handler_impl.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
namespace telemetry_monitor {
@@ -78,12 +78,13 @@ class TelemetryMonitor {
public:
TelemetryMonitor(const std::string& server_address, uint16_t port);
virtual ~TelemetryMonitor();
- virtual void Init(TelemetryObservable<protocol_handler::PHTelemetryObserver>*
- protocol_handler,
- TelemetryObservable<
- application_manager::AMTelemetryObserver>* app_manager,
- TelemetryObservable<transport_manager::TMTelemetryObserver>*
- transport_manager);
+ virtual void Init(
+ TelemetryObservable<protocol_handler::PHTelemetryObserver>*
+ protocol_handler,
+ TelemetryObservable<application_manager::AMTelemetryObserver>*
+ app_manager,
+ TelemetryObservable<transport_manager::TMTelemetryObserver>*
+ transport_manager);
virtual void Stop();
virtual void Start();
virtual void SendMetric(std::shared_ptr<MetricWrapper> metric);
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
index d0bf4ba5bb..f79e27d2a0 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_OBSERVER_H_
#include "transport_manager/telemetry_observer.h"
-#include "utils/message_queue.h"
#include "utils/date_time.h"
+#include "utils/message_queue.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
index 006aac196f..90c5ffb87e 100644
--- a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
@@ -31,8 +31,8 @@
*/
#include "telemetry_monitor/application_manager_metric_wrapper.h"
-#include "telemetry_monitor/json_keys.h"
#include "application_manager/smart_object_keys.h"
+#include "telemetry_monitor/json_keys.h"
#include "utils/convert_utils.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/src/application_manager_observer.cc b/src/components/telemetry_monitor/src/application_manager_observer.cc
index 1e621c8a6e..1a18d87ad8 100644
--- a/src/components/telemetry_monitor/src/application_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/application_manager_observer.cc
@@ -31,8 +31,8 @@
*/
#include "telemetry_monitor/application_manager_observer.h"
-#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
+#include "telemetry_monitor/telemetry_monitor.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/src/metric_wrapper.cc b/src/components/telemetry_monitor/src/metric_wrapper.cc
index 10b694c5e6..8b2ba6f220 100644
--- a/src/components/telemetry_monitor/src/metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/metric_wrapper.cc
@@ -71,4 +71,4 @@ void MetricWrapper::Clear() {
MetricWrapper::~MetricWrapper() {
Clear();
}
-}
+} // namespace telemetry_monitor
diff --git a/src/components/telemetry_monitor/src/protocol_handler_observer.cc b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
index 19b04da392..e696e58506 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_observer.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/date_time.h"
#include "telemetry_monitor/protocol_handler_observer.h"
#include "telemetry_monitor/protocol_handler_metric_wrapper.h"
#include "telemetry_monitor/telemetry_monitor.h"
+#include "utils/date_time.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index d62724a479..e2f45b7576 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -32,12 +32,12 @@
#include "telemetry_monitor/telemetry_monitor.h"
-#include <sys/socket.h>
-#include <sys/types.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
#include <sys/select.h>
+#include <sys/socket.h>
#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include <sys/types.h>
#include <unistd.h>
#include "transport_manager/transport_manager_default.h"
diff --git a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
index 789da92eaf..3a89c9245a 100644
--- a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
@@ -31,9 +31,9 @@
*/
#include "telemetry_monitor/transport_manager_metric_wrapper.h"
+#include "application_manager/smart_object_keys.h"
#include "json/json.h"
#include "telemetry_monitor/json_keys.h"
-#include "application_manager/smart_object_keys.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc
index 25817d6c73..15338eddff 100644
--- a/src/components/telemetry_monitor/src/transport_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc
@@ -33,8 +33,8 @@
#include <time.h>
-#include "telemetry_monitor/transport_manager_metric_wrapper.h"
#include "telemetry_monitor/telemetry_monitor.h"
+#include "telemetry_monitor/transport_manager_metric_wrapper.h"
namespace telemetry_monitor {
diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
index 2e6eaad9d8..4af5ba82b5 100644
--- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/smart_object_keys.h"
#include "gtest/gtest.h"
+#include "telemetry_monitor/application_manager_metric_wrapper.h"
#include "telemetry_monitor/json_keys.h"
#include "utils/resource_usage.h"
-#include "application_manager/smart_object_keys.h"
-#include "telemetry_monitor/application_manager_metric_wrapper.h"
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
index deecfa57b7..daf3890485 100644
--- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "telemetry_monitor/mock_telemetry_monitor.h"
+#include "telemetry_monitor/application_manager_observer.h"
#include "application_manager/telemetry_observer.h"
+#include "gtest/gtest.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
-#include "telemetry_monitor/application_manager_observer.h"
+#include "telemetry_monitor/mock_telemetry_monitor.h"
#include "telemetry_monitor/telemetry_monitor.h"
diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
index c2aebe72b3..9b41d5a9ac 100644
--- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
+++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
@@ -35,8 +35,8 @@
#include <string>
#include "gmock/gmock.h"
-#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/metric_wrapper.h"
+#include "telemetry_monitor/telemetry_monitor.h"
namespace test {
namespace components {
@@ -51,7 +51,7 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor {
MOCK_METHOD1(SendMetric,
void(std::shared_ptr<telemetry_monitor::MetricWrapper> metric));
};
-} // namespace transport_manager_test
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_TEST_INCLUDE_TELEMETRY_MONITOR_MOCK_TELEMETRY_MONITOR_H_
diff --git a/src/components/telemetry_monitor/test/metric_wrapper_test.cc b/src/components/telemetry_monitor/test/metric_wrapper_test.cc
index f1e3c77db4..5501877ec8 100644
--- a/src/components/telemetry_monitor/test/metric_wrapper_test.cc
+++ b/src/components/telemetry_monitor/test/metric_wrapper_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "telemetry_monitor/metric_wrapper.h"
-#include "telemetry_monitor/json_keys.h"
+#include "gtest/gtest.h"
#include "json/json.h"
+#include "telemetry_monitor/json_keys.h"
#include "utils/resource_usage.h"
namespace test {
diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
index c9130411e7..8662321be3 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
@@ -31,11 +31,11 @@
*/
#include "gtest/gtest.h"
-#include "telemetry_monitor/json_keys.h"
#include "json/json.h"
-#include "utils/resource_usage.h"
-#include "telemetry_monitor/protocol_handler_metric_wrapper.h"
#include "protocol_handler/telemetry_observer.h"
+#include "telemetry_monitor/json_keys.h"
+#include "telemetry_monitor/protocol_handler_metric_wrapper.h"
+#include "utils/resource_usage.h"
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
index 587bf21ce6..b74434da3c 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
@@ -31,9 +31,9 @@
*/
#include "gtest/gtest.h"
-#include "telemetry_monitor/telemetry_monitor.h"
-#include "telemetry_monitor/mock_telemetry_monitor.h"
#include "protocol_handler/telemetry_observer.h"
+#include "telemetry_monitor/mock_telemetry_monitor.h"
+#include "telemetry_monitor/telemetry_monitor.h"
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index b8d3f9063f..f7b74ac278 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -30,19 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "telemetry_monitor/telemetry_monitor.h"
-#include "protocol_handler/telemetry_observer.h"
-#include "protocol_handler/protocol_handler.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
#include "protocol_handler//mock_protocol_handler.h"
-#include "protocol_handler/mock_session_observer.h"
#include "protocol_handler/mock_protocol_handler_settings.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "transport_manager/mock_transport_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/telemetry_observer.h"
#include "telemetry_monitor/mock_telemetry_observable.h"
+#include "transport_manager/mock_transport_manager.h"
-using testing::Return;
using testing::_;
+using testing::Return;
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
index 40caa6e0d6..3b3ac07577 100644
--- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
@@ -31,11 +31,11 @@
*/
#include "gtest/gtest.h"
-#include "telemetry_monitor/json_keys.h"
#include "json/json.h"
-#include "utils/resource_usage.h"
-#include "telemetry_monitor/transport_manager_metric_wrapper.h"
#include "protocol_handler/telemetry_observer.h"
+#include "telemetry_monitor/json_keys.h"
+#include "telemetry_monitor/transport_manager_metric_wrapper.h"
+#include "utils/resource_usage.h"
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/test/transport_manager_observer_test.cc b/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
index adc857d6cc..57834339d6 100644
--- a/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "telemetry_monitor/transport_manager_observer.h"
#include "gtest/gtest.h"
-#include "telemetry_monitor/mock_telemetry_monitor.h"
#include "protocol_handler/telemetry_observer.h"
+#include "telemetry_monitor/mock_telemetry_monitor.h"
#include "telemetry_monitor/transport_manager_metric_wrapper.h"
-#include "telemetry_monitor/transport_manager_observer.h"
namespace test {
namespace components {
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 61606756fe..8912ed9bd2 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -1,7 +1,7 @@
+#include <iostream>
#include "gmock/gmock.h"
-#include "utils/logger.h"
#include "utils/custom_string.h"
-#include <iostream>
+#include "utils/logger.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
int main(int argc, char** argv) {
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 2f734b3a05..11986ee9fa 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -41,6 +41,7 @@ include_directories (
${POLICY_GLOBAL_INCLUDE_PATH}/
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
)
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
@@ -72,15 +73,25 @@ else()
)
endif()
+if(BUILD_CLOUD_APP_SUPPORT)
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system boost_regex -L${BOOST_LIBS_DIRECTORY})
+else()
+ list(APPEND EXCLUDE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/cloud
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/cloud
+ )
+endif()
+
if(BUILD_USB_SUPPORT)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- set(EXCLUDE_PATHS
+ list(APPEND EXCLUDE_PATHS
${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb/qnx
${COMPONENTS_DIR}/transport_manager/src/usb/qnx
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
- set(EXCLUDE_PATHS
+ list(APPEND EXCLUDE_PATHS
${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb/libusb
${COMPONENTS_DIR}/transport_manager/src/usb/libusb
)
@@ -129,3 +140,4 @@ endif()
if(BUILD_TESTS)
add_subdirectory(test)
endif()
+
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
index dc38a971f5..768d9ebb54 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
@@ -39,9 +39,9 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
+#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include <bluetooth/rfcomm.h>
#include "transport_manager/transport_adapter/device_scanner.h"
#include "utils/conditional_variable.h"
@@ -70,6 +70,11 @@ class BluetoothDeviceScanner : public DeviceScanner {
BluetoothDeviceScanner(TransportAdapterController* controller,
bool auto_repeat_search,
int repeat_search_pause_sec);
+
+ BluetoothDeviceScanner(TransportAdapterController* controller,
+ bool auto_repeat_search,
+ int repeat_search_pause_sec,
+ const uint8_t* smart_device_link_service_uuid_data);
/**
* @brief Destructor.
*/
diff --git a/src/components/transport_manager/include/transport_manager/cloud/cloud_device.h b/src/components/transport_manager/include/transport_manager/cloud/cloud_device.h
new file mode 100644
index 0000000000..9c25be2a3e
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/cloud/cloud_device.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/**
+ * \file Cloud_device.h
+ * \brief CloudDevice class header file.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_DEVICE_H_
+
+#include "transport_manager/transport_adapter/device.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+struct CloudAppEndpoint {
+ std::string host;
+ std::string port;
+ std::string path;
+ std::string query;
+ std::string fragment;
+};
+
+class CloudDevice : public Device {
+ public:
+ CloudDevice(std::string& host, std::string& port, std::string& name);
+
+ CloudDevice(CloudAppEndpoint endpoint, std::string& name);
+
+ virtual const std::string& GetHost() const;
+
+ virtual const std::string& GetPort() const;
+
+ virtual const std::string GetTarget() const;
+
+ protected:
+ virtual bool IsSameAs(const Device* other_device) const;
+
+ virtual ApplicationList GetApplicationList() const;
+
+ private:
+ const CloudAppEndpoint endpoint_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_connection_factory.h b/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_connection_factory.h
new file mode 100644
index 0000000000..ef1754a6e7
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_connection_factory.h
@@ -0,0 +1,98 @@
+/*
+ * \file cloud_websocket_connection_factory.h
+ * \brief CloudWebsocketConnectionFactory class header file.
+ *
+ * Copyright (c) 2018, 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.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_WEBSOCKET_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_WEBSOCKET_CONNECTION_FACTORY_H_
+
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Create connections.
+ */
+class CloudWebsocketConnectionFactory : public ServerConnectionFactory {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param controller Pointer to the device adapter controller.
+ */
+ CloudWebsocketConnectionFactory(TransportAdapterController* controller);
+
+ protected:
+ /**
+ * @brief Start cloud websocket connection factory.
+ */
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Create cloud boost websocket connection.
+ *
+ * @param device_uid Device unique identifier.
+ * @param ap_handle Handle of application.
+ */
+ virtual TransportAdapter::Error CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle);
+
+ /**
+ * @brief
+ */
+ virtual void Terminate();
+
+ /**
+ * @brief Check for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~CloudWebsocketConnectionFactory();
+
+ private:
+ TransportAdapterController* controller_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_WEBSOCKET_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_transport_adapter.h b/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_transport_adapter.h
new file mode 100644
index 0000000000..138f9ca895
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/cloud/cloud_websocket_transport_adapter.h
@@ -0,0 +1,107 @@
+/*
+ * \file cloud_websocket_transport_adapter.h
+ * \brief Cloud Websocket Transport Adapterclass header file.
+ *
+ * Copyright (c) 2018, 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.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_WEBSOCKET_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_CLOUD_WEBSOCKET_TRANSPORT_ADAPTER_H_
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Cloud transport adapter that uses websockets.
+ */
+class CloudWebsocketTransportAdapter : public TransportAdapterImpl {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ explicit CloudWebsocketTransportAdapter(
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~CloudWebsocketTransportAdapter();
+
+ /**
+ * @brief Set CloudTransportConfig for specified app_id
+ *
+ * @param app_id app ID string
+ * @param properties New cloud app properties for the app
+ */
+ void SetAppCloudTransportConfig(std::string app_id,
+ CloudAppProperties properties);
+
+ /**
+ * @brief Get CloudTransportConfig for specified app_id
+ *
+ * @param app_id app ID string
+ * @return CloudAppProperties for the app
+ */
+ const CloudAppProperties& GetAppCloudTransportConfig(std::string app_id);
+
+ protected:
+ /**
+ * @brief Return type of device.
+ *
+ * @return String with device type.
+ */
+ virtual DeviceType GetDeviceType() const;
+
+ /**
+ * @brief Store adapter state in last state singleton
+ */
+ virtual void Store() const;
+
+ /**
+ * @brief Restore adapter state from last state singleton
+ *
+ * @return True on success false otherwise
+ */
+ virtual bool Restore();
+
+ void CreateDevice(const std::string& uid) OVERRIDE;
+
+ private:
+ CloudAppTransportConfig transport_config_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_TRANSPORT_ADAPTER_H_
diff --git a/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h b/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h
new file mode 100644
index 0000000000..76c8ca73cd
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h
@@ -0,0 +1,205 @@
+/*
+ * \file websocket_client_connection.h
+ * \brief WebsocketClientConnection class header file.
+ *
+ * Copyright (c) 2018, 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.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_WEBSOCKET_CLIENT_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_CLOUD_WEBSOCKET_CLIENT_CONNECTION_H_
+
+#include <boost/asio/connect.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/thread_pool.hpp>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#ifdef ENABLE_SECURITY
+#include <boost/asio/ssl/stream.hpp>
+#include <boost/beast/websocket/ssl.hpp>
+#endif // ENABLE_SECURITY
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+#include "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "utils/message_queue.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/threads/thread.h"
+
+namespace websocket =
+ boost::beast::websocket; // from <boost/beast/websocket.hpp>
+
+using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
+typedef websocket::stream<tcp::socket> WS;
+
+#ifdef ENABLE_SECURITY
+namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp>
+typedef websocket::stream<ssl::stream<tcp::socket> > WSS;
+#endif // ENABLE_SECURITY
+
+using ::utils::MessageQueue;
+
+typedef std::queue<protocol_handler::RawMessagePtr> AsyncQueue;
+typedef protocol_handler::RawMessagePtr Message;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Class responsible for communication over bluetooth sockets.
+ */
+class WebsocketClientConnection
+ : public std::enable_shared_from_this<WebsocketClientConnection>,
+ public Connection {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of device.
+ * @param controller Pointer to the device adapter controller.
+ */
+ WebsocketClientConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~WebsocketClientConnection();
+
+ /**
+ * @brief Check if we can start the connection attempt and establish
+ *connection status.
+ *
+ * @param error contains information of any error that occurred during
+ *connection attempt.
+ *
+ * @return result that states whether we successfully connected or not.
+ */
+ TransportAdapter::Error Start();
+
+ /**
+ * @brief Send data frame.
+ *
+ * @param message Smart pointer to the raw message.
+ *
+ * @return Error Information about possible reason of sending data failure.
+ */
+ TransportAdapter::Error SendData(::protocol_handler::RawMessagePtr message);
+
+ /**
+ * @brief Disconnect the current connection.
+ *
+ * @return Error Information about possible reason of Disconnect failure.
+ */
+ TransportAdapter::Error Disconnect();
+
+#ifdef ENABLE_SECURITY
+ /**
+ * @brief Attempt to add provided certificate to the ssl::context
+ *
+ * @param cert Certificate string from policy table
+ */
+ void AddCertificateAuthority(std::string cert, boost::system::error_code& ec);
+#endif // ENABLE_SECURITY
+
+ void Shutdown();
+
+ void Recv(boost::system::error_code ec);
+
+ void OnRead(boost::system::error_code ec, std::size_t bytes_transferred);
+
+ private:
+ TransportAdapterController* controller_;
+ boost::asio::io_context ioc_;
+ tcp::resolver resolver_;
+ boost::beast::flat_buffer buffer_;
+ std::string host_;
+ std::string text_;
+ WS ws_;
+#ifdef ENABLE_SECURITY
+ ssl::context ctx_;
+ WSS wss_;
+#endif // ENABLE_SECURITY
+
+ std::atomic_bool shutdown_;
+
+ CloudAppProperties cloud_properties;
+ typedef std::queue<protocol_handler::RawMessagePtr> FrameQueue;
+ FrameQueue frames_to_send_;
+ mutable sync_primitives::Lock frames_to_send_mutex_;
+
+ MessageQueue<Message, AsyncQueue> message_queue_;
+
+ class LoopThreadDelegate : public threads::ThreadDelegate {
+ public:
+ LoopThreadDelegate(MessageQueue<Message, AsyncQueue>* message_queue,
+ WebsocketClientConnection* handler);
+
+ virtual void threadMain() OVERRIDE;
+ virtual void exitThreadMain() OVERRIDE;
+
+ void OnWrite();
+
+ void SetShutdown();
+
+ private:
+ void DrainQueue();
+ MessageQueue<Message, AsyncQueue>& message_queue_;
+ WebsocketClientConnection& handler_;
+ sync_primitives::Lock queue_lock_;
+ sync_primitives::ConditionalVariable queue_new_items_;
+ std::atomic_bool write_pending_;
+ std::atomic_bool shutdown_;
+
+ sync_primitives::Lock write_lock_;
+ };
+
+ LoopThreadDelegate* thread_delegate_;
+ threads::Thread* write_thread_;
+ std::thread io_service_thread_;
+
+ const DeviceUID device_uid_;
+ const ApplicationHandle app_handle_;
+
+ boost::asio::thread_pool io_pool_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_SOCKET_CONNECTION_H_
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 e53a472bcb..a802a64afa 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
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
+#include "resumption/last_state.h"
#include "transport_manager/tcp/tcp_transport_adapter.h"
#include "transport_manager/transport_manager_settings.h"
-#include "resumption/last_state.h"
#include "utils/macro.h"
#include "utils/threads/thread_delegate.h"
@@ -108,8 +108,8 @@ class IAP2USBEmulationTransportAdapter : public TcpTransportAdapter {
const TransportManagerSettings& settings);
/**
- * Destructor
- */
+ * Destructor
+ */
~IAP2USBEmulationTransportAdapter();
/**
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
index 159b5ff21d..272b28b6b2 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
@@ -1,11 +1,11 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
-#include <string>
#include <memory>
+#include <string>
-#include "utils/macro.h"
#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
namespace transport_manager {
namespace transport_adapter {
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
index 0f9529d8d8..28784fe3c7 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
@@ -36,9 +36,9 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+#include "transport_manager/transport_adapter/client_connection_listener.h"
#include "utils/lock.h"
#include "utils/threads/thread_delegate.h"
-#include "transport_manager/transport_adapter/client_connection_listener.h"
class Thread;
struct in_addr;
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
index 7aa0b72687..6e7a306879 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
@@ -36,19 +36,19 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
-#include <memory.h>
-#include <signal.h>
-#include <errno.h>
#include <arpa/inet.h>
+#include <errno.h>
+#include <memory.h>
#include <netinet/in.h>
-#include <sys/types.h>
+#include <signal.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <map>
#include <string>
-#include "utils/lock.h"
#include "transport_manager/transport_adapter/device.h"
+#include "utils/lock.h"
namespace transport_manager {
namespace transport_adapter {
diff --git a/src/components/transport_manager/include/transport_manager/telemetry_observer.h b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
index a38255966b..b4f321d23f 100644
--- a/src/components/transport_manager/include/transport_manager/telemetry_observer.h
+++ b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_H_
-#include "transport_manager/common.h"
#include "protocol/raw_message.h"
+#include "transport_manager/common.h"
#include "utils/date_time.h"
namespace transport_manager {
@@ -51,5 +51,5 @@ class TMTelemetryObserver {
virtual ~TMTelemetryObserver() {}
};
-} // transport_manager
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
index f1c679c123..11123ceb1c 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
@@ -38,11 +38,11 @@
#include <poll.h>
#include <queue>
-#include "transport_manager/transport_adapter/connection.h"
-#include "protocol/common.h"
#include <atomic>
-#include "utils/threads/thread_delegate.h"
+#include "protocol/common.h"
+#include "transport_manager/transport_adapter/connection.h"
#include "utils/lock.h"
+#include "utils/threads/thread_delegate.h"
using ::transport_manager::transport_adapter::Connection;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
index 69d76b4b2b..72a67a3087 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_CONTROLLER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_CONTROLLER_H_
-#include "transport_manager/transport_adapter/device.h"
-#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/device.h"
namespace transport_manager {
namespace transport_adapter {
@@ -88,6 +88,10 @@ class TransportAdapterController {
*/
virtual DeviceSptr FindDevice(const DeviceUID& device_handle) const = 0;
+ virtual ConnectionSPtr FindPendingConnection(
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) const = 0;
+
/**
* @brief Create connection and fill its parameters.
*
@@ -100,6 +104,16 @@ class TransportAdapterController {
const ApplicationHandle& app_handle) = 0;
/**
+ * @brief Set state of specified connection - PENDING and launch
+ *OnConnectPending event in device adapter listener.
+ *
+ * @param devcie_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectPending(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
* @brief Make state of specified connection - ESTABLISHED and launch
*OnConnectDone event in device adapter listener.
*
@@ -160,12 +174,12 @@ class TransportAdapterController {
const ApplicationHandle& app_handle) = 0;
/**
- * @brief Launch OnDataReceiveDone event in the device adapter listener.
- *
- * @param device_handle Device unique identifier.
- * @param app_handle Handle of application.
- * @param message Smart pointer to the raw message.
- */
+ * @brief Launch OnDataReceiveDone event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to the raw message.
+ */
virtual void DataReceiveDone(const DeviceUID& device_handle,
const ApplicationHandle& app_handle,
::protocol_handler::RawMessagePtr message) = 0;
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 078f93b32f..84b80e956f 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
@@ -33,20 +33,21 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_
-#include <queue>
-#include <set>
#include <map>
#include <memory>
+#include <queue>
+#include <set>
#include <string>
#include "utils/lock.h"
#include "utils/rwlock.h"
+#include "utils/timer.h"
+#include "resumption/last_state.h"
+#include "transport_manager/transport_adapter/connection.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
-#include "transport_manager/transport_adapter/connection.h"
#include "transport_manager/transport_manager_settings.h"
-#include "resumption/last_state.h"
#ifdef TELEMETRY_MONITOR
#include "transport_manager/telemetry_observer.h"
@@ -61,6 +62,8 @@ class DeviceScanner;
class ServerConnectionFactory;
class ClientConnectionListener;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
+
/*
* @brief Implementation of device adapter class.
**/
@@ -147,6 +150,22 @@ class TransportAdapterImpl : public TransportAdapter,
const DeviceUID& device_handle) OVERRIDE;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ ConnectionStatus GetConnectionStatus(
+ const DeviceUID& device_handle) const OVERRIDE;
+
+ /**
+ * @brief Notifies the application manager that a cloud connection status has
+ * updated and should trigger an UpdateAppList RPC to the HMI
+ */
+ void ConnectionStatusUpdated(DeviceSptr device, ConnectionStatus status);
+
+ /**
* @brief Disconnect from specified session.
*
* @param devcie_handle Device unique identifier.
@@ -245,6 +264,10 @@ class TransportAdapterImpl : public TransportAdapter,
*/
DeviceSptr FindDevice(const DeviceUID& device_handle) const OVERRIDE;
+ ConnectionSPtr FindPendingConnection(
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) const OVERRIDE;
+
/**
* @brief Search for device in container of devices, if it is not there - adds
*it.
@@ -306,6 +329,16 @@ class TransportAdapterImpl : public TransportAdapter,
const CommunicationError& error) OVERRIDE;
/**
+ * @brief Set state of specified connection - PENDING and launch
+ *OnConnectPending event in device adapter listener.
+ *
+ * @param devcie_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ void ConnectPending(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) OVERRIDE;
+
+ /**
* @brief Set state of specified connection - ESTABLISHED and launch
*OnConnectDone event in device adapter listener.
*
@@ -434,6 +467,10 @@ class TransportAdapterImpl : public TransportAdapter,
return TransportConfig();
}
+ void CreateDevice(const std::string& uid) OVERRIDE {
+ return;
+ }
+
/**
* @brief Return name of device.
*
@@ -533,6 +570,23 @@ class TransportAdapterImpl : public TransportAdapter,
TransportAdapter::Error ConnectDevice(DeviceSptr device);
/**
+ * @brief Reattempt the last failed connection to a device
+ */
+ void RetryConnection();
+
+ /**
+ * @brief Clear any retry timers which have been completed
+ */
+ void ClearCompletedTimers();
+
+ /**
+ * @brief Retrieve the next device available for a reattempted connection
+ * @return The handle first device with an expired retry timer if present,
+ * otherwise an empty string
+ */
+ DeviceUID GetNextRetryDevice();
+
+ /**
* @brief Remove specified device
* @param device_handle Device unique identifier.
*/
@@ -564,7 +618,7 @@ class TransportAdapterImpl : public TransportAdapter,
ConnectionSPtr connection;
DeviceUID device_id;
ApplicationHandle app_handle;
- enum { NEW, ESTABLISHED, FINALISING } state;
+ enum { NEW, ESTABLISHED, FINALISING, PENDING } state;
};
/**
@@ -594,6 +648,18 @@ class TransportAdapterImpl : public TransportAdapter,
ConnectionMap connections_;
/**
+ * @brief Queue of retry timers.
+ */
+ std::queue<std::pair<TimerSPtr, DeviceUID> > retry_timer_pool_;
+ sync_primitives::Lock retry_timer_pool_lock_;
+
+ /**
+ * @brief Queue of completed retry timers.
+ */
+ std::queue<std::pair<TimerSPtr, DeviceUID> > completed_timer_pool_;
+ sync_primitives::Lock completed_timer_pool_lock_;
+
+ /**
* @brief Mutex restricting access to connections map.
**/
mutable sync_primitives::RWLock connections_lock_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
index 4606bac2d4..4db9a3b710 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
+#include "protocol/common.h"
#include "transport_manager/common.h"
#include "transport_manager/error.h"
-#include "protocol/common.h"
namespace transport_manager {
namespace transport_adapter {
@@ -92,6 +92,25 @@ class TransportAdapterListener {
const TransportAdapter* adapter) = 0;
/**
+ * @brief Reaction to connection status update
+ * @param adapter Current transport adapter
+ */
+ virtual void OnConnectionStatusUpdated(const TransportAdapter* adapter) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ * to device adapters to be sure it is available,
+ * launch event ON_CONNECT_PENDING in transport manager.
+ *
+ * @param device_adater Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnConnectPending(const TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_id) = 0;
+
+ /**
* @brief Search specified device adapter in the container of shared pointers
*to device adapters to be sure it is available,
* launch event ON_CONNECT_DONE in transport manager.
@@ -288,6 +307,6 @@ class TransportAdapterListener {
const TransportAdapter* transport_adapter) = 0;
};
-} // transport_adapter namespace
-} // transport_manager namespace
+} // namespace transport_adapter
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
index a744400279..d00ae1c498 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_IMPL_H_
#include "transport_manager/common.h"
-#include "transport_manager/transport_adapter/transport_adapter_listener.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
#include "transport_manager/transport_manager.h"
namespace transport_manager {
@@ -88,6 +88,24 @@ class TransportAdapterListenerImpl
virtual void OnFindNewApplicationsRequest(const TransportAdapter* adapter);
/**
+ * @brief Passes notification to that the cloud conection status has updated
+ */
+ virtual void OnConnectionStatusUpdated(const TransportAdapter* adapter);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ * to device adapters to be sure it is available,
+ * launch event ON_CONNECT_PENDING in transport manager.
+ *
+ * @param device_adater Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnConnectPending(const TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_id);
+
+ /**
* @brief Search specified device adapter in the container of shared pointers
*to device adapters to be sure it is available,
* launch event ON_CONNECT_DONE in transport manager.
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 8039f9c985..7fb0904fdf 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
@@ -65,6 +65,6 @@ class TransportManagerDefault : public TransportManagerImpl {
DISALLOW_COPY_AND_ASSIGN(TransportManagerDefault);
};
-}
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_DEFAULT_H_
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 c1df49f91b..d576db7500 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
@@ -33,30 +33,29 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
-#include <queue>
-#include <map>
-#include <list>
-#include <vector>
-#include <utility>
#include <algorithm>
-#include <tuple>
#include <functional>
+#include <list>
+#include <map>
+#include <queue>
+#include <tuple>
+#include <utility>
+#include <vector>
-#include "utils/timer.h"
-#include "utils/timer_task_impl.h"
#include "utils/rwlock.h"
+#include "utils/timer.h"
+#include "protocol/common.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener.h"
-#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
-#include "protocol/common.h"
#ifdef TELEMETRY_MONITOR
-#include "transport_manager/telemetry_observer.h"
#include "telemetry_monitor/telemetry_observable.h"
+#include "transport_manager/telemetry_observer.h"
#endif // TELEMETRY_MONITOR
-#include "utils/threads/message_loop_thread.h"
#include "transport_manager/transport_adapter/transport_adapter_event.h"
#include "transport_manager/transport_manager_settings.h"
+#include "utils/threads/message_loop_thread.h"
namespace transport_manager {
@@ -75,10 +74,10 @@ class TransportManagerImpl
public RawMessageLoopThread::Handler,
public TransportAdapterEventLoopThread::Handler
#ifdef TELEMETRY_MONITOR
- ,
+ ,
public telemetry_monitor::TelemetryObservable<TMTelemetryObserver>
#endif // TELEMETRY_MONITOR
- {
+{
public:
struct Connection {
ConnectionUID id;
@@ -140,6 +139,12 @@ class TransportManagerImpl
**/
int SearchDevices() OVERRIDE;
+ void AddCloudDevice(
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) OVERRIDE;
+
+ void RemoveCloudDevice(const DeviceHandle device_id) OVERRIDE;
+
/**
* @brief Connect to all applications discovered on device.
*
@@ -150,6 +155,16 @@ class TransportManagerImpl
int ConnectDevice(const DeviceHandle device_id) OVERRIDE;
/**
+ * @brief Retrieves the connection status of a given device
+ *
+ * @param device_handle Handle of device to query
+ *
+ * @return The connection status of the given device
+ */
+ ConnectionStatus GetConnectionStatus(
+ const DeviceHandle& device_handle) const OVERRIDE;
+
+ /**
* @brief Disconnect from all applications connected on device.
*
* @param device_id Handle of device to Disconnect from.
@@ -312,9 +327,9 @@ class TransportManagerImpl
private:
/**
- * @brief Structure that contains conversion functions (Device ID -> Device
- * Handle; Device Handle -> Device ID)
- */
+ * @brief Structure that contains conversion functions (Device ID -> Device
+ * Handle; Device Handle -> Device ID)
+ */
struct Handle2GUIDConverter {
/**
* @brief ConversionTable Records uid/connection type/handle
@@ -365,7 +380,7 @@ class TransportManagerImpl
* @brief Converter variable (Device ID -> Device Handle; Device Handle ->
* Device ID)
*/
- Handle2GUIDConverter converter_;
+ mutable Handle2GUIDConverter converter_;
#ifdef BUILD_TESTS
public:
@@ -380,7 +395,7 @@ class TransportManagerImpl
int connection_id_counter_;
sync_primitives::RWLock connections_lock_;
std::vector<ConnectionInternal> connections_;
- sync_primitives::RWLock device_to_adapter_map_lock_;
+ mutable sync_primitives::RWLock device_to_adapter_map_lock_;
typedef std::map<DeviceUID, TransportAdapter*> DeviceToAdapterMap;
DeviceToAdapterMap device_to_adapter_map_;
std::vector<TransportAdapter*> transport_adapters_;
@@ -406,18 +421,18 @@ class TransportManagerImpl
void AddConnection(const ConnectionInternal& c);
/**
- * @brief Removes connection from connections list
- * @param id Identifier of connection to be removed
- * @param transport_adapter Pointer to transport adapter
- * that holds connection
- */
+ * @brief Removes connection from connections list
+ * @param id Identifier of connection to be removed
+ * @param transport_adapter Pointer to transport adapter
+ * that holds connection
+ */
void RemoveConnection(const uint32_t id,
transport_adapter::TransportAdapter* transport_adapter);
/**
- * @brief Deactivates all connections related to certain device
- * @param device_uid Device unique identifier
- */
+ * @brief Deactivates all connections related to certain device
+ * @param device_uid Device unique identifier
+ */
void DeactivateDeviceConnections(const DeviceUID& device_uid);
/**
* @brief Returns connection from connections list by connection identifier
@@ -437,14 +452,14 @@ class TransportManagerImpl
const ApplicationHandle& application);
/**
- * @brief Returns active connection from connections list by device unique
+ * @brief Returns active connection from connections list by device unique
* id
- * and application handle
- * (this method returns only active connections as opposed to previous one)
- * @param device Device unique identifier
- * @param application Application handle
- * @return Pointer to connection or NULL if connection could not be found
- */
+ * and application handle
+ * (this method returns only active connections as opposed to previous one)
+ * @param device Device unique identifier
+ * @param application Application handle
+ * @return Pointer to connection or NULL if connection could not be found
+ */
ConnectionInternal* GetActiveConnection(const DeviceUID& device,
const ApplicationHandle& application);
diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h
index 1db1a83a3a..d15e1fdd96 100644
--- a/src/components/transport_manager/include/transport_manager/usb/common.h
+++ b/src/components/transport_manager/include/transport_manager/usb/common.h
@@ -110,7 +110,7 @@ inline bool IsAppleDevice(const PlatformUsbDevice* device) {
return IsAppleIAPDevice(device) || IsAppleIAP2Device(device);
}
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_COMMON_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
index baec1938b1..201f3787e0 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
@@ -36,8 +36,8 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
-#include <string>
#include <libusb-1.0/libusb.h>
+#include <string>
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
index 5f6bd40957..2b7f6e4189 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
@@ -37,8 +37,8 @@
#include "utils/lock.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/usb/common.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
index bed631ea2e..6b15229522 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
@@ -39,8 +39,8 @@
#include <libusb-1.0/libusb.h>
#include "transport_manager/transport_adapter/transport_adapter.h"
-#include "transport_manager/usb/usb_control_transfer.h"
#include "transport_manager/usb/libusb/platform_usb_device.h"
+#include "transport_manager/usb/usb_control_transfer.h"
#include "utils/threads/thread.h"
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
index 9755a5eacd..738675754d 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
@@ -36,8 +36,8 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_PLATFORM_USB_DEVICE_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_PLATFORM_USB_DEVICE_H_
-#include <string>
#include <sys/usbdi.h>
+#include <string>
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
index e9f7344ee2..ba7e263b4c 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
@@ -38,8 +38,8 @@
#include "utils/lock.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/usb/common.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
index c33e0f2361..53600309ec 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
@@ -39,8 +39,8 @@
#include <sys/usbdi.h>
#include "transport_manager/transport_adapter/transport_adapter.h"
-#include "transport_manager/usb/usb_control_transfer.h"
#include "transport_manager/usb/qnx/platform_usb_device.h"
+#include "transport_manager/usb/usb_control_transfer.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
index 850902bea3..a47574353e 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
@@ -100,7 +100,7 @@ class UsbControlTransferSequence {
Transfers transfers_;
};
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONTROL_TRANSFER_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
index a6065de2b2..2cc482297b 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
@@ -38,9 +38,9 @@
#include <list>
-#include "utils/lock.h"
#include "transport_manager/transport_adapter/device_scanner.h"
#include "transport_manager/usb/common.h"
+#include "utils/lock.h"
namespace transport_manager {
@@ -71,7 +71,7 @@ class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
sync_primitives::Lock devices_mutex_;
};
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_SCANNER_H_
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index 62615cb30f..19f4078443 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -33,9 +33,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "utils/logger.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
index e7cc3d4f34..734d8fe1e9 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
@@ -36,13 +36,13 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
+#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include <bluetooth/rfcomm.h>
#include <errno.h>
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <algorithm>
#include <iostream>
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
index 75ea799ce8..4759b2003a 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -38,18 +38,18 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
+#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include <bluetooth/rfcomm.h>
#include <errno.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <vector>
#include <sstream>
-#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
+#include <vector>
#include "transport_manager/bluetooth/bluetooth_device.h"
+#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
#include "utils/logger.h"
#include "utils/threads/thread.h"
@@ -133,7 +133,27 @@ BluetoothDeviceScanner::BluetoothDeviceScanner(
0xA8};
sdp_uuid128_create(&smart_device_link_service_uuid_,
smart_device_link_service_uuid_data);
- thread_ = threads::CreateThread("BT Device Scaner",
+ thread_ = threads::CreateThread("BT Device Scanner",
+ new BluetoothDeviceScannerDelegate(this));
+}
+
+BluetoothDeviceScanner::BluetoothDeviceScanner(
+ TransportAdapterController* controller,
+ bool auto_repeat_search,
+ int auto_repeat_pause_sec,
+ const uint8_t* smart_device_link_service_uuid_data)
+ : controller_(controller)
+ , thread_(NULL)
+ , shutdown_requested_(false)
+ , ready_(true)
+ , device_scan_requested_(false)
+ , device_scan_requested_lock_()
+ , device_scan_requested_cv_()
+ , auto_repeat_search_(auto_repeat_search)
+ , auto_repeat_pause_sec_(auto_repeat_pause_sec) {
+ sdp_uuid128_create(&smart_device_link_service_uuid_,
+ smart_device_link_service_uuid_data);
+ thread_ = threads::CreateThread("BT Device Scanner",
new BluetoothDeviceScannerDelegate(this));
}
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
index b4370e4b12..78597ac2ad 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -33,13 +33,13 @@
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
-#include <unistd.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
+#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include <bluetooth/rfcomm.h>
+#include <unistd.h>
#include "transport_manager/bluetooth/bluetooth_device.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
@@ -93,9 +93,9 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) {
do {
rfcomm_socket = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
if (-1 == rfcomm_socket) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_,
- "Failed to create RFCOMM socket for device "
- << device_handle());
+ LOG4CXX_ERROR_WITH_ERRNO(
+ logger_,
+ "Failed to create RFCOMM socket for device " << device_handle());
*error = new ConnectError();
LOG4CXX_TRACE(logger_, "exit with FALSE");
return false;
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
index b373744f79..911658bc56 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -34,18 +34,18 @@
*/
#include <errno.h>
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <unistd.h>
+#include <bluetooth/bluetooth.h>
#include <iomanip>
#include <set>
-#include <bluetooth/bluetooth.h>
-#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
-#include "transport_manager/bluetooth/bluetooth_device_scanner.h"
#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_device.h"
+#include "transport_manager/bluetooth/bluetooth_device_scanner.h"
+#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
#include "utils/logger.h"
@@ -58,11 +58,12 @@ BluetoothTransportAdapter::~BluetoothTransportAdapter() {}
BluetoothTransportAdapter::BluetoothTransportAdapter(
resumption::LastState& last_state, const TransportManagerSettings& settings)
- : TransportAdapterImpl(new BluetoothDeviceScanner(this, true, 0),
- new BluetoothConnectionFactory(this),
- NULL,
- last_state,
- settings) {}
+ : TransportAdapterImpl(
+ new BluetoothDeviceScanner(this, true, 0, settings.bluetooth_uuid()),
+ new BluetoothConnectionFactory(this),
+ NULL,
+ last_state,
+ settings) {}
DeviceType BluetoothTransportAdapter::GetDeviceType() const {
return BLUETOOTH;
diff --git a/src/components/transport_manager/src/cloud/cloud_device.cc b/src/components/transport_manager/src/cloud/cloud_device.cc
new file mode 100644
index 0000000000..c1ad186ded
--- /dev/null
+++ b/src/components/transport_manager/src/cloud/cloud_device.cc
@@ -0,0 +1,97 @@
+/*
+ *
+ * Copyright (c) 2018, 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 "transport_manager/cloud/cloud_device.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+CloudDevice::CloudDevice(std::string& host,
+ std::string& port,
+ std::string& name)
+ : Device(name, std::string(name))
+ , endpoint_(CloudAppEndpoint{.host = host,
+ .port = port,
+ .path = "/",
+ .query = "",
+ .fragment = ""}) {}
+
+CloudDevice::CloudDevice(CloudAppEndpoint endpoint, std::string& name)
+ : Device(name, std::string(name)), endpoint_(endpoint) {}
+
+bool CloudDevice::IsSameAs(const Device* other) const {
+ LOG4CXX_TRACE(logger_, "enter. device: " << other);
+
+ const CloudDevice* other_cloud_device =
+ dynamic_cast<const CloudDevice*>(other);
+
+ if (!other_cloud_device) {
+ return false;
+ }
+
+ if (GetHost() != other_cloud_device->GetHost()) {
+ return false;
+ }
+
+ if (GetPort() != other_cloud_device->GetPort()) {
+ return false;
+ }
+
+ if (GetTarget() != other_cloud_device->GetTarget()) {
+ return false;
+ }
+
+ return true;
+}
+
+ApplicationList CloudDevice::GetApplicationList() const {
+ return ApplicationList{0};
+}
+
+const std::string& CloudDevice::GetHost() const {
+ return endpoint_.host;
+}
+
+const std::string& CloudDevice::GetPort() const {
+ return endpoint_.port;
+}
+
+const std::string CloudDevice::GetTarget() const {
+ return endpoint_.path + endpoint_.query + endpoint_.fragment;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/cloud/cloud_websocket_connection_factory.cc b/src/components/transport_manager/src/cloud/cloud_websocket_connection_factory.cc
new file mode 100644
index 0000000000..d072685eef
--- /dev/null
+++ b/src/components/transport_manager/src/cloud/cloud_websocket_connection_factory.cc
@@ -0,0 +1,85 @@
+/*
+ * \file cloud_websocket_connection_factory.cc
+ * \brief CloudWebsocketConnectionFactory class source file.
+ *
+ * Copyright (c) 2018, 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 "transport_manager/cloud/cloud_websocket_connection_factory.h"
+#include "transport_manager/cloud/websocket_client_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "utils/logger.h"
+
+#include "transport_manager/cloud/cloud_device.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+CloudWebsocketConnectionFactory::CloudWebsocketConnectionFactory(
+ TransportAdapterController* controller)
+ : controller_(controller) {}
+
+TransportAdapter::Error CloudWebsocketConnectionFactory::Init() {
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error CloudWebsocketConnectionFactory::CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto connection = controller_->FindPendingConnection(device_uid, app_handle);
+
+ std::shared_ptr<WebsocketClientConnection> ws_connection =
+ std::dynamic_pointer_cast<WebsocketClientConnection>(connection);
+ if (ws_connection.use_count() == 0) {
+ return TransportAdapter::Error::BAD_PARAM;
+ }
+
+ TransportAdapter::Error error = ws_connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Cloud Websocket connection::Start() failed with error: " << error);
+ }
+ return error;
+}
+
+void CloudWebsocketConnectionFactory::Terminate() {}
+
+bool CloudWebsocketConnectionFactory::IsInitialised() const {
+ return true;
+}
+
+CloudWebsocketConnectionFactory::~CloudWebsocketConnectionFactory() {}
+
+} // namespace transport_adapter
+} // namespace transport_manager
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
new file mode 100644
index 0000000000..622531b120
--- /dev/null
+++ b/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2018, 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 "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#include "transport_manager/cloud/cloud_websocket_connection_factory.h"
+
+#include "transport_manager/cloud/cloud_device.h"
+#include "transport_manager/cloud/websocket_client_connection.h"
+
+#include <boost/regex.hpp>
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+CloudWebsocketTransportAdapter::CloudWebsocketTransportAdapter(
+ resumption::LastState& last_state, const TransportManagerSettings& settings)
+ : TransportAdapterImpl(NULL,
+ new CloudWebsocketConnectionFactory(this),
+ NULL,
+ last_state,
+ settings) {}
+
+CloudWebsocketTransportAdapter::~CloudWebsocketTransportAdapter() {}
+
+void CloudWebsocketTransportAdapter::SetAppCloudTransportConfig(
+ std::string app_id, CloudAppProperties properties) {
+ transport_config_[app_id] = properties;
+}
+
+const CloudAppProperties&
+CloudWebsocketTransportAdapter::GetAppCloudTransportConfig(std::string app_id) {
+ return transport_config_[app_id];
+}
+
+DeviceType CloudWebsocketTransportAdapter::GetDeviceType() const {
+ return CLOUD_WEBSOCKET;
+}
+
+void CloudWebsocketTransportAdapter::Store() const {}
+
+bool CloudWebsocketTransportAdapter::Restore() {
+ return true;
+}
+
+void CloudWebsocketTransportAdapter::CreateDevice(const std::string& uid) {
+ // If the device has already been created, just ignore the request
+ DeviceSptr device = FindDevice(uid);
+ if (device.use_count() != 0) {
+ return;
+ }
+
+ std::string protocol_pattern = "(wss?)";
+ std::string host_pattern =
+ "(([^?#%\\\\/@:\\s]{1,})\\:?([^?#%\\\\/@\\s]*)\\@?([^?#%\\\\/\\s]*))";
+ std::string port_pattern = "(\\d{2,5})";
+ // Optional parameters
+ std::string path_pattern = "((\\/[^\\/#?\\s]+)*)?\\/?";
+ std::string query_pattern = "(\\?[^=&#\\s]*=?[^#\\s]*&?)?";
+ std::string fragment_pattern = "(#[^\\s]*)?";
+
+ // Extract host and port from endpoint string
+ boost::regex group_pattern(protocol_pattern + ":\\/\\/" + host_pattern + ":" +
+ port_pattern + path_pattern + query_pattern +
+ fragment_pattern,
+ boost::regex::icase);
+ boost::smatch results;
+ std::string str = uid;
+
+ if (!boost::regex_search(str, results, group_pattern)) {
+ LOG4CXX_DEBUG(logger_, "Invalid Pattern: " << uid);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "#Results: " << results.size());
+ std::string results_str;
+ 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>");
+ }
+ LOG4CXX_DEBUG(logger_, "Results: " << results_str);
+
+ std::string device_id = uid;
+
+ CloudAppEndpoint endpoint{.host = results[2],
+ .port = results[6],
+ .path = results[7] + "/",
+ .query = results[9],
+ .fragment = results[10]};
+
+ LOG4CXX_DEBUG(logger_,
+ "Creating Cloud Device For Host: "
+ << endpoint.host << " at Port: " << endpoint.port
+ << " with Target: "
+ << (endpoint.path + endpoint.query + endpoint.fragment));
+
+ auto cloud_device = std::make_shared<CloudDevice>(endpoint, device_id);
+
+ DeviceVector devices{cloud_device};
+
+ SearchDeviceDone(devices);
+
+ // Create connection object, do not start until app is activated
+ std::shared_ptr<WebsocketClientConnection> connection =
+ std::make_shared<WebsocketClientConnection>(uid, 0, this);
+
+ ConnectionCreated(connection, uid, 0);
+ ConnectPending(uid, 0);
+
+ return;
+}
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/cloud/websocket_client_connection.cc b/src/components/transport_manager/src/cloud/websocket_client_connection.cc
new file mode 100644
index 0000000000..ec2fb0bcfb
--- /dev/null
+++ b/src/components/transport_manager/src/cloud/websocket_client_connection.cc
@@ -0,0 +1,358 @@
+/*
+ *
+ * Copyright (c) 2018, 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 "transport_manager/cloud/websocket_client_connection.h"
+#include "transport_manager/cloud/cloud_device.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+WebsocketClientConnection::WebsocketClientConnection(
+ const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : controller_(controller)
+ , resolver_(ioc_)
+ , ws_(ioc_)
+#ifdef ENABLE_SECURITY
+ , ctx_(ssl::context::sslv23_client)
+ , wss_(ioc_, ctx_)
+#endif // ENABLE_SECURITY
+ , shutdown_(false)
+ , thread_delegate_(new LoopThreadDelegate(&message_queue_, this))
+ , write_thread_(threads::CreateThread("WS Async Send", thread_delegate_))
+ , device_uid_(device_uid)
+ , app_handle_(app_handle)
+ , io_pool_(1) {
+}
+
+WebsocketClientConnection::~WebsocketClientConnection() {
+ ioc_.stop();
+ io_pool_.join();
+}
+
+#ifdef ENABLE_SECURITY
+void WebsocketClientConnection::AddCertificateAuthority(
+ const std::string cert, boost::system::error_code& ec) {
+ ctx_.add_certificate_authority(boost::asio::buffer(cert.data(), cert.size()),
+ ec);
+ if (ec) {
+ return;
+ }
+
+ wss_.next_layer().set_verify_mode(ssl::verify_peer);
+}
+#endif // ENABLE_SECURITY
+
+TransportAdapter::Error WebsocketClientConnection::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DeviceSptr device = controller_->FindDevice(device_uid_);
+ CloudDevice* cloud_device = static_cast<CloudDevice*>(device.get());
+ CloudWebsocketTransportAdapter* cloud_ta =
+ static_cast<CloudWebsocketTransportAdapter*>(controller_);
+ cloud_properties = cloud_ta->GetAppCloudTransportConfig(device_uid_);
+ auto const host = cloud_device->GetHost();
+ auto const port = cloud_device->GetPort();
+ boost::system::error_code ec;
+
+ LOG4CXX_DEBUG(logger_, "Cloud app endpoint: " << cloud_properties.endpoint);
+ LOG4CXX_DEBUG(logger_,
+ "Cloud app certificate: " << cloud_properties.certificate);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Cloud app authentication token: " << cloud_properties.auth_token);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Cloud app transport type: " << cloud_properties.cloud_transport_type);
+ LOG4CXX_DEBUG(logger_,
+ "Cloud app hybrid app preference: "
+ << cloud_properties.hybrid_app_preference);
+
+ auto const results = resolver_.resolve(host, port, ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_, "Could not resolve host/port: " << str_err);
+ return TransportAdapter::FAIL;
+ }
+
+ // Make Connection to host IP Address over TCP
+ if (cloud_properties.cloud_transport_type == "WS") {
+ boost::asio::connect(ws_.next_layer(), results.begin(), results.end(), ec);
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ boost::asio::connect(
+ wss_.next_layer().next_layer(), results.begin(), results.end(), ec);
+ }
+#endif // ENABLE_SECURITY
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_,
+ "Could not connect to websocket: " << host << ":" << port);
+ LOG4CXX_ERROR(logger_, str_err);
+ return TransportAdapter::FAIL;
+ }
+
+#ifdef ENABLE_SECURITY
+ if (cloud_properties.cloud_transport_type == "WSS") {
+ AddCertificateAuthority(cloud_properties.certificate, ec);
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_,
+ "Failed to add certificate authority: "
+ << cloud_properties.certificate);
+ LOG4CXX_ERROR(logger_, str_err);
+ Shutdown();
+ return TransportAdapter::FAIL;
+ }
+
+ // Perform SSL Handshake
+ wss_.next_layer().handshake(ssl::stream_base::client, ec);
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_,
+ "Could not complete SSL Handshake failed with host/port: "
+ << host << ":" << port);
+ LOG4CXX_ERROR(logger_, str_err);
+ Shutdown();
+ return TransportAdapter::FAIL;
+ }
+ }
+#endif // ENABLE_SECURITY
+
+ // Perform websocket handshake
+ if (cloud_properties.cloud_transport_type == "WS") {
+ ws_.handshake(host, cloud_device->GetTarget(), ec);
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ wss_.handshake(host, cloud_device->GetTarget(), ec);
+ }
+#endif // ENABLE_SECURITY
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(
+ logger_,
+ "Could not complete handshake with host/port: " << host << ":" << port);
+ LOG4CXX_ERROR(logger_, str_err);
+ return TransportAdapter::FAIL;
+ }
+
+ // Set the binary message write option
+ if (cloud_properties.cloud_transport_type == "WS") {
+ ws_.binary(true);
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ wss_.binary(true);
+ }
+#endif // ENABLE_SECURITY
+ write_thread_->start(threads::ThreadOptions());
+ controller_->ConnectDone(device_uid_, app_handle_);
+
+ // Start async read
+ if (cloud_properties.cloud_transport_type == "WS") {
+ ws_.async_read(buffer_,
+ std::bind(&WebsocketClientConnection::OnRead,
+ this,
+ std::placeholders::_1,
+ std::placeholders::_2));
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ wss_.async_read(buffer_,
+ std::bind(&WebsocketClientConnection::OnRead,
+ this,
+ std::placeholders::_1,
+ std::placeholders::_2));
+ }
+#endif // ENABLE_SECURITY
+
+ boost::asio::post(io_pool_, [&]() { ioc_.run(); });
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Successfully started websocket connection @: " << host << ":" << port);
+ return TransportAdapter::OK;
+}
+
+void WebsocketClientConnection::Recv(boost::system::error_code ec) {
+ if (shutdown_) {
+ return;
+ }
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_, str_err);
+ Shutdown();
+ return;
+ }
+ if (cloud_properties.cloud_transport_type == "WS") {
+ ws_.async_read(buffer_,
+ std::bind(&WebsocketClientConnection::OnRead,
+ this,
+ std::placeholders::_1,
+ std::placeholders::_2));
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ wss_.async_read(buffer_,
+ std::bind(&WebsocketClientConnection::OnRead,
+ this,
+ std::placeholders::_1,
+ std::placeholders::_2));
+ }
+#endif // ENABLE_SECURITY
+}
+
+void WebsocketClientConnection::OnRead(boost::system::error_code ec,
+ std::size_t bytes_transferred) {
+ boost::ignore_unused(bytes_transferred);
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(logger_, str_err);
+ ws_.lowest_layer().close();
+ ioc_.stop();
+ Shutdown();
+ return;
+ }
+ std::string data_str = boost::beast::buffers_to_string(buffer_.data());
+
+ ssize_t size = (ssize_t)buffer_.size();
+ const uint8_t* data = boost::asio::buffer_cast<const uint8_t*>(
+ boost::beast::buffers_front(buffer_.data()));
+
+ ::protocol_handler::RawMessagePtr frame(
+ new protocol_handler::RawMessage(0, 0, data, size));
+
+ controller_->DataReceiveDone(device_uid_, app_handle_, frame);
+
+ buffer_.consume(buffer_.size());
+ Recv(ec);
+}
+
+TransportAdapter::Error WebsocketClientConnection::SendData(
+ ::protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(frames_to_send_mutex_);
+ message_queue_.push(message);
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error WebsocketClientConnection::Disconnect() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Shutdown();
+ return TransportAdapter::OK;
+}
+
+void WebsocketClientConnection::Shutdown() {
+ shutdown_ = true;
+
+ if (thread_delegate_) {
+ thread_delegate_->SetShutdown();
+ write_thread_->join();
+ delete thread_delegate_;
+ thread_delegate_ = NULL;
+ threads::DeleteThread(write_thread_);
+ write_thread_ = NULL;
+ }
+ if (buffer_.size()) {
+ buffer_.consume(buffer_.size());
+ }
+ controller_->DisconnectDone(device_uid_, app_handle_);
+}
+
+WebsocketClientConnection::LoopThreadDelegate::LoopThreadDelegate(
+ MessageQueue<Message, AsyncQueue>* message_queue,
+ WebsocketClientConnection* handler)
+ : message_queue_(*message_queue), handler_(*handler), shutdown_(false) {}
+
+void WebsocketClientConnection::LoopThreadDelegate::threadMain() {
+ while (!message_queue_.IsShuttingDown() && !shutdown_) {
+ DrainQueue();
+ message_queue_.wait();
+ }
+ DrainQueue();
+}
+
+void WebsocketClientConnection::LoopThreadDelegate::exitThreadMain() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+
+void WebsocketClientConnection::LoopThreadDelegate::DrainQueue() {
+ while (!message_queue_.empty()) {
+ Message message_ptr;
+ message_queue_.pop(message_ptr);
+ if (!shutdown_) {
+ boost::system::error_code ec;
+ if (handler_.cloud_properties.cloud_transport_type == "WS") {
+ handler_.ws_.write(
+ boost::asio::buffer(message_ptr->data(), message_ptr->data_size()));
+ }
+#ifdef ENABLE_SECURITY
+ else if (handler_.cloud_properties.cloud_transport_type == "WSS") {
+ handler_.wss_.write(
+ boost::asio::buffer(message_ptr->data(), message_ptr->data_size()));
+ }
+#endif // ENABLE_SECURITY
+ if (ec) {
+ LOG4CXX_ERROR(logger_, "Error writing to websocket");
+ handler_.controller_->DataSendFailed(handler_.device_uid_,
+ handler_.app_handle_,
+ message_ptr,
+ DataSendError());
+ }
+ }
+ }
+}
+
+void WebsocketClientConnection::LoopThreadDelegate::SetShutdown() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
index 31e997f3ba..2e37f76bc9 100644
--- a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
+++ b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
@@ -32,14 +32,14 @@
#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
-#include "utils/threads/thread.h"
#include "utils/file_system.h"
+#include "utils/threads/thread.h"
namespace {
static const mode_t mode = 0666;
@@ -182,5 +182,5 @@ void IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
run_flag_ = false;
ThreadDelegate::exitThreadMain();
}
-}
-} // namespace transport_manager::transport_adapter
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
index 047d43b7bf..e0bda61e4d 100644
--- a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
+++ b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
@@ -5,11 +5,11 @@
#include <errno.h>
#include <fcntl.h>
#include <ifaddrs.h>
-#include <unistd.h>
#include <net/if.h>
-#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
@@ -356,7 +356,7 @@ bool PlatformSpecificNetworkInterfaceListener::InitializeStatus() {
}
#endif // BUILD_TESTS
- struct ifaddrs* if_list, *interface;
+ struct ifaddrs *if_list, *interface;
if (getifaddrs(&if_list) != 0) {
LOG4CXX_WARN(logger_,
"getifaddr failed, interface status won't be available until "
@@ -421,9 +421,9 @@ bool PlatformSpecificNetworkInterfaceListener::UpdateStatus(
switch (type) {
case RTM_NEWLINK: {
- LOG4CXX_DEBUG(logger_,
- "netlink event: interface " << ifname
- << " created or updated");
+ LOG4CXX_DEBUG(
+ logger_,
+ "netlink event: interface " << ifname << " created or updated");
status.SetFlags(it->flags);
break;
}
diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
index 9f2597f0a7..66be810a9b 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -33,35 +33,35 @@
#include "transport_manager/tcp/tcp_client_listener.h"
-#include <memory.h>
-#include <signal.h>
+#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <sys/types.h>
+#include <ifaddrs.h>
+#include <memory.h>
+#include <signal.h>
#include <sys/select.h>
-#include <sys/sysctl.h>
#include <sys/socket.h>
-#include <ifaddrs.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <unistd.h>
#ifdef __linux__
#include <linux/tcp.h>
#else // __linux__
-#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netinet/tcp_var.h>
+#include <sys/time.h>
#endif // __linux__
#include <sstream>
#include "utils/logger.h"
-#include "utils/threads/thread.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "utils/threads/thread.h"
namespace transport_manager {
namespace transport_adapter {
@@ -455,9 +455,9 @@ void TcpClientListener::OnIPAddressUpdated(const std::string ipv4_addr,
if (IsListeningOnSpecificInterface()) {
if (!current_ip_address_.empty()) {
// the server socket is running, terminate it
- LOG4CXX_DEBUG(logger_,
- "Stopping current TCP server socket on "
- << designated_interface_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Stopping current TCP server socket on " << designated_interface_);
StopOnNetworkInterface();
}
if (!ipv4_addr.empty()) {
@@ -525,9 +525,9 @@ bool TcpClientListener::StopOnNetworkInterface() {
socket_ = -1;
}
- LOG4CXX_INFO(logger_,
- "TCP server socket on " << designated_interface_
- << " stopped");
+ LOG4CXX_INFO(
+ logger_,
+ "TCP server socket on " << designated_interface_ << " stopped");
}
return true;
}
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
index e202554f8f..50d1c74fa7 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/tcp_connection_factory.h"
#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "utils/logger.h"
@@ -52,9 +52,9 @@ TransportAdapter::Error TcpConnectionFactory::Init() {
TransportAdapter::Error TcpConnectionFactory::CreateConnection(
const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "DeviceUID: " << &device_uid
- << ", ApplicationHandle: " << &app_handle);
+ LOG4CXX_DEBUG(
+ logger_,
+ "DeviceUID: " << &device_uid << ", ApplicationHandle: " << &app_handle);
std::shared_ptr<TcpServerOriginatedSocketConnection> connection =
std::make_shared<TcpServerOriginatedSocketConnection>(
device_uid, app_handle, controller_);
diff --git a/src/components/transport_manager/src/tcp/tcp_device.cc b/src/components/transport_manager/src/tcp/tcp_device.cc
index dbcb5d38cb..4542f76c1d 100644
--- a/src/components/transport_manager/src/tcp/tcp_device.cc
+++ b/src/components/transport_manager/src/tcp/tcp_device.cc
@@ -30,8 +30,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/logger.h"
#include "transport_manager/tcp/tcp_device.h"
+#include "utils/logger.h"
namespace transport_manager {
namespace transport_adapter {
@@ -57,9 +57,9 @@ TcpDevice::TcpDevice(const in_addr_t& in_addr,
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"Device created with transport switch emulation support.");
- LOG4CXX_DEBUG(logger_,
- "Device parameters: " << device_uid << " / "
- << transport_switch_id);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Device parameters: " << device_uid << " / " << transport_switch_id);
}
#endif // BUILD_TESTS
diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
index 2f10bd9454..690b2d25b3 100644
--- a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
@@ -65,9 +65,9 @@ bool TcpServerOriginatedSocketConnection::Establish(ConnectError** error) {
const int port = tcp_device->GetApplicationPort(application_handle());
if (-1 == port) {
- LOG4CXX_ERROR(logger_,
- "Application port for " << application_handle()
- << " not found");
+ LOG4CXX_ERROR(
+ logger_,
+ "Application port for " << application_handle() << " not found");
*error = new ConnectError();
return false;
}
diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
index b3dbf49628..aeb50f3830 100644
--- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -32,19 +32,19 @@
#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include <errno.h>
#include <memory.h>
#include <signal.h>
-#include <errno.h>
#include <stdio.h>
#include <cstdlib>
#include <sstream>
-#include "utils/logger.h"
-#include "utils/threads/thread_delegate.h"
#include "transport_manager/tcp/tcp_client_listener.h"
#include "transport_manager/tcp/tcp_connection_factory.h"
#include "transport_manager/tcp/tcp_device.h"
+#include "utils/logger.h"
+#include "utils/threads/thread_delegate.h"
namespace transport_manager {
namespace transport_adapter {
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 9d594affe4..8f8c004594 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
@@ -30,13 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include <errno.h>
#include <fcntl.h>
#include <memory.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <algorithm>
#include "utils/logger.h"
#include "utils/threads/thread.h"
@@ -300,9 +300,9 @@ bool ThreadedSocketConnection::Receive() {
bytes_read = recv(socket_, buffer, sizeof(buffer), MSG_DONTWAIT);
if (bytes_read > 0) {
- LOG4CXX_DEBUG(logger_,
- "Received " << bytes_read << " bytes for connection "
- << this);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Received " << bytes_read << " bytes for connection " << this);
::protocol_handler::RawMessagePtr frame(
new protocol_handler::RawMessage(0, 0, buffer, bytes_read));
controller_->DataReceiveDone(
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index 346139cbd2..fc43cfc63e 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -31,14 +31,15 @@
*/
#include "config_profile/profile.h"
-#include "utils/logger.h"
#include "utils/helpers.h"
+#include "utils/logger.h"
+#include "utils/timer_task_impl.h"
-#include "transport_manager/transport_adapter/transport_adapter_impl.h"
-#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/client_connection_listener.h"
#include "transport_manager/transport_adapter/device_scanner.h"
#include "transport_manager/transport_adapter/server_connection_factory.h"
-#include "transport_manager/transport_adapter/client_connection_listener.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
namespace transport_manager {
namespace transport_adapter {
@@ -60,7 +61,9 @@ DeviceTypes devicesType = {
std::make_pair(DeviceType::IOS_USB_DEVICE_MODE,
std::string("USB_IOS_DEVICE_MODE")),
std::make_pair(DeviceType::IOS_CARPLAY_WIRELESS,
- std::string("CARPLAY_WIRELESS_IOS"))};
+ std::string("CARPLAY_WIRELESS_IOS")),
+ std::make_pair(DeviceType::CLOUD_WEBSOCKET,
+ std::string("CLOUD_WEBSOCKET"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -97,16 +100,16 @@ TransportAdapterImpl::~TransportAdapterImpl() {
LOG4CXX_DEBUG(logger_, "device_scanner_ deleted.");
}
if (server_connection_factory_) {
- LOG4CXX_DEBUG(logger_,
- "Deleting server_connection_factory "
- << server_connection_factory_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Deleting server_connection_factory " << server_connection_factory_);
delete server_connection_factory_;
LOG4CXX_DEBUG(logger_, "server_connection_factory deleted.");
}
if (client_connection_listener_) {
- LOG4CXX_DEBUG(logger_,
- "Deleting client_connection_listener_ "
- << client_connection_listener_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Deleting client_connection_listener_ " << client_connection_listener_);
delete client_connection_listener_;
LOG4CXX_DEBUG(logger_, "client_connection_listener_ deleted.");
}
@@ -190,9 +193,9 @@ TransportAdapter::Error TransportAdapterImpl::SearchDevices() {
TransportAdapter::Error TransportAdapterImpl::Connect(
const DeviceUID& device_id, const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_,
- "enter. DeviceUID " << device_id << " ApplicationHandle "
- << app_handle);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. DeviceUID " << device_id << " ApplicationHandle " << app_handle);
if (server_connection_factory_ == 0) {
LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED");
return NOT_SUPPORTED;
@@ -207,17 +210,21 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
}
connections_lock_.AcquireForWriting();
+
+ std::pair<DeviceUID, ApplicationHandle> connection_key =
+ std::make_pair(device_id, app_handle);
const bool already_exists =
- connections_.end() !=
- connections_.find(std::make_pair(device_id, app_handle));
+ connections_.end() != connections_.find(connection_key);
+ ConnectionInfo& info = connections_[connection_key];
if (!already_exists) {
- ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)];
info.app_handle = app_handle;
info.device_id = device_id;
info.state = ConnectionInfo::NEW;
}
+ const bool pending_app = ConnectionInfo::PENDING == info.state;
connections_lock_.Release();
- if (already_exists) {
+
+ if (already_exists && !pending_app) {
LOG4CXX_TRACE(logger_, "exit with ALREADY_EXISTS");
return ALREADY_EXISTS;
}
@@ -226,7 +233,9 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
server_connection_factory_->CreateConnection(device_id, app_handle);
if (TransportAdapter::OK != err) {
connections_lock_.AcquireForWriting();
- connections_.erase(std::make_pair(device_id, app_handle));
+ if (!pending_app) {
+ connections_.erase(std::make_pair(device_id, app_handle));
+ }
connections_lock_.Release();
}
LOG4CXX_TRACE(logger_, "exit with error: " << err);
@@ -239,6 +248,33 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(
DeviceSptr device = FindDevice(device_handle);
if (device) {
TransportAdapter::Error err = ConnectDevice(device);
+ if (FAIL == err && GetDeviceType() == DeviceType::CLOUD_WEBSOCKET) {
+ LOG4CXX_TRACE(logger_,
+ "Error occurred while connecting cloud app: " << err);
+ // Update retry count
+ if (device->retry_count() >=
+ get_settings().cloud_app_max_retry_attempts()) {
+ device->reset_retry_count();
+ ConnectionStatusUpdated(device, ConnectionStatus::PENDING);
+ return err;
+ } else if (device->connection_status() == ConnectionStatus::PENDING) {
+ ConnectionStatusUpdated(device, ConnectionStatus::RETRY);
+ }
+
+ device->next_retry();
+
+ // Start timer for next retry
+ TimerSPtr retry_timer(std::make_shared<timer::Timer>(
+ "RetryConnectionTimer",
+ new timer::TimerTaskImpl<TransportAdapterImpl>(
+ this, &TransportAdapterImpl::RetryConnection)));
+ sync_primitives::AutoLock locker(retry_timer_pool_lock_);
+ retry_timer_pool_.push(std::make_pair(retry_timer, device_handle));
+ retry_timer->Start(get_settings().cloud_app_retry_timeout(),
+ timer::kSingleShot);
+ } else if (OK == err) {
+ ConnectionStatusUpdated(device, ConnectionStatus::CONNECTED);
+ }
LOG4CXX_TRACE(logger_, "exit with error: " << err);
return err;
} else {
@@ -247,11 +283,65 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(
}
}
+void TransportAdapterImpl::RetryConnection() {
+ ClearCompletedTimers();
+ const DeviceUID device_id = GetNextRetryDevice();
+ if (device_id.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to find timer, ignoring RetryConnection request");
+ return;
+ }
+ ConnectDevice(device_id);
+}
+
+void TransportAdapterImpl::ClearCompletedTimers() {
+ // Cleanup any retry timers which have completed execution
+ sync_primitives::AutoLock locker(completed_timer_pool_lock_);
+ while (!completed_timer_pool_.empty()) {
+ auto timer_entry = completed_timer_pool_.front();
+ if (timer_entry.first->is_completed()) {
+ completed_timer_pool_.pop();
+ }
+ }
+}
+
+DeviceUID TransportAdapterImpl::GetNextRetryDevice() {
+ sync_primitives::AutoLock retry_locker(retry_timer_pool_lock_);
+ if (retry_timer_pool_.empty()) {
+ return std::string();
+ }
+ auto timer_entry = retry_timer_pool_.front();
+ retry_timer_pool_.pop();
+
+ // Store reference for cleanup later
+ sync_primitives::AutoLock completed_locker(completed_timer_pool_lock_);
+ completed_timer_pool_.push(timer_entry);
+
+ return timer_entry.second;
+}
+
+ConnectionStatus TransportAdapterImpl::GetConnectionStatus(
+ const DeviceUID& device_handle) const {
+ DeviceSptr device = FindDevice(device_handle);
+ return device.use_count() == 0 ? ConnectionStatus::INVALID
+ : device->connection_status();
+}
+
+void TransportAdapterImpl::ConnectionStatusUpdated(DeviceSptr device,
+ ConnectionStatus status) {
+ device->set_connection_status(status);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnConnectionStatusUpdated(this);
+ }
+}
+
TransportAdapter::Error TransportAdapterImpl::Disconnect(
const DeviceUID& device_id, const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_,
- "enter. device_id: " << &device_id
- << ", device_id: " << &device_id);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_id << ", device_id: " << &device_id);
if (!initialised_) {
LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
return BAD_STATE;
@@ -276,6 +366,8 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice(
}
Error error = OK;
+ DeviceSptr device = FindDevice(device_id);
+ ConnectionStatusUpdated(device, ConnectionStatus::CLOSING);
std::vector<ConnectionInfo> to_disconnect;
connections_lock_.AcquireForReading();
@@ -395,6 +487,7 @@ DeviceSptr TransportAdapterImpl::AddDevice(DeviceSptr device) {
LOG4CXX_TRACE(logger_, "exit with TRUE. Condition: same_device_found");
return existing_device;
} else {
+ device->set_connection_status(ConnectionStatus::PENDING);
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end();
++it) {
@@ -545,9 +638,9 @@ void TransportAdapterImpl::ConnectionCreated(
void TransportAdapterImpl::DeviceDisconnected(
const DeviceUID& device_handle, const DisconnectDeviceError& error) {
const DeviceUID device_uid = device_handle;
- LOG4CXX_TRACE(logger_,
- "enter. device_handle: " << &device_uid
- << ", error: " << &error);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_handle: " << &device_uid << ", error: " << &error);
ApplicationList app_list = GetApplicationList(device_uid);
for (ApplicationList::const_iterator i = app_list.begin();
i != app_list.end();
@@ -605,9 +698,9 @@ void TransportAdapterImpl::DisconnectDone(const DeviceUID& device_handle,
const ApplicationHandle& app_handle) {
const DeviceUID device_uid = device_handle;
const ApplicationHandle app_uid = app_handle;
- LOG4CXX_TRACE(logger_,
- "enter. device_id: " << &device_uid
- << ", app_handle: " << &app_uid);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_uid << ", app_handle: " << &app_uid);
DeviceSptr device = FindDevice(device_handle);
if (!device) {
LOG4CXX_WARN(logger_, "Device: uid " << &device_uid << " not found");
@@ -728,6 +821,26 @@ void TransportAdapterImpl::DeviceSwitched(const DeviceUID& device_handle) {
UNUSED(device_handle);
}
+ConnectionSPtr TransportAdapterImpl::FindPendingConnection(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle) const {
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_id << ", app_handle: " << &app_handle);
+ ConnectionSPtr connection;
+ connections_lock_.AcquireForReading();
+ ConnectionMap::const_iterator it =
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (it != connections_.end()) {
+ const ConnectionInfo& info = it->second;
+ if (info.state == ConnectionInfo::PENDING) {
+ connection = info.connection;
+ }
+ }
+ connections_lock_.Release();
+ LOG4CXX_TRACE(logger_, "exit with Connection: " << connection);
+ return connection;
+}
+
DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr ret;
@@ -743,11 +856,39 @@ DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
return ret;
}
+void TransportAdapterImpl::ConnectPending(const DeviceUID& device_id,
+ const ApplicationHandle& app_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ connections_lock_.AcquireForWriting();
+ ConnectionMap::iterator it_conn =
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (it_conn != connections_.end()) {
+ ConnectionInfo& info = it_conn->second;
+ info.state = ConnectionInfo::PENDING;
+ }
+ connections_lock_.Release();
+
+ DeviceSptr device = FindDevice(device_id);
+ if (device.use_count() == 0) {
+ LOG4CXX_ERROR(
+ logger_, "Unable to find device, cannot set connection pending status");
+ return;
+ } else {
+ device->set_connection_status(ConnectionStatus::PENDING);
+ }
+
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnConnectPending(this, device_id, app_handle);
+ }
+}
+
void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id,
const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_,
- "enter. device_id: " << &device_id
- << ", app_handle: " << &app_handle);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_id << ", app_handle: " << &app_handle);
connections_lock_.AcquireForReading();
ConnectionMap::iterator it_conn =
connections_.find(std::make_pair(device_id, app_handle));
@@ -834,9 +975,9 @@ ApplicationList TransportAdapterImpl::GetApplicationList(
void TransportAdapterImpl::ConnectionFinished(
const DeviceUID& device_id, const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_,
- "enter. device_id: " << &device_id
- << ", app_handle: " << &app_handle);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_id << ", app_handle: " << &app_handle);
connections_lock_.AcquireForReading();
ConnectionMap::iterator it =
connections_.find(std::make_pair(device_id, app_handle));
@@ -960,9 +1101,9 @@ bool TransportAdapterImpl::ToBeAutoDisconnected(DeviceSptr device) const {
ConnectionSPtr TransportAdapterImpl::FindEstablishedConnection(
const DeviceUID& device_id, const ApplicationHandle& app_handle) const {
- LOG4CXX_TRACE(logger_,
- "enter. device_id: " << &device_id
- << ", app_handle: " << &app_handle);
+ LOG4CXX_TRACE(
+ logger_,
+ "enter. device_id: " << &device_id << ", app_handle: " << &app_handle);
ConnectionSPtr connection;
connections_lock_.AcquireForReading();
ConnectionMap::const_iterator it =
@@ -1036,12 +1177,13 @@ void TransportAdapterImpl::RunAppOnDevice(const DeviceUID& device_uid,
void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Device_handle: " << &device_handle);
+ LOG4CXX_DEBUG(logger_, "Remove Device_handle: " << &device_handle);
sync_primitives::AutoLock locker(devices_mutex_);
DeviceMap::iterator i = devices_.find(device_handle);
if (i != devices_.end()) {
DeviceSptr device = i->second;
- if (!device->keep_on_disconnect()) {
+ bool is_cloud_device = (GetDeviceType() == DeviceType::CLOUD_WEBSOCKET);
+ if (!device->keep_on_disconnect() || is_cloud_device) {
devices_.erase(i);
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end();
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
index 544cdde999..bf2d3dbdf4 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -34,9 +34,9 @@
#include "utils/logger.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
#include "transport_manager/transport_manager_impl.h"
-#include "transport_manager/transport_adapter/transport_adapter_event.h"
namespace transport_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
@@ -116,6 +116,44 @@ void TransportAdapterListenerImpl::OnFindNewApplicationsRequest(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterListenerImpl::OnConnectionStatusUpdated(
+ const TransportAdapter* adapter) {
+ LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECTION_STATUS_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnConnectPending(
+ const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& application_id) {
+ LOG4CXX_TRACE(logger_,
+ "enter adapter*: " << adapter << ", device: " << &device
+ << ", application_id: " << &application_id);
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECT_PENDING,
+ transport_adapter_,
+ device,
+ application_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
void TransportAdapterListenerImpl::OnConnectDone(
const TransportAdapter* adapter,
const DeviceUID& device,
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
index 196ad09af4..71fc41ada9 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -44,6 +44,10 @@
#include "transport_manager/usb/usb_aoa_adapter.h"
#endif // USB_SUPPORT
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+#include "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
#if defined(BUILD_TESTS)
#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
#endif // BUILD_TEST
@@ -101,6 +105,19 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) {
ta_usb = NULL;
#endif // USB_SUPPORT
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ transport_adapter::TransportAdapterImpl* ta_cloud =
+ new transport_adapter::CloudWebsocketTransportAdapter(last_state,
+ get_settings());
+#ifdef TELEMETRY_MONITOR
+ if (metric_observer_) {
+ ta_cloud->SetTelemetryObserver(metric_observer_);
+ }
+#endif // TELEMETRY_MONITOR
+ AddTransportAdapter(ta_cloud);
+ ta_cloud = NULL;
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
#if defined BUILD_TESTS
const uint16_t iap2_bt_emu_port = 23456;
transport_adapter::IAP2BluetoothEmulationTransportAdapter*
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 2b0296debb..a2bc95bfdd 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -33,25 +33,28 @@
#include "transport_manager/transport_manager_impl.h"
#include <stdint.h>
+#include <algorithm>
#include <cstring>
+#include <functional>
+#include <iostream>
+#include <limits>
#include <queue>
#include <set>
-#include <algorithm>
-#include <limits>
-#include <functional>
#include <sstream>
-#include <iostream>
-#include "utils/macro.h"
#include "utils/logger.h"
+#include "utils/macro.h"
-#include "utils/timer_task_impl.h"
+#include "config_profile/profile.h"
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+#include "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#endif
#include "transport_manager/common.h"
-#include "transport_manager/transport_manager_listener.h"
-#include "transport_manager/transport_manager_listener_empty.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/transport_adapter/transport_adapter_event.h"
-#include "config_profile/profile.h"
+#include "transport_manager/transport_manager_listener.h"
+#include "transport_manager/transport_manager_listener_empty.h"
+#include "utils/timer_task_impl.h"
using ::transport_manager::transport_adapter::TransportAdapter;
@@ -129,6 +132,48 @@ void TransportManagerImpl::ReconnectionTimeout() {
device_to_reconnect_);
}
+void TransportManagerImpl::AddCloudDevice(
+ const transport_manager::transport_adapter::CloudAppProperties&
+ cloud_properties) {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function");
+#else
+ transport_adapter::DeviceType type = transport_adapter::DeviceType::UNKNOWN;
+ if (cloud_properties.cloud_transport_type == "WS") {
+ type = transport_adapter::DeviceType::CLOUD_WEBSOCKET;
+ }
+#ifdef ENABLE_SECURITY
+ else if (cloud_properties.cloud_transport_type == "WSS") {
+ type = transport_adapter::DeviceType::CLOUD_WEBSOCKET;
+ }
+#endif // ENABLE_SECURITY
+ else {
+ return;
+ }
+
+ std::vector<TransportAdapter*>::iterator ta = transport_adapters_.begin();
+ for (; ta != transport_adapters_.end(); ++ta) {
+ if ((*ta)->GetDeviceType() == type) {
+ (*ta)->CreateDevice(cloud_properties.endpoint);
+ transport_adapter::CloudWebsocketTransportAdapter* cta =
+ static_cast<transport_adapter::CloudWebsocketTransportAdapter*>(*ta);
+ cta->SetAppCloudTransportConfig(cloud_properties.endpoint,
+ cloud_properties);
+ }
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+ return;
+}
+
+void TransportManagerImpl::RemoveCloudDevice(const DeviceHandle device_handle) {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function");
+ return;
+#else
+ DisconnectDevice(device_handle);
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+}
+
int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) {
LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
if (!this->is_initialized_) {
@@ -157,6 +202,22 @@ int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) {
return err;
}
+ConnectionStatus TransportManagerImpl::GetConnectionStatus(
+ const DeviceHandle& device_handle) const {
+ DeviceUID device_id = converter_.HandleToUid(device_handle);
+
+ sync_primitives::AutoReadLock lock(device_to_adapter_map_lock_);
+ DeviceToAdapterMap::const_iterator it =
+ device_to_adapter_map_.find(device_id);
+ if (it == device_to_adapter_map_.end()) {
+ LOG4CXX_ERROR(logger_, "No device adapter found by id " << device_handle);
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == ta");
+ return ConnectionStatus::INVALID;
+ }
+ transport_adapter::TransportAdapter* ta = it->second;
+ return ta->GetConnectionStatus(device_id);
+}
+
int TransportManagerImpl::DisconnectDevice(const DeviceHandle device_handle) {
LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
if (!this->is_initialized_) {
@@ -318,9 +379,9 @@ int TransportManagerImpl::Stop() {
int TransportManagerImpl::SendMessageToDevice(
const ::protocol_handler::RawMessagePtr message) {
LOG4CXX_TRACE(logger_, "enter. RawMessageSptr: " << message);
- LOG4CXX_INFO(logger_,
- "Send message to device called with arguments "
- << message.get());
+ LOG4CXX_INFO(
+ logger_,
+ "Send message to device called with arguments " << message.get());
if (false == this->is_initialized_) {
LOG4CXX_ERROR(logger_, "TM is not initialized.");
LOG4CXX_TRACE(logger_,
@@ -720,9 +781,9 @@ TransportManagerImpl::ConnectionInternal*
TransportManagerImpl::GetActiveConnection(
const DeviceUID& device, const ApplicationHandle& application) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "DeviceUID: " << device
- << " ApplicationHandle: " << application);
+ LOG4CXX_DEBUG(
+ logger_,
+ "DeviceUID: " << device << " ApplicationHandle: " << application);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
@@ -871,9 +932,9 @@ bool TransportManagerImpl::UpdateDeviceMapping(
item = device_to_adapter_map_.begin();
}
- LOG4CXX_DEBUG(logger_,
- "After cleanup. Device map size is "
- << device_to_adapter_map_.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "After cleanup. Device map size is " << device_to_adapter_map_.size());
for (DeviceList::const_iterator it = adapter_device_list.begin();
it != adapter_device_list.end();
@@ -883,10 +944,10 @@ bool TransportManagerImpl::UpdateDeviceMapping(
device_to_adapter_map_.insert(std::make_pair(device_uid, ta));
if (!result.second) {
LOG4CXX_WARN(logger_,
- "Device UID "
- << device_uid
- << " is known already. Processing skipped."
- "Connection type is: " << ta->GetConnectionType());
+ "Device UID " << device_uid
+ << " is known already. Processing skipped."
+ "Connection type is: "
+ << ta->GetConnectionType());
continue;
}
DeviceHandle device_handle =
@@ -898,9 +959,9 @@ bool TransportManagerImpl::UpdateDeviceMapping(
RaiseEvent(&TransportManagerListener::OnDeviceFound, info);
}
- LOG4CXX_DEBUG(logger_,
- "After update. Device map size is "
- << device_to_adapter_map_.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "After update. Device map size is " << device_to_adapter_map_.size());
return true;
}
@@ -954,22 +1015,93 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_FIND_NEW_APPLICATIONS_REQUEST");
break;
}
+ case EventTypeEnum::ON_CONNECTION_STATUS_UPDATED: {
+ RaiseEvent(&TransportManagerListener::OnConnectionStatusUpdated);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECTION_STATUS_UPDATED");
+ break;
+ }
+ case EventTypeEnum::ON_CONNECT_PENDING: {
+ const DeviceHandle device_handle = converter_.UidToHandle(
+ event.device_uid, event.transport_adapter->GetConnectionType());
+ int connection_id = 0;
+ std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ std::vector<ConnectionInternal>::iterator end = connections_.end();
+ for (; it != end; ++it) {
+ if (it->transport_adapter != event.transport_adapter) {
+ continue;
+ } else if (it->Connection::device != event.device_uid) {
+ continue;
+ } else if (it->Connection::application != event.application_id) {
+ continue;
+ } else if (it->device_handle_ != device_handle) {
+ continue;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Connection Object Already Exists");
+ connection_id = it->Connection::id;
+ break;
+ }
+ }
+
+ if (it == end) {
+ AddConnection(ConnectionInternal(this,
+ event.transport_adapter,
+ ++connection_id_counter_,
+ event.device_uid,
+ event.application_id,
+ device_handle));
+ connection_id = connection_id_counter_;
+ }
+
+ RaiseEvent(
+ &TransportManagerListener::OnConnectionPending,
+ DeviceInfo(device_handle,
+ event.device_uid,
+ event.transport_adapter->DeviceName(event.device_uid),
+ event.transport_adapter->GetConnectionType()),
+ connection_id);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_PENDING");
+ break;
+ }
case EventTypeEnum::ON_CONNECT_DONE: {
const DeviceHandle device_handle = converter_.UidToHandle(
event.device_uid, event.transport_adapter->GetConnectionType());
- AddConnection(ConnectionInternal(this,
- event.transport_adapter,
- ++connection_id_counter_,
- event.device_uid,
- event.application_id,
- device_handle));
+
+ int connection_id = 0;
+ std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ std::vector<ConnectionInternal>::iterator end = connections_.end();
+ for (; it != end; ++it) {
+ if (it->transport_adapter != event.transport_adapter) {
+ continue;
+ } else if (it->Connection::device != event.device_uid) {
+ continue;
+ } else if (it->Connection::application != event.application_id) {
+ continue;
+ } else if (it->device_handle_ != device_handle) {
+ continue;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Connection Object Already Exists");
+ connection_id = it->Connection::id;
+ break;
+ }
+ }
+
+ if (it == end) {
+ AddConnection(ConnectionInternal(this,
+ event.transport_adapter,
+ ++connection_id_counter_,
+ event.device_uid,
+ event.application_id,
+ device_handle));
+ connection_id = connection_id_counter_;
+ }
+
RaiseEvent(
&TransportManagerListener::OnConnectionEstablished,
DeviceInfo(device_handle,
event.device_uid,
event.transport_adapter->DeviceName(event.device_uid),
event.transport_adapter->GetConnectionType()),
- connection_id_counter_);
+ connection_id);
LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_DONE");
break;
}
diff --git a/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
index 33709cf0f6..7d7fb49e6e 100644
--- a/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
+++ b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
@@ -83,5 +83,5 @@ std::string PlatformUsbDevice::GetSerialNumber() const {
return GetDescString(device_descriptor_.iSerialNumber);
}
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
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 212e6e0ec3..d60c409a96 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -38,8 +38,8 @@
#include <sstream>
-#include "transport_manager/usb/libusb/usb_connection.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/libusb/usb_connection.h"
#include "utils/logger.h"
diff --git a/src/components/transport_manager/src/usb/libusb/usb_handler.cc b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
index c62e80d1be..df3b7e128e 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_handler.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
@@ -33,14 +33,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <cstring>
#include <cstdlib>
+#include <cstring>
-#include "transport_manager/usb/common.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/common.h"
-#include "utils/macro.h"
#include "utils/logger.h"
+#include "utils/macro.h"
#include "utils/threads/thread.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
index e85ab12b10..bb6e341659 100644
--- a/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
+++ b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
@@ -76,5 +76,5 @@ std::string PlatformUsbDevice::GetSerialNumber() const {
return GetDescString(device_descriptor_.iSerialNumber);
}
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
index b9386c5d9f..c514162eb0 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -37,8 +37,8 @@
#include <sched.h>
#include <cstring>
-#include "transport_manager/usb/qnx/usb_connection.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/qnx/usb_connection.h"
#include "utils/logger.h"
diff --git a/src/components/transport_manager/src/usb/qnx/usb_handler.cc b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
index 2336a05f16..9ac4a40d92 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_handler.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
@@ -35,11 +35,11 @@
#include <errno.h>
-#include <cstring>
#include <cstdlib>
+#include <cstring>
-#include "transport_manager/usb/common.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/common.h"
#include "utils/logger.h"
@@ -321,5 +321,5 @@ TransportAdapter::Error UsbHandler::Init() {
return TransportAdapter::OK;
}
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
index b7faf1ef6b..3ecc1e22f3 100644
--- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -34,9 +34,9 @@
*/
#include "transport_manager/usb/usb_aoa_adapter.h"
-#include "transport_manager/usb/usb_device_scanner.h"
-#include "transport_manager/usb/usb_connection_factory.h"
#include "transport_manager/usb/common.h"
+#include "transport_manager/usb/usb_connection_factory.h"
+#include "transport_manager/usb/usb_device_scanner.h"
#include "utils/logger.h"
namespace transport_manager {
diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc
index 528855cd50..401dde2534 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -31,8 +31,8 @@
*/
#include "transport_manager/usb/usb_connection_factory.h"
-#include "transport_manager/usb/usb_device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/usb_device.h"
#include "utils/logger.h"
#if defined(__QNXNTO__)
diff --git a/src/components/transport_manager/src/usb/usb_device_scanner.cc b/src/components/transport_manager/src/usb/usb_device_scanner.cc
index 092fd29f1a..3a17203307 100644
--- a/src/components/transport_manager/src/usb/usb_device_scanner.cc
+++ b/src/components/transport_manager/src/usb/usb_device_scanner.cc
@@ -33,9 +33,9 @@
#include <sstream>
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
-#include "transport_manager/usb/usb_device_scanner.h"
-#include "transport_manager/usb/usb_device.h"
#include "transport_manager/usb/common.h"
+#include "transport_manager/usb/usb_device.h"
+#include "transport_manager/usb/usb_device_scanner.h"
#include "utils/logger.h"
@@ -247,5 +247,5 @@ bool UsbDeviceScanner::IsInitialised() const {
return true;
}
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
index 240784436b..f6e1212b36 100644
--- a/src/components/transport_manager/test/CMakeLists.txt
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -46,6 +46,13 @@ set(EXCLUDE_PATHS
raw_message_matcher.cc
)
+if (NOT BUILD_CLOUD_APP_SUPPORT)
+ list(APPEND EXCLUDE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/websocket_connection_test.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/sample_websocket_server.cc
+ )
+endif()
+
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
set(PLATFORM_DEPENDENT_SOURCES)
@@ -75,6 +82,11 @@ if (BUILD_BT_SUPPORT)
endif()
endif()
+if(BUILD_CLOUD_APP_SUPPORT)
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system boost_regex crypto ssl -L${BOOST_LIBS_DIRECTORY})
+endif()
+
create_test("transport_manager_test" "${SOURCES}" "${LIBRARIES}")
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/transport_manager/test/include/transport_manager/cloud/sample_websocket_server.h b/src/components/transport_manager/test/include/transport_manager/cloud/sample_websocket_server.h
new file mode 100644
index 0000000000..a8b801c1fe
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/cloud/sample_websocket_server.h
@@ -0,0 +1,162 @@
+
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_CLOUD_SAMPLE_WEBSOCKET_SERVER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_CLOUD_SAMPLE_WEBSOCKET_SERVER_H_
+
+#include <boost/asio/bind_executor.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/ssl/stream.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/beast/websocket/ssl.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/thread/thread.hpp>
+#include <iostream>
+#include <queue>
+#include <set>
+#include <string>
+#include <thread>
+
+namespace sample {
+namespace websocket {
+
+namespace beast = boost::beast; // from <boost/beast.hpp>
+namespace http = beast::http; // from <boost/beast/http.hpp>
+namespace websocket = beast::websocket; // from <boost/beast/websocket.hpp>
+namespace net = boost::asio; // from <boost/asio.hpp>
+namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp>
+using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
+
+// Accepts incoming connections and launches the WSServer
+class WSSession {
+ private:
+ class WSServer {
+ public:
+ explicit WSServer(tcp::socket&& socket);
+ void AddURLRoute(const std::string& route);
+ // Start the asynchronous operation
+ void Run();
+
+ private:
+ void OnWebsocketHandshake(const boost::system::error_code& ec);
+ void OnAccept(beast::error_code ec);
+ // Check if route can be handled by the server
+ bool CanHandleRoute(const std::string& route);
+ std::string ParseRouteFromTarget(const std::string& target);
+
+ websocket::stream<tcp::socket> ws_;
+ beast::flat_buffer buffer_;
+ boost::asio::strand<boost::asio::io_context::executor_type> strand_;
+ http::request<http::string_body> req_;
+ std::set<std::string> url_routes_;
+ };
+
+ public:
+ WSSession(const std::string& address, uint16_t port);
+ // Start Accepting incoming connections
+ void Run();
+ void Stop();
+ // Add route endpoint which can be handled the server
+ void AddRoute(const std::string& route);
+
+ private:
+ void on_accept(boost::system::error_code ec);
+ boost::asio::io_context ioc_;
+ const std::string& address_;
+ uint16_t port_;
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+ beast::flat_buffer buffer_;
+ boost::asio::ip::tcp::endpoint endpoint_;
+ std::shared_ptr<WSServer> ws_;
+ std::queue<std::string> buffered_routes_;
+};
+
+// Accepts incoming connections and launches the sessions
+class WSSSession {
+ private:
+ class WSSServer {
+ public:
+ // Take ownership of the socket
+ WSSServer(tcp::socket&& socket, ssl::context& ctx);
+ void AddURLRoute(const std::string& route);
+ // Start the asynchronous operation
+ void Run();
+
+ private:
+ void OnSSLHandshake(beast::error_code ec);
+ void OnWebsocketHandshake(const boost::system::error_code& ec);
+ void OnAccept(beast::error_code ec);
+
+ // Check if route can be handled by the server
+ bool CanHandleRoute(const std::string& route);
+ std::string ParseRouteFromTarget(const std::string& target);
+
+ websocket::stream<ssl::stream<tcp::socket> > wss_;
+ beast::flat_buffer buffer_;
+ http::request<http::string_body> req_;
+ std::set<std::string> url_routes_;
+ };
+
+ public:
+ WSSSession(const std::string& address,
+ uint16_t port,
+ const std::string& certificate,
+ const std::string& private_key);
+ // Start accepting incoming connections
+ void Run();
+ void Stop();
+ // Add route endpoint which can be handled the server
+ void AddRoute(const std::string& route);
+
+ private:
+ void do_accept();
+ void on_accept(boost::system::error_code ec);
+
+ private:
+ boost::asio::io_context ioc_;
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+ ssl::context ctx_;
+ tcp::endpoint endpoint_;
+ std::shared_ptr<WSSServer> wss_;
+ std::queue<std::string> buffered_routes_;
+};
+
+} // namespace websocket
+} // namespace sample
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_CLOUD_SAMPLE_WEBSOCKET_SERVER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h
index e94586a856..758d22dae2 100644
--- a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h
+++ b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_IMPL_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_IMPL_H_
-#include "gmock/gmock.h"
#include "config_profile/profile.h"
-#include "transport_manager/transport_manager_impl.h"
+#include "gmock/gmock.h"
#include "transport_manager/mock_transport_manager_settings.h"
+#include "transport_manager/transport_manager_impl.h"
#include "transport_manager/transport_manager_settings.h"
namespace test {
diff --git a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h
index 58e143342a..0c9ca959e9 100644
--- a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h
+++ b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
-#include <vector>
#include <gmock/gmock.h>
-#include "transport_manager/transport_manager_listener.h"
+#include <vector>
#include "protocol/raw_message.h"
+#include "transport_manager/transport_manager_listener.h"
namespace test {
namespace components {
@@ -56,6 +56,9 @@ class MockTransportManagerListener : public TransportManagerListener {
MOCK_METHOD1(OnDeviceRemoved, void(const DeviceInfo& device_info));
MOCK_METHOD0(OnScanDevicesFinished, void());
MOCK_METHOD1(OnScanDevicesFailed, void(const SearchDeviceError& error));
+ MOCK_METHOD2(OnConnectionPending,
+ void(const DeviceInfo& device_info,
+ const ConnectionUID connection_id));
MOCK_METHOD2(OnConnectionEstablished,
void(const DeviceInfo& device_info,
const ConnectionUID connection_id));
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 9c7327e6fb..2ee699096f 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
@@ -38,8 +38,8 @@
#include <gmock/gmock.h>
-#include "transport_manager/common.h"
#include "protocol/common.h"
+#include "transport_manager/common.h"
using ::testing::Matcher;
using ::testing::MatcherInterface;
diff --git a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h
index 432e4f3fa0..daa9397b7d 100644
--- a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h
+++ b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_TRANSPORT_ADAPTER_H_
#include "gmock/gmock.h"
+#include "transport_manager/common.h"
#include "transport_manager/tcp/tcp_transport_adapter.h"
#include "transport_manager/transport_manager_settings.h"
@@ -50,14 +51,18 @@ class MockTCPTransportAdapter : public TcpTransportAdapter {
resumption::LastState& last_state,
const transport_manager::TransportManagerSettings& settings)
: TcpTransportAdapter(port, last_state, settings) {}
- MOCK_CONST_METHOD2(FindEstablishedConnection,
- ConnectionSPtr(const DeviceUID& device_handle,
- const ApplicationHandle& app_handle));
+ MOCK_CONST_METHOD2(
+ FindEstablishedConnection,
+ ConnectionSPtr(const transport_manager::DeviceUID& device_handle,
+ const transport_manager::ApplicationHandle& app_handle));
- MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_CONST_METHOD1(
+ FindDevice,
+ DeviceSptr(const transport_manager::DeviceUID& device_handle));
MOCK_METHOD2(Connect,
- TransportAdapter::Error(const DeviceUID& device_handle,
- const ApplicationHandle& app_handle));
+ TransportAdapter::Error(
+ const transport_manager::DeviceUID& device_handle,
+ const transport_manager::ApplicationHandle& app_handle));
void CallStore() {
Store();
}
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h
index 642c193d63..1de5eac702 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h
@@ -55,6 +55,9 @@ class MockTransportAdapterController : public TransportAdapterController {
void(ConnectionSPtr connection,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle));
+ MOCK_CONST_METHOD2(FindPendingConnection,
+ ConnectionSPtr(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
MOCK_METHOD2(ConnectDone,
void(const DeviceUID& device_handle,
const ApplicationHandle& app_handle));
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 384f55605a..592ed855cc 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
@@ -34,17 +34,19 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_IMPL_H_
#include "gmock/gmock.h"
-#include "transport_manager/transport_manager_settings.h"
+#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/transport_manager_settings.h"
-using ::transport_manager::transport_adapter::TransportAdapterImpl;
-using ::transport_manager::transport_adapter::DeviceScanner;
-using ::transport_manager::transport_adapter::ServerConnectionFactory;
+using ::transport_manager::ApplicationHandle;
+using ::transport_manager::DeviceUID;
using ::transport_manager::transport_adapter::ClientConnectionListener;
-using ::transport_manager::transport_adapter::DeviceType;
using ::transport_manager::transport_adapter::ConnectionSPtr;
-using ::transport_manager::DeviceUID;
-using ::transport_manager::ApplicationHandle;
+using ::transport_manager::transport_adapter::DeviceScanner;
+using ::transport_manager::transport_adapter::DeviceType;
+using ::transport_manager::transport_adapter::ServerConnectionFactory;
+using ::transport_manager::transport_adapter::TransportAdapterImpl;
namespace test {
namespace components {
@@ -70,15 +72,17 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
}
virtual ~MockTransportAdapterImpl() {}
- virtual DeviceType GetDeviceType() const {
- return DeviceType::UNKNOWN;
- }
-
MOCK_CONST_METHOD0(Store, void());
MOCK_METHOD0(Restore, bool());
MOCK_CONST_METHOD1(FindDevice,
transport_manager::transport_adapter::DeviceSptr(
const DeviceUID& device_id));
+ MOCK_METHOD2(ConnectionStatusUpdated,
+ void(transport_manager::transport_adapter::DeviceSptr device,
+ ::transport_manager::ConnectionStatus status));
+ MOCK_CONST_METHOD0(GetDeviceType,
+ ::transport_manager::transport_adapter::DeviceType());
+ MOCK_METHOD0(RetryConnection, void());
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
index dce23189c8..f7bebf69c3 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -59,6 +59,12 @@ class MockTransportAdapterListener : public TransportAdapterListener {
const SearchDeviceError& error));
MOCK_METHOD1(OnFindNewApplicationsRequest,
void(const TransportAdapter* adapter));
+ MOCK_METHOD1(OnConnectionStatusUpdated,
+ void(const TransportAdapter* adapter));
+ MOCK_METHOD3(OnConnectPending,
+ void(const TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_id));
MOCK_METHOD1(OnDeviceListUpdated,
void(const TransportAdapter* transport_adapter));
MOCK_METHOD3(OnConnectDone,
diff --git a/src/components/transport_manager/test/network_interface_listener_test.cc b/src/components/transport_manager/test/network_interface_listener_test.cc
index 55a35fb4ea..c6e007b62a 100644
--- a/src/components/transport_manager/test/network_interface_listener_test.cc
+++ b/src/components/transport_manager/test/network_interface_listener_test.cc
@@ -3,8 +3,8 @@
#include <time.h>
#include "gtest/gtest.h"
-#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "utils/test_async_waiter.h"
#include "utils/threads/thread.h"
@@ -15,7 +15,7 @@ namespace transport_manager_test {
namespace {
const long kThreadStartWaitMsec = 10;
const uint32_t kStartNotificationTimeoutMsec = 500;
-}
+} // namespace
using ::testing::_;
using ::testing::AtLeast;
diff --git a/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
index da58466c29..97c8fac9c9 100644
--- a/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
+++ b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
@@ -15,7 +15,7 @@ namespace transport_manager_test {
namespace {
const long kThreadStartWaitMsec = 10;
const uint32_t kStartNotificationTimeoutMsec = 500;
-}
+} // namespace
using ::testing::_;
using ::testing::AtLeast;
@@ -207,7 +207,8 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressChanged) {
SetDummyInterfaceTable(entries1);
EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+ OnIPAddressUpdated(entries1[0].ipv4_address, ""))
+ .Times(1);
// this test case doesn't call Start() - we only check the behavior of
// NotifyIPAddresses()
@@ -216,7 +217,8 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressChanged) {
SetDummyInterfaceTable(entries2);
EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries2[0].ipv4_address, "")).Times(1);
+ OnIPAddressUpdated(entries2[0].ipv4_address, ""))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -239,7 +241,8 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressNotChanged) {
SetDummyInterfaceTable(entries1);
EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+ OnIPAddressUpdated(entries1[0].ipv4_address, ""))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -268,9 +271,10 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_GoesUnavailable) {
SetDummyInterfaceTable(entries1);
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries1[0].ipv4_address,
- entries1[0].ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, entries1[0].ipv6_address))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -297,9 +301,10 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Removed) {
SetDummyInterfaceTable(entries1);
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries1[0].ipv4_address,
- entries1[0].ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, entries1[0].ipv6_address))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -331,7 +336,8 @@ TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Added) {
SetDummyInterfaceTable(entries2);
EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries2[1].ipv4_address, "")).Times(1);
+ OnIPAddressUpdated(entries2[1].ipv4_address, ""))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -386,9 +392,10 @@ TEST_F(NetworkInterfaceListenerTest,
// dummy_int1 should not be selected
struct InterfaceEntry* expected = &entries[1];
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(expected->ipv4_address,
- expected->ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address, expected->ipv6_address))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -412,7 +419,8 @@ TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SkipEmptyInterface) {
// net_dummy2 should not be selected
struct InterfaceEntry* expected = &entries[0];
EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(expected->ipv4_address, "")).Times(1);
+ OnIPAddressUpdated(expected->ipv4_address, ""))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -434,9 +442,10 @@ TEST_F(NetworkInterfaceListenerTest,
// dummy_int1 should not be selected
struct InterfaceEntry* expected = &entries[1];
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(expected->ipv4_address,
- expected->ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address, expected->ipv6_address))
+ .Times(1);
SetDummyInterfaceTable(entries);
@@ -499,9 +508,10 @@ TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_EnableInterface) {
entries[0].flags |= IFF_RUNNING;
SetDummyInterfaceTable(entries);
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(entries[0].ipv4_address,
- entries[0].ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address, entries[0].ipv6_address))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
@@ -550,9 +560,10 @@ TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SwitchInterface) {
switched = &entries[0];
}
- EXPECT_CALL(mock_tcp_client_listener_,
- OnIPAddressUpdated(switched->ipv4_address,
- switched->ipv6_address)).Times(1);
+ EXPECT_CALL(
+ mock_tcp_client_listener_,
+ OnIPAddressUpdated(switched->ipv4_address, switched->ipv6_address))
+ .Times(1);
interface_listener_impl_->testCallNotifyIPAddresses();
diff --git a/src/components/transport_manager/test/sample_websocket_server.cc b/src/components/transport_manager/test/sample_websocket_server.cc
new file mode 100644
index 0000000000..917184a361
--- /dev/null
+++ b/src/components/transport_manager/test/sample_websocket_server.cc
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/cloud/sample_websocket_server.h"
+
+namespace {
+// Report a failure
+void Fail(char const* tag, boost::system::error_code ec) {
+ std::cerr << tag << ": " << ec.message() << "\n";
+}
+} // namespace
+
+namespace sample {
+namespace websocket {
+
+WSSession::WSServer::WSServer(tcp::socket&& socket)
+ : ws_(std::move(socket)), strand_(ws_.get_executor()) {}
+
+void WSSession::WSServer::AddURLRoute(const std::string& target) {
+ url_routes_.insert(ParseRouteFromTarget(target));
+}
+
+void WSSession::WSServer::Run() {
+ req_ = {};
+ http::async_read(
+ ws_.next_layer(),
+ buffer_,
+ req_,
+ std::bind(&WSServer::OnWebsocketHandshake, this, std::placeholders::_1));
+}
+
+void WSSession::WSServer::OnWebsocketHandshake(
+ const boost::system::error_code& ec) {
+ if (ec) {
+ return Fail("ERROR_HTTP_REQUEST_READ", ec);
+ }
+ if (websocket::is_upgrade(req_)) {
+ // Check target
+ std::string route = ParseRouteFromTarget(req_.target().to_string());
+ if (!CanHandleRoute(route)) {
+ auto error = boost::system::errc::make_error_code(
+ boost::system::errc::address_not_available);
+ ws_.next_layer().close();
+ return Fail("ERROR_INVALID_TARGET", error);
+ }
+ // Accept the websocket handshake
+ ws_.async_accept(
+ req_,
+ boost::asio::bind_executor(
+ strand_,
+ std::bind(&WSServer::OnAccept, this, std::placeholders::_1)));
+ }
+}
+
+void WSSession::WSServer::OnAccept(beast::error_code ec) {
+ if (ec) {
+ return Fail("ERROR_WEBSOCKET_HANDSHAKE", ec);
+ }
+}
+
+bool WSSession::WSServer::CanHandleRoute(const std::string& route) {
+ if (url_routes_.find(route) == url_routes_.end()) {
+ return false;
+ }
+ return true;
+}
+
+std::string WSSession::WSServer::ParseRouteFromTarget(
+ const std::string& target) {
+ std::string route = target;
+ // Remove fragment
+ auto fragment_pos = route.find('#');
+ if (fragment_pos != std::string::npos) {
+ route = route.substr(0, fragment_pos);
+ }
+ // Remove query
+ auto query_pos = route.find('?');
+ if (query_pos != std::string::npos) {
+ route = route.substr(0, query_pos);
+ }
+
+ return route;
+}
+
+WSSession::WSSession(const std::string& address, uint16_t port)
+ : address_(address)
+ , port_(port)
+ , acceptor_(ioc_)
+ , socket_(ioc_)
+ , ws_(nullptr) {
+ endpoint_ = {boost::asio::ip::make_address(address), port};
+ boost::system::error_code error;
+
+ // Open the acceptor
+ acceptor_.open(endpoint_.protocol(), error);
+ if (error) {
+ Fail("ERROR_ACCEPTOR_OPEN", error);
+ return;
+ }
+
+ // Allow address reuse
+ acceptor_.set_option(boost::asio::socket_base::reuse_address(true), error);
+ if (error) {
+ Fail("ERROR_SET_OPTION", error);
+ return;
+ }
+
+ // Bind to the server address
+ acceptor_.bind(endpoint_, error);
+ if (error) {
+ Fail("ERROR_BIND", error);
+ return;
+ }
+
+ // Start listening for connections
+ acceptor_.listen(boost::asio::socket_base::max_listen_connections, error);
+ if (error) {
+ Fail("ERROR_LISTEN", error);
+ return;
+ }
+}
+
+void WSSession::Run() {
+ if (acceptor_.is_open()) {
+ acceptor_.async_accept(
+ socket_, std::bind(&WSSession::on_accept, this, std::placeholders::_1));
+ ioc_.run();
+ }
+}
+
+void WSSession::Stop() {
+ try {
+ ioc_.stop();
+ acceptor_.close();
+ } catch (...) {
+ std::cerr << "Failed to close connection" << std::endl;
+ }
+}
+
+void WSSession::AddRoute(const std::string& route) {
+ if (ws_ == nullptr) {
+ buffered_routes_.push(route);
+ return;
+ }
+ ws_->AddURLRoute(route);
+}
+
+void WSSession::on_accept(boost::system::error_code ec) {
+ if (ec) {
+ Fail("ERROR_ON_ACCEPT", ec);
+ ioc_.stop();
+ return;
+ }
+
+ // Make websocket object and start
+ ws_ = std::make_shared<WSServer>(std::move(socket_));
+ // Load routes stored in buffer
+ while (!buffered_routes_.empty()) {
+ ws_->AddURLRoute(buffered_routes_.front());
+ buffered_routes_.pop();
+ }
+ ws_->Run();
+}
+
+WSSSession::WSSServer::WSSServer(tcp::socket&& socket, ssl::context& ctx)
+ : wss_(std::move(socket), ctx) {}
+
+void WSSSession::WSSServer::AddURLRoute(const std::string& target) {
+ url_routes_.insert(ParseRouteFromTarget(target));
+}
+void WSSSession::WSSServer::Run() {
+ // Perform the SSL handshake
+ wss_.next_layer().async_handshake(
+ ssl::stream_base::server,
+ std::bind(&WSSServer::OnSSLHandshake, this, std::placeholders::_1));
+}
+
+void WSSSession::WSSServer::OnSSLHandshake(beast::error_code ec) {
+ if (ec) {
+ return Fail("ERROR_SSL_HANDSHAKE", ec);
+ }
+
+ req_ = {};
+ http::async_read(
+ wss_.next_layer(),
+ buffer_,
+ req_,
+ std::bind(&WSSServer::OnWebsocketHandshake, this, std::placeholders::_1));
+}
+
+void WSSSession::WSSServer::OnWebsocketHandshake(
+ const boost::system::error_code& ec) {
+ if (ec) {
+ return Fail("ERROR_HTTP_REQUEST_READ", ec);
+ }
+ if (websocket::is_upgrade(req_)) {
+ // Check target
+ std::string route = ParseRouteFromTarget(req_.target().to_string());
+ if (!CanHandleRoute(route)) {
+ auto error = boost::system::errc::make_error_code(
+ boost::system::errc::address_not_available);
+ wss_.next_layer().next_layer().close();
+ return Fail("ERROR_INVALID_TARGET", error);
+ }
+ // Accept the websocket handshake
+ wss_.async_accept(
+ req_, std::bind(&WSSServer::OnAccept, this, std::placeholders::_1));
+ }
+}
+
+void WSSSession::WSSServer::OnAccept(beast::error_code ec) {
+ if (ec) {
+ return Fail("ERROR_ON_ACCEPT", ec);
+ }
+}
+
+bool WSSSession::WSSServer::CanHandleRoute(const std::string& route) {
+ if (url_routes_.find(route) == url_routes_.end()) {
+ return false;
+ }
+ return true;
+}
+
+std::string WSSSession::WSSServer::ParseRouteFromTarget(
+ const std::string& target) {
+ std::string route = target;
+ // Remove fragment
+ auto fragment_pos = route.find('#');
+ if (fragment_pos != std::string::npos) {
+ route = route.substr(0, fragment_pos);
+ }
+ // Remove query
+ auto query_pos = route.find('?');
+ if (query_pos != std::string::npos) {
+ route = route.substr(0, query_pos);
+ }
+
+ return route;
+}
+
+WSSSession::WSSSession(const std::string& address,
+ uint16_t port,
+ const std::string& certificate,
+ const std::string& private_key)
+ : acceptor_(ioc_)
+ , socket_(ioc_)
+ , ctx_(ssl::context::sslv23_server)
+ , wss_(nullptr) {
+ beast::error_code ec;
+ endpoint_ = {boost::asio::ip::make_address(address), port};
+
+ // Load the certificate
+ ctx_.use_certificate(
+ boost::asio::buffer(certificate.c_str(), certificate.size()),
+ ssl::context::file_format::pem,
+ ec);
+ if (ec) {
+ Fail("ERROR_USE_CERTIFICATE", ec);
+ return;
+ }
+
+ // Load the private key
+ ctx_.use_rsa_private_key(
+ boost::asio::buffer(private_key.c_str(), private_key.size()),
+ ssl::context::file_format::pem,
+ ec);
+ if (ec) {
+ Fail("ERROR_USE_RSA_PRIVATE_KEY", ec);
+ return;
+ }
+
+ // Open the acceptor
+ acceptor_.open(endpoint_.protocol(), ec);
+ if (ec) {
+ Fail("EEROR_ACCEPTOR_OPEN", ec);
+ return;
+ }
+
+ // Allow address reuse
+ acceptor_.set_option(net::socket_base::reuse_address(true), ec);
+ if (ec) {
+ Fail("ERROR_SET_OPTION", ec);
+ return;
+ }
+
+ // Bind to the server address
+ acceptor_.bind(endpoint_, ec);
+ if (ec) {
+ Fail("ERROR_BIND", ec);
+ return;
+ }
+
+ // Start listening for connections
+ acceptor_.listen(net::socket_base::max_listen_connections, ec);
+ if (ec) {
+ Fail("ERROR_LISTEN", ec);
+ return;
+ }
+}
+
+// Start accepting incoming connections
+void WSSSession::Run() {
+ do_accept();
+}
+
+void WSSSession::Stop() {
+ try {
+ ioc_.stop();
+ acceptor_.close();
+ } catch (...) {
+ std::cerr << "Failed to close connection" << std::endl;
+ }
+}
+
+void WSSSession::AddRoute(const std::string& route) {
+ if (wss_ == nullptr) {
+ buffered_routes_.push(route);
+ return;
+ }
+ wss_->AddURLRoute(route);
+}
+
+void WSSSession::do_accept() {
+ if (acceptor_.is_open()) {
+ acceptor_.async_accept(
+ socket_,
+ std::bind(&WSSSession::on_accept, this, std::placeholders::_1));
+ ioc_.run();
+ }
+}
+
+void WSSSession::on_accept(boost::system::error_code ec) {
+ if (ec) {
+ Fail("ERROR_ON_ACCEPT", ec);
+ ioc_.stop();
+ return;
+ }
+ // Create the session and run it
+ wss_ = std::make_shared<WSSServer>(std::move(socket_), ctx_);
+ // Load routes stored in buffer
+ while (!buffered_routes_.empty()) {
+ wss_->AddURLRoute(buffered_routes_.front());
+ buffered_routes_.pop();
+ }
+ wss_->Run();
+}
+
+} // namespace websocket
+} // namespace sample
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
index 5205d6ae3c..d524b3eb6a 100644
--- a/src/components/transport_manager/test/tcp_client_listener_test.cc
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -33,16 +33,16 @@
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
-#include <unistd.h>
#include <time.h>
+#include <unistd.h>
#include "gtest/gtest.h"
-#include "transport_manager/transport_adapter/mock_transport_adapter.h"
-#include "transport_manager/tcp/tcp_client_listener.h"
-#include "transport_manager/tcp/network_interface_listener.h"
#include "transport_manager/mock_transport_manager.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
#include "transport_manager/transport_adapter/mock_device.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "utils/test_async_waiter.h"
#include "utils/threads/thread.h"
@@ -60,7 +60,7 @@ using namespace ::transport_manager::transport_adapter;
namespace {
const long kThreadStartWaitMsec = 10;
const uint32_t kConnectionCreatedTimeoutMsec = 200;
-}
+} // namespace
class MockTransportAdapterController : public TransportAdapterController {
public:
@@ -69,10 +69,16 @@ class MockTransportAdapterController : public TransportAdapterController {
MOCK_METHOD1(SearchDeviceDone, void(const DeviceVector& devices));
MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error));
MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_CONST_METHOD2(FindPendingConnection,
+ ConnectionSPtr(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
MOCK_METHOD3(ConnectionCreated,
void(ConnectionSPtr connection,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle));
+ MOCK_METHOD2(ConnectPending,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
MOCK_METHOD2(ConnectDone,
void(const DeviceUID& device_handle,
const ApplicationHandle& app_handle));
@@ -389,7 +395,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_changed) {
expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_1)).Times(1);
+ TransportConfigUpdated(expected_config_1))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
@@ -400,7 +407,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_changed) {
expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_2)).Times(1);
+ TransportConfigUpdated(expected_config_2))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
@@ -434,7 +442,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_same) {
expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_1)).Times(1);
+ TransportConfigUpdated(expected_config_1))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
@@ -479,7 +488,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_disabled) {
expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_1)).Times(1);
+ TransportConfigUpdated(expected_config_1))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
@@ -490,7 +500,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_disabled) {
expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_2)).Times(1);
+ TransportConfigUpdated(expected_config_2))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
@@ -524,7 +535,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_1)).Times(1);
+ TransportConfigUpdated(expected_config_1))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
@@ -535,7 +547,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_2)).Times(1);
+ TransportConfigUpdated(expected_config_2))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
@@ -546,7 +559,8 @@ TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
expected_config_3.insert(std::make_pair(tc_tcp_port, test_port));
EXPECT_CALL(adapter_controller_mock_,
- TransportConfigUpdated(expected_config_3)).Times(1);
+ TransportConfigUpdated(expected_config_3))
+ .Times(1);
tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_3, test_ipv6_addr);
diff --git a/src/components/transport_manager/test/tcp_device_test.cc b/src/components/transport_manager/test/tcp_device_test.cc
index 55fa5ac5d3..f52270d1ee 100644
--- a/src/components/transport_manager/test/tcp_device_test.cc
+++ b/src/components/transport_manager/test/tcp_device_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "transport_manager/tcp/tcp_device.h"
+#include "gtest/gtest.h"
#include "transport_manager/transport_adapter/device.h"
namespace test {
diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
index 959180948a..f5f6cc38c8 100644
--- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -30,24 +30,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "transport_manager/tcp/tcp_transport_adapter.h"
-#include "resumption/last_state_impl.h"
+#include "gtest/gtest.h"
#include "protocol/raw_message.h"
+#include "resumption/last_state_impl.h"
+#include "transport_manager/mock_transport_manager_settings.h"
+#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
#include "transport_manager/transport_adapter/connection.h"
-#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
-#include "transport_manager/transport_adapter/mock_device.h"
#include "transport_manager/transport_adapter/mock_connection.h"
-#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
-#include "transport_manager/mock_transport_manager_settings.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
namespace test {
namespace components {
namespace transport_manager_test {
+using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::_;
using namespace ::protocol_handler;
using namespace ::transport_manager;
diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc
index a5d08035ae..0813448e91 100644
--- a/src/components/transport_manager/test/transport_adapter_listener_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -76,7 +76,8 @@ TEST_F(TransportAdapterListenerTest, OnCommunicationError) {
ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_COMMUNICATION_ERROR,
&adapter_mock,
dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnCommunicationError(&adapter_mock, dev_id, app_handle);
}
@@ -195,7 +196,8 @@ TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) {
IsEvent(EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
&adapter_mock,
"",
- 0))).WillOnce(Return(E_SUCCESS));
+ 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnFindNewApplicationsRequest(&adapter_mock);
}
@@ -225,7 +227,8 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
&adapter_mock,
dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnUnexpectedDisconnect(
&adapter_mock, dev_id, app_handle, err);
}
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 9e602332c6..56386db201 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -31,32 +31,35 @@
*/
#include "gtest/gtest.h"
-#include "transport_manager/transport_adapter/mock_device_scanner.h"
+#include "transport_manager/mock_transport_manager_settings.h"
#include "transport_manager/transport_adapter/mock_client_connection_listener.h"
-#include "transport_manager/transport_adapter/mock_server_connection_factory.h"
-#include "transport_manager/transport_adapter/mock_device.h"
#include "transport_manager/transport_adapter/mock_connection.h"
-#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+#include "transport_manager/transport_adapter/mock_device_scanner.h"
+#include "transport_manager/transport_adapter/mock_server_connection_factory.h"
#include "transport_manager/transport_adapter/mock_transport_adapter_impl.h"
-#include "transport_manager/mock_transport_manager_settings.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
+#include "utils/test_async_waiter.h"
+#include "protocol/raw_message.h"
+#include "transport_manager/cloud/cloud_device.h"
+#include "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "transport_manager/transport_adapter/transport_adapter_listener.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
-#include "transport_manager/transport_adapter/connection.h"
-#include "protocol/raw_message.h"
-#include "resumption/last_state_impl.h"
#include "config_profile/profile.h"
+#include "resumption/last_state_impl.h"
namespace test {
namespace components {
namespace transport_manager_test {
-using ::testing::Return;
-using ::testing::ReturnRef;
using ::testing::_;
using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
using namespace ::transport_manager;
using namespace ::protocol_handler;
@@ -73,11 +76,149 @@ class TransportAdapterTest : public ::testing::Test {
.WillByDefault(Return(true));
}
+ void SetDefaultExpectations(MockTransportAdapterImpl& adapter) {
+ ON_CALL(adapter, GetDeviceType())
+ .WillByDefault(Return(DeviceType::UNKNOWN));
+ }
+
NiceMock<MockTransportManagerSettings> transport_manager_settings;
resumption::LastStateImpl last_state_;
std::string dev_id;
std::string uniq_id;
int app_handle;
+
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ struct TestEndpoint {
+ std::string test_string;
+ std::string host;
+ std::string port;
+ std::string target;
+ };
+
+ CloudAppProperties test_cloud_properties_{.endpoint = "",
+ .certificate = "no cert",
+ .enabled = true,
+ .auth_token = "no auth token",
+ .cloud_transport_type = "WS",
+ .hybrid_app_preference = "CLOUD"};
+ std::vector<std::string> kWebsocketProtocols{"ws://", "wss://"};
+
+ std::vector<TestEndpoint> kValidTestEndpoints{
+ // Host and port
+ TestEndpoint{"localhost:40/", "localhost", "40", "/"},
+ TestEndpoint{"[::1]:40", "[::1]", "40", "/"},
+ TestEndpoint{"username:password@localhost.com:80",
+ "username:password@localhost.com",
+ "80",
+ "/"},
+ // With path
+ TestEndpoint{
+ "localhost:440/file.html", "localhost", "440", "/file.html/"},
+ TestEndpoint{"101.180.1.213:23234/folder/img_index(1)/file.html",
+ "101.180.1.213",
+ "23234",
+ "/folder/img_index(1)/file.html/"},
+ TestEndpoint{"[2600:3c00::f03c:91ff:fe73:2b08]:31333/folder/img_index(1)/"
+ "file.html",
+ "[2600:3c00::f03c:91ff:fe73:2b08]",
+ "31333",
+ "/folder/img_index(1)/file.html/"},
+ // With query and/or fragment
+ TestEndpoint{
+ "username@localhost:22/folder/img_index(1)/"
+ "file.html?eventId=2345&eventName='some%20event'&eventSuccess=true",
+ "username@localhost",
+ "22",
+ "/folder/img_index(1)/file.html/"
+ "?eventId=2345&eventName='some%20event'&eventSuccess="
+ "true"},
+ TestEndpoint{"username@localhost.com:80/folder/img_index(1)/"
+ "file.html?eventId=2345&eventName='some%20event'&"
+ "eventSuccess=true#section1",
+ "username@localhost.com",
+ "80",
+ "/folder/img_index(1)/file.html/"
+ "?eventId=2345&eventName='some%20event'&eventSuccess=true#"
+ "section1"},
+ TestEndpoint{
+ "localhost:443/"
+ "?eventId=2345&eventName='some%20event'&eventSuccess=true#section1",
+ "localhost",
+ "443",
+ "/?eventId=2345&eventName='some%20event'&eventSuccess=true#"
+ "section1"},
+ TestEndpoint{"a1-b2.com:443/folder/img_index(1)/file.html#section1",
+ "a1-b2.com",
+ "443",
+ "/folder/img_index(1)/file.html/#section1"},
+ TestEndpoint{"a1-b2.com:23#section1", "a1-b2.com", "23", "/#section1"}};
+
+ std::vector<TestEndpoint> kInvalidTestEndpoints{
+ // Invalid hostname
+ TestEndpoint{"/localhost:80", "localhost", "80", "/"},
+ TestEndpoint{"local?host:80", "local?host", "80", "/"},
+ TestEndpoint{"local#host:80", "local#host", "80", "/"},
+ TestEndpoint{"local\%host:80", "local\%host", "80", "/"},
+ TestEndpoint{"local\\host:80", "local\\host", "80", "/"},
+ TestEndpoint{"local/host:80", "local/host", "80", "/"},
+ TestEndpoint{"local host:80", "local host", "80", "/"},
+ TestEndpoint{"local\thost:80", "local\thost", "80", "/"},
+ TestEndpoint{":80#section1", "", "80", "/#section1"},
+ // Invalid port
+ TestEndpoint{"username:password@localhost.com",
+ "username:password@localhost.com",
+ "",
+ "/"},
+ TestEndpoint{"username:password@localhost.com:5",
+ "username:password@localhost.com",
+ "5",
+ "/"},
+ TestEndpoint{"201.123.213:2h32/", "201.123.213", "2h32", "/"}};
+ std::vector<TestEndpoint> kIncorrectTestEndpoints{
+ // Incorrect port number
+ TestEndpoint{"201.123.1.213:232454/folder/img_index(1)/file.html",
+ "201.123.1.213",
+ "232454",
+ "/folder/img_index(1)/file.html/"},
+ // Incorrect path
+ TestEndpoint{"201.123.1.213:232//folder/img_index(1)/file.html",
+ "201.123.1.213",
+ "232",
+ "//folder/img_index(1)/file.html/"},
+ TestEndpoint{"201.123.1.213:232/folder/img_index(1)//file.html",
+ "201.123.1.213",
+ "232",
+ "/folder/img_index(1)//file.html/"},
+ TestEndpoint{"201.123.1.213:232/folder/img index(1)//file.html",
+ "201.123.1.213",
+ "232",
+ "/folder/img index(1)//file.html/"},
+ TestEndpoint{"201.123.1.213:232/folder/img\tindex(1)//file.html",
+ "201.123.1.213",
+ "232",
+ "/folder/img\tindex(1)//file.html/"},
+ // Incorrect query
+ TestEndpoint{"username@localhost:443/?eventId=2345&eventName='some "
+ "event'&eventSuccess=true",
+ "username@localhost",
+ "443",
+ "?eventId=2345&eventName='some event'&eventSuccess=true"},
+ TestEndpoint{"username@localhost:443/"
+ "?eventId=2345&eventName='some\tevent'&eventSuccess=true",
+ "username@localhost",
+ "443",
+ "?eventId=2345&eventName='some\tevent'&eventSuccess=true"},
+ // Incorrect fragment
+ TestEndpoint{"a1(b2).com:80/folder/img_index(1)/file.html#section 1",
+ "a1(b2).com",
+ "80",
+ "/folder/img_index(1)/file.html#section 1"},
+ TestEndpoint{"a1(b2).com:80/folder/img_index(1)/file.html#section\t1",
+ "a1(b2).com",
+ "80",
+ "/folder/img_index(1)/file.html#section\t1"}};
+
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
};
TEST_F(TransportAdapterTest, Init) {
@@ -89,6 +230,7 @@ TEST_F(TransportAdapterTest, Init) {
clientMock,
last_state_,
transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -123,6 +265,7 @@ TEST_F(TransportAdapterTest, SearchDevices_DeviceNotInitialized) {
MockDeviceScanner* dev_mock = new MockDeviceScanner();
MockTransportAdapterImpl transport_adapter(
dev_mock, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -138,6 +281,7 @@ TEST_F(TransportAdapterTest, SearchDevices_DeviceInitialized) {
MockDeviceScanner* dev_mock = new MockDeviceScanner();
MockTransportAdapterImpl transport_adapter(
dev_mock, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -153,6 +297,7 @@ TEST_F(TransportAdapterTest, SearchDevices_DeviceInitialized) {
TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -169,6 +314,7 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
TEST_F(TransportAdapterTest, SearchDeviceFailed) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -183,6 +329,7 @@ TEST_F(TransportAdapterTest, SearchDeviceFailed) {
TEST_F(TransportAdapterTest, AddDevice) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -200,6 +347,7 @@ TEST_F(TransportAdapterTest, Connect_ServerNotSupported) {
MockClientConnectionListener* clientMock = new MockClientConnectionListener();
MockTransportAdapterImpl transport_adapter(
NULL, NULL, clientMock, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -217,6 +365,7 @@ TEST_F(TransportAdapterTest, Connect_ServerNotInitialized) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -234,6 +383,7 @@ TEST_F(TransportAdapterTest, Connect_Success) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -252,6 +402,7 @@ TEST_F(TransportAdapterTest, Connect_DeviceAddedTwice) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -274,6 +425,7 @@ TEST_F(TransportAdapterTest, Connect_DeviceAddedTwice) {
TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -292,12 +444,14 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::FAIL, res);
+ EXPECT_NE(ConnectionStatus::CONNECTED, mockdev->connection_status());
}
TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -318,6 +472,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -341,14 +496,53 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
EXPECT_CALL(*serverMock, Terminate());
}
+TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded_ConnectFailedRetry) {
+ MockServerConnectionFactory* server_mock = new MockServerConnectionFactory();
+ MockTransportAdapterImpl transport_adapter(
+ NULL, server_mock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
+
+ EXPECT_CALL(*server_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> dev_list = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, dev_list.size());
+ EXPECT_EQ(uniq_id, dev_list[0]);
+
+ int app_handle = 1;
+ std::vector<int> int_list = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(int_list));
+
+ EXPECT_CALL(*server_mock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*server_mock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::FAIL));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, GetDeviceType())
+ .WillOnce(Return(DeviceType::CLOUD_WEBSOCKET));
+ EXPECT_CALL(transport_manager_settings, cloud_app_max_retry_attempts())
+ .WillOnce(Return(0));
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::FAIL, res);
+ EXPECT_EQ(ConnectionStatus::PENDING, mockdev->connection_status());
+
+ EXPECT_CALL(*server_mock, Terminate());
+}
+
TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -372,6 +566,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
// Try to connect device second time
@@ -382,6 +577,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error newres = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, newres);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
EXPECT_CALL(*serverMock, Terminate());
}
@@ -390,6 +586,7 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -416,10 +613,221 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
EXPECT_CALL(*serverMock, Terminate());
}
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+TEST_F(TransportAdapterTest, FindPending) {
+ MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
+ MockTransportAdapterImpl transport_adapter(
+ NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ MockTransportAdapterListener mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
+ DeviceVector devices{mockdev};
+ transport_adapter.SearchDeviceDone(devices);
+
+ // Create cloud app device with connection in pending state
+ std::shared_ptr<MockConnection> connection =
+ std::make_shared<MockConnection>();
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ transport_adapter.ConnectionCreated(connection, uniq_id, 0);
+ transport_adapter.ConnectPending(uniq_id, 0);
+
+ std::vector<std::string> dev_list = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, dev_list.size());
+ EXPECT_EQ(uniq_id, dev_list[0]);
+ EXPECT_EQ(ConnectionStatus::PENDING, mockdev->connection_status());
+
+ ConnectionSPtr mock_connection =
+ transport_adapter.FindPendingConnection(uniq_id, 0);
+ ASSERT_TRUE(mock_connection.use_count() != 0);
+
+ ConnectionSPtr mock_connection_fake =
+ transport_adapter.FindPendingConnection(uniq_id, 1);
+ ASSERT_TRUE(mock_connection_fake.use_count() == 0);
+}
+
+TEST_F(TransportAdapterTest,
+ Pending_Connect_Disconnect_ConnectDoneSuccess_PendingDeviceAdded) {
+ MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
+ MockTransportAdapterImpl transport_adapter(
+ NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ MockTransportAdapterListener mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
+ DeviceVector devices{mockdev};
+ transport_adapter.SearchDeviceDone(devices);
+
+ // Create cloud app device with connection in pending state
+ std::shared_ptr<MockConnection> connection =
+ std::make_shared<MockConnection>();
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ transport_adapter.ConnectionCreated(connection, uniq_id, 0);
+ transport_adapter.ConnectPending(uniq_id, 0);
+
+ std::vector<std::string> dev_list = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, dev_list.size());
+ EXPECT_EQ(uniq_id, dev_list[0]);
+ EXPECT_EQ(ConnectionStatus::PENDING, mockdev->connection_status());
+
+ // Connect cloud app
+ int app_handle = 0;
+ std::vector<int> int_list = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(int_list));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+
+ EXPECT_EQ(TransportAdapter::OK, res);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
+
+ auto mock_connection = std::make_shared<MockConnection>();
+ transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
+
+ EXPECT_CALL(transport_adapter, Store());
+ transport_adapter.ConnectDone(dev_id, app_handle);
+
+ // Disconnect cloud app
+ EXPECT_CALL(*mock_connection, Disconnect())
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error new_res =
+ transport_adapter.Disconnect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, new_res);
+
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, GetDeviceType())
+ .WillOnce(Return(DeviceType::CLOUD_WEBSOCKET));
+ EXPECT_CALL(mock_listener,
+ OnDisconnectDeviceDone(&transport_adapter, uniq_id));
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter)).Times(2);
+ EXPECT_CALL(transport_adapter, Store());
+ transport_adapter.DisconnectDone(uniq_id, 0);
+
+ dev_list = transport_adapter.GetDeviceList();
+ ASSERT_EQ(0u, dev_list.size());
+
+ // Recreate device and put cloud app back into pending state
+ std::shared_ptr<MockDevice> mockdev2 =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
+ DeviceVector devices2{mockdev2};
+ transport_adapter.SearchDeviceDone(devices2);
+
+ std::shared_ptr<MockConnection> connection2 =
+ std::make_shared<MockConnection>();
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
+ .WillOnce(Return(mockdev2));
+ transport_adapter.ConnectionCreated(connection2, uniq_id, 0);
+ transport_adapter.ConnectPending(uniq_id, 0);
+
+ dev_list = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, dev_list.size());
+ EXPECT_EQ(uniq_id, dev_list[0]);
+ EXPECT_EQ(ConnectionStatus::PENDING, mockdev2->connection_status());
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, WebsocketEndpointParsing_SUCCESS) {
+ std::shared_ptr<CloudWebsocketTransportAdapter> cta =
+ std::make_shared<CloudWebsocketTransportAdapter>(
+ last_state_, transport_manager_settings);
+
+ for (auto protocol : kWebsocketProtocols) {
+ for (auto endpoint : kValidTestEndpoints) {
+ test_cloud_properties_.endpoint = protocol + endpoint.test_string;
+ cta->SetAppCloudTransportConfig("cloud app", test_cloud_properties_);
+
+ auto ta = std::dynamic_pointer_cast<TransportAdapter>(cta);
+ ASSERT_NE(ta.use_count(), 0);
+
+ ta->CreateDevice(test_cloud_properties_.endpoint);
+
+ auto device = cta->FindDevice(test_cloud_properties_.endpoint);
+ ASSERT_NE(device.use_count(), 0);
+
+ std::shared_ptr<CloudDevice> cloud_device =
+ std::dynamic_pointer_cast<CloudDevice>(device);
+ ASSERT_NE(cloud_device.use_count(), 0);
+
+ EXPECT_EQ(cloud_device->GetHost(), endpoint.host);
+ EXPECT_EQ(cloud_device->GetPort(), endpoint.port);
+ EXPECT_EQ(cloud_device->GetTarget(), endpoint.target);
+ }
+ }
+}
+TEST_F(TransportAdapterTest, WebsocketEndpointParsing_INVALID) {
+ std::shared_ptr<CloudWebsocketTransportAdapter> cta =
+ std::make_shared<CloudWebsocketTransportAdapter>(
+ last_state_, transport_manager_settings);
+
+ for (auto protocol : kWebsocketProtocols) {
+ for (auto endpoint : kInvalidTestEndpoints) {
+ test_cloud_properties_.endpoint = protocol + endpoint.test_string;
+ cta->SetAppCloudTransportConfig("cloud app", test_cloud_properties_);
+
+ auto ta = std::dynamic_pointer_cast<TransportAdapter>(cta);
+ ASSERT_NE(ta.use_count(), 0);
+
+ ta->CreateDevice(test_cloud_properties_.endpoint);
+
+ auto device = cta->FindDevice(test_cloud_properties_.endpoint);
+ EXPECT_EQ(device.use_count(), 0);
+ }
+ }
+}
+TEST_F(TransportAdapterTest, WebsocketEndpointParsing_INCORRECT) {
+ std::shared_ptr<CloudWebsocketTransportAdapter> cta =
+ std::make_shared<CloudWebsocketTransportAdapter>(
+ last_state_, transport_manager_settings);
+
+ for (auto protocol : kWebsocketProtocols) {
+ for (auto endpoint : kIncorrectTestEndpoints) {
+ test_cloud_properties_.endpoint = protocol + endpoint.test_string;
+ cta->SetAppCloudTransportConfig("cloud app", test_cloud_properties_);
+
+ auto ta = std::dynamic_pointer_cast<TransportAdapter>(cta);
+ ASSERT_NE(ta.use_count(), 0);
+
+ ta->CreateDevice(test_cloud_properties_.endpoint);
+
+ auto device = cta->FindDevice(test_cloud_properties_.endpoint);
+ ASSERT_NE(device.use_count(), 0);
+
+ std::shared_ptr<CloudDevice> cloud_device =
+ std::dynamic_pointer_cast<CloudDevice>(device);
+ ASSERT_NE(cloud_device.use_count(), 0);
+
+ EXPECT_FALSE(cloud_device->GetHost() == endpoint.host &&
+ cloud_device->GetPort() == endpoint.port &&
+ cloud_device->GetTarget() == endpoint.target);
+ }
+ }
+}
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -439,9 +847,11 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
- EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
+ .WillRepeatedly(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
@@ -451,6 +861,7 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
TransportAdapter::Error new_res = transport_adapter.DisconnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, new_res);
+ EXPECT_EQ(ConnectionStatus::CLOSING, mockdev->connection_status());
EXPECT_CALL(*serverMock, Terminate());
}
@@ -459,6 +870,7 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -484,6 +896,7 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
.WillOnce(Return(TransportAdapter::OK));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
+ EXPECT_EQ(ConnectionStatus::CONNECTED, mockdev->connection_status());
std::shared_ptr<MockConnection> mock_connection =
std::make_shared<MockConnection>();
@@ -507,6 +920,7 @@ TEST_F(TransportAdapterTest, AbortedConnectSuccess) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -533,6 +947,7 @@ TEST_F(TransportAdapterTest, SendData) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
dev_mock, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -574,6 +989,7 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) {
clientMock,
last_state_,
transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -609,6 +1025,7 @@ TEST_F(TransportAdapterTest, StartClientListening_ClientNotInitialized) {
MockClientConnectionListener* clientMock = new MockClientConnectionListener();
MockTransportAdapterImpl transport_adapter(
dev_mock, NULL, clientMock, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -630,6 +1047,7 @@ TEST_F(TransportAdapterTest, StartClientListening) {
MockClientConnectionListener* clientMock = new MockClientConnectionListener();
MockTransportAdapterImpl transport_adapter(
dev_mock, NULL, clientMock, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -656,6 +1074,7 @@ TEST_F(TransportAdapterTest, StopClientListening_Success) {
clientMock,
last_state_,
transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -690,6 +1109,7 @@ TEST_F(TransportAdapterTest, FindNewApplicationsRequest) {
clientMock,
last_state_,
transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
@@ -711,6 +1131,7 @@ TEST_F(TransportAdapterTest, FindNewApplicationsRequest) {
TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -735,6 +1156,7 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) {
MockServerConnectionFactory* serverMock = new MockServerConnectionFactory();
MockTransportAdapterImpl transport_adapter(
NULL, serverMock, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
@@ -764,6 +1186,7 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
std::shared_ptr<MockDevice> mock_device =
std::make_shared<MockDevice>("test_device_name", "test_device_uid0");
@@ -783,6 +1206,7 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
std::shared_ptr<MockDevice> mock_device =
std::make_shared<MockDevice>("test_device_name", device_uid);
@@ -814,6 +1238,7 @@ TEST_F(TransportAdapterTest, StopDevice) {
TEST_F(TransportAdapterTest, TransportConfigUpdated) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
@@ -832,6 +1257,7 @@ TEST_F(TransportAdapterTest, TransportConfigUpdated) {
TEST_F(TransportAdapterTest, GetTransportConfigration) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
+ SetDefaultExpectations(transport_adapter);
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
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 8e8a964228..e102458b96 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -30,20 +30,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_default.h"
-#include "transport_manager/mock_transport_manager_settings.h"
+#include "gtest/gtest.h"
#include "resumption/mock_last_state.h"
+#include "transport_manager/mock_transport_manager_settings.h"
+#include "transport_manager/transport_manager.h"
namespace test {
namespace components {
namespace transport_manager_test {
using resumption_test::MockLastState;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
namespace {
const std::string kDeviceName = "name";
@@ -57,6 +57,22 @@ const std::string kTransportManager = "TransportManager";
const std::string kTcpAdapter = "TcpAdapter";
const std::string kBluetoothAdapter = "BluetoothAdapter";
const std::string kDevices = "devices";
+std::vector<uint8_t> kBTUUID = {0x93,
+ 0x6D,
+ 0xA0,
+ 0x1F,
+ 0x9A,
+ 0xBD,
+ 0x4D,
+ 0x9D,
+ 0x80,
+ 0xC7,
+ 0x02,
+ 0xAF,
+ 0x85,
+ 0xC8,
+ 0x22,
+ 0xA8};
} // namespace
TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
@@ -78,6 +94,8 @@ TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
EXPECT_CALL(transport_manager_settings,
transport_manager_tcp_adapter_network_interface())
.WillRepeatedly(ReturnRef(network_interface));
+ EXPECT_CALL(transport_manager_settings, bluetooth_uuid())
+ .WillRepeatedly(Return(kBTUUID.data()));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
@@ -114,6 +132,8 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed) {
EXPECT_CALL(transport_manager_settings,
transport_manager_tcp_adapter_network_interface())
.WillRepeatedly(ReturnRef(network_interface));
+ EXPECT_CALL(transport_manager_settings, bluetooth_uuid())
+ .WillRepeatedly(Return(kBTUUID.data()));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
@@ -149,6 +169,8 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed_InvalidPort) {
EXPECT_CALL(transport_manager_settings,
transport_manager_tcp_adapter_network_interface())
.WillRepeatedly(ReturnRef(network_interface));
+ EXPECT_CALL(transport_manager_settings, bluetooth_uuid())
+ .WillRepeatedly(Return(kBTUUID.data()));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index 5f13adcd44..3c3e336d0a 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -30,26 +30,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "transport_manager/transport_manager_impl.h"
#include <string>
#include "gtest/gtest.h"
#include "protocol/raw_message.h"
+#include "resumption/last_state_impl.h"
#include "transport_manager/common.h"
-#include "transport_manager/transport_manager_impl.h"
#include "transport_manager/mock_telemetry_observer.h"
-#include "transport_manager/mock_transport_manager_listener.h"
-#include "transport_manager/mock_telemetry_observer.h"
-#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/mock_transport_manager_impl.h"
+#include "transport_manager/mock_transport_manager_listener.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "resumption/last_state_impl.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "utils/test_async_waiter.h"
using ::testing::_;
using ::testing::AtLeast;
+using ::testing::DoAll;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::DoAll;
using ::protocol_handler::RawMessage;
using ::protocol_handler::RawMessagePtr;
@@ -64,7 +63,7 @@ namespace {
const std::string kAppStorageFolder = "app_storage_folder";
const std::string kAppInfoFolder = "app_info_folder";
const uint32_t kAsyncExpectationsTimeout = 10000u;
-}
+} // namespace
class TransportManagerImplTest : public ::testing::Test {
protected:
@@ -190,6 +189,26 @@ class TransportManagerImplTest : public ::testing::Test {
tm_.TestHandle(test_event);
}
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ void HandlePending() {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_PENDING,
+ mock_adapter_,
+ dev_info_.mac_address(),
+ application_id_,
+ test_message_,
+ error_);
+
+ EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
+ .WillOnce(Return(dev_info_.name()));
+ EXPECT_CALL(*mock_adapter_, GetConnectionType())
+ .WillRepeatedly(Return(dev_info_.connection_type()));
+
+ EXPECT_CALL(*tm_listener_, OnConnectionPending(dev_info_, connection_key_));
+
+ tm_.TestHandle(test_event);
+ }
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
void HandleConnectionFailed() {
TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_FAIL,
mock_adapter_,
@@ -405,6 +424,34 @@ TEST_F(TransportManagerImplTest, DisconnectDevice_DeviceNotConnected) {
EXPECT_EQ(E_INVALID_HANDLE, tm_.DisconnectDevice(device_handle_));
}
+#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+TEST_F(TransportManagerImplTest, Pending) {
+ // Calling HandlePending twice verifies the connection_id stays the same if
+ // the connection exists.
+ HandlePending();
+ HandlePending();
+
+ // Now create pending event for new app id and verify connection_id is
+ // incremented
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_PENDING,
+ mock_adapter_,
+ dev_info_.mac_address(),
+ application_id_ + 1,
+ test_message_,
+ error_);
+
+ EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
+ .WillOnce(Return(dev_info_.name()));
+ EXPECT_CALL(*mock_adapter_, GetConnectionType())
+ .WillRepeatedly(Return(dev_info_.connection_type()));
+
+ EXPECT_CALL(*tm_listener_,
+ OnConnectionPending(dev_info_, connection_key_ + 1));
+
+ tm_.TestHandle(test_event);
+}
+#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT
+
TEST_F(TransportManagerImplTest, Disconnect) {
// Arrange
HandleConnection();
@@ -903,7 +950,8 @@ TEST_F(TransportManagerImplTest, Visibility_TMIsNotInitialized) {
TEST_F(TransportManagerImplTest, HandleMessage_ConnectionNotExist) {
EXPECT_CALL(*mock_adapter_,
- SendData(mac_address_, application_id_, test_message_)).Times(0);
+ SendData(mac_address_, application_id_, test_message_))
+ .Times(0);
TestAsyncWaiter waiter;
EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_))
@@ -1184,7 +1232,8 @@ TEST_F(TransportManagerImplTest,
EXPECT_CALL(mock_transport_manager_settings_, app_transport_change_timer())
.WillOnce(Return(timeout));
EXPECT_CALL(mock_transport_manager_settings_,
- app_transport_change_timer_addition()).WillOnce(Return(0));
+ app_transport_change_timer_addition())
+ .WillOnce(Return(0));
EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(mac_address_, usb_serial));
diff --git a/src/components/transport_manager/test/websocket_connection_test.cc b/src/components/transport_manager/test/websocket_connection_test.cc
new file mode 100644
index 0000000000..db3bc598b1
--- /dev/null
+++ b/src/components/transport_manager/test/websocket_connection_test.cc
@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) 2019, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "resumption/last_state_impl.h"
+#include "transport_manager/cloud/cloud_websocket_transport_adapter.h"
+#include "transport_manager/cloud/sample_websocket_server.h"
+#include "transport_manager/cloud/websocket_client_connection.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "transport_manager/mock_transport_manager_settings.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::testing::_;
+using ::testing::NiceMock;
+using ::testing::Return;
+using namespace ::transport_manager;
+using namespace ::transport_manager::transport_adapter;
+namespace websocket = sample::websocket;
+
+class WebsocketConnectionTest : public ::testing::Test {
+ public:
+ struct WebsocketClient {
+ std::shared_ptr<CloudWebsocketTransportAdapter> adapter;
+ std::shared_ptr<WebsocketClientConnection> connection;
+ };
+
+ void InitWebsocketClient(
+ const transport_manager::transport_adapter::CloudAppProperties&
+ properties,
+ WebsocketClient& client_out) {
+ uniq_id = dev_id = properties.endpoint;
+
+ client_out =
+ WebsocketClient{std::make_shared<CloudWebsocketTransportAdapter>(
+ last_state_, transport_manager_settings),
+ nullptr};
+ client_out.adapter->SetAppCloudTransportConfig(uniq_id, properties);
+
+ TransportAdapterImpl* ta_cloud =
+ dynamic_cast<TransportAdapterImpl*>(client_out.adapter.get());
+ ta_cloud->CreateDevice(uniq_id);
+
+ auto connection = client_out.adapter->FindPendingConnection(dev_id, 0);
+
+ ASSERT_NE(connection, nullptr);
+
+ client_out.connection =
+ std::dynamic_pointer_cast<WebsocketClientConnection>(connection);
+
+ ASSERT_NE(client_out.connection.use_count(), 0);
+ }
+
+ void StartWSServer(std::string path) {
+ ws_session = std::make_shared<websocket::WSSession>(kHost, kPort);
+ ws_session->AddRoute(path);
+ ws_session->Run();
+ }
+
+ void StartWSSServer(std::string path) {
+ wss_session = std::make_shared<websocket::WSSSession>(
+ kHost, kPort, kCertificate, kPrivateKey);
+ wss_session->AddRoute(path);
+ wss_session->Run();
+ }
+
+ protected:
+ WebsocketConnectionTest()
+ : last_state_("app_storage_folder", "app_info_storage") {}
+
+ ~WebsocketConnectionTest() {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(transport_manager_settings, use_last_state())
+ .WillByDefault(Return(true));
+ }
+
+ NiceMock<MockTransportManagerSettings> transport_manager_settings;
+ resumption::LastStateImpl last_state_;
+ std::string dev_id;
+ std::string uniq_id;
+ std::shared_ptr<websocket::WSSession> ws_session;
+ std::shared_ptr<websocket::WSSSession> wss_session;
+ WebsocketClient ws_client;
+ std::string kHost = "127.0.0.1";
+ uint16_t kPort = 8080;
+ std::string kPath = "/folder/file.html/";
+ std::string kQuery = "?eventId=2345&eventName='Test'&expectedResult=true";
+ std::string kFragment = "#section_1";
+
+ // Sample certificate for localhost
+ std::string kCertificate =
+ "-----BEGIN "
+ "CERTIFICATE-----\nMIIDqTCCApECCQC/"
+ "5LlQ+"
+ "GLgqTANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAwx\nMjcuMC4wLjEgQ0EwIBcNMTkwNTA"
+ "2MTkzMjM2WhgPMjExOTA0MTIxOTMyMzZaMBQx\nEjAQBgNVBAMMCTEyNy4wLjAuMTCCAiIwD"
+ "QYJKoZIhvcNAQEBBQADggIPADCCAgoC\nggIBALbeIoAHFaFeNqbMnhtAO5QTgRd0X9qxpB0"
+ "d4M0dEeog2l/+inNA/eu+CCvm\nJj2I8+6MWH2TUrl/"
+ "2xfhHjzsMrtISCdpNcjaNzCnvi8ZcspFi3evknvs3+uo2/"
+ "wn\nyNZ04jp0oQ0k1cZ6WBpLTYV7WgmueemiWEiAfw+YE+wtRg+"
+ "0H7rksrbpeNPnxQHX\nBDDkWqwvfkD15Sd0XFQkW27K72/"
+ "et2uKuAcJHCIUbsA4iZyJw4Uu4eusy7W5kddX\nThE7Y1WqTXyA4j/"
+ "ZCYigXmsHbWrikPLVXbORhiMF4/60u8RDs0jI8xtgRQhLR9Vp\n3xys7/"
+ "5tHZX00s6x6OVy8aMSZIIVS0eWoVN8bGd9B4+fDMOcNT0YODeQA10w/"
+ "85P\nEiZDQ8AxneQkh8H3qjD2+"
+ "G9oHZaTk0zHTyaKRg3xGP3N9C96onaJX4Rm6nNvApO8\nU7lQ+xHkLwjKCQke39W+"
+ "r3FHwwQvUDeoJBXf6iVkIMFoUPAHNZqKf9Db6KKIEp8i\nDgIhbBxiB4MSn36Zly4SOMojyM"
+ "ZFri+"
+ "HzMbuHFlm8e8QRWGmM4UM2rHIpl4OJolg\nejesDqO8YZR5mZXV0FJRiPgLo2Q4OTtb3tEHJ"
+ "ZLmlT+"
+ "f42bge4ZCZmGPrkNfr68Y\nDEnJ6z4ksOVkMefOp2SNYLYYGPYyiKwa9qVkH9Obkect1omNA"
+ "gMBAAEwDQYJKoZI\nhvcNAQELBQADggEBABFJQtOTftrzbLBA5Vm6aPkbUyxhcaOpz+d+"
+ "Ljd6pIs4H+"
+ "Eb\nXkoHhmay4stZkDc2HVSKESZloI3Ylup8z3aRJjfOexJqHlYzk2vraYryWm8odgID\n5V"
+ "B0Zle8ofpHTJw1LCOXHkzKt1G6vdQpuq/"
+ "4OKpmggaIqqEC1bfOYZt5t6vIx3OF\nxjPz91NTR9gZ4lKrho1+sfS+"
+ "jbSjKkqVAhE4yTpKLPHRshQnBFEhvATXNvdZGftF\n+tXxqKsBZ9aX0/"
+ "YmPFIXFcjdjSSiuq1F1DjiqIZo88qfa9jlTg6VJdayyQ/"
+ "cu41C\nBucY8YTF0Ui8ccIS55h2UTzPy5/4PbrwI4P+Zgo=\n-----END "
+ "CERTIFICATE-----\n";
+ // Sample private key
+ std::string kPrivateKey =
+ "-----BEGIN RSA PRIVATE "
+ "KEY-----\nMIIJKAIBAAKCAgEAtt4igAcVoV42psyeG0A7lBOBF3Rf2rGkHR3gzR0R6iDaX/"
+ "6K\nc0D9674IK+YmPYjz7oxYfZNSuX/"
+ "bF+EePOwyu0hIJ2k1yNo3MKe+LxlyykWLd6+S\ne+zf66jb/"
+ "CfI1nTiOnShDSTVxnpYGktNhXtaCa556aJYSIB/"
+ "D5gT7C1GD7QfuuSy\ntul40+fFAdcEMORarC9+"
+ "QPXlJ3RcVCRbbsrvb963a4q4BwkcIhRuwDiJnInDhS7h\n66zLtbmR11dOETtjVapNfIDiP9"
+ "kJiKBeawdtauKQ8tVds5GGIwXj/rS7xEOzSMjz\nG2BFCEtH1WnfHKzv/"
+ "m0dlfTSzrHo5XLxoxJkghVLR5ahU3xsZ30Hj58Mw5w1PRg4\nN5ADXTD/"
+ "zk8SJkNDwDGd5CSHwfeqMPb4b2gdlpOTTMdPJopGDfEY/"
+ "c30L3qidolf\nhGbqc28Ck7xTuVD7EeQvCMoJCR7f1b6vcUfDBC9QN6gkFd/"
+ "qJWQgwWhQ8Ac1mop/"
+ "\n0NvooogSnyIOAiFsHGIHgxKffpmXLhI4yiPIxkWuL4fMxu4cWWbx7xBFYaYzhQza\nscim"
+ "Xg4miWB6N6wOo7xhlHmZldXQUlGI+AujZDg5O1ve0QclkuaVP5/"
+ "jZuB7hkJm\nYY+uQ1+"
+ "vrxgMScnrPiSw5WQx586nZI1gthgY9jKIrBr2pWQf05uR5y3WiY0CAwEA\nAQKCAgBGSDGyS"
+ "wbBMliG2vWZO6KqUqS2wv9kKgoNNsKDkryj42SKqGXFziDJTgwN\n8zKXS9+Uu1P3T3vn13/"
+ "5OYhJme4VlL5Gh2UogNXdWVr69yjrHLdxlIUUJAIbrJZ/"
+ "\n3zqNUfbwyIptZs7SrYrW8EInHzWHqwsoBEEx/"
+ "FDZSXW+u9fFiVD4n5UgP7M0nktV\nXbI6qElBDC/V/"
+ "6vG8i3aGO8bMdu8fzi3mGUKLzIk1v2J2zDofPosYcxqq8rPWTb4\nMJHMhaqz7fRB+"
+ "bb7GwtS+2/Oathe0B0td1u//Bo1s7ng1s2jrPFm8/"
+ "SbfPCLM4O0\nPjCF8OF8Q6uvSp0K283LAdZk+liuDztc/"
+ "Ed8mcnCZQhBp86mJQi0Jj3Mje7prOAY\nXojMroYj7r2igCJvcwGb1y6zZWSj3jXuHze3bLy"
+ "fv7pCD+hkiZR7mZhQpOhQRZaU\ntdFGc+"
+ "DuykxKPqVjAPy7iVQXYnMjpo36SGIWoZLuepQto3GvU6czyOwhK0/"
+ "Mwbwd\nZpYpLH3L9IetY8GcPefmUR5wQUlUTrpxgGElIzkkWW8zmUWBXwrGbAtN1HJWpJdN"
+ "\neVshKod2fo03IQMPywSdENCJVeSrgRMuwPyFaOM+"
+ "CVrBJwD66K9YWn4cVRUIZsTq\nAXhQ8DzF+WCOZshhMUbCJX+KpcOFI8nxOrPp+"
+ "J1s1YpLLvdmcQKCAQEA7bwvOiCD\nHvaqpYg1jJak6l/"
+ "iY3QIOOpFyjfYrQXS0BNRmmxK8Lzevi/"
+ "NPTqu146QKDaIGvzu\n+"
+ "bXnuV1LmZqnOm5J6Kdx0Mk4Fb88akRtS9gOdzU7WWMYIGkeF1oih0ZrhHuIey6e\nCeLSmJh"
+ "UDaTIWcCirALRHcLWUS6BTGGuE+up5QG7djIW/"
+ "LD17lhGE6fXPlbYXb7l\nPbYwL1Yr0urIp9Un+zrExw+77TTGK7T37T1ZJv46qnro0/"
+ "HK8XxZ+"
+ "JNc18F763O4\nPmwu8KWrx4qnyPYAuB1rbVntK6UxYks9jvk93XecCUP6HHp0I0tV/"
+ "kBNd2+"
+ "18zux\n033xFEVKrUksmwKCAQEAxOrPGyBVFp29V4gQsMQdmafkDAgCLREgjQTOamFsYL5+"
+ "\nZWq+6VhT/"
+ "B650sIoRdX0N8timnSLBfjeqaBG5VVhhyKZhP5hulfRjALhdbGBOYvf\n0gLSffImwWdYQfx"
+ "jtCSO+"
+ "XCLVdAJGOOWeBVVKzH18ZvCFQwUr3Yrp7KmKWKAqgf7\n6rYovWh8T5LLYS0NzXCEwf9nJ0N"
+ "JMOy7I9B7EtF8Cs6tK3aaHVqDz7zufwosS7gI\n3aI51Qh4a5D1p95+"
+ "YU09beWjWGYnPiCKk4D47zaeOe7OQINaWugExlelHtJh9unO\nnhOFXhziav2Kxq1CICAuXl"
+ "Vx3A+gn/cU3niNHz2A9wKCAQEAws+aw78ws4bef5cG\nipZHveek1GqY8krHtdXdsKs8/"
+ "VVXYXusTWn3/VGelbYo4GrqpolJLxRloCr4IGXb\nNZwNvUvzNLtCAR1i4C89irdX+Paro/"
+ "PzFmSluKlrByfNc5y5Lm8sgATLbL56ZKEu\n/58wrpu0sc/"
+ "9HK40gYHiYn0I8ToElqy8uTaCr78zSIT9p826DFOOKgPsRo2tHp02\nfDf5Bc8eXDjkV1sFX"
+ "HQKkHZTVA0ZqWJbIKhncoaJDyofcBsR0ZuzuFWzfTOZo4mf\nInz00TEFldpF1e4C8+"
+ "kCdtHBOA/2Ki2Bp/YUVpHh6aoqZZa75Euehhs8tVpW242M\njEOSUQKCAQAM64sjMH/kt/"
+ "zQXXEa6AM5LbbcwznBUzpbhlE00aeWwWjxpotYLB92\nj12J4otZ6avYbVPO5o6omaeiYY3F"
+ "RlDb2P1RqI8o9tIc6aN5YWglKnRJBz5gXR8F\n2Y4E5lZ0X2GyJBxASSIPq/"
+ "8Xae7ooqKMc7fMQbqpuIssuaAFXx0qCtQQllsd8lkV\nr4AApEAflp5fTC6seNG4kA/"
+ "HTcqFdZE59E2QaHu8KVA0tSTA2R4G6dBLGnXI8IFW\nLXCwzvxjzfmV2FdbWXiBrwjonLG4o"
+ "FDJZE3MFdI73LVTfjSrTQp4dObFoGpDvols\nk64jUwLfsLzaG6kY0z2qwT9xSV+"
+ "ZCSQJAoIBADsSBeyELc5KnmOhT0Xue2o0bkAS\n8KcGWdAoQlaLCIs3vtdlC7DXDXO1l8FkT"
+ "Qrd+GwP3eWDq6ymtO4vkJ3m4cZ1PEsv\n6Qet7qtkVhUfa+"
+ "FYKtDzSMRuSaFPW3Ro1PesFa1H3y+sw5HL36vhRaSK+T4Wy5k2\nf7EwNZIf/"
+ "ZZeA+"
+ "sEtqj33obOBIiuU9htAjN81Kz4a0Xlh6jc4q6iwYKL8nZ76JYV\n8hXWIz6OXxLXE158+"
+ "QtJSZaRCvdr6L5UtWfMPKSMqgfhXfTYViPDleQCkJ132mIS\nH28UoET0Y5wI8M6pMkWpSqW"
+ "WcKPFGwyLInvHdxgnTAsutowkldA7qFwoRz4=\n-----END RSA PRIVATE KEY-----\n";
+ // Sample CA certificate(used to sign the server certificate)
+ std::string kCACertificate =
+ "-----BEGIN "
+ "CERTIFICATE-----"
+ "\nMIIDBjCCAe6gAwIBAgIJAPyCrKRDl3SWMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV\nBAMM"
+ "DDEyNy4wLjAuMSBDQTAgFw0xOTA1MDYxOTMyMzZaGA8yMTE5MDQxMjE5MzIz\nNlowFzEVMB"
+ "MGA1UEAwwMMTI3LjAuMC4xIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEA"
+ "xrNHoY5+"
+ "JCgnyvEdG2dvvOaZ3sg6uhuF5Ssb5snyo9ixrxO5\nZkDGWwUqFO9PiYuO5ovNeq9LZtPG6s"
+ "K8zsCS062ChZX/7tZHndf4MKCUDzv/"
+ "LPHe\nnROoPi9n2FAiOPctY5hpgpIJDPI5Ofx0el2KPeFGeUO/"
+ "W3yqnfol1ZqzZ2h3uErR\noHkgT2Ja4K+5gnPkr/"
+ "RluJIu3AmWYw4eKi8i3+"
+ "PoThGmCFvoGfcWvRoctgnOHYHE\n4bDRirXL9nGkZ5FMzOVDeoIAEAShOqJwL08VcY+Pg/"
+ "qFQjzRrTmiKgm6QsHNnm0q\nzg70XaD88VJimiGYZOuJHNZpX8o0W+1Ls/"
+ "NbawIDAQABo1MwUTAdBgNVHQ4EFgQU\nkW3hgFWYMpVUkq9AlzGlI3awTGEwHwYDVR0jBBgw"
+ "FoAUkW3hgFWYMpVUkq9AlzGl\nI3awTGEwDwYDVR0TAQH/BAUwAwEB/"
+ "zANBgkqhkiG9w0BAQsFAAOCAQEAZeMkILiG\neEcELWb8cktP3LzvS47O8hys9+"
+ "6TFmftuO7kjDBd9YH2v8iQ7qCcUvMJ7bqL5RP1\nQssKfNOHZtw/"
+ "MMcKE6E3nl4yQSKc8ymivvYSVu5SYtQCedcgfRLb5zvVxXw8JmCp\nGNS3/"
+ "OlIYZAamh76GxkKSaV3tv0XZB6n3rUVQZShncFbMpyJRW0XWxReGWrhXv4s\nNxMeC1r07EE"
+ "WIDecv8KKf1F8uT4UF48HnC0VBpXiOyDGvn35NiKp+"
+ "Q5k7QV6jdCS\ngPRcnZhs6jiU0jnV8C9A1A+"
+ "3pXSSPrAed7tvECOgHCfS10CLsLWsLuSjc93BE5Vt\nav7kmxSwrdvQ2A==\n-----END "
+ "CERTIFICATE-----\n";
+ std::string kIncorrectCertificate =
+ "-----BEGIN "
+ "CERTIFICATE-----\nMIIC/"
+ "jCCAeagAwIBAgIJAIZjLucUID1mMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV\nBAMMCTEyNy4"
+ "wLjAuMTAeFw0xOTA1MDYxNDA1MzdaFw0yOjA1MDZxNDA1MzdaMBQx\nEjAQBgNVBAMMCTEyN"
+ "y4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBALfE5Qhc2mHTIux30l7"
+ "eHFjFLdzYeXE8vcaXKodalCG8EkRxojDOfUv+y2DV\nJzHAMiGxMFAEcSz71k+"
+ "jFZwhNG8PLY0b36ChnUsrGkOSJWq3OKUFrg8KxO9At9dL\nJsa+"
+ "R0N0D1bMoPYdpCi3m0b0q2ITHe56qKuTLTrIPia+"
+ "qXGEVD7EoEhU9tnwlcwE\npsUURMXCn2+FhHyqN9wjFkldmu4k8U3OJOK4385L+"
+ "4RJoIV8dsYawAMAf+"
+ "WuxyWq\niPQTPxr8q33ZZm6z0XrgsgxHYCCsryx8L9Ub9Zwu0mie7eL63rYdr86gULvnF1bY"
+ "\ncOunKFc71rBYFalbD6YYsre733kCAwEAAaNTMFEwHQYDVR0OBBYEFKW9ByUNG84Z\nYiSc"
+ "hUrB7KV9FinZMB8GA1UdIwQYMBaAFKW9ByUNG84ZYiSchUrB7KV9FinZMA8G\nA1UdEwEB/"
+ "wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHYROS1EL2qnrwmAsR6c\nqo8yrk8qzLKt4os"
+ "41nv7QMUQFIO+QLPE8SbH4fK1YOMMUJ4ppARQBDaIIR3UEhp1\nZHT/"
+ "wGjK9qxcuQ1EXLyHOY0rxS5q57dYGxOyQo4v6IoLVMZ1ij+RJGPYI/"
+ "2fDXs0\nbDldeJyC1voHmG6lqTN5nLG7Y3j9j6rtSqJyRz5muaecQNiFPQOM2OTp0rC4VeAF"
+ "\ndejmTmLhUFVuHMzLF+"
+ "bpzsN76GnnQquJy2jexzFoWgbEfFVLKuyhTHQAalRb4ccq\nXCIx1hecNDYRY3Sc2Gzv5qxk"
+ "kWF8zqltT/0d5tx0JwN3k5nP4SlaEldFvD6BELxy\nVkU=\n-----END "
+ "CERTIFICATE-----\n";
+};
+
+TEST_F(WebsocketConnectionTest, WSConnection_SUCCESS) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "ws://" + kHost + ":" + std::to_string(kPort),
+ .certificate = "no cert",
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSServer, this, "/");
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> ws_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = ws_connection->Start();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop client
+ ret_code = ws_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ ws_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSConnection_SUCCESS_ValidTarget) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "ws://" + kHost + ":" + std::to_string(kPort) + kPath +
+ kQuery + kFragment,
+ .certificate = "no cert",
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSServer, this, kPath);
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> ws_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = ws_connection->Start();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop client
+ ret_code = ws_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ ws_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSConnection_FAILURE_InvalidTarget) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "ws://" + kHost + ":" + std::to_string(kPort) + kPath +
+ kQuery + kFragment,
+ .certificate = "no cert",
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSServer, this, "/");
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> ws_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = ws_connection->Start();
+ EXPECT_EQ(TransportAdapter::FAIL, ret_code);
+
+ // Stop client
+ ret_code = ws_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ ws_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSSConnection_SUCCESS) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "wss://" + kHost + ":" + std::to_string(kPort),
+ .certificate = kCACertificate,
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WSS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSSServer, this, "/");
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> wss_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = wss_connection->Start();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop client
+ ret_code = wss_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ wss_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSSConnection_SUCCESS_ValidTarget) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "wss://" + kHost + ":" + std::to_string(kPort) + kPath,
+ .certificate = kCACertificate,
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WSS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSSServer,
+ this,
+ (kPath + kQuery + kFragment));
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> wss_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = wss_connection->Start();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop client
+ ret_code = wss_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ wss_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSSConnection_FAILURE_InvalidTarget) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "wss://" + kHost + ":" + std::to_string(kPort),
+ .certificate = kCACertificate,
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WSS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSSServer, this, kPath);
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> wss_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = wss_connection->Start();
+ EXPECT_EQ(TransportAdapter::FAIL, ret_code);
+
+ // Stop client
+ ret_code = wss_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ wss_session->Stop();
+ t1.join();
+}
+
+TEST_F(WebsocketConnectionTest, WSSConnection_FAILURE_IncorrectCert) {
+ transport_manager::transport_adapter::CloudAppProperties properties{
+ .endpoint = "wss://" + kHost + ":" + std::to_string(kPort),
+ .certificate = kIncorrectCertificate,
+ .enabled = true,
+ .auth_token = "auth_token",
+ .cloud_transport_type = "WSS",
+ .hybrid_app_preference = "CLOUD"};
+
+ // Start server
+ std::thread t1(&WebsocketConnectionTest::StartWSSServer, this, "/");
+ usleep(5000);
+
+ // Start client
+ InitWebsocketClient(properties, ws_client);
+ std::shared_ptr<WebsocketClientConnection> wss_connection =
+ ws_client.connection;
+
+ // Check websocket connection
+ TransportAdapter::Error ret_code = wss_connection->Start();
+ EXPECT_EQ(TransportAdapter::FAIL, ret_code);
+
+ // Stop client
+ ret_code = wss_connection->Disconnect();
+ EXPECT_EQ(TransportAdapter::OK, ret_code);
+
+ // Stop server thread
+ wss_session->Stop();
+ t1.join();
+}
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index 98da4cf2ab..9562b50e78 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -40,6 +40,7 @@ include_directories (
${COMPONENTS_DIR}/protocol_handler/include
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src
)
diff --git a/src/components/utils/include/utils/back_trace.h b/src/components/utils/include/utils/back_trace.h
index 180714e5a6..f23f87e60c 100644
--- a/src/components/utils/include/utils/back_trace.h
+++ b/src/components/utils/include/utils/back_trace.h
@@ -33,8 +33,8 @@
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BACK_TRACE_H_
#include <ostream>
-#include <vector>
#include <string>
+#include <vector>
#include "utils/threads/thread.h"
namespace utils {
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index e26fef34bb..f62858417d 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -35,11 +35,11 @@
#include <stdint.h>
#include <string.h>
+#include <time.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
-#include <time.h>
namespace file_system {
@@ -241,6 +241,19 @@ bool WriteBinaryFile(const std::string& name,
*/
bool ReadBinaryFile(const std::string& name, std::vector<uint8_t>& result);
+/**
+ * @brief Reads from file
+ *
+ * @param name path to file
+ * @param result read data
+ * @param offset number of bytes to be ignored from begining of file
+ * @return returns true if the operation is successfully.
+ */
+bool ReadBinaryFile(const std::string& name,
+ std::vector<uint8_t>& result,
+ uint32_t offset,
+ uint32_t length);
+
bool ReadFile(const std::string& name, std::string& result);
/**
diff --git a/src/components/utils/include/utils/helpers.h b/src/components/utils/include/utils/helpers.h
index f13d69aa83..1ef336dadd 100644
--- a/src/components/utils/include/utils/helpers.h
+++ b/src/components/utils/include/utils/helpers.h
@@ -132,6 +132,6 @@ bool in_range(const Container& container,
return std::find(container.begin(), container.end(), value) !=
container.end();
}
-}
+} // namespace helpers
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H_
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index b20b43c251..b0cac75c71 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOG_MESSAGE_LOOP_THREAD_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOG_MESSAGE_LOOP_THREAD_H_
-#include <string>
-#include <queue>
#include <log4cxx/logger.h>
+#include <queue>
+#include <string>
#include "utils/macro.h"
#include "utils/threads/message_loop_thread.h"
diff --git a/src/components/utils/include/utils/optional.h b/src/components/utils/include/utils/optional.h
index 0395945de0..626c166a02 100644
--- a/src/components/utils/include/utils/optional.h
+++ b/src/components/utils/include/utils/optional.h
@@ -79,5 +79,5 @@ class Optional {
bool is_initialized_;
};
-} // utils utils
+} // namespace utils
#endif // ERROR_OR_H
diff --git a/src/components/utils/include/utils/qdb_wrapper/sql_query.h b/src/components/utils/include/utils/qdb_wrapper/sql_query.h
index bc3e7a592b..b324fd5d40 100644
--- a/src/components/utils/include/utils/qdb_wrapper/sql_query.h
+++ b/src/components/utils/include/utils/qdb_wrapper/sql_query.h
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_QUERY_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_QUERY_H_
-#include <stdint.h>
#include <qdb/qdb.h>
+#include <stdint.h>
#include <string>
-#include <vector>
#include <utility>
+#include <vector>
#include "qdb_wrapper/sql_error.h"
#include "utils/lock.h"
diff --git a/src/components/utils/include/utils/resource_usage.h b/src/components/utils/include/utils/resource_usage.h
index d358c49225..d34897eded 100644
--- a/src/components/utils/include/utils/resource_usage.h
+++ b/src/components/utils/include/utils/resource_usage.h
@@ -38,9 +38,9 @@
#include <sys/procfs.h>
#endif
-#include "utils/macro.h"
-#include <string>
#include <iostream>
+#include <string>
+#include "utils/macro.h"
#include "utils/logger.h"
@@ -171,6 +171,6 @@ class Resources {
*/
static const char* proc;
};
-}
+} // namespace utils
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_
diff --git a/src/components/utils/include/utils/singleton.h b/src/components/utils/include/utils/singleton.h
index b73780ee1d..54fc113aba 100644
--- a/src/components/utils/include/utils/singleton.h
+++ b/src/components/utils/include/utils/singleton.h
@@ -33,9 +33,9 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
+#include "utils/atomic.h"
#include "utils/lock.h"
#include "utils/memory_barrier.h"
-#include "utils/atomic.h"
namespace utils {
diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
index f68c5e215e..1bedbea01e 100644
--- a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
+++ b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_DATABASE_H_
#include <string>
-#include "utils/sqlite_wrapper/sql_error.h"
#include "utils/lock.h"
+#include "utils/sqlite_wrapper/sql_error.h"
struct sqlite3;
diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_query.h b/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
index dc45be7ed1..e7fe75f9c9 100644
--- a/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
+++ b/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
@@ -35,8 +35,8 @@
#include <stdint.h>
#include <string>
-#include "utils/sqlite_wrapper/sql_error.h"
#include "utils/lock.h"
+#include "utils/sqlite_wrapper/sql_error.h"
struct sqlite3_stmt;
diff --git a/src/components/utils/include/utils/system.h b/src/components/utils/include/utils/system.h
index 3b34d78526..f975f74510 100644
--- a/src/components/utils/include/utils/system.h
+++ b/src/components/utils/include/utils/system.h
@@ -91,6 +91,6 @@ class System {
std::vector<std::string> argv_;
};
-} // utils
+} // namespace utils
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_H_
diff --git a/src/components/utils/include/utils/threads/pulse_thread_delegate.h b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
index 623e12b261..ad6df6fca7 100644
--- a/src/components/utils/include/utils/threads/pulse_thread_delegate.h
+++ b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
@@ -55,23 +55,23 @@ namespace threads {
class PulseThreadDelegate : public ThreadDelegate {
public:
/**
- * @brief default constructor
- */
+ * @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
+ * @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
- */
+ * @brief This method is invoked from threadMain() when Pulse comes
+ */
virtual void OnPulse() = 0;
/**
@@ -83,9 +83,9 @@ class PulseThreadDelegate : public ThreadDelegate {
}
/**
- * Finalizes thread
- * Can free resources
- */
+ * Finalizes thread
+ * Can free resources
+ */
virtual void Finalize() {}
private:
diff --git a/src/components/utils/include/utils/threads/thread_manager.h b/src/components/utils/include/utils/threads/thread_manager.h
index 3f53c902c4..4f28d0cb15 100644
--- a/src/components/utils/include/utils/threads/thread_manager.h
+++ b/src/components/utils/include/utils/threads/thread_manager.h
@@ -37,16 +37,16 @@
#include <pthread.h>
+#include <list>
#include <map>
-#include <string>
#include <set>
-#include <list>
+#include <string>
-#include "utils/macro.h"
-#include "utils/singleton.h"
-#include "utils/lock.h"
#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"
diff --git a/src/components/utils/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index e391db992c..a47b52a030 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -32,15 +32,15 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_H_
-#include <string>
#include <stdint.h>
#include <memory>
+#include <string>
-#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/timer_task.h"
+#include "utils/macro.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
+#include "utils/timer_task.h"
namespace timer {
@@ -102,6 +102,8 @@ class Timer {
*/
bool is_running() const;
+ bool is_completed() const;
+
/**
* @brief Gets current timer timeout
* @return Current timeout in milliseconds.
@@ -119,7 +121,7 @@ class Timer {
* @brief Constructor
* @param timer Timer instance pointer for callback calling
*/
- TimerDelegate(const Timer* timer, sync_primitives::Lock& state_lock_ref);
+ TimerDelegate(Timer* timer, sync_primitives::Lock& state_lock_ref);
/**
* @brief Sets timer timeout
@@ -161,7 +163,7 @@ class Timer {
void exitThreadMain() OVERRIDE;
private:
- const Timer* timer_;
+ Timer* timer_;
Milliseconds timeout_;
/**
@@ -187,13 +189,13 @@ class Timer {
* Not thread-safe
* @param timeout Timer timeout
*/
- void StartDelegate(const Milliseconds timeout) const;
+ void StartDelegate(const Milliseconds timeout);
/**
* @brief Sets up timer delegate to stop state.
* Not thread-safe
*/
- void StopDelegate() const;
+ void StopDelegate();
/**
* @brief Starts timer thread.
@@ -211,14 +213,14 @@ class Timer {
* @brief Callback called on timeout.
* Not thread-safe
*/
- void OnTimeout() const;
+ void OnTimeout();
const std::string name_;
TimerTask* task_;
mutable sync_primitives::Lock state_lock_;
- mutable std::unique_ptr<TimerDelegate> delegate_;
+ std::unique_ptr<TimerDelegate> delegate_;
threads::Thread* thread_;
/**
@@ -226,6 +228,8 @@ class Timer {
*/
bool single_shot_;
+ bool completed_flag_;
+
DISALLOW_COPY_AND_ASSIGN(Timer);
};
diff --git a/src/components/utils/include/utils/timer_task_impl.h b/src/components/utils/include/utils/timer_task_impl.h
index 28618551ec..9ed6dd702d 100644
--- a/src/components/utils/include/utils/timer_task_impl.h
+++ b/src/components/utils/include/utils/timer_task_impl.h
@@ -33,8 +33,8 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_TASK_IMPL_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_TASK_IMPL_H_
-#include "utils/timer_task.h"
#include "utils/macro.h"
+#include "utils/timer_task.h"
namespace timer {
diff --git a/src/components/utils/src/back_trace.cc b/src/components/utils/src/back_trace.cc
index c587643cc6..65f9e72070 100644
--- a/src/components/utils/src/back_trace.cc
+++ b/src/components/utils/src/back_trace.cc
@@ -33,8 +33,8 @@
#include "utils/back_trace.h"
#include <algorithm>
-#include <vector>
#include <sstream>
+#include <vector>
#include <cxxabi.h>
#include <execinfo.h>
@@ -63,7 +63,7 @@ string demangle(const char* symbol) {
}
return symbol;
}
-}
+} // namespace
Backtrace::Backtrace(int32_t count, int32_t skip_top)
: thread_id_(threads::Thread::CurrentId()) {
diff --git a/src/components/utils/src/conditional_variable_boost.cc b/src/components/utils/src/conditional_variable_boost.cc
index a74aa3eaa6..c70b727d66 100644
--- a/src/components/utils/src/conditional_variable_boost.cc
+++ b/src/components/utils/src/conditional_variable_boost.cc
@@ -34,9 +34,9 @@
#include <errno.h>
#include <time.h>
+#include <boost/exception/diagnostic_information.hpp>
#include "utils/lock.h"
#include "utils/logger.h"
-#include <boost/exception/diagnostic_information.hpp>
namespace {
const long kNanosecondsPerSecond = 1000000000;
diff --git a/src/components/utils/src/convert_utils.cc b/src/components/utils/src/convert_utils.cc
index 319b231a96..9d90318731 100644
--- a/src/components/utils/src/convert_utils.cc
+++ b/src/components/utils/src/convert_utils.cc
@@ -32,8 +32,8 @@
#include "utils/convert_utils.h"
#include <stdint.h>
-#include <limits>
#include <algorithm>
+#include <limits>
#include "utils/macro.h"
long long int utils::ConvertInt64ToLongLongInt(const int64_t value) {
diff --git a/src/components/utils/src/custom_string.cc b/src/components/utils/src/custom_string.cc
index 8254a98180..7bbe5f2da8 100644
--- a/src/components/utils/src/custom_string.cc
+++ b/src/components/utils/src/custom_string.cc
@@ -31,14 +31,14 @@
*/
#include "utils/custom_string.h"
-#include <cwchar>
-#include <cstdlib>
+#include <string.h>
+#include <algorithm>
#include <clocale>
+#include <cstdlib>
+#include <cwchar>
#include <cwctype>
#include <new>
-#include <algorithm>
#include <vector>
-#include <string.h>
#include "utils/logger.h"
#include "utils/macro.h"
@@ -76,7 +76,7 @@ void ConvertWStringToLowerCase(std::wstring& str) {
std::transform(str.begin(), str.end(), str.begin(), towlower);
setlocale(LC_ALL, current_locale.c_str());
}
-}
+} // namespace
namespace utils {
namespace custom_string {
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index f98aeda056..430cf40da0 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -316,6 +316,26 @@ bool file_system::ReadBinaryFile(const std::string& name,
return true;
}
+bool file_system::ReadBinaryFile(const std::string& name,
+ std::vector<uint8_t>& result,
+ uint32_t offset,
+ uint32_t length) {
+ if (!FileExists(name) || !IsAccessible(name, R_OK)) {
+ return false;
+ }
+
+ std::ifstream file(name.c_str(), std::ios_base::binary);
+ file.ignore(offset);
+ std::ostringstream ss;
+ std::string s;
+ s.resize(length);
+ file.read(&s[0], length);
+
+ result.resize(s.length());
+ std::copy(s.begin(), s.end(), result.begin());
+ return true;
+}
+
bool file_system::ReadFile(const std::string& name, std::string& result) {
if (!FileExists(name) || !IsAccessible(name, R_OK)) {
return false;
diff --git a/src/components/utils/src/gen_hash.cc b/src/components/utils/src/gen_hash.cc
index a43b8feb03..0b85798b00 100644
--- a/src/components/utils/src/gen_hash.cc
+++ b/src/components/utils/src/gen_hash.cc
@@ -32,8 +32,8 @@
#include "utils/gen_hash.h"
#include <cstdlib>
-#include <string>
#include <locale>
+#include <string>
#include "utils/custom_string.h"
namespace utils {
diff --git a/src/components/utils/src/logger.cc b/src/components/utils/src/logger.cc
index af21aeac77..2a4b8eb108 100644
--- a/src/components/utils/src/logger.cc
+++ b/src/components/utils/src/logger.cc
@@ -31,9 +31,9 @@
*/
#include "utils/logger.h"
+#include <apr_time.h>
#include "utils/log_message_loop_thread.h"
#include "utils/logger_status.h"
-#include <apr_time.h>
void deinit_logger() {
CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
diff --git a/src/components/utils/src/qdb_wrapper/sql_database.cc b/src/components/utils/src/qdb_wrapper/sql_database.cc
index b95fe17845..e2a51753b2 100644
--- a/src/components/utils/src/qdb_wrapper/sql_database.cc
+++ b/src/components/utils/src/qdb_wrapper/sql_database.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <cstring>
#include "qdb_wrapper/sql_database.h"
+#include <cstring>
#include "utils/logger.h"
namespace utils {
diff --git a/src/components/utils/src/qdb_wrapper/sql_query.cc b/src/components/utils/src/qdb_wrapper/sql_query.cc
index e5facb5853..d101e80718 100644
--- a/src/components/utils/src/qdb_wrapper/sql_query.cc
+++ b/src/components/utils/src/qdb_wrapper/sql_query.cc
@@ -31,12 +31,12 @@
*/
#include "qdb_wrapper/sql_query.h"
+#include <errno.h>
#include <string.h>
-#include <cassert>
#include <algorithm>
+#include <cassert>
#include "qdb_wrapper/sql_database.h"
#include "utils/logger.h"
-#include <errno.h>
namespace utils {
namespace dbms {
diff --git a/src/components/utils/src/resource_usage.cc b/src/components/utils/src/resource_usage.cc
index 385c2bfa2e..15a8c71e70 100644
--- a/src/components/utils/src/resource_usage.cc
+++ b/src/components/utils/src/resource_usage.cc
@@ -10,11 +10,11 @@
#include <sys/types.h>
#include <unistd.h>
#endif
-#include <sys/resource.h>
#include <errno.h>
+#include <stdio.h>
+#include <sys/resource.h>
#include <sys/types.h>
#include <unistd.h>
-#include <stdio.h>
#include <sstream>
#include "utils/file_system.h"
diff --git a/src/components/utils/src/rwlock_posix.cc b/src/components/utils/src/rwlock_posix.cc
index 08edb8cb0c..81bf5feee1 100644
--- a/src/components/utils/src/rwlock_posix.cc
+++ b/src/components/utils/src/rwlock_posix.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/rwlock.h"
#include "utils/logger.h"
+#include "utils/rwlock.h"
namespace sync_primitives {
diff --git a/src/components/utils/src/signals_posix.cc b/src/components/utils/src/signals_posix.cc
index e13dc04f40..8d1134576f 100644
--- a/src/components/utils/src/signals_posix.cc
+++ b/src/components/utils/src/signals_posix.cc
@@ -29,10 +29,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdint.h>
#include <sys/wait.h>
#include <csignal>
#include <cstdlib>
-#include <stdint.h>
#include <iostream>
#include "utils/signals.h"
diff --git a/src/components/utils/src/system.cc b/src/components/utils/src/system.cc
index 6c3cf56133..2acc7acf92 100644
--- a/src/components/utils/src/system.cc
+++ b/src/components/utils/src/system.cc
@@ -32,16 +32,16 @@
#ifdef __QNX__
#include <process.h>
#else // __QNX__
+#include <fcntl.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/stat.h>
-#include <fcntl.h>
#include <unistd.h>
#endif // __QNX__
#include <algorithm>
-#include <functional>
#include <cstring>
+#include <functional>
#include <iostream>
#include "utils/logger.h"
@@ -87,7 +87,7 @@ bool System::Execute() {
bool System::Execute(bool wait) {
size_t size = argv_.size();
- char** argv = new char* [size + 1];
+ char** argv = new char*[size + 1];
std::transform(argv_.begin(), argv_.end(), argv, GetCString());
argv[size] = NULL;
@@ -137,7 +137,7 @@ bool System::Execute(bool wait) {
dup2(fd_dev0, STDERR_FILENO);
size_t size = argv_.size();
- char** argv = new char* [size + 1];
+ char** argv = new char*[size + 1];
std::transform(argv_.begin(), argv_.end(), argv, GetCString());
argv[size] = NULL;
@@ -173,4 +173,4 @@ bool System::Execute(bool wait) {
#endif // __QNX__
-} // utils
+} // namespace utils
diff --git a/src/components/utils/src/threads/async_runner.cc b/src/components/utils/src/threads/async_runner.cc
index 131aaa3f78..740db016be 100644
--- a/src/components/utils/src/threads/async_runner.cc
+++ b/src/components/utils/src/threads/async_runner.cc
@@ -110,4 +110,4 @@ void AsyncRunner::AsyncRunnerDelegate::runDelegate(ThreadDelegate* delegate) {
delegate_notifier_.NotifyOne();
}
-} // namespace policy.
+} // namespace threads
diff --git a/src/components/utils/src/threads/pulse_thread_delegate.cc b/src/components/utils/src/threads/pulse_thread_delegate.cc
index 37e6c670d1..a76b17368a 100644
--- a/src/components/utils/src/threads/pulse_thread_delegate.cc
+++ b/src/components/utils/src/threads/pulse_thread_delegate.cc
@@ -32,8 +32,8 @@
#include <sys/netmgr.h>
-#include "utils/threads/pulse_thread_delegate.h"
#include "utils/logger.h"
+#include "utils/threads/pulse_thread_delegate.h"
namespace threads {
diff --git a/src/components/utils/src/threads/thread_delegate.cc b/src/components/utils/src/threads/thread_delegate.cc
index 917603f92c..e071959522 100644
--- a/src/components/utils/src/threads/thread_delegate.cc
+++ b/src/components/utils/src/threads/thread_delegate.cc
@@ -34,8 +34,8 @@
#include <pthread.h>
-#include "utils/threads/thread.h"
#include "utils/lock.h"
+#include "utils/threads/thread.h"
namespace threads {
diff --git a/src/components/utils/src/threads/thread_manager.cc b/src/components/utils/src/threads/thread_manager.cc
index 2959a86cb7..8825510d74 100644
--- a/src/components/utils/src/threads/thread_manager.cc
+++ b/src/components/utils/src/threads/thread_manager.cc
@@ -31,16 +31,16 @@
*/
#include "utils/threads/thread_manager.h"
-#include "utils/threads/thread_delegate.h"
-#include "utils/lock.h"
#include "utils/conditional_variable.h"
-#include "utils/threads/thread.h"
+#include "utils/lock.h"
#include "utils/logger.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
#include <pthread.h>
-#include <sstream>
#include <list>
+#include <sstream>
#if defined(OS_LINUX)
#include <sys/syscall.h>
diff --git a/src/components/utils/src/threads/thread_posix.cc b/src/components/utils/src/threads/thread_posix.cc
index 51e59fa108..35c1cd7084 100644
--- a/src/components/utils/src/threads/thread_posix.cc
+++ b/src/components/utils/src/threads/thread_posix.cc
@@ -32,16 +32,16 @@
#include <errno.h>
#include <limits.h>
-#include <stddef.h>
-#include <signal.h>
#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
#include <algorithm>
#include <functional>
-#include "utils/threads/thread.h"
#include "utils/atomic.h"
-#include "utils/threads/thread_delegate.h"
#include "utils/logger.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
#ifndef __QNXNTO__
const int EOK = 0;
@@ -172,9 +172,9 @@ bool Thread::start(const ThreadOptions& options) {
}
if (isThreadRunning_) {
- LOG4CXX_TRACE(logger_,
- "EXIT thread " << name_ << " #" << handle_
- << " is already running");
+ LOG4CXX_TRACE(
+ logger_,
+ "EXIT thread " << name_ << " #" << handle_ << " is already running");
return true;
}
diff --git a/src/components/utils/src/threads/thread_validator.cc b/src/components/utils/src/threads/thread_validator.cc
index 4024522ae4..3b753e79b5 100644
--- a/src/components/utils/src/threads/thread_validator.cc
+++ b/src/components/utils/src/threads/thread_validator.cc
@@ -31,8 +31,8 @@
*/
#include "utils/threads/thread_validator.h"
-#include "utils/logger.h"
#include "utils/back_trace.h"
+#include "utils/logger.h"
namespace threads {
@@ -46,14 +46,15 @@ SingleThreadSimpleValidator::~SingleThreadSimpleValidator() {}
void SingleThreadSimpleValidator::AssertRunningOnCreationThread() const {
PlatformThreadHandle current_id = Thread::CurrentId();
if (creation_thread_id_ != current_id) {
- LOG4CXX_ERROR(logger_,
- "Single-threaded object created at thread "
- << creation_thread_id_ << " is accessed from thread "
- << current_id
+ LOG4CXX_ERROR(
+ logger_,
+ "Single-threaded object created at thread "
+ << creation_thread_id_ << " is accessed from thread " << current_id
#ifdef BACKTRACE_SUPPORT
- << "\n" << utils::Backtrace()
+ << "\n"
+ << utils::Backtrace()
#endif
- );
+ );
}
}
@@ -80,7 +81,7 @@ void SingleThreadValidator::AssertRunningOnValidThread() const {
#ifdef BACKTRACE_SUPPORT
<< utils::Backtrace()
#endif
- );
+ );
}
}
diff --git a/src/components/utils/src/timer.cc b/src/components/utils/src/timer.cc
index b819b56f54..8e854654de 100644
--- a/src/components/utils/src/timer.cc
+++ b/src/components/utils/src/timer.cc
@@ -33,13 +33,13 @@
#include <string>
-#include "utils/macro.h"
-#include "utils/logger.h"
-#include "utils/lock.h"
-#include "utils/timer_task.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
+#include "utils/timer_task.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
@@ -49,7 +49,8 @@ timer::Timer::Timer(const std::string& name, TimerTask* task)
, state_lock_()
, delegate_(new TimerDelegate(this, state_lock_))
, thread_(threads::CreateThread(name_.c_str(), delegate_.get()))
- , single_shot_(true) {
+ , single_shot_(true)
+ , completed_flag_(false) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(!name_.empty());
DCHECK(task_);
@@ -76,6 +77,7 @@ void timer::Timer::Start(const Milliseconds timeout,
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(state_lock_);
StopThread();
+ completed_flag_ = false;
switch (timer_type) {
case kSingleShot: {
single_shot_ = true;
@@ -106,17 +108,21 @@ bool timer::Timer::is_running() const {
return !delegate_->stop_flag();
}
+bool timer::Timer::is_completed() const {
+ return completed_flag_;
+}
+
timer::Milliseconds timer::Timer::timeout() const {
sync_primitives::AutoLock auto_lock(state_lock_);
return delegate_->timeout();
}
-void timer::Timer::StartDelegate(const Milliseconds timeout) const {
+void timer::Timer::StartDelegate(const Milliseconds timeout) {
delegate_->set_stop_flag(false);
delegate_->set_timeout(timeout);
}
-void timer::Timer::StopDelegate() const {
+void timer::Timer::StopDelegate() {
delegate_->set_stop_flag(true);
delegate_->set_timeout(0);
}
@@ -148,7 +154,7 @@ void timer::Timer::StopThread() {
}
}
-void timer::Timer::OnTimeout() const {
+void timer::Timer::OnTimeout() {
{
sync_primitives::AutoLock auto_lock(state_lock_);
if (single_shot_) {
@@ -158,10 +164,11 @@ void timer::Timer::OnTimeout() const {
DCHECK_OR_RETURN_VOID(task_);
task_->run();
+ completed_flag_ = true;
}
timer::Timer::TimerDelegate::TimerDelegate(
- const Timer* timer, sync_primitives::Lock& state_lock_ref)
+ Timer* timer, sync_primitives::Lock& state_lock_ref)
: timer_(timer)
, timeout_(0)
, stop_flag_(true)
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index f01dad8d58..e26f80d954 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -30,15 +30,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/threads/async_runner.h"
#include <stdlib.h>
#include <ctime>
#include <memory>
-#include "utils/lock.h"
-#include "utils/threads/async_runner.h"
#include "utils/conditional_variable.h"
+#include "utils/lock.h"
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
@@ -49,7 +49,7 @@ using namespace threads;
namespace {
size_t kCheckValue = 0u;
const size_t kDelegatesAmount = 4u;
-}
+} // namespace
// ThreadDelegate successor
class TestThreadDelegate : public ThreadDelegate {
@@ -93,7 +93,7 @@ class AsyncRunnerTest : public ::testing::Test {
std::shared_ptr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
- delegates_ = new ThreadDelegate* [kDelegatesAmount];
+ delegates_ = new ThreadDelegate*[kDelegatesAmount];
}
void DeleteThreadsArray() {
diff --git a/src/components/utils/test/auto_trace_test.cc b/src/components/utils/test/auto_trace_test.cc
index 1290ce7e96..41dc90cae4 100644
--- a/src/components/utils/test/auto_trace_test.cc
+++ b/src/components/utils/test/auto_trace_test.cc
@@ -30,19 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <fstream>
#include <ctime>
+#include <fstream>
#include "gtest/gtest.h"
#include "utils/auto_trace.h"
-#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "utils/log_message_loop_thread.h"
+#include "utils/logger.h"
+#include "utils/logger_status.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/file_system.h"
#include "utils/threads/thread.h"
-#include "utils/date_time.h"
-#include "utils/logger_status.h"
-#include "utils/helpers.h"
namespace test {
namespace components {
@@ -115,7 +115,7 @@ bool CheckAutoTraceDebugInFile(const std::string& debug_message) {
bool trace_exit = false;
for (std::string line;
Compare<bool, EQ, ONE>(false, debug_found, trace_enter, trace_exit) &&
- getline(file_log, line);) {
+ getline(file_log, line);) {
debug_found = debug_found
? debug_found
: IsLogLineContains(line, debug_log_level, debug_message);
diff --git a/src/components/utils/test/back_trace_test.cc b/src/components/utils/test/back_trace_test.cc
index dcb2a79baa..2c8c61439b 100644
--- a/src/components/utils/test/back_trace_test.cc
+++ b/src/components/utils/test/back_trace_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "utils/back_trace.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/bitstream_test.cc b/src/components/utils/test/bitstream_test.cc
index caec4b3970..3d20845dc4 100644
--- a/src/components/utils/test/bitstream_test.cc
+++ b/src/components/utils/test/bitstream_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/bitstream.h"
#include <unistd.h>
#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/bitstream.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/custom_string_test.cc b/src/components/utils/test/custom_string_test.cc
index bca332be5a..cf03f6099f 100644
--- a/src/components/utils/test/custom_string_test.cc
+++ b/src/components/utils/test/custom_string_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/custom_string.h"
#include <iostream>
#include <string>
#include "gtest/gtest.h"
-#include "utils/custom_string.h"
namespace custom_str = utils::custom_string;
diff --git a/src/components/utils/test/data_accessor_test.cc b/src/components/utils/test/data_accessor_test.cc
index 24b7bab282..b9d8f3b4f9 100644
--- a/src/components/utils/test/data_accessor_test.cc
+++ b/src/components/utils/test/data_accessor_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "utils/data_accessor.h"
+#include "gtest/gtest.h"
#include "utils/lock.h"
namespace test {
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
index 00085813aa..4cde9a4fc4 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/date_time.h"
#include <boost/thread/thread.hpp>
#include "gtest/gtest.h"
-#include "utils/date_time.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
index eb35773fc9..3d518e599f 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -32,8 +32,8 @@
#include <algorithm>
#include <fstream>
-#include <vector>
#include <string>
+#include <vector>
#include "gtest/gtest.h"
#include "utils/file_system.h"
@@ -57,7 +57,7 @@ StringArray MergeStringsToArray(const std::string& first,
return array_of_strings;
}
-}
+} // namespace
TEST(FileSystemTest, CreateDeleteDirectory) {
ASSERT_FALSE(DirectoryExists("./Test directory"));
diff --git a/src/components/utils/test/generated_code_with_sqlite_test.cc b/src/components/utils/test/generated_code_with_sqlite_test.cc
index 1c829c838c..b75ec5c58f 100644
--- a/src/components/utils/test/generated_code_with_sqlite_test.cc
+++ b/src/components/utils/test/generated_code_with_sqlite_test.cc
@@ -29,9 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/generated_code_with_sqlite_test.h"
#include <sqlite3.h>
#include "gtest/gtest.h"
-#include "utils/generated_code_with_sqlite_test.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h b/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
index e21fd75f87..0e75b8ba87 100644
--- a/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
+++ b/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
@@ -35,8 +35,8 @@
#include <string>
#include "policy/policy_table/types.h"
#include "rpc_base/rpc_base.h"
-#include "utils/sqlite_wrapper/sql_query.h"
#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/include/utils/mock_signals_posix.h b/src/components/utils/test/include/utils/mock_signals_posix.h
index 1aad2d5873..363708a668 100644
--- a/src/components/utils/test/include/utils/mock_signals_posix.h
+++ b/src/components/utils/test/include/utils/mock_signals_posix.h
@@ -33,10 +33,10 @@
#ifndef SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
#define SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
-#include "gmock/gmock.h"
-#include "utils/signals.h"
#include <signal.h>
#include "appMain/low_voltage_signals_handler.h"
+#include "gmock/gmock.h"
+#include "utils/signals.h"
namespace utils {
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
index 92287fb45b..74b1f5094f 100644
--- a/src/components/utils/test/log_message_loop_thread_test.cc
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
#include "utils/log_message_loop_thread.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#include "utils/logger_status.h"
namespace test {
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
index 9aa70933d6..b3c654420a 100644
--- a/src/components/utils/test/message_queue_test.cc
+++ b/src/components/utils/test/message_queue_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/message_queue.h"
#include <unistd.h>
#include "gtest/gtest.h"
-#include "utils/message_queue.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index d45e600034..fdfca113a8 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -1,44 +1,44 @@
/*
-* 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.
-*/
+ * 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 <unistd.h>
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/messagemeter.h"
#include "utils/date_time.h"
+#include "utils/messagemeter.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/mock_signals_posix.cc b/src/components/utils/test/mock_signals_posix.cc
index 47531b4a9f..93c08a690d 100644
--- a/src/components/utils/test/mock_signals_posix.cc
+++ b/src/components/utils/test/mock_signals_posix.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
#include "utils/mock_signals_posix.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#include "utils/signals.h"
namespace utils {
diff --git a/src/components/utils/test/posix_thread_test.cc b/src/components/utils/test/posix_thread_test.cc
index a44e1b9b89..4bf0c8c092 100644
--- a/src/components/utils/test/posix_thread_test.cc
+++ b/src/components/utils/test/posix_thread_test.cc
@@ -52,7 +52,7 @@ const char* threadName("test thread");
const std::string test_thread_name("THREAD");
sync_primitives::ConditionalVariable cond_var_;
sync_primitives::Lock test_mutex_;
-};
+}; // namespace
// ThreadDelegate successor
class TestThreadDelegate : public threads::ThreadDelegate {
diff --git a/src/components/utils/test/prioritized_queue_test.cc b/src/components/utils/test/prioritized_queue_test.cc
index 082ff56713..ed22c2db48 100644
--- a/src/components/utils/test/prioritized_queue_test.cc
+++ b/src/components/utils/test/prioritized_queue_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "utils/prioritized_queue.h"
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/qdb_wrapper/sql_database_test.cc b/src/components/utils/test/qdb_wrapper/sql_database_test.cc
index 4e1a822b57..33dfe69119 100644
--- a/src/components/utils/test/qdb_wrapper/sql_database_test.cc
+++ b/src/components/utils/test/qdb_wrapper/sql_database_test.cc
@@ -33,11 +33,11 @@
#include "gtest/gtest.h"
-#include "qdb_wrapper/sql_error.h"
#include "qdb_wrapper/sql_database.h"
+#include "qdb_wrapper/sql_error.h"
-using ::utils::dbms::SQLError;
using ::utils::dbms::SQLDatabase;
+using ::utils::dbms::SQLError;
namespace test {
namespace components {
diff --git a/src/components/utils/test/qdb_wrapper/sql_query_test.cc b/src/components/utils/test/qdb_wrapper/sql_query_test.cc
index e575e4f575..6279f4d8a1 100644
--- a/src/components/utils/test/qdb_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/qdb_wrapper/sql_query_test.cc
@@ -34,12 +34,12 @@
#include "gtest/gtest.h"
-#include "qdb_wrapper/sql_error.h"
#include "qdb_wrapper/sql_database.h"
+#include "qdb_wrapper/sql_error.h"
#include "qdb_wrapper/sql_query.h"
-using ::utils::dbms::SQLError;
using ::utils::dbms::SQLDatabase;
+using ::utils::dbms::SQLError;
using ::utils::dbms::SQLQuery;
namespace test {
diff --git a/src/components/utils/test/resource_usage_test.cc b/src/components/utils/test/resource_usage_test.cc
index 96b4fe4b49..ac8825c841 100644
--- a/src/components/utils/test/resource_usage_test.cc
+++ b/src/components/utils/test/resource_usage_test.cc
@@ -34,8 +34,8 @@
#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/resource_usage.h"
#include "utils/file_system.h"
+#include "utils/resource_usage.h"
namespace utils {
@@ -80,7 +80,7 @@ TEST_F(ResourceUsagePrivateTest, GetProcPathTest) {
// assert
EXPECT_EQ(filename, fd + "/stat");
}
-}
+} // namespace utils
namespace test {
namespace components {
diff --git a/src/components/utils/test/scope_guard_test.cc b/src/components/utils/test/scope_guard_test.cc
index 5e685d6aba..1f9224effa 100644
--- a/src/components/utils/test/scope_guard_test.cc
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -30,18 +30,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gmock/gmock.h"
#include "utils/scope_guard.h"
+#include "gmock/gmock.h"
#include "utils/macro.h"
namespace test {
namespace components {
namespace utils_test {
-using ::utils::ScopeGuard;
+using ::testing::Mock;
using ::utils::MakeGuard;
using ::utils::MakeObjGuard;
-using ::testing::Mock;
+using ::utils::ScopeGuard;
class TestCalleeObject {
public:
@@ -55,7 +55,7 @@ void dealloc(char* ptr) {
delete ptr;
++call_with_param_count;
}
-}
+} // namespace
TEST(ScopeGuardTest, CallFreeFunctionWithParam) {
{
@@ -118,4 +118,4 @@ TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
} // namespace utils_test
} // namespace components
-} // namesapce test
+} // namespace test
diff --git a/src/components/utils/test/singleton_test.cc b/src/components/utils/test/singleton_test.cc
index ae05b6cbab..a38f51726c 100644
--- a/src/components/utils/test/singleton_test.cc
+++ b/src/components/utils/test/singleton_test.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "utils/singleton.h"
#include <pthread.h>
+#include "gtest/gtest.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/sqlite_wrapper/sql_database_test.cc b/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
index 9732fbe078..0195e02121 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
@@ -1,40 +1,40 @@
/* 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.
-*/
+ * 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/sqlite_wrapper/sql_database.h"
#include "gtest/gtest.h"
#include "utils/sqlite_wrapper/sql_error.h"
-#include "utils/sqlite_wrapper/sql_database.h"
-using ::utils::dbms::SQLError;
using ::utils::dbms::SQLDatabase;
+using ::utils::dbms::SQLError;
namespace test {
namespace components {
diff --git a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
index c10c26a2c7..b2d3c747cd 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
@@ -29,17 +29,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string>
#include <sqlite3.h>
+#include <string>
#include "gtest/gtest.h"
-#include "utils/sqlite_wrapper/sql_error.h"
#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_error.h"
#include "utils/sqlite_wrapper/sql_query.h"
-using ::utils::dbms::SQLError;
using ::utils::dbms::SQLDatabase;
+using ::utils::dbms::SQLError;
using ::utils::dbms::SQLQuery;
namespace test {
diff --git a/src/components/utils/test/stl_utils_test.cc b/src/components/utils/test/stl_utils_test.cc
index 5250a7a514..c2701c1558 100644
--- a/src/components/utils/test/stl_utils_test.cc
+++ b/src/components/utils/test/stl_utils_test.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <vector>
+#include "utils/stl_utils.h"
#include <map>
+#include <vector>
#include "gtest/gtest.h"
-#include "utils/stl_utils.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/system_test.cc b/src/components/utils/test/system_test.cc
index b479823aa5..b9daa575ba 100644
--- a/src/components/utils/test/system_test.cc
+++ b/src/components/utils/test/system_test.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gmock/gmock.h"
#include "utils/system.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
diff --git a/src/components/utils/test/test_generator/generated_msg_version_test.cc b/src/components/utils/test/test_generator/generated_msg_version_test.cc
index c9647dcad0..4d1d70a5d6 100644
--- a/src/components/utils/test/test_generator/generated_msg_version_test.cc
+++ b/src/components/utils/test/test_generator/generated_msg_version_test.cc
@@ -30,11 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <iostream>
+#include "generated_msg_version.h"
#include <fstream>
+#include <iostream>
#include <string>
#include "gtest/gtest.h"
-#include "generated_msg_version.h"
#include "utils/file_system.h"
using namespace std;
diff --git a/src/components/utils/test/timer_test.cc b/src/components/utils/test/timer_test.cc
index ea5c9f0b84..d7b196876d 100644
--- a/src/components/utils/test/timer_test.cc
+++ b/src/components/utils/test/timer_test.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gtest/gtest.h"
#include "utils/timer.h"
-#include "utils/mock_timer_task.h"
+#include "gtest/gtest.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/macro.h"
+#include "utils/mock_timer_task.h"
#include "utils/timer_task_impl.h"
namespace test {
diff --git a/tools/InterfaceGenerator/MsgVersionGenerate.py b/tools/InterfaceGenerator/MsgVersionGenerate.py
index 4a24a3239f..6ec0c40a68 100644
--- a/tools/InterfaceGenerator/MsgVersionGenerate.py
+++ b/tools/InterfaceGenerator/MsgVersionGenerate.py
@@ -96,6 +96,7 @@ def prepare_data_for_storage(major_version, minor_version, patch_version, minimu
u'''*/\n'''
u'''#ifndef GENERATED_MSG_VERSION_H\n'''
u'''#define GENERATED_MSG_VERSION_H\n\n'''
+ u'''#include <cstdint>\n\n'''
u'''namespace application_manager {\n\n'''
u'''const uint16_t major_version = $m_version;\n'''
u'''const uint16_t minor_version = $min_version;\n'''
diff --git a/tools/infrastructure/check_style.sh b/tools/infrastructure/check_style.sh
index 08ae1b9860..006dd340d9 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-3.6
+FORMATER=clang-format-6.0
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 9c46f195f3..710f0656c3 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-3.6
-CLANG_FORMAT=clang-format-3.6
+# Auto update c++ files with clang-format-6.0
+CLANG_FORMAT=clang-format-6.0
# Verify clang-format
-CLANG_FORMAT_REQUIRED_VERSION=3.6
+CLANG_FORMAT_REQUIRED_VERSION=6.0
CLANG_FORMAT_CURRENT_VERSION=$($CLANG_FORMAT -version)
if [[ $CLANG_FORMAT_CURRENT_VERSION != *$CLANG_FORMAT_REQUIRED_VERSION* ]]
then