summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhit Adlakha <adlakhashobhit@gmail.com>2019-02-26 14:25:05 -0500
committerShobhit Adlakha <adlakhashobhit@gmail.com>2019-02-26 14:25:05 -0500
commit2cb0d5758bbc733770b08e1495f03f64205064ea (patch)
tree92e0d38f9ceeeab6be4b6346b408e6109559a745
parent8a442f27a9e408cb9071559757a029bd59a6a58a (diff)
parent45b9c2e8d109ed124c604c4b690b1847bc93c9c6 (diff)
downloadsdl_core-2cb0d5758bbc733770b08e1495f03f64205064ea.tar.gz
Merge branch 'feature/base_app_services_implementation' into feature/forwarded_request_timeout
-rw-r--r--src/appMain/sdl_preloaded_pt.json20
-rw-r--r--src/appMain/smartDeviceLink.ini7
-rw-r--r--src/components/application_manager/include/application_manager/app_service_manager.h49
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h13
-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.h20
-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.h38
-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.h3
-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_service_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h10
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt6
-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_rpc_plugin.h18
-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.h1
-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.h1
-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.h1
-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.h1
-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.h1
-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.h1
-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.h1
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h1
-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.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc76
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc46
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc25
-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.cc137
-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.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc14
-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.cc47
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc176
-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.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc10
-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/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/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/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/on_bc_system_capability_updated_notification.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc27
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc157
-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.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc5
-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.cc37
-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/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.cc342
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc18
-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.cc103
-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.cc176
-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.cc10
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc4
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc21
-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.cc1
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc24
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc10
-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.h3
-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.cc5
-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.cc51
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/include/application_manager/application_manager.h1
-rw-r--r--src/components/include/application_manager/application_manager_settings.h2
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h26
-rw-r--r--src/components/include/application_manager/rpc_service.h4
-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.h1
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h4
-rw-r--r--src/components/include/test/application_manager/mock_rpc_service.h5
-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.xml183
-rw-r--r--src/components/interfaces/MOBILE_API.xml179
-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.h15
-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.cc15
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc120
-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.cc66
-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.h15
-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.cc27
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc119
-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
228 files changed, 8366 insertions, 589 deletions
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 06ab56bc39..8041a0d4e9 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"]
@@ -577,10 +583,20 @@
"AppService":{
"rpcs":{
"PublishAppService":{
- "hmi_levels":["BACKGROUND",
+ "hmi_levels": [
+ "BACKGROUND",
"FULL",
"LIMITED",
- "NONE"]
+ "NONE"
+ ]
+ },
+ "PerformAppServiceInteraction": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
}
}
},
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 50e27452c0..ee67e6f018 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -379,3 +379,10 @@ RpcPassThroughTimeout = 10000
; 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, VOICE_ASSISTANT
diff --git a/src/components/application_manager/include/application_manager/app_service_manager.h b/src/components/application_manager/include/application_manager/app_service_manager.h
index 97df35e2b4..386b473f3d 100644
--- a/src/components/application_manager/include/application_manager/app_service_manager.h
+++ b/src/components/application_manager/include/application_manager/app_service_manager.h
@@ -33,7 +33,14 @@
#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"
+
+namespace resumption {
+class LastState;
+}
namespace application_manager {
@@ -55,7 +62,8 @@ class AppServiceManager {
* @brief Class constructor
* @param app_manager
*/
- AppServiceManager(ApplicationManager& app_manager);
+ AppServiceManager(ApplicationManager& app_manager,
+ resumption::LastState& last_state);
/**
* @brief Class destructor
@@ -77,6 +85,22 @@ class AppServiceManager {
*/
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
+ * @param service_published
+ */
+ void SetServicePublished(const std::string service_id,
+ bool service_published);
+
/**
* @brief TODO
* @param service_id
@@ -107,16 +131,39 @@ class AppServiceManager {
*/
std::vector<smart_objects::SmartObject> GetAllServices();
+ void GetProviderByType(const std::string& service_type,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
+ void GetProviderByID(const std::string& service_id,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
+
std::pair<std::string, AppService> ActiveServiceByType(
std::string service_type);
+ std::pair<std::string, AppService> EmbeddedServiceForType(
+ std::string service_type);
+
std::pair<std::string, AppService> FindServiceByName(std::string name);
+ std::pair<std::string, AppService> FindServiceByID(std::string service_id);
+
std::string DefaultServiceByType(std::string service_type);
private:
+ void GetProviderFromService(const AppService& service,
+ ApplicationSharedPtr& app,
+ bool& hmi_service);
ApplicationManager& app_manager_;
+ resumption::LastState& last_state_;
std::map<std::string, AppService> published_services_;
+
+ void BroadcastAppServiceUpdate(smart_objects::SmartObject& msg_params);
+ void AppServiceUpdated(
+ const smart_objects::SmartObject& service_record,
+ const mobile_apis::ServiceUpdateReason::eType update_reason,
+ smart_objects::SmartObject& msg_params);
};
} // namespace application_manager
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 8f53b06594..6161d6bbbf 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
@@ -388,6 +388,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
@@ -1438,6 +1445,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_;
@@ -1544,6 +1552,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..a5ecd7274b 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
*
@@ -170,6 +172,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 +247,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 d980e98576..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,17 +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,
- const smart_objects::SmartObject* response_params = NULL);
+ 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
@@ -79,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 609b240301..fd16d57740 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -878,6 +878,9 @@ 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);
+
private:
/**
* @brief Allows to fill SO according to the current permissions.
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 8ee5ff64f6..df96ade313 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
@@ -447,6 +447,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_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h
index 1eaeb46255..98767672ca 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;
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 19b2daaaf4..33fc3bd7d5 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;
@@ -316,6 +318,14 @@ extern const char* service_id;
extern const char* service_manifest;
extern const char* service_published;
extern const char* service_active;
+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;
// resuming
extern const char* application_commands;
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/app_service_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
index e254c36587..2bdc150906 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt
@@ -28,7 +28,10 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-include_directories(include)
+include_directories(
+ include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include
+ )
set (COMMANDS_SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/src/commands
@@ -54,6 +57,7 @@ set(LIBRARIES
v4_protocol_v1_2_no_extra
SmartObjects
Utils
+ sdl_rpc_plugin
)
if(ENABLE_LOG)
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_rpc_plugin.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
index 1113911a22..c9cb98cdfb 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_app_service_PLUGIN_INCLUDE_app_service_PLUGIN_app_service_PLUGIN_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_app_service_PLUGIN_INCLUDE_app_service_PLUGIN_app_service_PLUGIN_H
+#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"
@@ -60,17 +60,9 @@ class AppServiceRpcPlugin : public plugins::RPCPlugin {
void OnApplicationEvent(plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) OVERRIDE;
- /**
- * @brief ProcessResumptionSubscription send Subscribe vehicle data requests
- * to HMI
- * @param app application for subscription
- * @param ext application extension
- */
- // TODO
- // void ProcessResumptionSubscription(app_mngr::Application& app,
- // AppServiceAppExtension& ext);
-
private:
+ void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app);
+
std::unique_ptr<app_mngr::CommandFactory> command_factory_;
app_mngr::ApplicationManager* application_manager_;
};
@@ -78,4 +70,4 @@ class AppServiceRpcPlugin : public plugins::RPCPlugin {
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
+#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
index 0c7f222c1d..ec2c00a714 100644
--- 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
@@ -71,7 +71,6 @@ class ASPublishAppServiceRequest : public app_mngr::commands::RequestFromHMI {
private:
bool ValidateManifest(smart_objects::SmartObject& manifest);
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceRequest);
};
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
index c532225632..519d57c609 100644
--- 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
@@ -69,7 +69,6 @@ class ASPublishAppServiceResponse : public app_mngr::commands::ResponseToHMI {
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceResponse);
};
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
index 44d6d09fd3..30af13038a 100644
--- 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
@@ -70,7 +70,6 @@ class OnASAppServiceDataNotification
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotification);
};
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
index 7ca20d692a..5a23e35df0 100644
--- 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
@@ -70,7 +70,6 @@ class OnASAppServiceDataNotificationFromHMI
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotificationFromHMI);
};
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
index 4bc818f9be..719f5ebf5b 100644
--- 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
@@ -70,7 +70,6 @@ class OnAppServiceDataNotification
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotification);
};
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
index f163e5848b..c41fabf7b1 100644
--- 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
@@ -70,7 +70,6 @@ class OnAppServiceDataNotificationFromMobile
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotificationFromMobile);
};
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
index 459fa0457e..72e4f1c629 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h
@@ -70,7 +70,6 @@ class PublishAppServiceRequest : public app_mngr::commands::CommandRequestImpl {
private:
bool ValidateManifest(smart_objects::SmartObject& manifest);
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(PublishAppServiceRequest);
};
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
index a11399c9e1..9275f9e468 100644
--- 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
@@ -69,7 +69,6 @@ class PublishAppServiceResponse
virtual void Run();
private:
- AppServiceRpcPlugin* plugin_;
DISALLOW_COPY_AND_ASSIGN(PublishAppServiceResponse);
};
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
index 0405bb3e7c..f0a0698bb7 100644
--- 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
@@ -55,7 +55,8 @@ AppServiceCommandFactory::~AppServiceCommandFactory() {
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) {
+ 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);
@@ -65,7 +66,11 @@ app_mngr::CommandSharedPtr AppServiceCommandFactory::CreateCommand(
bool AppServiceCommandFactory::IsAbleToProcess(
const int32_t function_id,
const commands::Command::CommandSource source) const {
- return commands::Command::SOURCE_HMI == source
+ 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);
}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
index e741d7bfd4..7cfbdd22d0 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc
@@ -34,6 +34,20 @@
#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"
@@ -74,6 +88,8 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand(
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);
@@ -87,6 +103,8 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand(
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,
@@ -100,6 +118,9 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator(
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
@@ -111,9 +132,60 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator(
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 function_id: " << function_id);
- return factory.GetCreator<app_mngr::InvalidCommand>();
+ 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
index e0e667e975..572e637108 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc
@@ -35,10 +35,22 @@
#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"
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request.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_request_to_mobile.h"
+#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin")
@@ -111,9 +123,41 @@ app_mngr::CommandCreator& AppServiceMobileCommandFactory::buildCommandCreator(
? 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>();
}
+ 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
index 739d8bb0e2..971e3cc5e0 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc
@@ -32,7 +32,7 @@
#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_app_extension.h"
#include "app_service_rpc_plugin/app_service_command_factory.h"
#include "app_service_rpc_plugin/app_service_rpc_plugin.h"
@@ -71,13 +71,24 @@ void AppServiceRpcPlugin::OnPolicyEvent(plugins::PolicyEvent event) {}
void AppServiceRpcPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
- app_mngr::ApplicationSharedPtr application) {}
+ 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);
+ }
+}
-/*void AppServiceRpcPlugin::ProcessResumptionSubscription(
- application_manager::Application& app, AppServiceAppExtension& ext) {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO
-}*/
} // namespace app_service_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
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..8f52268f19
--- /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,137 @@
+/*
+ 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 service_id = msg_params[strings::service_id].asString();
+ auto service =
+ application_manager_.GetAppServiceManager().FindServiceByID(service_id);
+ if (service.first.empty()) {
+ 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.second.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
index 89da1e744c..5e20ca20d1 100644
--- 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
@@ -47,15 +47,7 @@ ASPublishAppServiceRequest::ASPublishAppServiceRequest(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- hmi_apis::FunctionID::AppService_PublishAppService,
- app_mngr::commands::Command::CommandSource::SOURCE_HMI);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
ASPublishAppServiceRequest::~ASPublishAppServiceRequest() {}
@@ -78,6 +70,7 @@ bool ASPublishAppServiceRequest::ValidateManifest(
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 =
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
index 1191b07abe..c143315b8c 100644
--- 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
@@ -47,15 +47,7 @@ ASPublishAppServiceResponse::ASPublishAppServiceResponse(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- hmi_apis::FunctionID::AppService_PublishAppService,
- app_mngr::commands::Command::CommandSource::SOURCE_HMI);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
ASPublishAppServiceResponse::~ASPublishAppServiceResponse() {}
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
index 29562d3086..80dd88c15f 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc
@@ -31,7 +31,6 @@
*/
#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h"
-#include "application_manager/message_helper.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
@@ -47,22 +46,14 @@ OnASAppServiceDataNotification::OnASAppServiceDataNotification(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- hmi_apis::FunctionID::AppService_OnAppServiceData,
- app_mngr::commands::Command::CommandSource::SOURCE_HMI);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
OnASAppServiceDataNotification::~OnASAppServiceDataNotification() {}
void OnASAppServiceDataNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData from HMI");
- MessageHelper::PrintSmartObject(*message_);
+ LOG4CXX_DEBUG(logger_, "Sending AS data to HMI");
+ SendNotification();
}
} // namespace commands
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
index ce68192d13..05266f834b 100644
--- 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
@@ -31,7 +31,6 @@
*/
#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h"
-#include "application_manager/message_helper.h"
namespace app_service_rpc_plugin {
using namespace application_manager;
@@ -47,15 +46,7 @@ OnASAppServiceDataNotificationFromHMI::OnASAppServiceDataNotificationFromHMI(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- hmi_apis::FunctionID::AppService_OnAppServiceData,
- app_mngr::commands::Command::CommandSource::SOURCE_HMI);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
OnASAppServiceDataNotificationFromHMI::
~OnASAppServiceDataNotificationFromHMI() {}
@@ -63,7 +54,8 @@ OnASAppServiceDataNotificationFromHMI::
void OnASAppServiceDataNotificationFromHMI::Run() {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData from HMI");
- MessageHelper::PrintSmartObject(*message_);
+ SendNotificationToConsumers(
+ mobile_apis::FunctionID::eType::OnAppServiceDataID);
}
} // namespace commands
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..b54071068f
--- /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();
+
+ bool subscribe = false;
+ if ((*message_)[strings::msg_params].keyExists(strings::subscribe)) {
+ subscribe = (*message_)[strings::msg_params][strings::subscribe].asBool();
+ }
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (subscribe) {
+ auto& ext = AppServiceAppExtension::ExtractASExtension(*app);
+ ext.SubscribeToAppService(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
index ef2ab7a4ab..a016d1fe16 100644
--- 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
@@ -31,11 +31,15 @@
*/
#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 {
@@ -50,15 +54,7 @@ OnAppServiceDataNotification::OnAppServiceDataNotification(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- mobile_apis::FunctionID::OnAppServiceDataID,
- app_mngr::commands::Command::CommandSource::SOURCE_MOBILE);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
OnAppServiceDataNotification::~OnAppServiceDataNotification() {}
@@ -66,7 +62,38 @@ void OnAppServiceDataNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Sending OnAppServiceData to consumer");
MessageHelper::PrintSmartObject(*message_);
- SendNotification();
+
+ std::string service_type =
+ (*message_)[strings::msg_params][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
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
index 0b0ac0b68c..1328e128d4 100644
--- 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
@@ -50,15 +50,7 @@ OnAppServiceDataNotificationFromMobile::OnAppServiceDataNotificationFromMobile(
application_manager,
rpc_service,
hmi_capabilities,
- policy_handler)
- , plugin_(NULL) {
- auto plugin = application_manager.GetPluginManager().FindPluginToProcess(
- mobile_apis::FunctionID::OnAppServiceDataID,
- app_mngr::commands::Command::CommandSource::SOURCE_MOBILE);
- if (plugin) {
- plugin_ = dynamic_cast<AppServiceRpcPlugin*>(&(*plugin));
- }
-}
+ policy_handler) {}
OnAppServiceDataNotificationFromMobile::
~OnAppServiceDataNotificationFromMobile() {}
@@ -67,6 +59,25 @@ 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
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..d21c413b29
--- /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,176 @@
+/*
+ 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.first.empty()) {
+ 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.second.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;
+ 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
index 7a0333e763..05210208ca 100644
--- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
+++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc
@@ -35,6 +35,7 @@
#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;
@@ -50,15 +51,7 @@ PublishAppServiceRequest::PublishAppServiceRequest(
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));
- }
-}
+ policy_handler) {}
PublishAppServiceRequest::~PublishAppServiceRequest() {}
@@ -79,7 +72,7 @@ bool PublishAppServiceRequest::ValidateManifest(
void PublishAppServiceRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Received a PublishAppService");
+ LOG4CXX_DEBUG(logger_, "Received a PublishAppService " << connection_key());
MessageHelper::PrintSmartObject(*message_);
smart_objects::SmartObject response_params =
@@ -89,9 +82,56 @@ void PublishAppServiceRequest::Run() {
if (!ValidateManifest(manifest)) {
return;
}
+
+ 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;
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
index b302189ef7..b1136c79d0 100644
--- 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
@@ -50,15 +50,7 @@ PublishAppServiceResponse::PublishAppServiceResponse(
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));
- }
-}
+ policy_handler) {}
PublishAppServiceResponse::~PublishAppServiceResponse() {}
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/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/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/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/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..d0c33e76d9
--- /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,147 @@
+/*
+ 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: {
+ if (hmi_capabilities_.navigation_capability()) {
+ msg_params[strings::system_capability][strings::navigation_capability] =
+ *hmi_capabilities_.navigation_capability();
+ }
+ 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();
+ }
+ 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();
+ }
+ 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();
+ }
+ 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_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
index a6c627aad2..b551db0008 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;
@@ -128,10 +131,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..0745bc08dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc
@@ -0,0 +1,157 @@
+#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: {
+ if (hmi_capabilities_.navigation_capability()) {
+ msg_params[strings::system_capability][strings::navigation_capability] =
+ *hmi_capabilities_.navigation_capability();
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities_.phone_capability()) {
+ msg_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities_.phone_capability();
+ }
+ 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();
+ }
+ 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();
+ }
+ 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..dc94474b9d 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
@@ -241,6 +241,8 @@
#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/on_bc_system_capability_updated_notification.h"
+
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -840,6 +842,10 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UISendHapticDataRequest>()
: factory.GetCreator<commands::UISendHapticDataResponse>();
}
+ 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 8eab054be3..77be545e0b 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"
@@ -388,6 +389,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..aa82c74098 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
@@ -32,15 +32,18 @@
#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,8 +51,7 @@ 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);
}
@@ -57,16 +59,27 @@ std::string SDLRPCPlugin::PluginName() {
return "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/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
index 3a01ce1303..f26bcaf01f 100644
--- a/src/components/application_manager/src/app_service_manager.cc
+++ b/src/components/application_manager/src/app_service_manager.cc
@@ -35,21 +35,28 @@
#include <algorithm>
#include <iterator>
-#include "application_manager/app_service_manager.h"
#include "application_manager/application.h"
+#include "application_manager/app_service_manager.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 "utils/logger.h"
+#include "smart_objects/enum_schema_item.h"
+
CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceManager")
namespace application_manager {
-AppServiceManager::AppServiceManager(ApplicationManager& app_manager)
- : app_manager_(app_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) {}
AppServiceManager::~AppServiceManager() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -77,20 +84,89 @@ smart_objects::SmartObject AppServiceManager::PublishAppService(
service_record[strings::service_manifest] = manifest;
service_record[strings::service_id] = service_id;
service_record[strings::service_published] = true;
- service_record[strings::service_active] = true;
-
+ service_record[strings::service_active] = false;
app_service.record = service_record;
+ std::string service_type = manifest[strings::service_type].asString();
+ Json::Value& dictionary = last_state_.get_dictionary();
+ app_service.default_service =
+ (dictionary[kAppServiceSection][kDefaults][service_type].asString() ==
+ manifest[strings::service_name].asString());
+
published_services_.insert(
std::pair<std::string, AppService>(service_id, app_service));
+ smart_objects::SmartObject msg_params;
+ AppServiceUpdated(
+ service_record, mobile_apis::ServiceUpdateReason::PUBLISHED, msg_params);
+ BroadcastAppServiceUpdate(msg_params);
+
+ // Activate the new service if it is the default for its service type, or if
+ // no service is active of its service type
+ std::pair<std::string, AppService> active_service =
+ ActiveServiceByType(service_type);
+ if (active_service.first.empty() || app_service.default_service) {
+ ActivateAppService(service_id);
+ }
+
return service_record;
}
bool AppServiceManager::UnpublishAppService(const std::string service_id) {
LOG4CXX_AUTO_TRACE(logger_);
- // TODO
- return false;
+
+ 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;
+
+ 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.first.empty()) {
+ embedded_service.second.record[strings::service_active] = true;
+ AppServiceUpdated(embedded_service.second.record,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ msg_params);
+ }
+ }
+ AppServiceUpdated(
+ it->second.record, mobile_apis::ServiceUpdateReason::REMOVED, msg_params);
+ BroadcastAppServiceUpdate(msg_params);
+ 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);
+ 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_);
+ 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() {
@@ -103,6 +179,168 @@ std::vector<smart_objects::SmartObject> AppServiceManager::GetAllServices() {
return services;
}
+void AppServiceManager::GetProviderByType(const std::string& service_type,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto active_service = ActiveServiceByType(service_type);
+ if (active_service.first.empty()) {
+ 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.second, app, hmi_service);
+}
+
+void AppServiceManager::GetProviderByID(const std::string& service_id,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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, app, hmi_service);
+}
+
+void AppServiceManager::GetProviderFromService(const AppService& service,
+ ApplicationSharedPtr& app,
+ bool& hmi_service) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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_);
+ 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_service_name = DefaultServiceByType(service_type);
+ if (!default_service_name.empty()) {
+ auto default_service = FindServiceByName(default_service_name);
+ if (!default_service.first.empty()) {
+ default_service.second.default_service = false;
+ }
+ }
+ service.default_service = true;
+
+ Json::Value& dictionary = last_state_.get_dictionary();
+ dictionary[kAppServiceSection][kDefaults][service_type] =
+ service.record[strings::service_manifest][strings::service_name]
+ .asString();
+ return true;
+}
+
+bool AppServiceManager::RemoveDefaultService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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_);
+ 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;
+
+ const std::string service_type =
+ service[strings::service_manifest][strings::service_type].asString();
+ auto active_service = ActiveServiceByType(service_type);
+ if (!active_service.first.empty()) {
+ active_service.second.record[strings::service_active] = false;
+ AppServiceUpdated(active_service.second.record,
+ mobile_apis::ServiceUpdateReason::DEACTIVATED,
+ msg_params);
+ }
+ service[strings::service_active] = true;
+ AppServiceUpdated(
+ service, mobile_apis::ServiceUpdateReason::ACTIVATED, msg_params);
+
+ BroadcastAppServiceUpdate(msg_params);
+ return true;
+}
+
+bool AppServiceManager::DeactivateAppService(const std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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.first.empty()) {
+ embedded_service.second.record[strings::service_active] = true;
+ AppServiceUpdated(embedded_service.second.record,
+ mobile_apis::ServiceUpdateReason::ACTIVATED,
+ msg_params);
+ }
+ send_update = true;
+ }
+
+ if (send_update) {
+ BroadcastAppServiceUpdate(msg_params);
+ }
+ return true;
+}
+
std::pair<std::string, AppService> AppServiceManager::ActiveServiceByType(
std::string service_type) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -119,6 +357,21 @@ std::pair<std::string, AppService> AppServiceManager::ActiveServiceByType(
return std::make_pair(std::string(), empty);
}
+std::pair<std::string, AppService> AppServiceManager::EmbeddedServiceForType(
+ std::string service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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;
+ }
+ }
+ AppService empty;
+ return std::make_pair(std::string(), empty);
+}
+
std::pair<std::string, AppService> AppServiceManager::FindServiceByName(
std::string name) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -132,4 +385,79 @@ std::pair<std::string, AppService> AppServiceManager::FindServiceByName(
AppService empty;
return std::make_pair(std::string(), empty);
}
+
+std::pair<std::string, AppService> AppServiceManager::FindServiceByID(
+ std::string service_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto it = published_services_.find(service_id);
+ if (it == published_services_.end()) {
+ LOG4CXX_ERROR(logger_, "Service id does not exist in published services");
+ AppService empty;
+ return std::make_pair(std::string(), empty);
+ }
+
+ return *it;
+}
+
+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_);
+ 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;
+}
+
+void AppServiceManager::BroadcastAppServiceUpdate(
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject message(smart_objects::SmartType_Map);
+
+ msg_params[strings::system_capability][strings::system_capability_type] =
+ mobile_apis::SystemCapabilityType::APP_SERVICES;
+ 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_manager_.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_manager_.GetRPCService().ManageHMICommand(hmi_notification);
+}
+
+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;
+}
+
} // 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 b6f4024426..2c8f5e06b2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -132,6 +132,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;
@@ -699,6 +700,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
@@ -1011,6 +1014,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_++;
@@ -2010,7 +2023,8 @@ 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));
+ app_service_manager_.reset(
+ new application_manager::AppServiceManager(*this, last_state));
return true;
}
@@ -2630,6 +2644,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..c6dbe6972f 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,6 +260,8 @@ 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,
@@ -414,6 +419,81 @@ 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, 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, app, hmi_destination);
+ }
+
+ if (hmi_destination) {
+ LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider");
+ 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();
+
+ 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 +519,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 +554,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 +891,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 0a6865457e..823e93cb5e 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -33,6 +33,11 @@
#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/application_manager.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,12 +72,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 smart_objects::SmartObject* response_params) {
+ const smart_objects::SmartObject* response_params,
+ commands::Command::CommandSource source) {
smart_objects::SmartObjectSPtr message =
std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
@@ -86,7 +94,7 @@ void RequestFromHMI::SendResponse(
(*message)[strings::msg_params] = *response_params;
}
- rpc_service_.ManageHMICommand(message);
+ rpc_service_.ManageHMICommand(message, source);
}
void RequestFromHMI::SendErrorResponse(
@@ -116,5 +124,169 @@ 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, 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, app, hmi_destination);
+ }
+
+ if (hmi_destination) {
+ LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider");
+ 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");
+ 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..1d1dbe6996 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -227,6 +227,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 +258,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 58d5171f84..124ec80312 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -327,6 +327,27 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
return message;
}
+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/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 3be3ef0da7..c267ac5de9 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -1937,6 +1937,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..40f2e90115 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -269,6 +269,7 @@ bool RPCHandlerImpl::ConvertMessageToSO(
"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_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index 7a68ae5779..99d0bf0cfe 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -154,7 +154,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 +253,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 +270,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");
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 1b6dfe2b8b..8df9a5cfbd 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";
@@ -283,6 +285,14 @@ const char* service_id = "serviceID";
const char* service_manifest = "serviceManifest";
const char* service_published = "servicePublished";
const char* service_active = "serviceActive";
+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";
// resuming
const char* application_commands = "applicationCommands";
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 4ea44e5aca..389f092e50 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 84a3b6bc87..8d9cf9d7ef 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
@@ -308,6 +308,9 @@ 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));
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 f091e183dc..0fe82e0dfb 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -572,4 +572,9 @@ 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);
+}
} // 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 1d4cead52b..58fea00f82 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
@@ -992,7 +992,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));
}
@@ -1941,7 +1941,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 4747e50fdc..ba43ec9695 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -526,7 +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;
+ 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
*
@@ -1066,6 +1068,10 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
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);
};
} // namespace profile
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index b324087689..e5a32f4560 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -91,12 +91,12 @@ const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
const char* kMultipleTransportsSection = "MultipleTransports";
-const char* kAppServicesSection = "AppServices";
const char* kServicesMapSection = "ServicesMap";
const char* kTransportRequiredForResumptionSection =
"TransportRequiredForResumption";
const char* kLowBandwidthTransportResumptionLevelSection =
"LowBandwidthTransportResumptionLevel";
+const char* kAppServicesSection = "AppServices";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -286,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";
@@ -394,6 +396,7 @@ const std::string kAllowedSymbols =
const bool kDefaultMultipleTransportsEnabled = false;
const char* kDefaultLowBandwidthResumptionLevel = "NONE";
const uint32_t kDefaultRpcPassThroughTimeout = 10000;
+const char* kDefaultHMIOriginId = "HMI_ID";
} // namespace
namespace profile {
@@ -1122,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_);
@@ -2295,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/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 b506caa47f..863ec093f0 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -397,6 +397,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;
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index 23e903920a..b206e56125 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -110,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 8c8a12ced3..64f0b893b2 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -488,6 +488,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..d892b12422 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.
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 92c0305279..e7aefe9f6c 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -593,6 +593,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 b2d48585f4..e4ee95fda0 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -574,6 +574,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 0065ad0a58..1b9fe5ed1c 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -162,6 +162,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));
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 79ff1813b0..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
@@ -137,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..3503f8bad1 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,
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 02a0d73086..1db0338caf 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
@@ -227,6 +227,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 da2b4cc2a1..25c391205d 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
@@ -98,6 +98,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 72dcb147e3..7c47202496 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
@@ -206,6 +206,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 24fe9b2393..c8bff0bbc0 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
@@ -90,6 +90,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 a5ce488e1a..fe0a301a58 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
@@ -203,6 +203,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 adef6a87cc..7eead66618 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -3298,15 +3298,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 >
@@ -3448,7 +3439,7 @@
</description>
</param>
- <param name="queuePlaybackProgess" type="Integer" mandatory="false">
+ <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
@@ -3481,7 +3472,7 @@
</param>
</struct>
- <struct name="WeatherServiceManifest" since="5.1">
+ <struct name="WeatherServiceManifest">
<param name="currentForecastSupported" type="Boolean" mandatory="false"/>
<param name="maxMultidayForecastAmount" type="Integer" mandatory="false"/>
<param name="maxHourlyForecastAmount" type="Integer" mandatory="false"/>
@@ -3489,7 +3480,7 @@
<param name="weatherForLocationSupported" type="Boolean" mandatory="false"/>
</struct>
- <struct name="WeatherAlert" since="5.1">
+ <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"/>
@@ -3498,7 +3489,7 @@
<param name="timeIssued" type="Common.DateTime" mandatory="false"/>
</struct>
- <struct name="WeatherData" since="5.1">
+ <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"/>
@@ -3553,7 +3544,7 @@
<param name="weatherIconImageName" type="String" mandatory="false"/>
</struct>
- <struct name="WeatherServiceData" since="5.1">
+ <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"/>
@@ -3634,8 +3625,73 @@
<param name="weatherServiceData" type="Common.WeatherServiceData" 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="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">
+ <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 -->
+ <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="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>
+
</interface>
<interface name="Buttons" version="1.3.0" date="2017-07-18">
@@ -4065,6 +4121,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">
@@ -6139,5 +6201,98 @@
<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 4d9bfbf09d..185b9d8773 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -2618,6 +2618,8 @@
<element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
<element name="SetCloudAppPropertiesID" value="50" hexvalue="32" 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="PerformAppServiceInteractionID" value="55" hexvalue="37" since="5.1" />
<!--
Base Notifications
@@ -2643,6 +2645,7 @@
<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
@@ -2800,6 +2803,7 @@
<element name="PHONE_CALL"/>
<element name="VIDEO_STREAMING"/>
<element name="REMOTE_CONTROL"/>
+ <element name="APP_SERVICES" />
</enum>
<struct name="NavigationCapability" since="4.5">
@@ -3613,24 +3617,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">
@@ -3787,7 +3773,7 @@
</description>
</param>
- <param name="queuePlaybackProgess" type="Integer" mandatory="false">
+ <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
@@ -3905,26 +3891,26 @@
</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>
+ <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>
+ <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>
+ <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>
+ <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>
+ <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="uriPrefix" type="String" mandatory="false">
- <description> The URI prefix for this service. If provided, all PerformAppServiceInteraction requests must start with it.</description>
+ <description> The URI prefix for this service. If provided, all PerformAppServiceInteraction requests must start with it. </description>
</param>
<param name="uriScheme" type="String" mandatory="false">
@@ -3973,8 +3959,64 @@
<param name="weatherServiceData" type="WeatherServiceData" 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">
@@ -6847,6 +6889,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">
@@ -6980,7 +7025,82 @@
<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">
@@ -7280,6 +7400,13 @@
<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 3344b149e4..3813b58ca3 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -229,6 +229,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 6a172e6f4b..21c8a947cc 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
@@ -238,6 +238,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 399c95170d..9cf067c0ec 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
@@ -640,6 +640,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 094e5cc7c6..d795721863 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
@@ -451,6 +451,16 @@ enum FunctionID {
PublishAppServiceID = 52,
/**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -546,6 +556,11 @@ enum FunctionID {
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 f37531eb63..0edfa55ab8 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);
@@ -185,6 +233,9 @@ struct ApplicationParams : PolicyBase {
Optional<String<0, 65535> > auth_token;
Optional<String<0, 255> > cloud_transport_type;
+ // 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 5ed852cf45..7749c4ee8f 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
@@ -108,6 +108,9 @@
<param name="cloud_transport_type" type="String" minlength="0" maxlength="255"
mandatory="false" />
<param name="hybrid_app_preference" type="HybridAppPreference" 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 8cec6ef91c..6d400cd0b4 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -1501,6 +1501,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 0844edd8eb..404c48d2e4 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -772,6 +772,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 2260d7e320..718bafa905 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -1131,6 +1131,16 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("GetAppServiceData" == literal) {
+ *result = GetAppServiceDataID;
+ return true;
+ }
+
+ if ("PerformAppServiceInteraction" == literal) {
+ *result = PerformAppServiceInteractionID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1226,6 +1236,11 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
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 977448dacd..db28b5b4fb 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() {}
@@ -247,8 +351,8 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, endpoint(impl::ValueMember(value__, "endpoint"))
, enabled(impl::ValueMember(value__, "enabled"))
, auth_token(impl::ValueMember(value__, "auth_token"))
- , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type")) {
-}
+ , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -267,6 +371,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("enabled", enabled, &result__);
impl::WriteJsonField("auth_token", auth_token, &result__);
impl::WriteJsonField("cloud_transport_type", cloud_transport_type, &result__);
+ impl::WriteJsonField("app_services", app_service_parameters, &result__);
return result__;
}
@@ -309,6 +414,9 @@ bool ApplicationParams::is_valid() const {
if (!hybrid_app_preference.is_valid()) {
return false;
}
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -359,6 +467,9 @@ bool ApplicationParams::struct_empty() const {
if (hybrid_app_preference.is_initialized()) {
return false;
}
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -426,6 +537,10 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
moduleType.ReportErrors(
&report__->ReportSubobject("hybrid_app_preference"));
}
+ if (!app_service_parameters.is_valid()) {
+ app_service_parameters.ReportErrors(
+ &report__->ReportSubobject("app_services"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -441,6 +556,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
enabled.SetPolicyTableType(pt_type);
cloud_transport_type.SetPolicyTableType(pt_type);
hybrid_app_preference.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 43961815d6..6e0da9e5de 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;
}
@@ -805,6 +824,11 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -941,6 +965,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 162d6957e7..51f4e4c13e 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -301,6 +301,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`( "
@@ -509,6 +533,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`; "
@@ -671,6 +698,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 =
@@ -802,6 +844,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`";
@@ -849,6 +906,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` = ?";
@@ -882,7 +946,7 @@ const std::string kSelectApplicationFull =
"SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
" `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
" `heart_beat_timeout_ms`, `certificate`, `hybrid_app_preference_value`, "
- " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type` "
+ " `endpoint`, `enabled`, `auth_token`, `cloud_transport_type`"
"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 b794d4c3a6..0b60daa0e1 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -810,6 +810,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;
}
@@ -1001,6 +1005,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
@@ -1106,6 +1125,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;
}
@@ -1270,6 +1293,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;
@@ -1696,6 +1798,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());
@@ -2041,6 +2194,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));
@@ -2142,7 +2301,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 8c8f0c55c6..354a979287 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -217,6 +217,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 50b546ecc5..639a9f9c18 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
@@ -224,6 +224,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 20a37717a7..4ed8903b00 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
@@ -635,6 +635,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 a62a60f2e9..16f0ef3d67 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,16 @@ enum FunctionID {
PublishAppServiceID = 52,
/**
+ * @brief GetAppServiceDataID.
+ */
+ GetAppServiceDataID = 53,
+
+ /**
+ * @brief PerformAppServiceInteractionID.
+ */
+ PerformAppServiceInteractionID = 55,
+
+ /**
* @brief OnHMIStatusID.
*/
OnHMIStatusID = 32768,
@@ -532,6 +542,11 @@ enum FunctionID {
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 58f07492c4..118f98677a 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;
@@ -151,6 +199,9 @@ struct ApplicationParams : PolicyBase {
Optional<String<0, 65535> > auth_token;
Optional<String<0, 255> > cloud_transport_type;
+ // 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 ca61a338f1..5abe4158f1 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -796,6 +796,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 9b2392a015..5f09d166b1 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -591,6 +591,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 5c011fbfa0..25f6d778fc 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,10 @@ bool IsValidEnum(FunctionID val) {
return true;
case PublishAppServiceID:
return true;
+ case GetAppServiceDataID:
+ return true;
+ case PerformAppServiceInteractionID:
+ return true;
case OnHMIStatusID:
return true;
case OnAppInterfaceUnregisteredID:
@@ -897,6 +901,8 @@ bool IsValidEnum(FunctionID val) {
return true;
case OnSyncPDataID:
return true;
+ case OnSystemCapabilityUpdatedID:
+ return true;
default:
return false;
}
@@ -1004,6 +1010,10 @@ const char* EnumToJsonString(FunctionID val) {
return "SetCloudAppProperties";
case PublishAppServiceID:
return "PublishAppService";
+ case GetAppServiceDataID:
+ return "GetAppServiceData";
+ case PerformAppServiceInteractionID:
+ return "PerformAppServiceInteraction";
case OnHMIStatusID:
return "OnHMIStatus";
case OnAppInterfaceUnregisteredID:
@@ -1050,6 +1060,8 @@ const char* EnumToJsonString(FunctionID val) {
return "OnEncodedSyncPData";
case OnSyncPDataID:
return "OnSyncPData";
+ case OnSystemCapabilityUpdatedID:
+ return "OnSystemCapabilityUpdated";
default:
return "";
}
@@ -1306,6 +1318,16 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
return true;
}
+ if ("GetAppServiceData" == literal) {
+ *result = GetAppServiceDataID;
+ return true;
+ }
+
+ if ("PerformAppServiceInteraction" == literal) {
+ *result = PerformAppServiceInteractionID;
+ return true;
+ }
+
if ("OnHMIStatus" == literal) {
*result = OnHMIStatusID;
return true;
@@ -1401,6 +1423,11 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
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 88564df050..5f7d2e57bf 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() {}
@@ -173,8 +276,8 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, endpoint(impl::ValueMember(value__, "endpoint"))
, enabled(impl::ValueMember(value__, "enabled"))
, auth_token(impl::ValueMember(value__, "auth_token"))
- , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type")) {
-}
+ , cloud_transport_type(impl::ValueMember(value__, "cloud_transport_type"))
+ , app_service_parameters(impl::ValueMember(value__, "app_services")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -194,6 +297,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("enabled", enabled, &result__);
impl::WriteJsonField("auth_token", auth_token, &result__);
impl::WriteJsonField("cloud_transport_type", cloud_transport_type, &result__);
+ impl::WriteJsonField("app_services", app_service_parameters, &result__);
return result__;
}
@@ -240,6 +344,9 @@ bool ApplicationParams::is_valid() const {
if (!hybrid_app_preference.is_valid()) {
return false;
}
+ if (!app_service_parameters.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -293,6 +400,9 @@ bool ApplicationParams::struct_empty() const {
if (hybrid_app_preference.is_initialized()) {
return false;
}
+ if (app_service_parameters.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -347,6 +457,10 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
moduleType.ReportErrors(
&report__->ReportSubobject("hybrid_app_preference"));
}
+ if (!app_service_parameters.is_valid()) {
+ app_service_parameters.ReportErrors(
+ &report__->ReportSubobject("app_services"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -363,6 +477,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
enabled.SetPolicyTableType(pt_type);
cloud_transport_type.SetPolicyTableType(pt_type);
hybrid_app_preference.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 297031d4c0..610a24eb19 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -287,6 +287,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`( "
@@ -467,6 +491,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`; "
@@ -620,6 +647,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 =
@@ -737,6 +779,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`";
@@ -784,6 +841,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 9282caf535..661be436f0 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -766,6 +766,11 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
+ if (!GatherAppServiceParameters(gather_app_id,
+ &*params.app_service_parameters)) {
+ return false;
+ }
+
(*policies).apps[app_id] = params;
}
return true;
@@ -942,6 +947,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
@@ -1050,6 +1070,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveAppServiceParameters(app.first,
+ *app.second.app_service_parameters)) {
+ return false;
+ }
+
return true;
}
@@ -1209,6 +1234,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());
@@ -1647,6 +1751,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());
@@ -1997,6 +2153,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`";