summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2019-03-08 00:29:12 -0500
committerGitHub <noreply@github.com>2019-03-08 00:29:12 -0500
commit121f62b0ca53bcf6fdcb6ffb561261524b412ed2 (patch)
tree921488f777cfa7bf2d0e15ea3d387e8a74ba98de
parentf8e92350ef0dc3b807ed9e5a2a97cf87b77d975c (diff)
parent0fdfd32ff5ebeae5d6eb8f92131b235de5441236 (diff)
downloadsdl_core-121f62b0ca53bcf6fdcb6ffb561261524b412ed2.tar.gz
Merge pull request #2802 from smartdevicelink/feature/base_app_services_implementation
Base App Services Implementation
-rw-r--r--src/appMain/sdl_preloaded_pt.json80
-rw-r--r--src/appMain/smartDeviceLink.ini10
-rw-r--r--src/components/application_manager/include/application_manager/app_service_manager.h188
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h31
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h7
-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.h30
-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/request_from_hmi.h37
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event.h99
-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.h51
-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/hmi_interfaces.h3
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h6
-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/policies/external/policy_event_observer.h1
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h25
-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/rpc_handler_impl.h3
-rw-r--r--src/components/application_manager/include/application_manager/rpc_passing_handler.h113
-rw-r--r--src/components/application_manager/include/application_manager/rpc_service_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h30
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h1
-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.h93
-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.h94
-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.h80
-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.h88
-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.h81
-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.cc159
-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.cc87
-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.cc114
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc62
-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.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc88
-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.cc155
-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.cc74
-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.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc130
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc74
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc117
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc177
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc61
-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.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc61
-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/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/on_bc_system_capability_updated_notification.h79
-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/on_system_capability_updated_notification.h84
-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/sdl_rpc_plugin.h25
-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/on_bc_system_capability_updated_notification.cc165
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc355
-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.cc41
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc175
-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.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc6
-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/get_urls_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc140
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc38
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc38
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc7
-rw-r--r--src/components/application_manager/src/app_service_manager.cc563
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc44
-rw-r--r--src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc24
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc114
-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.cc188
-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.cc72
-rw-r--r--src/components/application_manager/src/event_engine/event_observer.cc23
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc12
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc4
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc45
-rw-r--r--src/components/application_manager/src/plugin_manager/plugin_keys.cc14
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc2
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc68
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc72
-rw-r--r--src/components/application_manager/src/rpc_passing_handler.cc331
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc118
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc30
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc1
-rw-r--r--src/components/application_manager/src/system_time/system_time_handler_impl.cc2
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc13
-rw-r--r--src/components/application_manager/test/command_holder_test.cc14
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc6
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc2
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h20
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.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.cc9
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc11
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc4
-rw-r--r--src/components/config_profile/include/config_profile/profile.h8
-rw-r--r--src/components/config_profile/src/profile.cc68
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h10
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h10
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h8
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h6
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cc12
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cc12
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc6
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/include/application_manager/application_manager.h7
-rw-r--r--src/components/include/application_manager/application_manager_settings.h3
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h26
-rw-r--r--src/components/include/application_manager/rpc_service.h15
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h10
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h10
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h5
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h5
-rw-r--r--src/components/include/test/application_manager/mock_rpc_service.h9
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h9
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h4
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h4
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h4
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h4
-rw-r--r--src/components/interfaces/HMI_API.xml598
-rw-r--r--src/components/interfaces/MOBILE_API.xml656
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h10
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h10
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h10
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h30
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h51
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml3
-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.h6
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc16
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc6
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc30
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc119
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc8
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc28
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc64
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc161
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc4
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h30
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h51
-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.h7
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc16
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc6
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc54
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc118
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc8
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc64
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc162
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc4
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h11
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h15
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h10
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h10
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h10
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc9
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc15
-rw-r--r--src/components/smart_objects/src/schema_item.cc5
-rw-r--r--src/components/smart_objects/src/smart_schema.cc9
-rw-r--r--src/components/utils/include/utils/file_system.h13
-rw-r--r--src/components/utils/src/file_system.cc20
265 files changed, 13598 insertions, 560 deletions
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index a2fdb7740a..06b9c3caa4 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -180,6 +180,12 @@
"LIMITED",
"NONE"]
},
+ "OnSystemCapabilityUpdated": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
"PerformAudioPassThru": {
"hmi_levels": ["FULL",
"LIMITED"]
@@ -193,7 +199,7 @@
"FULL",
"LIMITED",
"NONE"]
- },
+ },
"RegisterAppInterface": {
"hmi_levels": ["BACKGROUND",
"FULL",
@@ -579,6 +585,78 @@
}
}
},
+ "AppServiceProducer":{
+ "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": {
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index ccb377d1e6..54c2395c47 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -369,3 +369,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/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..f7c46178c5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_service_manager.h
@@ -0,0 +1,188 @@
+/*
+ * 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 "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "application_manager/rpc_passing_handler.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 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
+ */
+ ~AppServiceManager();
+
+ /**
+ * @brief TODO
+ * @param manifest
+ */
+ smart_objects::SmartObject PublishAppService(
+ const smart_objects::SmartObject& manifest,
+ const bool mobile_service,
+ const uint32_t connection_key);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ */
+ bool UnpublishAppService(const std::string service_id);
+
+ void OnAppActivated(ApplicationConstSharedPtr app);
+
+ /**
+ * @brief TODO
+ * @param connection_key
+ */
+ void UnpublishServices(const uint32_t connection_key);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ */
+ bool SetDefaultService(const std::string service_id);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ */
+ bool RemoveDefaultService(const std::string service_id);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ */
+ bool ActivateAppService(const std::string service_id);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ */
+ bool DeactivateAppService(const std::string service_id);
+
+ /**
+ * @brief TODO
+ * @param manifest
+ */
+ std::vector<smart_objects::SmartObject> GetAllServices();
+ std::vector<std::pair<std::string, AppService> > GetActiveServices();
+
+ void GetProviderByType(const std::string& service_type,
+ bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ void GetProviderByID(const std::string& service_id,
+ bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ AppService* ActiveServiceByType(std::string service_type);
+
+ AppService* EmbeddedServiceForType(std::string service_type);
+
+ AppService* FindServiceByName(std::string name);
+
+ AppService* FindServiceByID(std::string service_id);
+
+ std::string DefaultServiceByType(std::string service_type);
+
+ /**
+ * @brief TODO
+ * @param service_id
+ * @param service_published
+ */
+ void SetServicePublished(const std::string service_id,
+ bool service_published);
+
+ /**
+ * @brief TODO
+ * @param out_params
+ */
+ bool UpdateNavigationCapabilities(smart_objects::SmartObject& out_params);
+
+ 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 AppServiceUpdated(
+ const smart_objects::SmartObject& service_record,
+ const mobile_apis::ServiceUpdateReason::eType update_reason,
+ smart_objects::SmartObject& msg_params);
+ void GetProviderFromService(const AppService& service,
+ bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+ AppService* FindServiceByPolicyAppID(std::string policy_app_id,
+ std::string type);
+ 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_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index d72d03fa53..27be913cd5 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
@@ -229,6 +229,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;
@@ -408,6 +413,13 @@ class ApplicationManagerImpl
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
*
* @return Unique correlation ID
@@ -719,6 +731,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.
*
@@ -1127,7 +1148,8 @@ class ApplicationManagerImpl
mobile_apis::MOBILE_API& mobile_so_factory();
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
- Message& output);
+ Message& output,
+ const bool remove_unknown_parameters = true);
template <typename ApplicationList>
void PrepareApplicationListSO(ApplicationList app_list,
@@ -1431,6 +1453,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
@@ -1453,6 +1476,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_;
@@ -1562,6 +1586,11 @@ class ApplicationManagerImpl
plugin_manager_.reset(plugin_manager.release());
}
+ virtual void SetAppServiceManager(
+ std::unique_ptr<AppServiceManager>& app_service_manager) {
+ app_service_manager_.reset(app_service_manager.release());
+ }
+
private:
#endif
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..d832995b8d 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -112,7 +112,12 @@ class Command {
*/
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_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..e12c6de3ab 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
@@ -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
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..a1e63561bf
--- /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/commands/command_impl.h"
+#include "application_manager/application_manager.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..65983d82f8
--- /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/commands/command_impl.h"
+#include "application_manager/application_manager.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/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
index 927a45c6a6..a37e0a289e 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,20 @@ 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.
*/
- 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
@@ -78,6 +82,31 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
const hmi_apis::Common_Result::eType result_code,
const std::string error_message);
+ 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:
/**
* @brief Fills common parameters for SO
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..cfd6e95693 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,6 +34,7 @@
#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"
@@ -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 response_so_.getElement(strings::params)
+ .getElement(strings::function_id)
+ .asInt();
+}
+
+int32_t MobileEvent::smart_object_correlation_id() const {
+ return response_so_.getElement(strings::params)
+ .getElement(strings::correlation_id)
+ .asInt();
+}
+
+int32_t MobileEvent::smart_object_type() const {
+ return 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..75e77e603c 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
@@ -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/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/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 93cf6f9ad3..ac84bcfaa5 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -886,6 +886,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/plugin_manager/plugin_keys.h b/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h
new file mode 100644
index 0000000000..11a7d353f6
--- /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_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/policies/external/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
index 8c904bf513..3168b80b5a 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
@@ -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 2b6919eac0..abc98876a2 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
@@ -449,6 +449,31 @@ class PolicyHandler : public PolicyHandlerInterface,
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;
+
virtual void OnUpdateHMIAppType(
std::map<std::string, StringArray> app_hmi_types) OVERRIDE;
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/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
index cc93e4213c..b7e74c5ab3 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
@@ -158,7 +158,8 @@ class RPCHandlerImpl : public RPCHandler,
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 remove_unknown_parameters = 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..3ed10ff1e6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_passing_handler.h
@@ -0,0 +1,113 @@
+/*
+ * 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 "application_manager/application.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/app_service_manager.h"
+#include <deque>
+#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 Function to handle sending and receiving RPC Passing
+ * requests/responses
+ * @param rpc_message RPC message SmartObject
+ * @return true if the request was forwarded, 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);
+
+ 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..848e9645e7 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
@@ -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,7 +131,8 @@ class RPCServiceImpl : public RPCService,
private:
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
- Message& output);
+ Message& output,
+ const bool remove_unknown_parameters = true);
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
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 2e8b02d06b..67c849c8fc 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
@@ -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;
@@ -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;
@@ -200,6 +202,7 @@ 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;
@@ -302,6 +305,31 @@ 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* 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;
+
// resuming
extern const char* application_commands;
extern const char* application_submenus;
@@ -368,6 +396,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;
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..8270e9b807 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
@@ -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
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..2bdc150906
--- /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..9be93f5c9e
--- /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_;
+};
+}
+
+#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..847b921502
--- /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,93 @@
+/*
+ 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 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:
+ 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..775bb9f812
--- /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,94 @@
+/*
+ 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;
+
+ 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..30af13038a
--- /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,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_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:
+ 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..8295e855fa
--- /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,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_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:
+ AppServiceRpcPlugin* plugin_;
+ 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..1411b23e5a
--- /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,81 @@
+/*
+ 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:
+ AppServiceRpcPlugin* plugin_;
+ 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..63812056f1
--- /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) 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/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;
+}
+}
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..f0a0698bb7
--- /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 service_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..7cfbdd22d0
--- /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>();
+}
+}
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..4b4da5e3e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
@@ -0,0 +1,159 @@
+/*
+ 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:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::PublishAppServiceRequest>()
+ : factory.GetCreator<commands::PublishAppServiceResponse>();
+ 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 vehicle_info_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..b96e5c199d
--- /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 "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "app_service_rpc_plugin/app_service_app_extension.h"
+#include "app_service_rpc_plugin/app_service_command_factory.h"
+#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
+#include "application_manager/plugin_manager/plugin_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..7c32d9bbe1
--- /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,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.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.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..5cdbbfc012
--- /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,114 @@
+/*
+ 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/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::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_GetAppServiceData,
+ result,
+ &msg_params,
+ application_manager::commands::Command::SOURCE_SDL_TO_HMI);
+}
+
+void ASGetAppServiceDataRequestFromHMI::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_GetAppServiceData,
+ result,
+ &msg_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_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..822cd0a29b
--- /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,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_app_service_data_request_to_hmi.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+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..9ce6ffdb50
--- /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/MOBILE_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..9e2289d39e
--- /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,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_app_service_data_response_to_hmi.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+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..1131448d2f
--- /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,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.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.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().GetAllServices();
+
+ 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..2b66993d8f
--- /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,155 @@
+/*
+ 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/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()) {
+ smart_objects::SmartObject response_params;
+ response_params[strings::info] =
+ "No HMI origin ID to use for interaction passthrough";
+ SendResponse(
+ false,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ hmi_apis::Common_Result::INVALID_DATA,
+ &response_params,
+ 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) {
+ smart_objects::SmartObject response_params;
+ response_params[strings::info] = "The requested service ID does not exist";
+ SendResponse(false,
+ correlation_id(),
+ hmi_apis::FunctionID::AppService_PerformAppServiceInteraction,
+ hmi_apis::Common_Result::INVALID_ID,
+ &response_params,
+ 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);
+}
+
+} // 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..b816016fa7
--- /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,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.
+ */
+
+#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.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, UINT32_MAX);
+
+ 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);
+}
+
+} // 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..80dd88c15f
--- /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,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/on_as_app_service_data_notification.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::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Sending AS data to HMI");
+ 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..05266f834b
--- /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,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/on_as_app_service_data_notification_from_hmi.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");
+ 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..0d387785ee
--- /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,130 @@
+/*
+ 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)
+ , plugin_(NULL) {
+ auto plugin = (application_manager.GetPluginManager().FindPluginToProcess(
+ mobile_apis::FunctionID::GetAppServiceDataID,
+ app_mngr::commands::Command::CommandSource::SOURCE_MOBILE));
+ if (plugin) {
+ plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
+ }
+}
+
+GetAppServiceDataRequest::~GetAppServiceDataRequest() {}
+
+void GetAppServiceDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::service_type].asString();
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if ((*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);
+ }
+ }
+
+ SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID,
+ hmi_apis::FunctionID::AppService_GetAppServiceData,
+ &(*message_),
+ true);
+}
+
+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);
+
+ 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);
+
+ 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..2bf81b3a2d
--- /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,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/get_app_service_data_request_to_mobile.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+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..df7bbba2f7
--- /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,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/get_app_service_data_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace app_service_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+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..f8c1f3892d
--- /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,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.
+ */
+
+#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)
+ , plugin_(NULL) {
+ auto plugin = (application_manager.GetPluginManager().FindPluginToProcess(
+ mobile_apis::FunctionID::PublishAppServiceID,
+ app_mngr::commands::Command::CommandSource::SOURCE_MOBILE));
+ if (plugin) {
+ plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
+ }
+}
+
+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..2c6ba414e0
--- /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,117 @@
+/*
+ Copyright (c) 2019, Ford Motor Company, Livio
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the the copyright holders nor the names of their
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "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/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..1328e128d4
--- /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,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 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/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_);
+
+ std::string service_type =
+ (*message_)[strings::msg_params][strings::app_service_manifest]
+ [strings::service_type].asString();
+
+ ApplicationSharedPtr app = application_manager_.application(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;
+ }
+
+ 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..9e262f0ca3
--- /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,177 @@
+/*
+ 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/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;
+ }
+
+ 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->is_foreground()) {
+ // 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..8d71174c8d
--- /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,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 "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.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..774ec93720
--- /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,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/perform_app_service_interaction_response.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.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..22d8e50c3a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
@@ -0,0 +1,124 @@
+/*
+ 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/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",
+ NULL);
+ 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 (app->is_foreground()) {
+ // 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..b1136c79d0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_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 "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"
+#include "interfaces/MOBILE_API.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/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..d49f3e9e36 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
@@ -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());
@@ -153,7 +154,8 @@ 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();
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..3bc1106573 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,7 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+#include "application_manager/plugin_manager/plugin_keys.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_command_factory.h"
#include "rc_rpc_plugin/rc_app_extension.h"
@@ -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() {
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..e9d1063648 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
@@ -196,8 +196,8 @@ TEST_F(ButtonPressRequestTest,
SetResourceState(resource, kAppId, rc_rpc_plugin::ResourceState::BUSY));
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress)))
- .WillOnce(Return(true));
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress),
+ _)).WillOnce(Return(true));
// Act
std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
@@ -230,8 +230,9 @@ TEST_F(
.Times(2);
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_ButtonPress))).Times(0);
+ 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..4e74e74ef8 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
@@ -199,9 +199,10 @@ TEST_F(GetInteriorVehicleDataRequestTest,
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
command->Run();
@@ -225,9 +226,10 @@ TEST_F(GetInteriorVehicleDataRequestTest,
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
command->Run();
@@ -253,7 +255,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_,
@@ -295,9 +297,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_,
@@ -347,7 +350,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_,
@@ -383,7 +386,7 @@ TEST_F(
.WillByDefault(Return(&rc_capabilities));
// 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::UNSUPPORTED_RESOURCE),
@@ -407,7 +410,7 @@ TEST_F(
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), _))
@@ -443,9 +446,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
@@ -478,9 +482,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(
@@ -519,9 +524,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(
@@ -569,10 +575,11 @@ 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)))
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData),
+ _)).WillRepeatedly(Return(true));
// Act
command->Run();
}
@@ -585,7 +592,7 @@ 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
command->Run();
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/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/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..17f8a5b3c8
--- /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 app_service_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/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/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..1f7e8468db
--- /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 "application_manager/commands/command_notification_impl.h"
+#include "policy/policy_table/enums.h"
+#include <vector>
+
+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 application_manager
+
+#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/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..fb82cf37c2
--- /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_;
+};
+}
+
+#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/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
index 6ae3a0b6bc..b57fcbec12 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
@@ -36,29 +36,32 @@
#include "application_manager/command_factory.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_;
};
}
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..b86ab6a2b8
--- /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/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/event_engine/event.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/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..73ec1137a8
--- /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,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 "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.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().GetAllServices();
+ 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 app_service_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..2b3611fece
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc
@@ -0,0 +1,355 @@
+/*
+ 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 "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/app_service_manager.h"
+#include "utils/file_system.h"
+#include <boost/crc.hpp>
+
+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..63a4416139 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
@@ -31,6 +31,9 @@
*/
#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h"
+#include "application_manager/message_helper.h"
+#include <set>
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -80,10 +83,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;
+ auto 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 +141,34 @@ void GetSystemCapabilityRequest::Run() {
return;
}
break;
+ case mobile_apis::SystemCapabilityType::APP_SERVICES: {
+ auto all_services =
+ application_manager_.GetAppServiceManager().GetAllServices();
+ 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);
}
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..b5e3a73ee4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
@@ -0,0 +1,175 @@
+#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.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().GetAllServices();
+ 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 application_manager
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..130585a927
--- /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;
+}
+} \ 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 7065c7cf7d..3cfe4d7118 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
@@ -240,6 +240,10 @@
#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_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/bc_get_file_path_request.h"
+#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h"
+
+#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -840,6 +844,15 @@ 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>(); }
}
}
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 5ef76b59ef..554d004360 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
@@ -73,6 +73,7 @@
#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_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_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"
#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
@@ -128,6 +129,8 @@
#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_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 "interfaces/MOBILE_API.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -235,6 +238,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>()
@@ -396,6 +404,10 @@ 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>();
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..d745cd8f44 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,7 +71,8 @@ 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;
}
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..c448b41ff1 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
@@ -30,17 +30,21 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/plugin_manager/plugin_keys.h"
#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
#include "sdl_rpc_plugin/sdl_command_factory.h"
+#include "sdl_rpc_plugin/extensions/system_capability_app_extension.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/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
index 2191900750..20a05d8601 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
@@ -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();
@@ -197,7 +197,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 +226,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 +261,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();
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..ca322ea425 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
@@ -945,7 +945,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 +973,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();
}
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..c7fbdb663b 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
@@ -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/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..25abefb010 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
@@ -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 8543a201bf..a90c0c70fc 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
@@ -166,9 +166,9 @@ TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DeactivateApp_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();
@@ -487,7 +487,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/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..a69f6c71fc 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
@@ -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,
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..4f415975ba 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
@@ -310,7 +310,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/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..70fc80bbd1 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
@@ -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/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..259fd0b92b 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
@@ -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/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..0023368b5a 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
@@ -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/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
index e32cc2b335..a66d0d557f 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
@@ -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);
}
@@ -477,10 +477,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
(*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak),
+ _)).WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
@@ -509,10 +508,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
VerifyTtsFiles(
(*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak),
+ _)).WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
@@ -556,9 +554,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 +603,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);
@@ -643,10 +641,9 @@ TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
VerifyTtsFiles(
(*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak),
+ _)).WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
@@ -654,9 +651,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);
@@ -693,10 +690,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
VerifyTtsFiles(
(*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak),
+ _)).WillOnce(Return(true));
CommandPtr command(CreateCommand<AlertRequest>(msg_));
command->Run();
@@ -704,9 +700,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 +739,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/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..3abda89234 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
@@ -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();
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..c209c4fea2 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
@@ -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..ff9e29c872 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
@@ -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..ffa1b833be 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
@@ -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/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..f450d4b671 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
@@ -205,7 +205,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/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..acda9b9fc7 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
@@ -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_,
@@ -342,7 +342,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 +355,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 +431,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 +444,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_);
@@ -505,7 +505,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 +518,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 +551,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 +564,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)));
}
@@ -613,7 +613,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 +676,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 +703,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 +751,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 +783,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 +796,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 +807,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 +819,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();
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..415b559f82 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
@@ -315,10 +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)))
- .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_OnPutFile),
+ _)).WillOnce(Return(true));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
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..868d353a85 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
@@ -207,27 +207,36 @@ class RegisterAppInterfaceRequestTest
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(response_result_code), _));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
- .Times(0);
+ 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)))
- .Times(0);
+ 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,13 +306,15 @@ 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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _)).WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
@@ -399,25 +410,27 @@ TEST_F(RegisterAppInterfaceRequestTest,
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ _)).WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription),
+ _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration)))
- .WillOnce(Return(true));
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration),
+ _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_ChangeRegistration)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration),
+ _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
- .WillOnce(Return(true));
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration),
+ _)).WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
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..38585319e4 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
@@ -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();
}
@@ -238,12 +238,13 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
.WillOnce(Return(so_help_prompt.get()));
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)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
@@ -275,9 +276,9 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
command_->Run();
@@ -321,12 +322,13 @@ TEST_F(ResetGlobalPropertiesRequestTest,
(*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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ 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);
@@ -363,9 +365,9 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
smart_objects::SmartObjectSPtr vr_help =
std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
@@ -413,12 +415,13 @@ 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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
ResetGlobalPropertiesRequestPtr command =
@@ -478,12 +481,13 @@ 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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _))
.WillOnce(Return(true));
command_->Run();
@@ -542,12 +546,13 @@ 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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ 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/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..19f799448a 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
@@ -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..4cab3db2a3 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
@@ -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_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
index cd6af1512d..10ca925739 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
@@ -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();
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..94dbbc8b44 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
@@ -322,12 +322,13 @@ TEST_F(SetGlobalPropertiesRequestTest,
(*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)))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties),
+ _)).WillOnce(Return(true));
+ 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;
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..04a7da60cf 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
@@ -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..4540980b9e 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
@@ -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();
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..14e670a387 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
@@ -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();
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..5dcbd7e6b9 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
@@ -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();
}
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..df3e778ee6 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
@@ -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;
@@ -230,7 +230,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;
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..298661dc74 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
@@ -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,7 @@ 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());
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..22893b771c 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
@@ -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..818ee06e96 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
@@ -123,8 +123,10 @@ TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
.WillOnce(Return(true));
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/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..0c6e0a07b1 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,7 +64,8 @@ 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);
}
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..c9e9839929 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
@@ -33,6 +33,7 @@
#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/plugin_manager/plugin_keys.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/message_helper.h"
#include "application_manager/message_helper.h"
@@ -41,6 +42,7 @@ 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 +63,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() {
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..679d9d0e58 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
@@ -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..b27a306a5c 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
@@ -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..981d649a94 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
@@ -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..cb78e44904 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
@@ -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/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..165c7694b1 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
@@ -149,9 +149,10 @@ TEST_F(UnsubscribeVehicleRequestTest,
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData)))
- .WillOnce(Return(true));
+ ManageHMICommand(
+ HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData),
+ _)).WillOnce(Return(true));
vehicle_info_plugin::VehicleInfoAppExtension* vi_app_extension =
dynamic_cast<vehicle_info_plugin::VehicleInfoAppExtension*>(
vi_app_extension_ptr_.get());
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..d148e4ef61
--- /dev/null
+++ b/src/components/application_manager/src/app_service_manager.cc
@@ -0,0 +1,563 @@
+/*
+ * 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/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 = "";
+
+ 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 service_type = manifest[strings::service_type].asString();
+
+ 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 = 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 = ActiveServiceByType(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::GetAllServices() {
+ 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,
+ bool mobile_consumer,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto active_service = ActiveServiceByType(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,
+ 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,
+ 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 = ActiveServiceByType(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_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::ActiveServiceByType(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(
+ 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::FindServiceByName(std::string name) {
+ 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_name]
+ .asString() == name) {
+ return &(it->second);
+ }
+ }
+ return NULL;
+}
+
+AppService* AppServiceManager::FindServiceByPolicyAppID(
+ std::string policy_app_id, 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(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);
+}
+
+std::string AppServiceManager::DefaultServiceByType(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,
+ 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 = ActiveServiceByType(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<std::pair<std::string, AppService> >
+AppServiceManager::GetActiveServices() {
+ std::vector<std::pair<std::string, 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);
+ }
+ }
+ return active_services;
+}
+
+RPCPassingHandler& AppServiceManager::GetRPCPassingHandler() {
+ return rpc_passing_handler_;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 61c0f41524..9d16c366d5 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -133,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;
@@ -725,6 +726,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
@@ -1224,6 +1227,16 @@ ApplicationManagerImpl::GetCloudAppConnectionStatus(
}
}
+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() {
if (corelation_id_ < max_corelation_id_) {
corelation_id_++;
@@ -2223,6 +2236,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;
}
@@ -2250,7 +2266,9 @@ bool ApplicationManagerImpl::Stop() {
}
bool ApplicationManagerImpl::ConvertSOtoMessage(
- const smart_objects::SmartObject& message, Message& output) {
+ const smart_objects::SmartObject& message,
+ Message& output,
+ const bool remove_unknown_parameters) {
LOG4CXX_AUTO_TRACE(logger_);
if (smart_objects::SmartType_Null == message.getType() ||
@@ -2275,16 +2293,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, remove_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, remove_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -2296,7 +2314,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
break;
}
case 1: {
- if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ if (!formatters::FormatterJsonRpc::ToString(
+ message, output_string, remove_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -2595,6 +2614,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 =
@@ -2831,6 +2861,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_);
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..f9b084323a 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
@@ -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_.SendMessageToHMI(message_);
+}
+
+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_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index 68e8cfe6b4..344831f882 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -41,6 +41,8 @@
#include "application_manager/message_helper.h"
#include "smart_objects/smart_object.h"
+#include "smart_objects/enum_schema_item.h"
+
namespace application_manager {
namespace commands {
@@ -233,7 +235,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 +260,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 +292,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 +422,85 @@ 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;
+ 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);
+ } 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);
+ }
+
+ 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,
+ mobile_apis::Result::DATA_NOT_AVAILABLE,
+ "No app service provider available");
+ 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 +526,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 +561,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 +898,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..b6bb8d4e3c 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_.SendMessageToHMI(message);
+}
+
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..0adb389e76 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -32,7 +32,13 @@
#include "application_manager/commands/request_from_hmi.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,11 +73,15 @@ 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);
@@ -81,7 +91,11 @@ void RequestFromHMI::SendResponse(
(*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(
@@ -111,5 +125,175 @@ 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;
+ 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);
+ } 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);
+ }
+
+ 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");
+ 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..3f3cfae1d3 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
@@ -122,5 +122,77 @@ 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/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 452b5ab79d..9aff403e09 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -103,6 +103,8 @@ 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[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Started] = HmiInterfaces::HMI_INTERFACE_VR;
convert_map[VR_Stopped] = HmiInterfaces::HMI_INTERFACE_VR;
@@ -227,6 +229,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;
}
@@ -250,6 +260,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..647df242df 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -284,7 +284,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 +304,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/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index cc291bbfe3..0e44a53c6f 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -338,6 +338,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_);
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..9eabc67c09
--- /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_manager
+} // namespace application_manager \ No newline at end of file
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..ea8935c8c5 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -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 691ac21040..6a164d196a 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -1987,6 +1987,74 @@ void PolicyHandler::OnSetCloudAppProperties(
}
}
+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;
+}
+
uint32_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const {
POLICY_LIB_CHECK(0);
return policy_manager_->HeartBeatTimeout(app_id);
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index 939b3d1ce6..6374e2a955 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/rpc_handler_impl.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
namespace application_manager {
namespace rpc_handler {
@@ -38,6 +39,7 @@ 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 +65,54 @@ void RPCHandlerImpl::ProcessMessageFromMobile(
#endif // TELEMETRY_MONITOR
smart_objects::SmartObjectSPtr so_from_mobile =
std::make_shared<smart_objects::SmartObject>();
-
+ bool remove_unknown_parameters = true;
DCHECK_OR_RETURN_VOID(so_from_mobile);
if (!so_from_mobile) {
LOG4CXX_ERROR(logger_, "Null pointer");
return;
}
- if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ 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());
+ remove_unknown_parameters = false;
+ }
+
+ if (!ConvertMessageToSO(
+ *message, *so_from_mobile, remove_unknown_parameters)) {
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();
+ if (app_manager_.GetAppServiceManager()
+ .GetRPCPassingHandler()
+ .RPCPassThrough(*so_from_mobile)) {
+ // RPC was forwarded. Skip handling by Core
+ return;
+ } else if (!app_manager_.GetAppServiceManager()
+ .GetRPCPassingHandler()
+ .IsPassThroughMessage(correlation_id,
+ commands::Command::SOURCE_MOBILE,
+ message_type)) {
+ // Since PassThrough failed, refiltering the message
+ if (!ConvertMessageToSO(*message, *so_from_mobile, true)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+ }
+ }
+
#ifdef TELEMETRY_MONITOR
metric->message = so_from_mobile;
#endif // TELEMETRY_MONITOR
@@ -95,13 +134,28 @@ void RPCHandlerImpl::ProcessMessageFromHMI(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr smart_object =
std::make_shared<smart_objects::SmartObject>();
-
+ bool remove_unknown_parameters = true;
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());
+ remove_unknown_parameters = false;
+ }
+
+ if (!ConvertMessageToSO(*message, *smart_object, remove_unknown_parameters)) {
if (application_manager::MessageType::kResponse ==
(*smart_object)[strings::params][strings::message_type].asInt()) {
(*smart_object).erase(strings::msg_params);
@@ -228,7 +282,8 @@ 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 remove_unknown_parameters) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"\t\t\tMessage to convert: protocol "
@@ -262,13 +317,16 @@ bool RPCHandlerImpl::ConvertMessageToSO(
}
if (!conversion_result ||
- !mobile_so_factory().attachSchema(output, true, msg_version) ||
+ !mobile_so_factory().attachSchema(
+ output, remove_unknown_parameters, msg_version) ||
((output.validate(&report, msg_version) !=
- smart_objects::errors::OK))) {
+ smart_objects::errors::OK &&
+ remove_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(),
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..560418e910
--- /dev/null
+++ b/src/components/application_manager/src/rpc_passing_handler.cc
@@ -0,0 +1,331 @@
+/*
+ * 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/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_passing_handler.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"
+
+#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->second.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::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. Continuing");
+ return false;
+ }
+
+ 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);
+ auto result_code = static_cast<mobile_apis::Result::eType>(
+ rpc_message[strings::msg_params][strings::result_code].asInt());
+
+ 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->second
+ .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->first,
+ services_it->second.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();
+ 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;
+ uint32_t cid = it->second;
+ if (timer->is_completed()) {
+ LOG4CXX_DEBUG(logger_,
+ "Removing completed timer for correlation id " << cid);
+ 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..d8329ba8cf 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/rpc_service_impl.h"
+#include "application_manager/plugin_manager/plugin_keys.h"
namespace application_manager {
namespace rpc_service {
@@ -38,6 +39,7 @@ 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,
@@ -154,7 +156,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 +255,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 +272,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 +388,7 @@ void RPCServiceImpl::SendMessageToMobile(
const bool is_result_code_exists =
(*message)[strings::msg_params].keyExists(strings::result_code);
+ bool remove_unknown_parameters = true;
if (!app) {
LOG4CXX_ERROR(logger_, "No application associated with connection key");
@@ -405,7 +420,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);
+ remove_unknown_parameters = false;
+ }
+
+ 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())) {
+ remove_unknown_parameters = true;
+ }
+ if (!ConvertSOtoMessage(
+ (*message), (*message_to_send), remove_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
return;
}
@@ -484,6 +523,7 @@ void RPCServiceImpl::SendMessageToHMI(
return;
}
+ bool remove_unknown_parameters = true;
// 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 +537,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());
+
+ remove_unknown_parameters = false;
+ }
+
+ if (!ConvertSOtoMessage(
+ *message, *message_to_send, remove_unknown_parameters)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
@@ -506,6 +556,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 +604,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 remove_unknown_parameters) {
LOG4CXX_AUTO_TRACE(logger_);
if (smart_objects::SmartType_Null == message.getType() ||
@@ -543,16 +630,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, remove_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, remove_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -564,7 +651,8 @@ bool RPCServiceImpl::ConvertSOtoMessage(
break;
}
case 1: {
- if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ if (!formatters::FormatterJsonRpc::ToString(
+ message, output_string, remove_unknown_parameters)) {
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
@@ -577,7 +665,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)
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 485b59c520..a1dedd1d64 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";
@@ -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";
@@ -167,6 +169,7 @@ 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";
@@ -269,6 +272,31 @@ 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* 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";
+
// resuming
const char* application_commands = "applicationCommands";
const char* application_submenus = "applicationSubMenus";
@@ -328,6 +356,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 5e912ca3be..f4852c532c 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -624,6 +624,7 @@ 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;
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..06343af5a3 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
@@ -56,7 +56,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/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index d4e73ef492..f27e252142 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -36,25 +36,26 @@
#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_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/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"
@@ -138,6 +139,11 @@ class ApplicationManagerImplTest : public ::testing::Test {
app_manager_impl_->resume_controller().set_resumption_storage(
mock_storage_);
app_manager_impl_->set_connection_handler(&mock_connection_handler_);
+ Json::Value empty;
+ ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(empty));
+ std::unique_ptr<AppServiceManager> app_service_manager_ptr(
+ new AppServiceManager(*app_manager_impl_, mock_last_state_));
+ app_manager_impl_->SetAppServiceManager(app_service_manager_ptr);
}
void CreateAppManager() {
@@ -209,6 +215,7 @@ class ApplicationManagerImplTest : public ::testing::Test {
std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
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_;
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
index 56e24b8d29..9496e37924 100644
--- a/src/components/application_manager/test/command_holder_test.cc
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -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(
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..d4a62d069f 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
@@ -258,7 +258,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 +280,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 +298,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,
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index ae95fca35f..d67dfebaa5 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -583,7 +583,7 @@ 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(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _))
.WillRepeatedly(Return(true));
}
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..8dd29ce244 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
@@ -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/mock_event_dispatcher.h b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
index 916f4a69f0..c5aedba029 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
@@ -59,6 +59,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_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 1a4c561ab4..ac39c39f22 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
@@ -310,6 +310,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/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..f43062dc53 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
@@ -49,6 +49,9 @@
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.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"
#endif
@@ -964,7 +967,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 +1007,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 +1053,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/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 180818f401..518761c315 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -578,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/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index 76d9a69e74..9574f8d00f 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
@@ -1040,7 +1040,7 @@ class StateControllerImplTest : public ::testing::Test {
.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));
}
@@ -1991,7 +1991,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))
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 4846648b2b..ba43ec9695 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -526,6 +526,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
*
@@ -1063,6 +1066,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/profile.cc b/src/components/config_profile/src/profile.cc
index 38afdbf35b..e5a32f4560 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -96,6 +96,7 @@ const char* kTransportRequiredForResumptionSection =
"TransportRequiredForResumption";
const char* kLowBandwidthTransportResumptionLevelSection =
"LowBandwidthTransportResumptionLevel";
+const char* kAppServicesSection = "AppServices";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -238,6 +239,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";
@@ -284,6 +286,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";
@@ -391,6 +395,8 @@ const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
const bool kDefaultMultipleTransportsEnabled = false;
const char* kDefaultLowBandwidthResumptionLevel = "NONE";
+const uint32_t kDefaultRpcPassThroughTimeout = 10000;
+const char* kDefaultHMIOriginId = "HMI_ID";
} // namespace
namespace profile {
@@ -506,7 +512,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);
@@ -1078,6 +1085,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_;
@@ -1114,6 +1125,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_);
@@ -2235,6 +2254,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;
@@ -2278,6 +2306,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,
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index d2fdf87957..cd3e50212a 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.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);
};
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index e248954552..f86e4e51cb 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>
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index a48eab2a6b..f3c3fbe207 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -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;
@@ -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;
}
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 842e176976..3503767988 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.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/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
index 121fd43131..a5c3d1a103 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,7 +159,8 @@ 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;
}
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
index ffbb644cc6..a582b52462 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,7 +102,8 @@ 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;
}
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/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/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 67be49a224..97140a18f1 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -51,6 +51,7 @@
#include "application_manager/hmi_interfaces.h"
#include "policy/policy_types.h"
#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/app_service_manager.h"
namespace resumption {
class LastState;
}
@@ -196,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;
@@ -405,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;
@@ -573,6 +577,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(
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index fc16f1f1ed..b206e56125 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -85,6 +85,7 @@ 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;
@@ -109,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/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index 8dfa1b133a..7003e11473 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -489,6 +489,32 @@ class PolicyHandlerInterface {
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;
+
#ifdef EXTERNAL_PROPRIETARY_MODE
/**
* @brief Gets meta information
diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h
index 79b4007f71..e0127eac80 100644
--- a/src/components/include/application_manager/rpc_service.h
+++ b/src/components/include/application_manager/rpc_service.h
@@ -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/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index 64306d7e0a..80365f10ab 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -616,6 +616,16 @@ class PolicyManager : public usage_statistics::StatisticsManager {
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 Gets meta information
* @return meta information
*/
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 0528dc9f36..bcb55ed681 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -597,6 +597,16 @@ class PolicyManager : public usage_statistics::StatisticsManager {
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 OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
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 daf4a23925..4f09d2c2f9 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -94,6 +94,8 @@ 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));
@@ -172,6 +174,7 @@ 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));
@@ -231,6 +234,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 0f9ca194b1..a4ec7c0317 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
@@ -127,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());
@@ -136,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_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h
index 4eddbbe257..aacb48a5ab 100644
--- a/src/components/include/test/application_manager/mock_rpc_service.h
+++ b/src/components/include/test/application_manager/mock_rpc_service.h
@@ -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,6 +27,10 @@ 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));
};
}
}
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 0983e8eedb..b6d8ab4cfa 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
@@ -228,6 +228,15 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
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));
#ifdef EXTERNAL_PROPRIETARY_MODE
MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
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 2885126fd1..ee8a111100 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
@@ -104,6 +104,10 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
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(GetDeviceConsent,
DeviceConsent(const std::string& device_id));
MOCK_METHOD2(SetDeviceConsent,
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 d7d81b3476..3f594ff6df 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
@@ -213,6 +213,10 @@ class MockPolicyManager : public PolicyManager {
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_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_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index ff186b5ab4..c92b310fcd 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
@@ -96,6 +96,10 @@ class MockCacheManagerInterface : public CacheManagerInterface {
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_METHOD1(
GetNotificationsNumber,
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 4e3121397f..ab49a6caae 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
@@ -209,6 +209,10 @@ class MockPolicyManager : public PolicyManager {
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_METHOD0(GetMetaInfo, const policy::MetaInfo());
MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
MOCK_CONST_METHOD0(HasCertificate, bool());
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index b056ae3910..004e0301c7 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -3302,15 +3302,6 @@
</param>
</struct>
- <struct name="SystemCapabilities">
- <param name="navigationCapability" type="NavigationCapability" mandatory="false">
- </param>
- <param name="phoneCapability" type="PhoneCapability" mandatory="false">
- </param>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
- </param>
- </struct>
-
<struct name="RemoteControlCapabilities">
<param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
@@ -3361,6 +3352,448 @@
<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>
+ </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="weatherIconImageName" type="String" 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, direction=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 </description>
+ </param>
+
+ <param name="serviceIcon" type="String" mandatory="false">
+ <description> The file name of 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. (eg if service type equals MEDIA, the mediaServiceData param should be included.</description>
+
+ <param name="serviceType" type="String" mandatory="true"/>
+ <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</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="SystemCapabilities">
+ <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 para 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>
@@ -3750,6 +4183,29 @@
</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>
@@ -3791,6 +4247,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 connected device that a specific system capability has changed.</description>
+ <param name="systemCapability" type="Common.SystemCapabilities" 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">
@@ -5841,4 +6303,122 @@
</function>
</interface>
+
+<interface name="AppService" version="1.0.0" date="2019-01-20">
+ <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"/>
+
+ <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 is requested from the specific service</description>
+ <param name="serviceData" type="Common.AppServiceData" mandatory="false"/>
+ </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="PerformAppServiceInteraction" messagetype="request">
+ <param name="serviceUri" type="String" mandatory="true">
+ <description>Fully qualified URI based on the URI prefix and URI scheme the app service provided. SDL makes no gurantee 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. These results should be described in the URI schema set in the Service Manifest</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 e7dbc1e089..3b9614ab76 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -2639,6 +2639,10 @@
<element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
<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" />
<!--
Base Notifications
@@ -2663,6 +2667,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
@@ -2820,6 +2826,7 @@
<element name="PHONE_CALL"/>
<element name="VIDEO_STREAMING"/>
<element name="REMOTE_CONTROL"/>
+ <element name="APP_SERVICES" />
</enum>
<struct name="NavigationCapability" since="4.5">
@@ -3633,24 +3640,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">
@@ -3730,7 +3719,426 @@
<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" 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>
+ </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="weatherIconImageName" type="String" 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">
+ <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="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, direction=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">
+ <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 </description>
+ </param>
+
+ <param name="serviceIcon" type="Image" mandatory="false">
+ <description> The file name of 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. (eg if service type equals MEDIA, the mediaServiceData param should be included.</description>
+
+ <param name="serviceType" type="String" mandatory="true"/>
+ <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 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>
+ <param name="appServicesCapabilities" type="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>
+
<!-- Requests/Responses -->
<function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
@@ -6063,6 +6471,64 @@
</param>
</function>
+ <function name ="GetFile" functionID="GetFileID" messagetype="request">
+ <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 downloaded</description>
+ </param>
+ </function>
+
+ <function name="GetFile" functionID="GetFileID" messagetype="response">
+ <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.
@@ -6603,6 +7069,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, then requester will be subscribed</description>
+ </param>
</function>
<function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
@@ -6674,19 +7143,13 @@
</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="DUPLICATE_NAME" />
- <element name="TOO_MANY_APPLICATIONS" />
- <element name="APPLICATION_REGISTERED_ALREADY" />
- <element name="UNSUPPORTED_VERSION" />
- <element name="WRONG_LANGUAGE" />
- <element name="DISALLOWED" />
- <element name="WARNINGS" />
- <element name="RESUME_FAILED" />
+ <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>
</function>
@@ -6712,18 +7175,122 @@
<element name="OUT_OF_MEMORY"/>
<element name="TOO_MANY_PENDING_REQUESTS"/>
<element name="GENERIC_ERROR"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TOO_MANY_APPLICATIONS"/>
- <element name="APPLICATION_REGISTERED_ALREADY"/>
- <element name="UNSUPPORTED_VERSION"/>
- <element name="WRONG_LANGUAGE"/>
<element name="DISALLOWED"/>
<element name="WARNINGS"/>
- <element name="RESUME_FAILED"/>
</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>See AppServiceType</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 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"/>
+ </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">
+ <param name="serviceUri" type="String" mandatory="true">
+ <description>Fully qualified URI based on the URI prefix and URI scheme the app service provided. SDL makes no gurantee 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">
+ <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. These results should be described in the URI schema set in the Service Manifest</description>
+ </param>
+ </function>
+
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
@@ -7016,6 +7583,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/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index a1db3536c2..8dd8c3a9b9 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -243,6 +243,16 @@ class CacheManager : public CacheManagerInterface {
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 Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
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 78546823c4..e5185ed1d3 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
@@ -252,6 +252,16 @@ class CacheManagerInterface {
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 Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
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 8ba0aafacc..09da4d6c9f 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
@@ -663,6 +663,16 @@ class PolicyManagerImpl : public PolicyManager {
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 OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
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 a37a9d6b5e..28b0caf95b 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
@@ -452,6 +452,26 @@ enum FunctionID {
GetCloudAppPropertiesID = 51,
/**
+ * @brief PublishAppServiceID.
+ */
+ PublishAppServiceID = 52,
+
+ /**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief GetFileID
+ */
+ GetFileID = 54,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -542,6 +562,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 e844381707..f354a3176f 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);
@@ -186,6 +234,9 @@ struct ApplicationParams : PolicyBase {
Optional<String<0, 255> > cloud_transport_type;
Optional<String<0, 65535> > icon_url;
+ // App Service Params
+ Optional<AppServiceParameters> app_service_parameters;
+
public:
ApplicationParams();
ApplicationParams(const Strings& groups,
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 f90edca8aa..d2ce9f1022 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
@@ -110,6 +110,9 @@
<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" />
</struct>
<typedef name="HmiLevels" type="HmiLevel" array="true"
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..581340ba02 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
@@ -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/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index c105a9161d..bfc0825d65 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -1525,6 +1525,22 @@ void CacheManager::SetHybridAppPreference(
}
}
+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);
+ }
+ }
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes,
const std::string& language,
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 28e493c115..4858611ba1 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -793,6 +793,12 @@ void PolicyManagerImpl::SetHybridAppPreference(
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);
+}
+
void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
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 aa4b8e55d1..bb25623b35 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -1139,6 +1139,26 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
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 ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1229,6 +1249,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 12de0cc62b..ca14b20987 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -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() {}
@@ -248,7 +352,8 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, 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")) {}
+ , icon_url(impl::ValueMember(value__, "icon_url"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -268,6 +373,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
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__);
return result__;
}
@@ -313,6 +419,9 @@ bool ApplicationParams::is_valid() const {
if (!icon_url.is_valid()) {
return false;
}
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -366,6 +475,9 @@ bool ApplicationParams::struct_empty() const {
if (icon_url.is_initialized()) {
return false;
}
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -436,6 +548,10 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
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"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -452,6 +568,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType 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);
}
// 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..fad8509711 100644
--- a/src/components/policy/policy_external/src/policy_table/validation.cc
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -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_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
index c0214f087f..29970a4424 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
@@ -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;
}
@@ -808,6 +827,11 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -945,6 +969,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 66f7ef65be..dea0fb4166 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -302,6 +302,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`( "
@@ -510,6 +534,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`; "
@@ -672,6 +699,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 =
@@ -804,6 +846,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`";
@@ -851,6 +908,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` = ?";
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 885a59ba36..6b2996f2fd 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -811,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;
}
@@ -1002,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
@@ -1110,6 +1129,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;
}
@@ -1274,6 +1297,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;
@@ -1700,6 +1802,57 @@ 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);
+ }
+
+ service_name_query.Reset();
+ handled_rpcs_query.Reset();
+ }
+
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -2045,6 +2198,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));
@@ -2146,7 +2305,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);
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 fddc5e631e..c43c9dace6 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
@@ -406,8 +406,8 @@ TEST_F(SQLPTRepresentationTest,
query.Prepare(query_select);
query.Next();
- // 34 - is current total tables number created by schema
- const int policy_tables_number = 34;
+ // 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_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index b789c7252c..72a6aae4ad 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -231,6 +231,16 @@ class CacheManager : public CacheManagerInterface {
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 Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
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 4a59bfb8a9..6f6c8f97ab 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
@@ -237,6 +237,16 @@ class CacheManagerInterface {
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 Allows to update 'vin' field in module_meta table.
*
* @param new 'vin' value.
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 1b5a78ed00..df2b44ba9a 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
@@ -658,6 +658,16 @@ class PolicyManagerImpl : public PolicyManager {
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 OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
* It will send OnAppPermissionSend notification and will try to start PTU. *
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 a32060d9bc..679950277d 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
@@ -437,6 +437,26 @@ enum FunctionID {
GetCloudAppPropertiesID = 51,
/**
+ * @brief PublishAppServiceID.
+ */
+ PublishAppServiceID = 52,
+
+ /**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief GetFileID
+ */
+ GetFileID = 54,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -527,6 +547,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 63058dee26..65a489ef27 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;
@@ -152,6 +200,9 @@ struct ApplicationParams : PolicyBase {
Optional<String<0, 255> > cloud_transport_type;
Optional<String<0, 65535> > icon_url;
+ // App Service Params
+ Optional<AppServiceParameters> app_service_parameters;
+
public:
ApplicationParams();
ApplicationParams(const Strings& groups, Priority priority);
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..dfa318454b 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
@@ -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/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index a8e033d505..42e2af5804 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -820,6 +820,22 @@ void CacheManager::SetHybridAppPreference(
}
}
+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);
+ }
+ }
+}
+
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes, const std::string& language) {
LOG4CXX_AUTO_TRACE(logger_);
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 bbd843b7c2..62e40433aa 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -612,6 +612,12 @@ void PolicyManagerImpl::SetHybridAppPreference(
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);
+}
+
void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
const PTString& app_id,
const PTString& hmi_level,
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 195213f844..421ccacded 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -851,6 +851,14 @@ bool IsValidEnum(FunctionID val) {
return true;
case GetCloudAppPropertiesID:
return true;
+ case PublishAppServiceID:
+ return true;
+ case GetFileID:
+ return true;
+ case GetAppServiceDataID:
+ return true;
+ case PerformAppServiceInteractionID:
+ return true;
case OnHMIStatusID:
return true;
case OnAppInterfaceUnregisteredID:
@@ -887,6 +895,8 @@ bool IsValidEnum(FunctionID val) {
return true;
case OnRCStatusID:
return true;
+ case OnAppServiceDataID:
+ return true;
case EncodedSyncPDataID:
return true;
case SyncPDataID:
@@ -895,6 +905,8 @@ bool IsValidEnum(FunctionID val) {
return true;
case OnSyncPDataID:
return true;
+ case OnSystemCapabilityUpdatedID:
+ return true;
default:
return false;
}
@@ -1002,6 +1014,14 @@ const char* EnumToJsonString(FunctionID val) {
return "SetCloudAppProperties";
case GetCloudAppPropertiesID:
return "GetCloudAppProperties";
+ case PublishAppServiceID:
+ return "PublishAppService";
+ case GetFileID:
+ return "GetFile";
+ case GetAppServiceDataID:
+ return "GetAppServiceData";
+ case PerformAppServiceInteractionID:
+ return "PerformAppServiceInteraction";
case OnHMIStatusID:
return "OnHMIStatus";
case OnAppInterfaceUnregisteredID:
@@ -1038,6 +1058,8 @@ const char* EnumToJsonString(FunctionID val) {
return "OnWayPointChange";
case OnRCStatusID:
return "OnRCStatus";
+ case OnAppServiceDataID:
+ return "OnAppServiceData";
case EncodedSyncPDataID:
return "EncodedSyncPData";
case SyncPDataID:
@@ -1046,6 +1068,8 @@ const char* EnumToJsonString(FunctionID val) {
return "OnEncodedSyncPData";
case OnSyncPDataID:
return "OnSyncPData";
+ case OnSystemCapabilityUpdatedID:
+ return "OnSystemCapabilityUpdated";
default:
return "";
}
@@ -1302,6 +1326,26 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
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 ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1392,6 +1436,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 2ee8bf1b21..ac100984da 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() {}
@@ -174,7 +277,8 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, 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")) {}
+ , icon_url(impl::ValueMember(value__, "icon_url"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -195,6 +299,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
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__);
return result__;
}
@@ -244,6 +349,9 @@ bool ApplicationParams::is_valid() const {
if (!icon_url.is_valid()) {
return false;
}
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -300,6 +408,9 @@ bool ApplicationParams::struct_empty() const {
if (icon_url.is_initialized()) {
return false;
}
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -357,6 +468,10 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
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"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -374,6 +489,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType 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);
}
// 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..4db84e06ff 100644
--- a/src/components/policy/policy_regular/src/policy_table/validation.cc
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -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 8d2576866b..708a29c34a 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -288,6 +288,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`( "
@@ -468,6 +492,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`; "
@@ -621,6 +648,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 =
@@ -739,6 +781,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`";
@@ -786,6 +843,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` = ?";
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 49aeec2642..19133a45f8 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -767,6 +767,11 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
+ if (!GatherAppServiceParameters(gather_app_id,
+ &*params.app_service_parameters)) {
+ return false;
+ }
+
(*policies).apps[app_id] = params;
}
return true;
@@ -943,6 +948,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
@@ -1054,6 +1074,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -1213,6 +1238,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());
@@ -1651,6 +1755,58 @@ 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);
+ }
+
+ service_name_query.Reset();
+ handled_rpcs_query.Reset();
+ }
+
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -2001,6 +2157,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);
}
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 030dc374dd..6448a47b42 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
@@ -426,8 +426,8 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->RefreshDB());
// Check PT structure destroyed and tables number is 0
- // There are 30 tables in the database, now.
- const int32_t total_tables_number = 30;
+ // 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`";
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..b365a48638 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
@@ -79,12 +79,12 @@ class CArraySchemaItem : public 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.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters,
+ const bool remove_unknown_parameters,
const utils::SemanticVersion& MessageVersion =
utils::SemanticVersion()) OVERRIDE;
@@ -92,8 +92,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/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index 942b491927..dfa0a4baeb 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
@@ -129,18 +129,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:
/**
@@ -365,7 +369,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);
@@ -376,7 +380,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/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index 45d161320b..27937ee17c 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
@@ -118,18 +118,22 @@ class CObjectSchemaItem : public 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.
**/
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..0c1b3f75b8 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -88,21 +88,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_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index 5e1497fdde..41737fed25 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -85,22 +85,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/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 7d5f8bcf84..be5fc2b83a 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -90,20 +90,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..b32757db7a 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -154,13 +154,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 +173,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 +192,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 +203,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);
}
}
}
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 5e9358092a..fbab17f32d 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -51,10 +51,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_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index f7cd22c4bc..dc0f1cbe31 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -52,13 +52,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/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index e26fef34bb..e6e5fdc0d4 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -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/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;